clauder-hub 0.1.13 → 0.1.14

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 (24) hide show
  1. package/package.json +1 -1
  2. package/server/dist/index.js +41 -4
  3. package/web/dist/assets/{MonacoEditor-DbrZH7RQ.js → MonacoEditor-CbpiSq9q.js} +3 -3
  4. package/web/dist/assets/{cssMode-CBcwtbru.js → cssMode-CN9bc7nj.js} +1 -1
  5. package/web/dist/assets/{freemarker2-CmgEqz0j.js → freemarker2-CRnvTAds.js} +1 -1
  6. package/web/dist/assets/{handlebars-Bc5wn073.js → handlebars-C2kgmAWI.js} +1 -1
  7. package/web/dist/assets/{html-Bx1ZYBKn.js → html-BDYl1She.js} +1 -1
  8. package/web/dist/assets/{htmlMode-Dy1sq2ZA.js → htmlMode-Cx5zCPn6.js} +1 -1
  9. package/web/dist/assets/{index-Dvl-6HEm.css → index-R-juGYqF.css} +1 -1
  10. package/web/dist/assets/{index-jesLojEl.js → index-m9eVnt__.js} +1 -1
  11. package/web/dist/assets/{index-D_FK5tAf.js → index-zwtldSlq.js} +18 -18
  12. package/web/dist/assets/{javascript-RNvbIxFA.js → javascript-vSl2Hjmn.js} +1 -1
  13. package/web/dist/assets/{jsonMode-DEyUdKfX.js → jsonMode-DzNsYGk_.js} +1 -1
  14. package/web/dist/assets/{liquid-ClawdWz2.js → liquid-kBEtoK3z.js} +1 -1
  15. package/web/dist/assets/{lspLanguageFeatures-B2Ri5yOC.js → lspLanguageFeatures-FKrlDCvN.js} +1 -1
  16. package/web/dist/assets/{mdx-DhBuyid8.js → mdx-DlYho8un.js} +1 -1
  17. package/web/dist/assets/{python-CqlBzS34.js → python-CscaxAmN.js} +1 -1
  18. package/web/dist/assets/{razor-Ccg59w6F.js → razor-ML1yBys3.js} +1 -1
  19. package/web/dist/assets/{tsMode-D4XYmQ0Q.js → tsMode-BMrsa7Gm.js} +1 -1
  20. package/web/dist/assets/{typescript-YNrO5mxL.js → typescript-Cs2X5p1b.js} +1 -1
  21. package/web/dist/assets/{workers-WMxUHImw.js → workers-B5NJGWxk.js} +1 -1
  22. package/web/dist/assets/{xml-VlPSTB_q.js → xml-CDgfErGy.js} +1 -1
  23. package/web/dist/assets/{yaml-CbcwIq08.js → yaml-Pb8QFqoF.js} +1 -1
  24. package/web/dist/index.html +2 -2
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MonacoEditor-DbrZH7RQ.js","assets/MonacoEditor-BbYsqB7V.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MonacoEditor-CbpiSq9q.js","assets/MonacoEditor-BbYsqB7V.css"])))=>i.map(i=>d[i]);
2
2
  var Wx=e=>{throw TypeError(e)};var Gx=(e,i,r)=>i.has(e)||Wx("Cannot "+r);var un=(e,i,r)=>(Gx(e,i,"read from private field"),r?r.call(e):i.get(e)),Yx=(e,i,r)=>i.has(e)?Wx("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,r),Ep=(e,i,r,s)=>(Gx(e,i,"write to private field"),s?s.call(e,r):i.set(e,r),r);function h3(e,i){for(var r=0;r<i.length;r++){const s=i[r];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in e)){const f=Object.getOwnPropertyDescriptor(s,l);f&&Object.defineProperty(e,l,f.get?f:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const f of l)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function r(l){const f={};return l.integrity&&(f.integrity=l.integrity),l.referrerPolicy&&(f.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?f.credentials="include":l.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(l){if(l.ep)return;l.ep=!0;const f=r(l);fetch(l.href,f)}})();function ng(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kp={exports:{}},xl={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -39,15 +39,15 @@ var Wx=e=>{throw TypeError(e)};var Gx=(e,i,r)=>i.has(e)||Wx("Cannot "+r);var un=
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */var iy;function _3(){if(iy)return yl;iy=1;var e=g3(),i=ig(),r=fS();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){for(var n=t,o=n;o&&!o.alternate;)n=o,(n.flags&4098)!==0&&(t=n.return),o=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function p(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function a(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(f(t)!==t)throw Error(s(188))}function d(t){var n=t.alternate;if(!n){if(n=f(t),n===null)throw Error(s(188));return n!==t?null:t}for(var o=t,u=n;;){var C=o.return;if(C===null)break;var k=C.alternate;if(k===null){if(u=C.return,u!==null){o=u;continue}break}if(C.child===k.child){for(k=C.child;k;){if(k===o)return h(C),t;if(k===u)return h(C),n;k=k.sibling}throw Error(s(188))}if(o.return!==u.return)o=C,u=k;else{for(var N=!1,q=C.child;q;){if(q===o){N=!0,o=C,u=k;break}if(q===u){N=!0,u=C,o=k;break}q=q.sibling}if(!N){for(q=k.child;q;){if(q===o){N=!0,o=k,u=C;break}if(q===u){N=!0,u=k,o=C;break}q=q.sibling}if(!N)throw Error(s(189))}}if(o.alternate!==u)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?t:n}function m(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=m(t),n!==null)return n;t=t.sibling}return null}function c(t,n,o,u,C,k){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&o(t,u,C,k)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&c(t.child,n,o,u,C,k))return!0;t=t.sibling}return!1}function _(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function x(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function E(t){var n=[null,null],o=_(t);return o===null||w(n,t,o.child,{foundSelf:!1}),n}function w(t,n,o,u){for(;o!==null;){if(o===n)u.foundSelf=!0;else if(o.tag===5||o.tag===27||o.tag===6){if(u.foundSelf)return t[1]=o,!0;t[0]=o}else if((o.tag!==22||o.memoizedState===null)&&w(t,n,o.child,u))return!0;o=o.sibling}return!1}function g(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(s(559))}}var b=null,S=null;function y(t,n,o){return t===o?!0:t===n?(b=t,!0):!1}function T(t,n,o){return t===o?(S=t,!1):t===n?(S!==null&&(b=t),!0):!1}function L(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function R(t,n,o){for(var u=0,C=t;C;C=o(C))u++;C=0;for(var k=n;k;k=o(k))C++;for(;0<u-C;)t=o(t),u--;for(;0<C-u;)n=o(n),C--;for(;u--;){if(t===n||n!==null&&t===n.alternate)return t;t=o(t),n=o(n)}return null}var D=Object.assign,A=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),W=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),Z=Symbol.for("react.legacy_hidden"),F=Symbol.for("react.memo_cache_sentinel"),V=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),le=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=le&&t[le]||t["@@iterator"],typeof t=="function"?t:null)}var $=Symbol.for("react.client.reference");function oe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case H:return"Profiler";case B:return"StrictMode";case Q:return"Suspense";case K:return"SuspenseList";case G:return"Activity";case V:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case W:return t.displayName||"Context";case U:return(t._context.displayName||"Context")+".Consumer";case Y:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return n=t.displayName||null,n!==null?n:oe(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return oe(t(n))}catch{}}return null}var ee=Array.isArray,ue=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we={pending:!1,data:null,method:null,action:null},Se=[],Re=-1;function qe(t){return{current:t}}function ke(t){0>Re||(t.current=Se[Re],Se[Re]=null,Re--)}function ze(t,n){Re++,Se[Re]=t.current,t.current=n}var Mt=qe(null),$e=qe(null),Be=qe(null),Ie=qe(null);function Te(t,n){switch(ze(Be,n),ze($e,t),ze(Mt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?tx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=tx(n),t=nx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ke(Mt),ze(Mt,t)}function Ve(){ke(Mt),ke($e),ke(Be)}function gt(t){var n=t.memoizedState;n!==null&&($o._currentValue=n.memoizedState,ze(Ie,t)),n=Mt.current;var o=nx(n,t.type);n!==o&&(ze($e,t),ze(Mt,o))}function st(t){$e.current===t&&(ke(Mt),ke($e)),Ie.current===t&&(ke(Ie),$o._currentValue=we)}var fe,ge;function Le(t){if(fe===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);fe=n&&n[1]||"",ge=-1<o.stack.indexOf(`
42
+ */var iy;function _3(){if(iy)return yl;iy=1;var e=g3(),i=ig(),r=fS();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){for(var n=t,o=n;o&&!o.alternate;)n=o,(n.flags&4098)!==0&&(t=n.return),o=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function p(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function a(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(f(t)!==t)throw Error(s(188))}function d(t){var n=t.alternate;if(!n){if(n=f(t),n===null)throw Error(s(188));return n!==t?null:t}for(var o=t,u=n;;){var C=o.return;if(C===null)break;var k=C.alternate;if(k===null){if(u=C.return,u!==null){o=u;continue}break}if(C.child===k.child){for(k=C.child;k;){if(k===o)return h(C),t;if(k===u)return h(C),n;k=k.sibling}throw Error(s(188))}if(o.return!==u.return)o=C,u=k;else{for(var N=!1,q=C.child;q;){if(q===o){N=!0,o=C,u=k;break}if(q===u){N=!0,u=C,o=k;break}q=q.sibling}if(!N){for(q=k.child;q;){if(q===o){N=!0,o=k,u=C;break}if(q===u){N=!0,u=k,o=C;break}q=q.sibling}if(!N)throw Error(s(189))}}if(o.alternate!==u)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?t:n}function m(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=m(t),n!==null)return n;t=t.sibling}return null}function c(t,n,o,u,C,k){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&o(t,u,C,k)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&c(t.child,n,o,u,C,k))return!0;t=t.sibling}return!1}function _(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function x(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function E(t){var n=[null,null],o=_(t);return o===null||w(n,t,o.child,{foundSelf:!1}),n}function w(t,n,o,u){for(;o!==null;){if(o===n)u.foundSelf=!0;else if(o.tag===5||o.tag===27||o.tag===6){if(u.foundSelf)return t[1]=o,!0;t[0]=o}else if((o.tag!==22||o.memoizedState===null)&&w(t,n,o.child,u))return!0;o=o.sibling}return!1}function g(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(s(559))}}var b=null,S=null;function y(t,n,o){return t===o?!0:t===n?(b=t,!0):!1}function T(t,n,o){return t===o?(S=t,!1):t===n?(S!==null&&(b=t),!0):!1}function L(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function R(t,n,o){for(var u=0,C=t;C;C=o(C))u++;C=0;for(var k=n;k;k=o(k))C++;for(;0<u-C;)t=o(t),u--;for(;0<C-u;)n=o(n),C--;for(;u--;){if(t===n||n!==null&&t===n.alternate)return t;t=o(t),n=o(n)}return null}var D=Object.assign,A=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),W=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),Z=Symbol.for("react.legacy_hidden"),F=Symbol.for("react.memo_cache_sentinel"),V=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),le=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=le&&t[le]||t["@@iterator"],typeof t=="function"?t:null)}var $=Symbol.for("react.client.reference");function oe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case H:return"Profiler";case B:return"StrictMode";case Q:return"Suspense";case K:return"SuspenseList";case G:return"Activity";case V:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case W:return t.displayName||"Context";case U:return(t._context.displayName||"Context")+".Consumer";case Y:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return n=t.displayName||null,n!==null?n:oe(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return oe(t(n))}catch{}}return null}var ee=Array.isArray,ue=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we={pending:!1,data:null,method:null,action:null},Se=[],Re=-1;function qe(t){return{current:t}}function ke(t){0>Re||(t.current=Se[Re],Se[Re]=null,Re--)}function ze(t,n){Re++,Se[Re]=t.current,t.current=n}var Mt=qe(null),$e=qe(null),Be=qe(null),Ie=qe(null);function Te(t,n){switch(ze(Be,n),ze($e,t),ze(Mt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?tx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=tx(n),t=nx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ke(Mt),ze(Mt,t)}function Ve(){ke(Mt),ke($e),ke(Be)}function gt(t){var n=t.memoizedState;n!==null&&(qo._currentValue=n.memoizedState,ze(Ie,t)),n=Mt.current;var o=nx(n,t.type);n!==o&&(ze($e,t),ze(Mt,o))}function st(t){$e.current===t&&(ke(Mt),ke($e)),Ie.current===t&&(ke(Ie),qo._currentValue=we)}var fe,ge;function Le(t){if(fe===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);fe=n&&n[1]||"",ge=-1<o.stack.indexOf(`
43
43
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
44
44
  `+fe+t+ge}var De=!1;function Fe(t,n){if(!t||De)return"";De=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(Ce){var ie=Ce}Reflect.construct(t,[],me)}else{try{me.call()}catch(Ce){ie=Ce}me=!1;try{var ce=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),me=!0,new t}finally{me&&(ce!==void 0?Object.defineProperty(t.prototype,"props",ce):delete t.prototype.props)}}}else{try{throw Error()}catch(Ce){ie=Ce}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(Ce){if(Ce&&ie&&typeof Ce.stack=="string")return[Ce.stack,ie.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=u.DetermineComponentFrameRoot(),N=k[0],q=k[1];if(N&&q){var J=N.split(`
45
45
  `),se=q.split(`
46
46
  `);for(C=u=0;u<J.length&&!J[u].includes("DetermineComponentFrameRoot");)u++;for(;C<se.length&&!se[C].includes("DetermineComponentFrameRoot");)C++;if(u===J.length||C===se.length)for(u=J.length-1,C=se.length-1;1<=u&&0<=C&&J[u]!==se[C];)C--;for(;1<=u&&0<=C;u--,C--)if(J[u]!==se[C]){if(u!==1||C!==1)do if(u--,C--,0>C||J[u]!==se[C]){var de=`
47
47
  `+J[u].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=u&&0<=C);break}}}finally{De=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?Le(o):""}function Me(t,n){switch(t.tag){case 26:case 27:case 5:return Le(t.type);case 16:return Le("Lazy");case 13:return t.child!==n&&n!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Fe(t.type,!1);case 11:return Fe(t.type.render,!1);case 1:return Fe(t.type,!0);case 31:return Le("Activity");case 30:return Le("ViewTransition");default:return""}}function Tt(t){try{var n="",o=null;do n+=Me(t,o),o=t,t=t.return;while(t);return n}catch(u){return`
48
48
  Error generating stack: `+u.message+`
49
- `+u.stack}}var qt=Object.prototype.hasOwnProperty,kn=e.unstable_scheduleCallback,Jn=e.unstable_cancelCallback,ei=e.unstable_shouldYield,eo=e.unstable_requestPaint,Vt=e.unstable_now,Wt=e.unstable_getCurrentPriorityLevel,ti=e.unstable_ImmediatePriority,_n=e.unstable_UserBlockingPriority,to=e.unstable_NormalPriority,x5=e.unstable_LowPriority,kv=e.unstable_IdlePriority,y5=e.log,b5=e.unstable_setDisableYieldValue,ka=null,zn=null;function Tr(t){if(typeof y5=="function"&&b5(t),zn&&typeof zn.setStrictMode=="function")try{zn.setStrictMode(ka,t)}catch{}}var Hn=Math.clz32?Math.clz32:C5,S5=Math.log,w5=Math.LN2;function C5(t){return t>>>=0,t===0?32:31-(S5(t)/w5|0)|0}var rc=256,sc=262144,oc=4194304;function gs(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ac(t,n,o){var u=t.pendingLanes;if(u===0)return 0;var C=0,k=t.suspendedLanes,N=t.pingedLanes;t=t.warmLanes;var q=u&134217727;return q!==0?(u=q&~k,u!==0?C=gs(u):(N&=q,N!==0?C=gs(N):o||(o=q&~t,o!==0&&(C=gs(o))))):(q=u&~k,q!==0?C=gs(q):N!==0?C=gs(N):o||(o=u&~t,o!==0&&(C=gs(o)))),C===0?0:n!==0&&n!==C&&(n&k)===0&&(k=C&-C,o=n&-n,k>=o||k===32&&(o&4194048)!==0)?n:C}function Ta(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Tv(t,n){(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var u=31-Hn(o),C=1<<u;n|=t[u],o&=~C}return n}function E5(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Rv(){var t=oc;return oc<<=1,(oc&62914560)===0&&(oc=4194304),t}function Qh(t){for(var n=[],o=0;31>o;o++)n.push(t);return n}function Ra(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function k5(t,n,o,u,C,k){var N=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var q=t.entanglements,J=t.expirationTimes,se=t.hiddenUpdates;for(o=N&~o;0<o;){var de=31-Hn(o),me=1<<de;q[de]=0,J[de]=-1;var ie=se[de];if(ie!==null)for(se[de]=null,de=0;de<ie.length;de++){var ce=ie[de];ce!==null&&(ce.lane&=-536870913)}o&=~me}u!==0&&Av(t,u,0),k!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=k&~(N&~n))}function Av(t,n,o){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-Hn(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|o&261930}function Lv(t,n){var o=t.entangledLanes|=n;for(t=t.entanglements;o;){var u=31-Hn(o),C=1<<u;C&n|t[u]&n&&(t[u]|=n),o&=~C}}function Dv(t,n){var o=n&-n;return o=(o&42)!==0?1:Zh(o),(o&(t.suspendedLanes|n))!==0?0:o}function Zh(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Jh(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Mv(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:zx(t.type))}function jv(t,n){var o=he.p;try{return he.p=t,n()}finally{he.p=o}}var Gi=Math.random().toString(36).slice(2),rn="__reactFiber$"+Gi,Tn="__reactProps$"+Gi,no="__reactContainer$"+Gi,Ov="__reactEvents$"+Gi,T5="__reactListeners$"+Gi,R5="__reactHandles$"+Gi,Nv="__reactResources$"+Gi,Aa="__reactMarker$"+Gi,lc="__reactLoad$"+Gi;function cc(t){delete t[rn],delete t[Tn],delete t[T5],delete t[R5]}function vs(t){var n;if(n=t[rn])return n;for(var o=t.parentNode;o;){if(n=o[no]||o[rn]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(t=xx(t);t!==null;){if(o=t[rn])return o;t=xx(t)}return n}t=o,o=t.parentNode}return null}function io(t){if(t=t[rn]||t[no]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function La(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function ro(t){var n=t[Nv];return n||(n=t[Nv]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(t){t[Aa]=!0}function Bv(t){t[lc]=void 0}var Pv=new Set,Iv={};function _s(t,n){so(t,n),so(t+"Capture",n)}function so(t,n){for(Iv[t]=n,t=0;t<n.length;t++)Pv.add(n[t])}var A5=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]*$"),zv={},Hv={};function L5(t){return qt.call(Hv,t)?!0:qt.call(zv,t)?!1:A5.test(t)?Hv[t]=!0:(zv[t]=!0,!1)}var ot=!1;function Fv(){var t=ot;return ot=!1,t}function uc(t,n,o){if(L5(n))if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,o)}}function hc(t,n,o){if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,o)}}function Yi(t,n,o,u){if(u===null)t.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(n,o,u)}}function Fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Uv(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function D5(t,n,o){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var C=u.get,k=u.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return C.call(this)},set:function(N){o=""+N,k.call(this,N)}}),Object.defineProperty(t,n,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(N){o=""+N},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ed(t){if(!t._valueTracker){var n=Uv(t)?"checked":"value";t._valueTracker=D5(t,n,""+t[n])}}function $v(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return t&&(u=Uv(t)?t.checked?"true":"false":t.value),t=u,t!==o?(n.setValue(t),!0):!1}var M5=/[\n"\\]/g;function ni(t){return t.replace(M5,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function td(t,n,o,u,C,k,N,q){t.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.type=N:t.removeAttribute("type"),n!=null?N==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Fn(n)):t.value!==""+Fn(n)&&(t.value=""+Fn(n)):N!=="submit"&&N!=="reset"||t.removeAttribute("value"),n!=null?N==="number"&&t.value==n?nd(t,Fn(t.value)):nd(t,Fn(n)):o!=null?nd(t,Fn(o)):u!=null&&t.removeAttribute("value"),C==null&&k!=null&&(t.defaultChecked=!!k),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?t.name=""+Fn(q):t.removeAttribute("name")}function qv(t,n,o,u,C,k,N,q){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.type=k),n!=null||o!=null){if(!(k!=="submit"&&k!=="reset"||n!=null)){ed(t);return}o=o!=null?""+Fn(o):"",n=n!=null?""+Fn(n):o,q||n===t.value||(t.value=n),t.defaultValue=n}u=u??C,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=q?t.checked:!!u,t.defaultChecked=!!u,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(t.name=N),ed(t)}function nd(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function oo(t,n,o,u){if(t=t.options,n){n={};for(var C=0;C<o.length;C++)n["$"+o[C]]=!0;for(o=0;o<t.length;o++)C=n.hasOwnProperty("$"+t[o].value),t[o].selected!==C&&(t[o].selected=C),C&&u&&(t[o].defaultSelected=!0)}else{for(o=""+Fn(o),n=null,C=0;C<t.length;C++){if(t[C].value===o){t[C].selected=!0,u&&(t[C].defaultSelected=!0);return}n!==null||t[C].disabled||(n=t[C])}n!==null&&(n.selected=!0)}}function Vv(t,n,o){if(n!=null&&(n=""+Fn(n),n!==t.value&&(t.value=n),o==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=o!=null?""+Fn(o):""}function Wv(t,n,o,u){if(n==null){if(u!=null){if(o!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}o=u}o==null&&(o=""),n=o}o=Fn(n),t.defaultValue=o,u=t.textContent,u===o&&u!==""&&u!==null&&(t.value=u),ed(t)}function ao(t,n){if(n){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=n;return}}t.textContent=n}var j5=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 Gv(t,n,o){var u=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,o):typeof o!="number"||o===0||j5.has(n)?n==="float"?t.cssFloat=o:t[n]=(""+o).trim():t[n]=o+"px"}function Yv(t,n,o){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="",ot=!0);for(var C in n)u=n[C],n.hasOwnProperty(C)&&o[C]!==u&&(Gv(t,C,u),ot=!0)}else for(var k in n)n.hasOwnProperty(k)&&Gv(t,k,n[k])}function id(t){if(t.indexOf("-")===-1)return!1;switch(t){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 O5=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"],["maskType","mask-type"],["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"]]),N5=/^[\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 dc(t){return N5.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ei(){}var rd=null;function sd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lo=null,co=null;function Xv(t){var n=io(t);if(n&&(t=n.stateNode)){var o=t[Tn]||null;e:switch(t=n.stateNode,n.type){case"input":if(td(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+ni(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==t&&u.form===t.form){var C=u[Tn]||null;if(!C)throw Error(s(90));td(u,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(n=0;n<o.length;n++)u=o[n],u.form===t.form&&$v(u)}break e;case"textarea":Vv(t,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&oo(t,!!o.multiple,n,!1)}}}var od=!1;function Kv(t,n,o){if(od)return t(n,o);od=!0;try{var u=t(n);return u}finally{if(od=!1,(lo!==null||co!==null)&&(du(),lo&&(n=lo,t=co,co=lo=null,Xv(n),t)))for(n=0;n<t.length;n++)Xv(t[n])}}function Da(t,n){var o=t.stateNode;if(o===null)return null;var u=o[Tn]||null;if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(s(231,n,typeof o));return o}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ad=!1;if(Xi)try{var Ma={};Object.defineProperty(Ma,"passive",{get:function(){ad=!0}}),window.addEventListener("test",Ma,Ma),window.removeEventListener("test",Ma,Ma)}catch{ad=!1}var Rr=null,ld=null,fc=null;function Qv(){if(fc)return fc;var t,n=ld,o=n.length,u,C="value"in Rr?Rr.value:Rr.textContent,k=C.length;for(t=0;t<o&&n[t]===C[t];t++);var N=o-t;for(u=1;u<=N&&n[o-u]===C[k-u];u++);return fc=C.slice(t,1<u?1-u:void 0)}function pc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function mc(){return!0}function Zv(){return!1}function xn(t){function n(o,u,C,k,N){this._reactName=o,this._targetInst=C,this.type=u,this.nativeEvent=k,this.target=N,this.currentTarget=null;for(var q in t)t.hasOwnProperty(q)&&(o=t[q],this[q]=o?o(k):k[q]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?mc:Zv,this.isPropagationStopped=Zv,this}return D(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mc)},persist:function(){},isPersistent:mc}),n}var Ar={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gc=xn(Ar),ja=D({},Ar,{view:0,detail:0}),B5=xn(ja),cd,ud,Oa,vc=D({},ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Oa&&(Oa&&t.type==="mousemove"?(cd=t.screenX-Oa.screenX,ud=t.screenY-Oa.screenY):ud=cd=0,Oa=t),cd)},movementY:function(t){return"movementY"in t?t.movementY:ud}}),Jv=xn(vc),P5=D({},vc,{dataTransfer:0}),I5=xn(P5),z5=D({},ja,{relatedTarget:0}),hd=xn(z5),H5=D({},Ar,{animationName:0,elapsedTime:0,pseudoElement:0}),F5=xn(H5),U5=D({},Ar,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),$5=xn(U5),q5=D({},Ar,{data:0}),e_=xn(q5),V5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W5={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"},G5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y5(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=G5[t])?!!n[t]:!1}function dd(){return Y5}var X5=D({},ja,{key:function(t){if(t.key){var n=V5[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=pc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?W5[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dd,charCode:function(t){return t.type==="keypress"?pc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),K5=xn(X5),Q5=D({},vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),t_=xn(Q5),Z5=D({},Ar,{submitter:0}),J5=xn(Z5),eE=D({},ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dd}),tE=xn(eE),nE=D({},Ar,{propertyName:0,elapsedTime:0,pseudoElement:0}),iE=xn(nE),rE=D({},vc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),sE=xn(rE),oE=D({},Ar,{newState:0,oldState:0,source:0}),aE=xn(oE),lE=[9,13,27,32],fd=Xi&&"CompositionEvent"in window,Na=null;Xi&&"documentMode"in document&&(Na=document.documentMode);var cE=Xi&&"TextEvent"in window&&!Na,n_=Xi&&(!fd||Na&&8<Na&&11>=Na),i_=" ",r_=!1;function s_(t,n){switch(t){case"keyup":return lE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function o_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var uo=!1;function uE(t,n){switch(t){case"compositionend":return o_(n);case"keypress":return n.which!==32?null:(r_=!0,i_);case"textInput":return t=n.data,t===i_&&r_?null:t;default:return null}}function hE(t,n){if(uo)return t==="compositionend"||!fd&&s_(t,n)?(t=Qv(),fc=ld=Rr=null,uo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return n_&&n.locale!=="ko"?null:n.data;default:return null}}var dE={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 a_(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!dE[t.type]:n==="textarea"}function l_(t,n,o,u){lo?co?co.push(u):co=[u]:lo=u,n=_u(n,"onChange"),0<n.length&&(o=new gc("onChange","change",null,o,u),t.push({event:o,listeners:n}))}var Ba=null,Pa=null;function fE(t){X0(t,0)}function _c(t){var n=La(t);if($v(n))return t}function c_(t,n){if(t==="change")return n}var u_=!1;if(Xi){var pd;if(Xi){var md="oninput"in document;if(!md){var h_=document.createElement("div");h_.setAttribute("oninput","return;"),md=typeof h_.oninput=="function"}pd=md}else pd=!1;u_=pd&&(!document.documentMode||9<document.documentMode)}function d_(){Ba&&(Ba.detachEvent("onpropertychange",f_),Pa=Ba=null)}function f_(t){if(t.propertyName==="value"&&_c(Pa)){var n=[];l_(n,Pa,t,sd(t)),Kv(fE,n)}}function pE(t,n,o){t==="focusin"?(d_(),Ba=n,Pa=o,Ba.attachEvent("onpropertychange",f_)):t==="focusout"&&d_()}function mE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return _c(Pa)}function gE(t,n){if(t==="click")return _c(n)}function vE(t,n){if(t==="input"||t==="change")return _c(n)}function _E(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Un=typeof Object.is=="function"?Object.is:_E;function Ia(t,n){if(Un(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var o=Object.keys(t),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var C=o[u];if(!qt.call(n,C)||!Un(t[C],n[C]))return!1}return!0}function gd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function p_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function m_(t,n){var o=p_(t);t=0;for(var u;o;){if(o.nodeType===3){if(u=t+o.textContent.length,t<=n&&u>=n)return{node:o,offset:n-t};t=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=p_(o)}}function g_(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?g_(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function v_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=gd(t.document);n instanceof t.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)t=n.contentWindow;else break;n=gd(t.document)}return n}function vd(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var xE=Xi&&"documentMode"in document&&11>=document.documentMode,ho=null,_d=null,za=null,xd=!1;function __(t,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;xd||ho==null||ho!==gd(u)||(u=ho,"selectionStart"in u&&vd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),za&&Ia(za,u)||(za=u,u=_u(_d,"onSelect"),0<u.length&&(n=new gc("onSelect","select",null,n,o),t.push({event:n,listeners:u}),n.target=ho)))}function xs(t,n){var o={};return o[t.toLowerCase()]=n.toLowerCase(),o["Webkit"+t]="webkit"+n,o["Moz"+t]="moz"+n,o}var fo={animationend:xs("Animation","AnimationEnd"),animationiteration:xs("Animation","AnimationIteration"),animationstart:xs("Animation","AnimationStart"),transitionrun:xs("Transition","TransitionRun"),transitionstart:xs("Transition","TransitionStart"),transitioncancel:xs("Transition","TransitionCancel"),transitionend:xs("Transition","TransitionEnd")},yd={},x_={};Xi&&(x_=document.createElement("div").style,"AnimationEvent"in window||(delete fo.animationend.animation,delete fo.animationiteration.animation,delete fo.animationstart.animation),"TransitionEvent"in window||delete fo.transitionend.transition);function ys(t){if(yd[t])return yd[t];if(!fo[t])return t;var n=fo[t],o;for(o in n)if(n.hasOwnProperty(o)&&o in x_)return yd[t]=n[o];return t}var y_=ys("animationend"),b_=ys("animationiteration"),S_=ys("animationstart"),yE=ys("transitionrun"),bE=ys("transitionstart"),SE=ys("transitioncancel"),w_=ys("transitionend"),C_=new Map,bd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");bd.push("scrollEnd");function mi(t,n){C_.set(t,n),_s(n,[t])}var wE=0;function Ki(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=xi.identifierPrefix;var o=wE++;return t="_"+t+"t_"+o.toString(32)+"_",n.autoName=t}function E_(t){if(t==null||typeof t=="string")return t;var n=null,o=jo;if(o!==null)for(var u=0;u<o.length;u++){var C=t[o[u]];if(C!=null){if(C==="none")return"none";n=n==null?C:n+(" "+C)}}return n??t.default}function Qi(t,n){return t=E_(t),n=E_(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var xc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ii=[],po=0,Sd=0;function yc(){for(var t=po,n=Sd=po=0;n<t;){var o=ii[n];ii[n++]=null;var u=ii[n];ii[n++]=null;var C=ii[n];ii[n++]=null;var k=ii[n];if(ii[n++]=null,u!==null&&C!==null){var N=u.pending;N===null?C.next=C:(C.next=N.next,N.next=C),u.pending=C}k!==0&&k_(o,C,k)}}function bc(t,n,o,u){ii[po++]=t,ii[po++]=n,ii[po++]=o,ii[po++]=u,Sd|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function wd(t,n,o,u){return bc(t,n,o,u),Sc(t)}function bs(t,n){return bc(t,null,null,n),Sc(t)}function k_(t,n,o){t.lanes|=o;var u=t.alternate;u!==null&&(u.lanes|=o);for(var C=!1,k=t.return;k!==null;)k.childLanes|=o,u=k.alternate,u!==null&&(u.childLanes|=o),k.tag===22&&(t=k.stateNode,t===null||t._visibility&1||(C=!0)),t=k,k=k.return;return t.tag===3?(k=t.stateNode,C&&n!==null&&(C=31-Hn(o),t=k.hiddenUpdates,u=t[C],u===null?t[C]=[n]:u.push(n),n.lane=o|536870912),k):null}function Sc(t){if(50<al)throw al=0,hu=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var mo={};function CE(t,n,o,u){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(t,n,o,u){return new CE(t,n,o,u)}function Cd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Zi(t,n){var o=t.alternate;return o===null?(o=Rn(t.tag,n,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=n,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&1206910976,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,n=t.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function T_(t,n){t.flags&=1206910978;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,n=o.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function wc(t,n,o,u,C,k){var N=0;if(u=t,typeof u=="function")Cd(u)&&(N=1);else if(typeof u=="string")N=Zk(t,o,Mt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(u){case G:return t=Rn(31,o,n,C),t.elementType=G,t.lanes=k,t;case I:return Ss(o.children,C,k,n);case B:N=8,C|=24;break;case H:return t=Rn(12,o,n,C|2),t.elementType=H,t.lanes=k,t;case Q:return t=Rn(13,o,n,C),t.elementType=Q,t.lanes=k,t;case K:return t=Rn(19,o,n,C),t.elementType=K,t.lanes=k,t;case Z:case V:return t=C|32,t=Rn(30,o,n,t),t.elementType=V,t.lanes=k,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case W:N=10;break e;case U:N=9;break e;case Y:N=11;break e;case z:N=14;break e;case O:N=16,u=null;break e}N=29,o=Error(s(130,t===null?"null":typeof t,"")),u=null}return n=Rn(N,o,n,C),n.elementType=t,n.type=u,n.lanes=k,n}function Ss(t,n,o,u){return t=Rn(7,t,u,n),t.lanes=o,t}function Ed(t,n,o){return t=Rn(6,t,null,n),t.lanes=o,t}function R_(t){var n=Rn(18,null,null,0);return n.stateNode=t,n}function kd(t,n,o){return n=Rn(4,t.children!==null?t.children:[],t.key,n),n.lanes=o,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var A_=new WeakMap;function ri(t,n){if(typeof t=="object"&&t!==null){var o=A_.get(t);return o!==void 0?o:(n={value:t,source:n,stack:Tt(n)},A_.set(t,n),n)}return{value:t,source:n,stack:Tt(n)}}var go=[],vo=0,Cc=null,Ha=0,si=[],oi=0,Lr=null,ki=1,Ti="";function Ji(t,n){go[vo++]=Ha,go[vo++]=Cc,Cc=t,Ha=n}function L_(t,n,o){si[oi++]=ki,si[oi++]=Ti,si[oi++]=Lr,Lr=t;var u=ki;t=Ti;var C=32-Hn(u)-1;u&=~(1<<C),o+=1;var k=32-Hn(n)+C;if(30<k){var N=C-C%5;k=(u&(1<<N)-1).toString(32),u>>=N,C-=N,ki=1<<32-Hn(n)+C|o<<C|u,Ti=k+t}else ki=1<<k|o<<C|u,Ti=t}function Ec(t){t.return!==null&&(Ji(t,1),L_(t,1,0))}function Td(t){for(;t===Cc;)Cc=go[--vo],go[vo]=null,Ha=go[--vo],go[vo]=null;for(;t===Lr;)Lr=si[--oi],si[oi]=null,Ti=si[--oi],si[oi]=null,ki=si[--oi],si[oi]=null}function D_(t,n){si[oi++]=ki,si[oi++]=Ti,si[oi++]=Lr,ki=n.id,Ti=n.overflow,Lr=t}var Qt=null,bt=null,Xe=!1,Dr=null,ai=!1,Rd=Error(s(519));function Mr(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fa(ri(n,t)),Rd}function M_(t){var n=t.stateNode,o=t.type,u=t.memoizedProps;switch(n[rn]=t,n[Tn]=u,o){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(o=0;o<cl.length;o++)Ze(cl[o],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),qv(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),Wv(n,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||u.suppressHydrationWarning===!0||J0(n.textContent,o)?(u.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),u.onScroll!=null&&Ze("scroll",n),u.onScrollEnd!=null&&Ze("scrollend",n),u.onClick!=null&&(n.onclick=Ei),n=!0):n=!1,n||Mr(t,!0)}function kc(t){for(Qt=t.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:ai=!1;return;case 27:case 3:ai=!0;return;default:Qt=Qt.return}}function _o(t){if(t!==Qt)return!1;if(!Xe)return kc(t),Xe=!0,!1;var n=t.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||sp(t.type,t.memoizedProps)),o=!o),o&&bt&&Mr(t),kc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=_x(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=_x(t)}else n===27?(n=bt,Yr(t.type)?(t=pp,pp=null,bt=t):bt=n):bt=Qt?ci(t.stateNode.nextSibling):null;return!0}function ws(){bt=Qt=null,Xe=!1}function Ad(){var t=Dr;return t!==null&&(Dn===null?Dn=t:Dn.push.apply(Dn,t),Dr=null),t}function Fa(t){Dr===null?Dr=[t]:Dr.push(t)}var Ld=qe(null),Cs=null,er=null;function jr(t,n,o){ze(Ld,n._currentValue),n._currentValue=o}function tr(t){t._currentValue=Ld.current,ke(Ld)}function Tc(t,n,o){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===o)break;t=t.return}}function Dd(t,n,o,u){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var k=C.dependencies;if(k!==null){var N=C.child;k=k.firstContext;e:for(;k!==null;){var q=k;k=C;for(var J=0;J<n.length;J++)if(q.context===n[J]){k.lanes|=o,q=k.alternate,q!==null&&(q.lanes|=o),Tc(k.return,o,t),u||(N=null);break e}k=q.next}}else if(C.tag===18){if(N=C.return,N===null)throw Error(s(341));N.lanes|=o,k=N.alternate,k!==null&&(k.lanes|=o),Tc(N,o,t),N=null}else C.tag===13&&C.memoizedState!==null&&C.memoizedState.dehydrated===null?(C.lanes|=o,N=C.alternate,N!==null&&(N.lanes|=o),Tc(C.return,o,t),N=C.child,N=N!==null?N.sibling:null):N=C.child;if(N!==null)N.return=C;else for(N=C;N!==null;){if(N===t){N=null;break}if(C=N.sibling,C!==null){C.return=N.return,N=C;break}N=N.return}C=N}}function Es(t,n,o,u){t=null;for(var C=n,k=!1;C!==null;){if(!k){if((C.flags&524288)!==0)k=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var N=C.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var q=C.type;Un(C.pendingProps.value,N.value)||(t!==null?t.push(q):t=[q])}}else if(C===Ie.current){if(N=C.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push($o):t=[$o])}C=C.return}return t!==null&&Dd(n,t,o,u),n.flags|=262144,t!==null}function Rc(t){for(t=t.firstContext;t!==null;){if(!Un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ks(t){Cs=t,er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function sn(t){return j_(Cs,t)}function Ac(t,n){return Cs===null&&ks(t),j_(t,n)}function j_(t,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},er===null){if(t===null)throw Error(s(308));er=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else er=er.next=n;return o}var EE=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(o,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(o){return o()})}},kE=e.unstable_scheduleCallback,TE=e.unstable_NormalPriority,Bt={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new EE,data:new Map,refCount:0}}function Ua(t){t.refCount--,t.refCount===0&&kE(TE,function(){t.controller.abort()})}function O_(t,n){if((t.pendingLanes&4194048)!==0){var o=t.transitionTypes;for(o===null&&(o=t.transitionTypes=[]),t=0;t<n.length;t++){var u=n[t];o.indexOf(u)===-1&&o.push(u)}}}var $a=null;function RE(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var qa=null,jd=0,Ts=0,xo=null;function AE(t,n){if(qa===null){var o=qa=[];jd=0,Ts=Kf(),xo={status:"pending",value:void 0,then:function(u){o.push(u)}}}return jd++,n.then(N_,N_),n}function N_(){if(--jd===0&&($a=null,qa!==null)){xo!==null&&(xo.status="fulfilled");var t=qa;qa=null,Ts=0,xo=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function LE(t,n){var o=[],u={status:"pending",value:null,reason:null,then:function(C){o.push(C)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var C=0;C<o.length;C++)(0,o[C])(n)},function(C){for(u.status="rejected",u.reason=C,C=0;C<o.length;C++)(0,o[C])(void 0)}),u}var B_=ue.S;ue.S=function(t,n){if(R0=Vt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&AE(t,n),$a!==null)for(var o=Po;o!==null;)O_(o,$a),o=o.next;if(o=t.types,o!==null){for(var u=Po;u!==null;)O_(u,o),u=u.next;if(Ts!==0){u=$a,u===null&&(u=$a=[]);for(var C=0;C<o.length;C++){var k=o[C];u.indexOf(k)===-1&&u.push(k)}}}B_!==null&&B_(t,n)};var Rs=qe(null);function Od(){var t=Rs.current;return t!==null?t:_t.pooledCache}function Lc(t,n){n===null?ze(Rs,Rs.current):ze(Rs,n.pool)}function P_(){var t=Od();return t===null?null:{parent:Bt._currentValue,pool:t}}var yo=Error(s(460)),Nd=Error(s(474)),Dc=Error(s(542)),Mc={then:function(){}};function I_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function z_(t,n,o){switch(o=t[o],o===void 0?t.push(n):o!==n&&(n.then(Ei,Ei),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,F_(t),t===void 0&&!("reason"in n)?Error(s(600)):t;default:if(typeof n.status=="string")n.then(Ei,Ei);else{if(t=_t,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var C=n;C.status="fulfilled",C.value=u}},function(u){if(n.status==="pending"){var C=n;C.status="rejected",C.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,F_(t),t}throw Ls=n,yo}}function As(t){try{var n=t._init;return n(t._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ls=o,yo):o}}var Ls=null;function H_(){if(Ls===null)throw Error(s(459));var t=Ls;return Ls=null,t}function F_(t){if(t===yo||t===Dc)throw Error(s(483))}var bo=null,Va=0;function jc(t){var n=Va;return Va+=1,bo===null&&(bo=[]),z_(bo,t,n)}function Or(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Oc(t,n){throw n.$$typeof===A?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function U_(t){function n(re,te){if(t){var ae=re.deletions;ae===null?(re.deletions=[te],re.flags|=16):ae.push(te)}}function o(re,te){if(!t)return null;for(;te!==null;)n(re,te),te=te.sibling;return null}function u(re){for(var te=new Map;re!==null;)re.key===null?te.set(re.index,re):te.set(re.key,re),re=re.sibling;return te}function C(re,te){return re=Zi(re,te),re.index=0,re.sibling=null,re}function k(re,te,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<te?(re.flags|=2,te):ae):(re.flags|=134217730,te)):(re.flags|=1048576,te)}function N(re){return t&&re.alternate===null&&(re.flags|=134217730),re}function q(re,te,ae,pe){return te===null||te.tag!==6?(te=Ed(ae,re.mode,pe),te.return=re,te):(te=C(te,ae),te.return=re,te)}function J(re,te,ae,pe){var Ae=ae.type;return Ae===I?(re=de(re,te,ae.props.children,pe,ae.key),Or(re,ae),re):te!==null&&(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&As(Ae)===te.type)?(te=C(te,ae.props),Or(te,ae),te.return=re,te):(te=wc(ae.type,ae.key,ae.props,null,re.mode,pe),Or(te,ae),te.return=re,te)}function se(re,te,ae,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=kd(ae,re.mode,pe),te.return=re,te):(te=C(te,ae.children||[]),te.return=re,te)}function de(re,te,ae,pe,Ae){return te===null||te.tag!==7?(te=Ss(ae,re.mode,pe,Ae),te.return=re,te):(te=C(te,ae),te.return=re,te)}function me(re,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Ed(""+te,re.mode,ae),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case j:return ae=wc(te.type,te.key,te.props,null,re.mode,ae),Or(ae,te),ae.return=re,ae;case M:return te=kd(te,re.mode,ae),te.return=re,te;case O:return te=As(te),me(re,te,ae)}if(ee(te)||X(te))return te=Ss(te,re.mode,ae,null),te.return=re,te;if(typeof te.then=="function")return me(re,jc(te),ae);if(te.$$typeof===W)return me(re,Ac(re,te),ae);Oc(re,te)}return null}function ie(re,te,ae,pe){var Ae=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ae!==null?null:q(re,te,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:return ae.key===Ae?J(re,te,ae,pe):null;case M:return ae.key===Ae?se(re,te,ae,pe):null;case O:return ae=As(ae),ie(re,te,ae,pe)}if(ee(ae)||X(ae))return Ae!==null?null:de(re,te,ae,pe,null);if(typeof ae.then=="function")return ie(re,te,jc(ae),pe);if(ae.$$typeof===W)return ie(re,te,Ac(re,ae),pe);Oc(re,ae)}return null}function ce(re,te,ae,pe,Ae){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return re=re.get(ae)||null,q(te,re,""+pe,Ae);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case j:return re=re.get(pe.key===null?ae:pe.key)||null,J(te,re,pe,Ae);case M:return re=re.get(pe.key===null?ae:pe.key)||null,se(te,re,pe,Ae);case O:return pe=As(pe),ce(re,te,ae,pe,Ae)}if(ee(pe)||X(pe))return re=re.get(ae)||null,de(te,re,pe,Ae,null);if(typeof pe.then=="function")return ce(re,te,ae,jc(pe),Ae);if(pe.$$typeof===W)return ce(re,te,ae,Ac(te,pe),Ae);Oc(te,pe)}return null}function Ce(re,te,ae,pe){for(var Ae=null,et=null,Oe=te,Pe=te=0,zt=null;Oe!==null&&Pe<ae.length;Pe++){Oe.index>Pe?(zt=Oe,Oe=null):zt=Oe.sibling;var it=ie(re,Oe,ae[Pe],pe);if(it===null){Oe===null&&(Oe=zt);break}t&&Oe&&it.alternate===null&&n(re,Oe),te=k(it,te,Pe),et===null?Ae=it:et.sibling=it,et=it,Oe=zt}if(Pe===ae.length)return o(re,Oe),Xe&&Ji(re,Pe),Ae;if(Oe===null){for(;Pe<ae.length;Pe++)Oe=me(re,ae[Pe],pe),Oe!==null&&(te=k(Oe,te,Pe),et===null?Ae=Oe:et.sibling=Oe,et=Oe);return Xe&&Ji(re,Pe),Ae}for(Oe=u(Oe);Pe<ae.length;Pe++)zt=ce(Oe,re,Pe,ae[Pe],pe),zt!==null&&(t&&(it=zt.alternate,it!==null&&Oe.delete(it.key===null?Pe:it.key)),te=k(zt,te,Pe),et===null?Ae=zt:et.sibling=zt,et=zt);return t&&Oe.forEach(function(Jr){return n(re,Jr)}),Xe&&Ji(re,Pe),Ae}function je(re,te,ae,pe){if(ae==null)throw Error(s(151));for(var Ae=null,et=null,Oe=te,Pe=te=0,zt=null,it=ae.next();Oe!==null&&!it.done;Pe++,it=ae.next()){Oe.index>Pe?(zt=Oe,Oe=null):zt=Oe.sibling;var Jr=ie(re,Oe,it.value,pe);if(Jr===null){Oe===null&&(Oe=zt);break}t&&Oe&&Jr.alternate===null&&n(re,Oe),te=k(Jr,te,Pe),et===null?Ae=Jr:et.sibling=Jr,et=Jr,Oe=zt}if(it.done)return o(re,Oe),Xe&&Ji(re,Pe),Ae;if(Oe===null){for(;!it.done;Pe++,it=ae.next())it=me(re,it.value,pe),it!==null&&(te=k(it,te,Pe),et===null?Ae=it:et.sibling=it,et=it);return Xe&&Ji(re,Pe),Ae}for(Oe=u(Oe);!it.done;Pe++,it=ae.next())it=ce(Oe,re,Pe,it.value,pe),it!==null&&(t&&(zt=it.alternate,zt!==null&&Oe.delete(zt.key===null?Pe:zt.key)),te=k(it,te,Pe),et===null?Ae=it:et.sibling=it,et=it);return t&&Oe.forEach(function(u3){return n(re,u3)}),Xe&&Ji(re,Pe),Ae}function Ge(re,te,ae,pe){if(typeof ae=="object"&&ae!==null&&ae.type===I&&ae.key===null&&ae.props.ref===void 0&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:e:{for(var Ae=ae.key;te!==null;){if(te.key===Ae){if(Ae=ae.type,Ae===I){if(te.tag===7){o(re,te.sibling),pe=C(te,ae.props.children),Or(pe,ae),pe.return=re,re=pe;break e}}else if(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&As(Ae)===te.type){o(re,te.sibling),pe=C(te,ae.props),Or(pe,ae),pe.return=re,re=pe;break e}o(re,te);break}else n(re,te);te=te.sibling}ae.type===I?(pe=Ss(ae.props.children,re.mode,pe,ae.key),Or(pe,ae),pe.return=re,re=pe):(pe=wc(ae.type,ae.key,ae.props,null,re.mode,pe),Or(pe,ae),pe.return=re,re=pe)}return N(re);case M:e:{for(Ae=ae.key;te!==null;){if(te.key===Ae)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){o(re,te.sibling),pe=C(te,ae.children||[]),pe.return=re,re=pe;break e}else{o(re,te);break}else n(re,te);te=te.sibling}pe=kd(ae,re.mode,pe),pe.return=re,re=pe}return N(re);case O:return ae=As(ae),Ge(re,te,ae,pe)}if(ee(ae))return Ce(re,te,ae,pe);if(X(ae)){if(Ae=X(ae),typeof Ae!="function")throw Error(s(150));return ae=Ae.call(ae),je(re,te,ae,pe)}if(typeof ae.then=="function")return Ge(re,te,jc(ae),pe);if(ae.$$typeof===W)return Ge(re,te,Ac(re,ae),pe);Oc(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(o(re,te.sibling),pe=C(te,ae),pe.return=re,re=pe):(o(re,te),pe=Ed(ae,re.mode,pe),pe.return=re,re=pe),N(re)):o(re,te)}return function(re,te,ae,pe){try{Va=0;var Ae=Ge(re,te,ae,pe);return bo=null,Ae}catch(Oe){if(Oe===yo||Oe===Dc)throw Oe;var et=Rn(29,Oe,null,re.mode);return et.lanes=pe,et.return=re,et}finally{}}}var Ds=U_(!0),$_=U_(!1),Nr=!1;function Bd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Br(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(t,n,o){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(lt&2)!==0){var C=u.pending;return C===null?n.next=n:(n.next=C.next,C.next=n),u.pending=n,n=Sc(t),k_(t,null,o),n}return bc(t,u,n,o),Sc(t)}function Wa(t,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,Lv(t,o)}}function Id(t,n){var o=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var C=null,k=null;if(o=o.firstBaseUpdate,o!==null){do{var N={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};k===null?C=k=N:k=k.next=N,o=o.next}while(o!==null);k===null?C=k=n:k=k.next=n}else C=k=n;o={baseState:u.baseState,firstBaseUpdate:C,lastBaseUpdate:k,shared:u.shared,callbacks:u.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=n:t.next=n,o.lastBaseUpdate=n}var zd=!1;function Ga(){if(zd){var t=xo;if(t!==null)throw t}}function Ya(t,n,o,u){zd=!1;var C=t.updateQueue;Nr=!1;var k=C.firstBaseUpdate,N=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,se=J.next;J.next=null,N===null?k=se:N.next=se,N=J;var de=t.alternate;de!==null&&(de=de.updateQueue,q=de.lastBaseUpdate,q!==N&&(q===null?de.firstBaseUpdate=se:q.next=se,de.lastBaseUpdate=J))}if(k!==null){var me=C.baseState;N=0,de=se=J=null,q=k;do{var ie=q.lane&-536870913,ce=ie!==q.lane;if(ce?(Je&ie)===ie:(u&ie)===ie){ie!==0&&ie===Ts&&(zd=!0),de!==null&&(de=de.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ce=t,je=q;ie=n;var Ge=o;switch(je.tag){case 1:if(Ce=je.payload,typeof Ce=="function"){me=Ce.call(Ge,me,ie);break e}me=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=je.payload,ie=typeof Ce=="function"?Ce.call(Ge,me,ie):Ce,ie==null)break e;me=D({},me,ie);break e;case 2:Nr=!0}}ie=q.callback,ie!==null&&(t.flags|=64,ce&&(t.flags|=8192),ce=C.callbacks,ce===null?C.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:q.tag,payload:q.payload,callback:q.callback,next:null},de===null?(se=de=ce,J=me):de=de.next=ce,N|=ie;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;ce=q,q=ce.next,ce.next=null,C.lastBaseUpdate=ce,C.shared.pending=null}}while(!0);de===null&&(J=me),C.baseState=J,C.firstBaseUpdate=se,C.lastBaseUpdate=de,k===null&&(C.shared.lanes=0),qr|=N,t.lanes=N,t.memoizedState=me}}function q_(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function V_(t,n){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)q_(o[t],n)}var Ir=qe(null),Nc=qe(0);function W_(t,n){t=or,ze(Nc,t),ze(Ir,n),or=t|n.baseLanes}function Hd(){ze(Nc,or),ze(Ir,Ir.current)}function Fd(){or=Nc.current,ke(Ir),ke(Nc)}var on=qe(null),mn=null;function zr(t){var n=t.alternate;ze(an,an.current&1),ze(on,t),mn===null&&(n===null||Ir.current!==null||n.memoizedState!==null)&&(mn=t)}function Ud(t){ze(an,an.current),ze(on,t),mn===null&&(mn=t)}function G_(t){t.tag===22?(ze(an,an.current),ze(on,t),mn===null&&(mn=t)):Hr()}function Hr(){ze(an,an.current),ze(on,on.current)}function $n(t){ke(on),mn===t&&(mn=null),ke(an)}var an=qe(0);function Xa(t,n){ze(on,on.current),ze(an,n)}function $d(t){ke(an),ke(on),mn===t&&(mn=null)}function Bc(t){for(var n=t;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||dp(o)||fp(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var nr=0,We=null,vt=null,Pt=null,Pc=!1,So=!1,Ms=!1,Ic=0,Ka=0,wo=null,DE=0;function At(){throw Error(s(321))}function qd(t,n){if(n===null)return!1;for(var o=0;o<n.length&&o<t.length;o++)if(!Un(t[o],n[o]))return!1;return!0}function Vd(t,n,o,u,C,k){return nr=k,We=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ue.H=t===null||t.memoizedState===null?L1:D1,Ms=!1,k=o(u,C),Ms=!1,So&&(k=X_(n,o,u,C)),Y_(t),k}function Y_(t){ue.H=Vc;var n=vt!==null&&vt.next!==null;if(nr=0,Pt=vt=We=null,Pc=!1,Ka=0,wo=null,n)throw Error(s(300));t===null||It||(t=t.dependencies,t!==null&&Rc(t)&&(It=!0))}function X_(t,n,o,u){We=t;var C=0;do{if(So&&(wo=null),Ka=0,So=!1,25<=C)throw Error(s(301));if(C+=1,Pt=vt=null,t.updateQueue!=null){var k=t.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}ue.H=zE,k=n(o,u)}while(So);return k}function ME(){var t=ue.H,n=t.useState()[0];return n=typeof n.then=="function"?Qa(n):n,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(We.flags|=1024),n}function Wd(){var t=Ic!==0;return Ic=0,t}function Gd(t,n,o){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~o}function Yd(t){if(Pc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Pc=!1}nr=0,Pt=vt=We=null,So=!1,Ka=Ic=0,wo=null}function yn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?We.memoizedState=Pt=t:Pt=Pt.next=t,Pt}function jt(){if(vt===null){var t=We.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var n=Pt===null?We.memoizedState:Pt.next;if(n!==null)Pt=n,vt=t;else{if(t===null)throw We.alternate===null?Error(s(467)):Error(s(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Pt===null?We.memoizedState=Pt=t:Pt=Pt.next=t}return Pt}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qa(t){var n=Ka;return Ka+=1,wo===null&&(wo=[]),t=z_(wo,t,n),n=We,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,ue.H=n===null||n.memoizedState===null?L1:D1),t}function Hc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Qa(t);if(t.$$typeof===ne)return;if(t.$$typeof===W)return sn(t)}throw Error(s(438,String(t)))}function Xd(t){var n=null,o=We.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var u=We.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(C){return C.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=zc(),We.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(t),u=0;u<t;u++)o[u]=F;return n.index++,o}function ir(t,n){return typeof n=="function"?n(t):n}function Fc(t){var n=jt();return Kd(n,vt,t)}function Kd(t,n,o){var u=t.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=o;var C=t.baseQueue,k=u.pending;if(k!==null){if(C!==null){var N=C.next;C.next=k.next,k.next=N}n.baseQueue=C=k,u.pending=null}if(k=t.baseState,C===null)t.memoizedState=k;else{n=C.next;var q=N=null,J=null,se=n,de=!1;do{var me=se.lane&-536870913;if(me!==se.lane?(Je&me)===me:(nr&me)===me){var ie=se.revertLane;if(ie===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),me===Ts&&(de=!0);else if((nr&ie)===ie){se=se.next,ie===Ts&&(de=!0);continue}else me={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=me,N=k):J=J.next=me,We.lanes|=ie,qr|=ie;me=se.action,Ms&&o(k,me),k=se.hasEagerState?se.eagerState:o(k,me)}else ie={lane:me,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=ie,N=k):J=J.next=ie,We.lanes|=me,qr|=me;se=se.next}while(se!==null&&se!==n);if(J===null?N=k:J.next=q,!Un(k,t.memoizedState)&&(It=!0,de&&(o=xo,o!==null)))throw o;t.memoizedState=k,t.baseState=N,t.baseQueue=J,u.lastRenderedState=k}return C===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Qd(t){var n=jt(),o=n.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var u=o.dispatch,C=o.pending,k=n.memoizedState;if(C!==null){o.pending=null;var N=C=C.next;do k=t(k,N.action),N=N.next;while(N!==C);Un(k,n.memoizedState)||(It=!0),n.memoizedState=k,n.baseQueue===null&&(n.baseState=k),o.lastRenderedState=k}return[k,u]}function K_(t,n,o){var u=We,C=jt(),k=Xe;if(k){if(o===void 0)throw Error(s(407));o=o()}else o=n();var N=!Un((vt||C).memoizedState,o);if(N&&(C.memoizedState=o,It=!0),C=C.queue,ef(J_.bind(null,u,C,t),[t]),t=C.getSnapshot!==n||N||Pt!==null&&(Pt.memoizedState.tag&1)!==0,Co(t?9:8,{destroy:void 0},Z_.bind(null,u,C,o,n),null),t){if(u.flags|=2048,_t===null)throw Error(s(349));k||(nr&127)!==0||Q_(u,n,o)}return o}function Q_(t,n,o){t.flags|=16384,t={getSnapshot:n,value:o},n=We.updateQueue,n===null?(n=zc(),We.updateQueue=n,n.stores=[t]):(o=n.stores,o===null?n.stores=[t]:o.push(t))}function Z_(t,n,o,u){n.value=o,n.getSnapshot=u,e1(n)&&t1(t)}function J_(t,n,o){return o(function(){e1(n)&&t1(t)})}function e1(t){var n=t.getSnapshot;t=t.value;try{var o=n();return!Un(t,o)}catch{return!0}}function t1(t){var n=bs(t,2);n!==null&&Mn(n,t,2)}function Zd(t){var n=yn();if(typeof t=="function"){var o=t;if(t=o(),Ms){Tr(!0);try{o()}finally{Tr(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:t},n}function n1(t,n,o,u){return t.baseState=o,Kd(t,vt,typeof u=="function"?u:ir)}function jE(t,n,o,u,C){if(qc(t))throw Error(s(485));if(t=n.action,t!==null){var k={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){k.listeners.push(N)}};ue.T!==null?o(!0):k.isTransition=!1,u(k),o=n.pending,o===null?(k.next=n.pending=k,i1(n,k)):(k.next=o.next,n.pending=o.next=k)}}function i1(t,n){var o=n.action,u=n.payload,C=t.state;if(n.isTransition){var k=ue.T,N={};N.types=k!==null?k.types:null,ue.T=N;try{var q=o(C,u),J=ue.S;J!==null&&J(N,q),r1(t,n,q)}catch(se){Jd(t,n,se)}finally{k!==null&&N.types!==null&&(k.types=N.types),ue.T=k}}else try{k=o(C,u),r1(t,n,k)}catch(se){Jd(t,n,se)}}function r1(t,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){s1(t,n,u)},function(u){return Jd(t,n,u)}):s1(t,n,o)}function s1(t,n,o){n.status="fulfilled",n.value=o,o1(n),t.state=o,n=t.pending,n!==null&&(o=n.next,o===n?t.pending=null:(o=o.next,n.next=o,i1(t,o)))}function Jd(t,n,o){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=o,o1(n),n=n.next;while(n!==u)}t.action=null}function o1(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function a1(t,n){return n}function l1(t,n){if(Xe){var o=_t.formState;if(o!==null){e:{var u=We;if(Xe){if(bt){t:{for(var C=bt,k=ai;C.nodeType!==8;){if(!k){C=null;break t}if(C=ci(C.nextSibling),C===null){C=null;break t}}k=C.data,C=k==="F!"||k==="F"?C:null}if(C){bt=ci(C.nextSibling),u=C.data==="F!";break e}}Mr(u)}u=!1}u&&(n=o[0])}}return o=yn(),o.memoizedState=o.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a1,lastRenderedState:n},o.queue=u,o=T1.bind(null,We,u),u.dispatch=o,u=Zd(!1),k=of.bind(null,We,!1,u.queue),u=yn(),C={state:n,dispatch:null,action:t,pending:null},u.queue=C,o=jE.bind(null,We,C,k,o),C.dispatch=o,u.memoizedState=t,[n,o,!1]}function c1(t){var n=jt();return u1(n,vt,t)}function u1(t,n,o){if(n=Kd(t,n,a1)[0],t=Fc(ir)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=Qa(n)}catch(N){throw N===yo?Dc:N}else u=n;n=jt();var C=n.queue,k=C.dispatch;return o!==n.memoizedState&&(We.flags|=2048,Co(9,{destroy:void 0},OE.bind(null,C,o),null)),[u,k,t]}function OE(t,n){t.action=n}function h1(t){var n=jt(),o=vt;if(o!==null)return u1(n,o,t);jt(),n=n.memoizedState,o=jt();var u=o.queue.dispatch;return o.memoizedState=t,[n,u,!1]}function Co(t,n,o,u){return t={tag:t,create:o,deps:u,inst:n,next:null},n=We.updateQueue,n===null&&(n=zc(),We.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=t.next=t:(u=o.next,o.next=t,t.next=u,n.lastEffect=t),t}function d1(){return jt().memoizedState}function Uc(t,n,o,u){var C=yn();We.flags|=t,C.memoizedState=Co(1|n,{destroy:void 0},o,u===void 0?null:u)}function $c(t,n,o,u){var C=jt();u=u===void 0?null:u;var k=C.memoizedState.inst;vt!==null&&u!==null&&qd(u,vt.memoizedState.deps)?C.memoizedState=Co(n,k,o,u):(We.flags|=t,C.memoizedState=Co(1|n,k,o,u))}function f1(t,n){Uc(8390656,8,t,n)}function ef(t,n){$c(2048,8,t,n)}function NE(t){We.flags|=4;var n=We.updateQueue;if(n===null)n=zc(),We.updateQueue=n,n.events=[t];else{var o=n.events;o===null?n.events=[t]:o.push(t)}}function p1(t){var n=jt().memoizedState;return NE({ref:n,nextImpl:t}),function(){if((lt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function m1(t,n){return $c(4,2,t,n)}function g1(t,n){return $c(4,4,t,n)}function v1(t,n){if(typeof n=="function"){t=t();var o=n(t);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function _1(t,n,o){o=o!=null?o.concat([t]):null,$c(4,4,v1.bind(null,n,t),o)}function tf(){}function x1(t,n){var o=jt();n=n===void 0?null:n;var u=o.memoizedState;return n!==null&&qd(n,u[1])?u[0]:(o.memoizedState=[t,n],t)}function y1(t,n){var o=jt();n=n===void 0?null:n;var u=o.memoizedState;if(n!==null&&qd(n,u[1]))return u[0];if(u=t(),Ms){Tr(!0);try{t()}finally{Tr(!1)}}return o.memoizedState=[u,n],u}function nf(t,n,o){return o===void 0||(nr&1073741824)!==0&&(Je&261930)===0?t.memoizedState=n:(t.memoizedState=o,t=L0(),We.lanes|=t,qr|=t,o)}function b1(t,n,o,u){return Un(o,n)?o:Ir.current!==null?(t=nf(t,o,u),Un(t,n)||(It=!0),t):(nr&106)===0||(nr&1073741824)!==0&&(Je&261930)===0?(It=!0,t.memoizedState=o):(t=L0(),We.lanes|=t,qr|=t,n)}function S1(t,n,o,u,C){var k=he.p;he.p=k!==0&&8>k?k:8;var N=ue.T,q={};q.types=N!==null?N.types:null,ue.T=q,of(t,!1,n,o);try{var J=C(),se=ue.S;if(se!==null&&se(q,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var de=LE(J,u);Za(t,n,de,Gn(t))}else Za(t,n,u,Gn(t))}catch(me){Za(t,n,{then:function(){},status:"rejected",reason:me},Gn())}finally{he.p=k,N!==null&&q.types!==null&&(N.types=q.types),ue.T=N}}function BE(){}function rf(t,n,o,u){if(t.tag!==5)throw Error(s(476));var C=w1(t).queue;S1(t,C,n,we,o===null?BE:function(){return C1(t),o(u)})}function w1(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:we,baseState:we,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:we},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:o},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function C1(t){var n=w1(t);n.next===null&&(n=t.alternate.memoizedState),Za(t,n.next.queue,{},Gn())}function sf(){return sn($o)}function E1(){return jt().memoizedState}function k1(){return jt().memoizedState}function PE(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var o=Gn();t=Br(o);var u=Pr(n,t,o);u!==null&&(Mn(u,n,o),Wa(u,n,o)),n={cache:Md()},t.payload=n;return}n=n.return}}function IE(t,n,o){var u=Gn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},qc(t)?R1(n,o):(o=wd(t,n,o,u),o!==null&&(Mn(o,t,u),A1(o,n,u)))}function T1(t,n,o){var u=Gn();Za(t,n,o,u)}function Za(t,n,o,u){var C={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(qc(t))R1(n,C);else{var k=t.alternate;if(t.lanes===0&&(k===null||k.lanes===0)&&(k=n.lastRenderedReducer,k!==null))try{var N=n.lastRenderedState,q=k(N,o);if(C.hasEagerState=!0,C.eagerState=q,Un(q,N))return bc(t,n,C,0),_t===null&&yc(),!1}catch{}finally{}if(o=wd(t,n,C,u),o!==null)return Mn(o,t,u),A1(o,n,u),!0}return!1}function of(t,n,o,u){if(u={lane:2,revertLane:Kf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},qc(t)){if(n)throw Error(s(479))}else n=wd(t,o,u,2),n!==null&&Mn(n,t,2)}function qc(t){var n=t.alternate;return t===We||n!==null&&n===We}function R1(t,n){So=Pc=!0;var o=t.pending;o===null?n.next=n:(n.next=o.next,o.next=n),t.pending=n}function A1(t,n,o){if((o&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,Lv(t,o)}}var Vc={readContext:sn,use:Hc,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At,useEffectEvent:At},L1={readContext:sn,use:Hc,useCallback:function(t,n){return yn().memoizedState=[t,n===void 0?null:n],t},useContext:sn,useEffect:f1,useImperativeHandle:function(t,n,o){o=o!=null?o.concat([t]):null,Uc(4194308,4,v1.bind(null,n,t),o)},useLayoutEffect:function(t,n){return Uc(4194308,4,t,n)},useInsertionEffect:function(t,n){Uc(4,2,t,n)},useMemo:function(t,n){var o=yn();n=n===void 0?null:n;var u=t();if(Ms){Tr(!0);try{t()}finally{Tr(!1)}}return o.memoizedState=[u,n],u},useReducer:function(t,n,o){var u=yn();if(o!==void 0){var C=o(n);if(Ms){Tr(!0);try{o(n)}finally{Tr(!1)}}}else C=n;return u.memoizedState=u.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},u.queue=t,t=t.dispatch=IE.bind(null,We,t),[u.memoizedState,t]},useRef:function(t){var n=yn();return t={current:t},n.memoizedState=t},useState:function(t){t=Zd(t);var n=t.queue,o=T1.bind(null,We,n);return n.dispatch=o,[t.memoizedState,o]},useDebugValue:tf,useDeferredValue:function(t,n){var o=yn();return nf(o,t,n)},useTransition:function(){var t=Zd(!1);return t=S1.bind(null,We,t.queue,!0,!1),yn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,o){var u=We,C=yn();if(Xe){if(o===void 0)throw Error(s(407));o=o()}else{if(o=n(),_t===null)throw Error(s(349));(Je&127)!==0||Q_(u,n,o)}C.memoizedState=o;var k={value:o,getSnapshot:n};return C.queue=k,f1(J_.bind(null,u,k,t),[t]),u.flags|=2048,Co(9,{destroy:void 0},Z_.bind(null,u,k,o,n),null),o},useId:function(){var t=yn(),n=_t.identifierPrefix;if(Xe){var o=Ti,u=ki;o=(u&~(1<<32-Hn(u)-1)).toString(32)+o,n="_"+n+"R_"+o,o=Ic++,0<o&&(n+="H"+o.toString(32)),n+="_"}else o=DE++,n="_"+n+"r_"+o.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:sf,useFormState:l1,useActionState:l1,useOptimistic:function(t){var n=yn();n.memoizedState=n.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=of.bind(null,We,!0,o),o.dispatch=n,[t,n]},useMemoCache:Xd,useCacheRefresh:function(){return yn().memoizedState=PE.bind(null,We)},useEffectEvent:function(t){var n=yn(),o={impl:t};return n.memoizedState=o,function(){if((lt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},D1={readContext:sn,use:Hc,useCallback:x1,useContext:sn,useEffect:ef,useImperativeHandle:_1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:y1,useReducer:Fc,useRef:d1,useState:function(){return Fc(ir)},useDebugValue:tf,useDeferredValue:function(t,n){var o=jt();return b1(o,vt.memoizedState,t,n)},useTransition:function(){var t=Fc(ir)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:Qa(t),n]},useSyncExternalStore:K_,useId:E1,useHostTransitionStatus:sf,useFormState:c1,useActionState:c1,useOptimistic:function(t,n){var o=jt();return n1(o,vt,t,n)},useMemoCache:Xd,useCacheRefresh:k1,useEffectEvent:p1},zE={readContext:sn,use:Hc,useCallback:x1,useContext:sn,useEffect:ef,useImperativeHandle:_1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:y1,useReducer:Qd,useRef:d1,useState:function(){return Qd(ir)},useDebugValue:tf,useDeferredValue:function(t,n){var o=jt();return vt===null?nf(o,t,n):b1(o,vt.memoizedState,t,n)},useTransition:function(){var t=Qd(ir)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:Qa(t),n]},useSyncExternalStore:K_,useId:E1,useHostTransitionStatus:sf,useFormState:h1,useActionState:h1,useOptimistic:function(t,n){var o=jt();return vt!==null?n1(o,vt,t,n):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:Xd,useCacheRefresh:k1,useEffectEvent:p1};function af(t,n,o,u){n=t.memoizedState,o=o(u,n),o=o==null?n:D({},n,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var lf={enqueueSetState:function(t,n,o){t=t._reactInternals;var u=Gn(),C=Br(u);C.payload=n,o!=null&&(C.callback=o),n=Pr(t,C,u),n!==null&&(Mn(n,t,u),Wa(n,t,u))},enqueueReplaceState:function(t,n,o){t=t._reactInternals;var u=Gn(),C=Br(u);C.tag=1,C.payload=n,o!=null&&(C.callback=o),n=Pr(t,C,u),n!==null&&(Mn(n,t,u),Wa(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var o=Gn(),u=Br(o);u.tag=2,n!=null&&(u.callback=n),n=Pr(t,u,o),n!==null&&(Mn(n,t,o),Wa(n,t,o))}};function M1(t,n,o,u,C,k,N){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,k,N):n.prototype&&n.prototype.isPureReactComponent?!Ia(o,u)||!Ia(C,k):!0}function j1(t,n,o,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==t&&lf.enqueueReplaceState(n,n.state,null)}function js(t,n){var o=n;if("ref"in n){o={};for(var u in n)u!=="ref"&&(o[u]=n[u])}if(t=t.defaultProps){o===n&&(o=D({},o));for(var C in t)o[C]===void 0&&(o[C]=t[C])}return o}function O1(t){xc(t)}function N1(t){console.error(t)}function B1(t){xc(t)}function Wc(t,n){try{var o=t.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function P1(t,n,o){try{var u=t.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function cf(t,n,o){return o=Br(o),o.tag=3,o.payload={element:null},o.callback=function(){Wc(t,n)},o}function I1(t){return t=Br(t),t.tag=3,t}function z1(t,n,o,u){var C=o.type.getDerivedStateFromError;if(typeof C=="function"){var k=u.value;t.payload=function(){return C(k)},t.callback=function(){P1(n,o,u)}}var N=o.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(t.callback=function(){P1(n,o,u),typeof C!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var q=u.stack;this.componentDidCatch(u.value,{componentStack:q!==null?q:""})})}function HE(t,n,o,u,C){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=o.alternate,n!==null&&Es(n,o,C,!0),o=on.current,o!==null){switch(o.tag){case 31:case 13:case 19:return mn===null?fu():o.alternate===null&&Lt===0&&(Lt=3),o.flags&=-257,o.flags|=65536,o.lanes=C,u===Mc?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([u]):n.add(u),Gf(t,u,C)),!1;case 22:return o.flags|=65536,u===Mc?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([u]):o.add(u)),Gf(t,u,C)),!1}throw Error(s(435,o.tag))}return Gf(t,u,C),fu(),!1}if(Xe)return n=on.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=C,u!==Rd&&(t=Error(s(422),{cause:u}),Fa(ri(t,o)))):(u!==Rd&&(n=Error(s(423),{cause:u}),Fa(ri(n,o))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,u=ri(u,o),C=cf(t.stateNode,u,C),Id(t,C),Lt!==4&&(Lt=2)),!1;var k=Error(s(520),{cause:u});if(k=ri(k,o),ol===null?ol=[k]:ol.push(k),Lt!==4&&(Lt=2),n===null)return!0;u=ri(u,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,t=C&-C,o.lanes|=t,t=cf(o.stateNode,u,t),Id(o,t),!1;case 1:if(n=o.type,k=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Vr===null||!Vr.has(k))))return o.flags|=65536,C&=-C,o.lanes|=C,C=I1(C),z1(C,t,o,u),Id(o,C),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var uf=Error(s(461)),It=!1;function Gt(t,n,o,u){n.child=t===null?$_(n,null,o,u):Ds(n,t.child,o,u)}function H1(t,n,o,u,C){o=o.render;var k=n.ref;if("ref"in u){var N={};for(var q in u)q!=="ref"&&(N[q]=u[q])}else N=u;return ks(n),u=Vd(t,n,o,N,k,C),q=Wd(),t!==null&&!It?(Gd(t,n,C),rr(t,n,C)):(Xe&&q&&Ec(n),n.flags|=1,Gt(t,n,u,C),n.child)}function F1(t,n,o,u,C){if(t===null){var k=o.type;return typeof k=="function"&&!Cd(k)&&k.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=k,U1(t,n,k,u,C)):(t=wc(o.type,null,u,n,n.mode,C),t.ref=n.ref,t.return=n,n.child=t)}if(k=t.child,!_f(t,C)){var N=k.memoizedProps;if(o=o.compare,o=o!==null?o:Ia,o(N,u)&&t.ref===n.ref)return rr(t,n,C)}return n.flags|=1,t=Zi(k,u),t.ref=n.ref,t.return=n,n.child=t}function U1(t,n,o,u,C){if(t!==null){var k=t.memoizedProps;if(Ia(k,u)&&t.ref===n.ref)if(It=!1,n.pendingProps=u=k,_f(t,C))(t.flags&131072)!==0&&(It=!0);else return n.lanes=t.lanes,rr(t,n,C)}return hf(t,n,o,u,C)}function $1(t,n,o,u){var C=u.children,k=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(k=k!==null?k.baseLanes|o:o,t!==null){for(u=n.child=t.child,C=0;u!==null;)C=C|u.lanes|u.childLanes,u=u.sibling;u=C&~k}else u=0,n.child=null;return q1(t,n,k,o,u)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Lc(n,k!==null?k.cachePool:null),k!==null?W_(n,k):Hd(),G_(n);else return u=n.lanes=536870912,q1(t,n,k!==null?k.baseLanes|o:o,o,u)}else k!==null?(Lc(n,k.cachePool),W_(n,k),Hr(),n.memoizedState=null):(t!==null&&Lc(n,null),Hd(),Hr());return Gt(t,n,C,o),n.child}function Ja(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function q1(t,n,o,u,C){var k=Od();return k=k===null?null:{parent:Bt._currentValue,pool:k},n.memoizedState={baseLanes:o,cachePool:k},t!==null&&Lc(n,null),Hd(),G_(n),t!==null&&Es(t,n,u,!0),n.childLanes=C,null}function Gc(t,n){return n=Yc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function V1(t,n,o){return Ds(n,t.child,null,o),t=Gc(n,n.pendingProps),t.flags|=2,$n(n),n.memoizedState=null,t}function FE(t,n,o){var u=n.pendingProps,C=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Xe){if(u.mode==="hidden")return t=Gc(n,u),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Ja(null,t);if(Ud(n),(t=bt)?(t=vx(t,ai),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Lr!==null?{id:ki,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},o=R_(t),o.return=n,n.child=o,Qt=n,bt=null)):t=null,t===null)throw Mr(n);return n.lanes=536870912,null}return Gc(n,u)}var k=t.memoizedState;if(k!==null){var N=k.dehydrated;if(Ud(n),C)if(n.flags&256)n.flags&=-257,n=V1(t,n,o);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(It||Es(t,n,o,!1),C=(o&t.childLanes)!==0,It||C){if(Ir.current===null){if(u=_t,u!==null&&(N=Dv(u,o),N!==0&&N!==k.retryLane))throw k.retryLane=N,bs(t,N),Mn(u,t,N),uf;fu()}n=V1(t,n,o)}else t=k.treeContext,bt=ci(N.nextSibling),Qt=n,Xe=!0,Dr=null,ai=!1,t!==null&&D_(n,t),n=Gc(n,u),n.flags|=134221824;return n}return t=Zi(t.child,{mode:u.mode,children:u.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Eo(t,n){var o=n.ref;if(o===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(t===null||t.ref!==o)&&(n.flags|=4194816)}}function hf(t,n,o,u,C){return ks(n),o=Vd(t,n,o,u,void 0,C),u=Wd(),t!==null&&!It?(Gd(t,n,C),rr(t,n,C)):(Xe&&u&&Ec(n),n.flags|=1,Gt(t,n,o,C),n.child)}function W1(t,n,o,u,C,k){return ks(n),n.updateQueue=null,o=X_(n,u,o,C),Y_(t),u=Wd(),t!==null&&!It?(Gd(t,n,k),rr(t,n,k)):(Xe&&u&&Ec(n),n.flags|=1,Gt(t,n,o,k),n.child)}function G1(t,n,o,u,C){if(ks(n),n.stateNode===null){var k=mo,N=o.contextType;typeof N=="object"&&N!==null&&(k=sn(N)),k=new o(u,k),n.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=lf,n.stateNode=k,k._reactInternals=n,k=n.stateNode,k.props=u,k.state=n.memoizedState,k.refs={},Bd(n),N=o.contextType,k.context=typeof N=="object"&&N!==null?sn(N):mo,k.state=n.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(af(n,o,N,u),k.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(N=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),N!==k.state&&lf.enqueueReplaceState(k,k.state,null),Ya(n,u,k,C),Ga(),k.state=n.memoizedState),typeof k.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){k=n.stateNode;var q=n.memoizedProps,J=js(o,q);k.props=J;var se=k.context,de=o.contextType;N=mo,typeof de=="object"&&de!==null&&(N=sn(de));var me=o.getDerivedStateFromProps;de=typeof me=="function"||typeof k.getSnapshotBeforeUpdate=="function",q=n.pendingProps!==q,de||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(q||se!==N)&&j1(n,k,u,N),Nr=!1;var ie=n.memoizedState;k.state=ie,Ya(n,u,k,C),Ga(),se=n.memoizedState,q||ie!==se||Nr?(typeof me=="function"&&(af(n,o,me,u),se=n.memoizedState),(J=Nr||M1(n,o,J,u,ie,se,N))?(de||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(n.flags|=4194308)):(typeof k.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=se),k.props=u,k.state=se,k.context=N,u=J):(typeof k.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{k=n.stateNode,Pd(t,n),N=n.memoizedProps,de=js(o,N),k.props=de,me=n.pendingProps,ie=k.context,se=o.contextType,J=mo,typeof se=="object"&&se!==null&&(J=sn(se)),q=o.getDerivedStateFromProps,(se=typeof q=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(N!==me||ie!==J)&&j1(n,k,u,J),Nr=!1,ie=n.memoizedState,k.state=ie,Ya(n,u,k,C),Ga();var ce=n.memoizedState;N!==me||ie!==ce||Nr||t!==null&&t.dependencies!==null&&Rc(t.dependencies)?(typeof q=="function"&&(af(n,o,q,u),ce=n.memoizedState),(de=Nr||M1(n,o,de,u,ie,ce,J)||t!==null&&t.dependencies!==null&&Rc(t.dependencies))?(se||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(u,ce,J),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(u,ce,J)),typeof k.componentDidUpdate=="function"&&(n.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof k.componentDidUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=ce),k.props=u,k.state=ce,k.context=J,u=de):(typeof k.componentDidUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),u=!1)}return k=u,Eo(t,n),u=(n.flags&128)!==0,k||u?(k=n.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:k.render(),n.flags|=1,t!==null&&u?(n.child=Ds(n,t.child,null,C),n.child=Ds(n,null,o,C)):Gt(t,n,o,C),n.memoizedState=k.state,t=n.child):t=rr(t,n,C),t}function Y1(t,n,o,u){return ws(),n.flags|=256,Gt(t,n,o,u),n.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ff(t){return{baseLanes:t,cachePool:P_()}}function pf(t,n,o){return t=t!==null?t.childLanes&~o:0,n&&(t|=Wn),t}function X1(t,n,o){var u=n.pendingProps,C=!1,k=(n.flags&128)!==0,N;if((N=k)||(N=t!==null&&t.memoizedState===null?!1:(an.current&2)!==0),N&&(C=!0,n.flags&=-129),N=(n.flags&32)!==0,n.flags&=-33,t===null){if(Xe){if(C?zr(n):Hr(),(t=bt)?(t=vx(t,ai),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Lr!==null?{id:ki,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},o=R_(t),o.return=n,n.child=o,Qt=n,bt=null)):t=null,t===null)throw Mr(n);return fp(t)?n.lanes=32:n.lanes=536870912,null}return k=u.children,u=u.fallback,C?(Hr(),C=n.mode,k=Yc({mode:"hidden",children:k},C),u=Ss(u,C,o,null),k.return=n,u.return=n,k.sibling=u,n.child=k,u=n.child,u.memoizedState=ff(o),u.childLanes=pf(t,N,o),n.memoizedState=df,Ja(null,u)):(zr(n),mf(n,k))}var q=t.memoizedState;if(q!==null){var J=q.dehydrated;if(J!==null)return UE(t,n,k,N,u,J,q,o)}return C?(Hr(),C=u.fallback,k=n.mode,q=t.child,J=q.sibling,u=Zi(q,{mode:"hidden",children:u.children}),u.subtreeFlags=q.subtreeFlags&1206910976,J!==null?C=Zi(J,C):(C=Ss(C,k,o,null),C.flags|=2),C.return=n,u.return=n,u.sibling=C,n.child=u,Ja(null,u),u=n.child,C=t.child.memoizedState,C===null?C=ff(o):(k=C.cachePool,k!==null?(q=Bt._currentValue,k=k.parent!==q?{parent:q,pool:q}:k):k=P_(),C={baseLanes:C.baseLanes|o,cachePool:k}),u.memoizedState=C,u.childLanes=pf(t,N,o),n.memoizedState=df,Ja(t.child,u)):(zr(n),o=t.child,t=o.sibling,o=Zi(o,{mode:"visible",children:u.children}),o.return=n,o.sibling=null,t!==null&&(N=n.deletions,N===null?(n.deletions=[t],n.flags|=16):N.push(t)),n.child=o,n.memoizedState=null,o)}function mf(t,n){return n=Yc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Yc(t,n){return t=Rn(22,t,null,n),t.lanes=0,t}function Xc(t,n,o){return Ds(n,t.child,null,o),t=mf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function UE(t,n,o,u,C,k,N,q){if(o)return n.flags&256?(zr(n),n.flags&=-257,Xc(t,n,q)):n.memoizedState!==null?(Hr(),n.child=t.child,n.flags|=128,null):(Hr(),k=C.fallback,N=n.mode,C=Yc({mode:"visible",children:C.children},N),k=Ss(k,N,q,null),k.flags|=2,C.return=n,k.return=n,C.sibling=k,n.child=C,Ds(n,t.child,null,q),C=n.child,C.memoizedState=ff(q),C.childLanes=pf(t,u,q),n.memoizedState=df,Ja(null,C));if(zr(n),fp(k)){if(u=k.nextSibling&&k.nextSibling.dataset,u)var J=u.dgst;return u=J,u!==""&&(C=Error(s(419)),C.stack="",C.digest=u,Fa({value:C,source:null,stack:null})),Xc(t,n,q)}if(It||Es(t,n,q,!1),u=(q&t.childLanes)!==0,It||u){if(Ir.current!==null)return Xc(t,n,q);if(u=_t,u!==null&&(C=Dv(u,q),C!==0&&C!==N.retryLane))throw N.retryLane=C,bs(t,C),Mn(u,t,C),uf;return dp(k)||fu(),Xc(t,n,q)}return dp(k)?(n.flags|=192,n.child=t.child,null):(t=N.treeContext,bt=ci(k.nextSibling),Qt=n,Xe=!0,Dr=null,ai=!1,t!==null&&D_(n,t),n=mf(n,C.children),n.flags|=134221824,n)}function K1(t,n,o){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),Tc(t.return,n,o)}function Q1(t){for(var n=null;t!==null;){var o=t.alternate;o!==null&&Bc(o)===null&&(n=t),t=t.sibling}return n}function Kc(t,n,o,u,C,k){var N=t.memoizedState;N===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:C,treeForkCount:k}:(N.isBackwards=n,N.rendering=null,N.renderingStartTime=0,N.last=u,N.tail=o,N.tailMode=C,N.treeForkCount=k)}function gf(t){var n=t.child;for(t.child=null;n!==null;){var o=n.sibling;n.sibling=t.child,t.child=n,n=o}}function vf(t,n,o){var u=n.pendingProps,C=u.revealOrder,k=u.tail;u=u.children;var N=an.current;if(n.flags&128)return Xa(n,N),null;var q=(N&2)!==0;if(q?(N=N&1|2,n.flags|=128):N&=1,Xa(n,N),C==="backwards"&&t!==null?(gf(t),Gt(t,n,u,o),gf(t)):Gt(t,n,u,o),u=Xe?Ha:0,!q&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&K1(t,o,n);else if(t.tag===19)K1(t,o,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"backwards":o=Q1(n.child),o===null?(C=n.child,n.child=null):(C=o.sibling,o.sibling=null,gf(n)),Kc(n,!0,C,null,k,u);break;case"unstable_legacy-backwards":for(o=null,C=n.child,n.child=null;C!==null;){if(t=C.alternate,t!==null&&Bc(t)===null){n.child=C;break}t=C.sibling,C.sibling=o,o=C,C=t}Kc(n,!0,o,null,k,u);break;case"together":Kc(n,!1,null,null,void 0,u);break;case"independent":n.memoizedState=null;break;default:o=Q1(n.child),o===null?(C=n.child,n.child=null):(C=o.sibling,o.sibling=null),Kc(n,!1,C,o,k,u)}return n.child}function Z1(t,n,o){var u=n.pendingProps;return jr(n,n.type,u.value),Gt(t,n,u.children,o),n.child}function rr(t,n,o){if(t!==null&&(n.dependencies=t.dependencies),qr|=n.lanes,(o&n.childLanes)===0)if(t!==null){if(Es(t,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,o=Zi(t,t.pendingProps),n.child=o,o.return=n;t.sibling!==null;)t=t.sibling,o=o.sibling=Zi(t,t.pendingProps),o.return=n;o.sibling=null}return n.child}function _f(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Rc(t)))}function $E(t,n,o){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),jr(n,Bt,t.memoizedState.cache),ws();break;case 27:case 5:gt(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:jr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ud(n),null;break;case 13:var u=n.memoizedState;if(u!==null){if(u.dehydrated!==null)return zr(n),n.flags|=128,null;u=Es(t,n,o,!1);var C=n.child.childLanes;return u||(o&C)!==0?X1(t,n,o):(zr(n),t=rr(t,n,o),t!==null?t.sibling:null)}zr(n);break;case 19:if(n.flags&128)return vf(t,n,o);if(C=(t.flags&128)!==0,u=(o&n.childLanes)!==0,u||(Es(t,n,o,!1),u=(o&n.childLanes)!==0),C){if(u)return vf(t,n,o);n.flags|=128}if(C=n.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Xa(n,an.current),u)break;return null;case 22:return n.lanes=0,$1(t,n,o,n.pendingProps);case 24:jr(n,Bt,t.memoizedState.cache)}return rr(t,n,o)}function J1(t,n,o){if(t!==null)if(t.memoizedProps!==n.pendingProps)It=!0;else{if(!_f(t,o)&&(n.flags&128)===0)return It=!1,$E(t,n,o);It=(t.flags&131072)!==0}else It=!1,Xe&&(n.flags&1048576)!==0&&L_(n,Ha,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(t=As(n.elementType),n.type=t,typeof t=="function")Cd(t)?(u=js(t,u),n.tag=1,n=G1(null,n,t,u,o)):(n.tag=0,n=hf(null,n,t,u,o));else{if(t!=null){var C=t.$$typeof;if(C===Y){n.tag=11,n=H1(null,n,t,u,o);break e}else if(C===z){n.tag=14,n=F1(null,n,t,u,o);break e}else if(C===W){n.tag=10,n.type=t,n=Z1(null,n,o);break e}}throw n=oe(t)||t,Error(s(306,n,""))}}return n;case 0:return hf(t,n,n.type,n.pendingProps,o);case 1:return u=n.type,C=js(u,n.pendingProps),G1(t,n,u,C,o);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(s(387));u=n.pendingProps;var k=n.memoizedState;C=k.element,Pd(t,n),Ya(n,u,null,o);var N=n.memoizedState;if(u=N.cache,jr(n,Bt,u),u!==k.cache&&Dd(n,[Bt],o,!0),Ga(),u=N.element,k.isDehydrated)if(k={element:u,isDehydrated:!1,cache:N.cache},n.updateQueue.baseState=k,n.memoizedState=k,n.flags&256){n=Y1(t,n,u,o);break e}else if(u!==C){C=ri(Error(s(424)),n),Fa(C),n=Y1(t,n,u,o);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(bt=ci(t.firstChild),Qt=n,Xe=!0,Dr=null,ai=!0,o=$_(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling}else{if(ws(),u===C){n=rr(t,n,o);break e}Gt(t,n,u,o)}n=n.child}return n;case 26:return Eo(t,n),t===null?(o=Cx(n.type,null,n.pendingProps,null))?n.memoizedState=o:Xe||(n.stateNode=ix(n.type,n.pendingProps,Be.current,n)):n.memoizedState=Cx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return gt(n),t===null&&Xe&&(u=n.stateNode=yx(n.type,n.pendingProps,Be.current),Qt=n,ai=!0,C=bt,Yr(n.type)?(pp=C,bt=ci(u.firstChild)):bt=C),Gt(t,n,n.pendingProps.children,o),Eo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Xe&&((C=u=bt)&&(u=Pk(u,n.type,n.pendingProps,ai),u!==null?(n.stateNode=u,Qt=n,bt=ci(u.firstChild),ai=!1,C=!0):C=!1),C||Mr(n)),gt(n),C=n.type,k=n.pendingProps,N=t!==null?t.memoizedProps:null,u=k.children,sp(C,k)?u=null:N!==null&&sp(C,N)&&(n.flags|=32),n.memoizedState!==null&&(C=Vd(t,n,ME,null,null,o),$o._currentValue=C),Eo(t,n),Gt(t,n,u,o),n.child;case 6:return t===null&&Xe&&((t=o=bt)&&(o=Ik(o,n.pendingProps,ai),o!==null?(n.stateNode=o,Qt=n,bt=null,t=!0):t=!1),t||Mr(n)),null;case 13:return X1(t,n,o);case 4:return Te(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Ds(n,null,u,o):Gt(t,n,u,o),n.child;case 11:return H1(t,n,n.type,n.pendingProps,o);case 7:return u=n.pendingProps,Eo(t,n),Gt(t,n,u,o),n.child;case 8:return Gt(t,n,n.pendingProps.children,o),n.child;case 12:return Gt(t,n,n.pendingProps.children,o),n.child;case 10:return Z1(t,n,o);case 9:return C=n.type._context,u=n.pendingProps.children,ks(n),C=sn(C),u=u(C),n.flags|=1,Gt(t,n,u,o),n.child;case 14:return F1(t,n,n.type,n.pendingProps,o);case 15:return U1(t,n,n.type,n.pendingProps,o);case 19:return vf(t,n,o);case 31:return FE(t,n,o);case 22:return $1(t,n,o,n.pendingProps);case 24:return ks(n),u=sn(Bt),t===null?(C=Od(),C===null&&(C=_t,k=Md(),C.pooledCache=k,k.refCount++,k!==null&&(C.pooledCacheLanes|=o),C=k),n.memoizedState={parent:u,cache:C},Bd(n),jr(n,Bt,C)):((t.lanes&o)!==0&&(Pd(t,n),Ya(n,null,null,o),Ga()),C=t.memoizedState,k=n.memoizedState,C.parent!==u?(C={parent:u,cache:u},n.memoizedState=C,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=C),jr(n,Bt,u)):(u=k.cache,jr(n,Bt,u),u!==C.cache&&Dd(n,[Bt],o,!0))),Gt(t,n,n.pendingProps.children,o),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),u=n.pendingProps,u.name!=null&&u.name!=="auto"?n.flags|=t===null?18882560:18874368:Xe&&Ec(n),t!==null&&t.memoizedProps.name!==u.name?n.flags|=4194816:Eo(t,n),Gt(t,n,u.children,o),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function sr(t){t.flags|=4}function xf(t,n,o,u,C){var k;if((k=(t.mode&32)!==0)&&(k=o===null?Rx(n,u):Rx(n,u)&&(u.src!==o.src||u.srcSet!==o.srcSet)),k){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(O0())t.flags|=8192;else throw Ls=Mc,Nd}else t.flags&=-16777217}function e0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ax(n))if(O0())t.flags|=8192;else throw Ls=Mc,Nd}function Qc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Rv():536870912,t.lanes|=n,Lo|=n)}function el(t,n){if(!Xe)switch(t.tailMode){case"visible":break;case"collapsed":for(var o=t.tail,u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null;break;default:for(n=t.tail,o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t.tail=null:o.sibling=null}}function St(t){var n=t.alternate!==null&&t.alternate.child===t.child,o=0,u=0;if(n)for(var C=t.child;C!==null;)o|=C.lanes|C.childLanes,u|=C.subtreeFlags&1206910976,u|=C.flags&1206910976,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)o|=C.lanes|C.childLanes,u|=C.subtreeFlags,u|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=u,t.childLanes=o,n}function qE(t,n,o){var u=n.pendingProps;switch(Td(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(n),null;case 1:return St(n),null;case 3:return o=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),tr(Bt),Ve(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(_o(n)?sr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Ad())),St(n),null;case 26:var C=n.type,k=n.memoizedState;return t===null?(sr(n),k!==null?(St(n),e0(n,k)):(St(n),xf(n,C,null,u,o))):k?k!==t.memoizedState?(sr(n),St(n),e0(n,k)):(St(n),n.flags&=-16777217):(t=t.memoizedProps,t!==u&&sr(n),St(n),xf(n,C,t,u,o)),null;case 27:if(st(n),o=Be.current,C=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&sr(n);else{if(!u){if(n.stateNode===null)throw Error(s(166));return St(n),n.subtreeFlags&=-33554433,null}t=Mt.current,_o(n)?M_(n):(t=yx(C,u,o),n.stateNode=t,sr(n))}return St(n),n.subtreeFlags&=-33554433,null;case 5:if(st(n),C=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&sr(n);else{if(!u){if(n.stateNode===null)throw Error(s(166));return St(n),n.subtreeFlags&=-33554433,null}if(k=Mt.current,_o(n))M_(n);else{var N=hl(Be.current);switch(k){case 1:k=N.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:k=N.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":k=N.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":k=N.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":k=N.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof u.is=="string"?N.createElement("select",{is:u.is}):N.createElement("select"),u.multiple?k.multiple=!0:u.size&&(k.size=u.size);break;default:k=typeof u.is=="string"?N.createElement(C,{is:u.is}):N.createElement(C)}}k[rn]=n,k[Tn]=u;e:for(N=n.child;N!==null;){if(N.tag===5||N.tag===6)k.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===n)break e;for(;N.sibling===null;){if(N.return===null||N.return===n)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}n.stateNode=k;e:switch(cn(k,C,u),C){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&sr(n)}}return St(n),n.subtreeFlags&=-33554433,xf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,o),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&sr(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(s(166));if(t=Be.current,_o(n)){if(t=n.stateNode,o=n.memoizedProps,u=null,C=Qt,C!==null)switch(C.tag){case 27:case 5:u=C.memoizedProps}t[rn]=n,t=!!(t.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||J0(t.nodeValue,o)),t||Mr(n,!0)}else t=hl(t).createTextNode(u),t[rn]=n,n.stateNode=t}return St(n),null;case 31:if(o=n.memoizedState,t===null||t.memoizedState!==null){if(u=_o(n),o!==null){if(t===null){if(!u)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;St(n),t=!1}else o=Ad(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),t=!0;if(!t)return n.flags&256?($n(n),n):($n(n),null);if((n.flags&128)!==0)throw Error(s(558))}return St(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=_o(n),u!==null&&u.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=n.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;St(n),C=!1}else C=Ad(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return n.flags&256?($n(n),n):($n(n),null)}return $n(n),(n.flags&128)!==0?(n.lanes=o,n):(o=u!==null,t=t!==null&&t.memoizedState!==null,o&&(u=n.child,C=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(C=u.alternate.memoizedState.cachePool.pool),k=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(k=u.memoizedState.cachePool.pool),k!==C&&(u.flags|=2048)),o!==t&&o&&(n.child.flags|=8192),Qc(n,n.updateQueue),St(n),null);case 4:return Ve(),t===null&&ep(n.stateNode.containerInfo),n.flags|=67108864,St(n),null;case 10:return tr(n.type),St(n),null;case 19:if($d(n),u=n.memoizedState,u===null)return St(n),null;if(C=(n.flags&128)!==0,k=u.rendering,k===null)if(C)el(u,!1);else{if(Lt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(k=Bc(t),k!==null){for(n.flags|=128,el(u,!1),t=k.updateQueue,n.updateQueue=t,Qc(n,t),n.subtreeFlags=0,t=o,o=n.child;o!==null;)T_(o,t),o=o.sibling;return Xa(n,an.current&1|2),Xe&&Ji(n,u.treeForkCount),n.child}t=t.sibling}u.tail!==null&&Vt()>cu&&(n.flags|=128,C=!0,el(u,!1),n.lanes=4194304)}else{if(!C)if(t=Bc(k),t!==null){if(n.flags|=128,C=!0,t=t.updateQueue,n.updateQueue=t,Qc(n,t),el(u,!0),u.tail===null&&u.tailMode!=="collapsed"&&u.tailMode!=="visible"&&!k.alternate&&!Xe)return St(n),null}else 2*Vt()-u.renderingStartTime>cu&&o!==536870912&&(n.flags|=128,C=!0,el(u,!1),n.lanes=4194304);u.isBackwards?(k.sibling=n.child,n.child=k):(t=u.last,t!==null?t.sibling=k:n.child=k,u.last=k)}if(u.tail!==null){t=u.tail;e:{for(o=t;o!==null;){if(o.alternate!==null){o=!1;break e}o=o.sibling}o=!0}return u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Vt(),t.sibling=null,k=an.current,k=C?k&1|2:k&1,u.tailMode==="visible"||u.tailMode==="collapsed"||!o||Xe?Xa(n,k):(o=k,ze(on,n),ze(an,o),mn===null&&(mn=n)),Xe&&Ji(n,u.treeForkCount),t}return St(n),null;case 22:case 23:return $n(n),Fd(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(o&536870912)!==0&&(n.flags&128)===0&&(St(n),n.subtreeFlags&6&&(n.flags|=8192)):St(n),o=n.updateQueue,o!==null&&Qc(n,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==o&&(n.flags|=2048),t!==null&&ke(Rs),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),tr(Bt),St(n),null;case 25:return null;case 30:return n.flags|=33554432,St(n),null}throw Error(s(156,n.tag))}function VE(t,n){switch(Td(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return tr(Bt),Ve(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return st(n),null;case 31:if(n.memoizedState!==null){if($n(n),n.alternate===null)throw Error(s(340));ws()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if($n(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));ws()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return $d(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return Ve(),null;case 10:return tr(n.type),null;case 22:case 23:return $n(n),Fd(),t!==null&&ke(Rs),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return tr(Bt),null;case 25:return null;default:return null}}function t0(t,n){switch(Td(n),n.tag){case 3:tr(Bt),Ve();break;case 26:case 27:case 5:st(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&$n(n);break;case 13:$n(n);break;case 19:$d(n);break;case 10:tr(n.type);break;case 22:case 23:$n(n),Fd(),t!==null&&ke(Rs);break;case 24:tr(Bt)}}function tl(t,n){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var C=u.next;o=C;do{if((o.tag&t)===t){u=void 0;var k=o.create,N=o.inst;u=k(),N.destroy=u}o=o.next}while(o!==C)}}catch(q){ft(n,n.return,q)}}function Fr(t,n,o){try{var u=n.updateQueue,C=u!==null?u.lastEffect:null;if(C!==null){var k=C.next;u=k;do{if((u.tag&t)===t){var N=u.inst,q=N.destroy;if(q!==void 0){N.destroy=void 0,C=n;var J=o,se=q;try{se()}catch(de){ft(C,J,de)}}}u=u.next}while(u!==k)}}catch(de){ft(n,n.return,de)}}function n0(t){var n=t.updateQueue;if(n!==null){var o=t.stateNode;try{V_(n,o)}catch(u){ft(t,t.return,u)}}}function i0(t,n,o){o.props=js(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(u){ft(t,n,u)}}function Ri(t,n){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:var C=t.stateNode,k=Ki(t.memoizedProps,C);(C.ref===null||C.ref.name!==k)&&(C.ref=ux(k)),u=C.ref;break;case 7:if(t.stateNode===null){var N=new Yn(t);c(t.child,!1,Nk,N,void 0,void 0),t.stateNode=N}u=t.stateNode;break;default:u=t.stateNode}typeof o=="function"?t.refCleanup=o(u):o.current=u}}catch(q){ft(t,n,q)}}function ln(t,n){var o=t.ref,u=t.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(C){ft(t,n,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(C){ft(t,n,C)}else o.current=null}function Zc(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var o=0;o<n.length;o++)gx(t.stateNode,n[o])}function r0(t){for(var n=t.return;n!==null&&(bf(n)&&gx(t.stateNode,n.stateNode),!yf(n));)n=n.return}function nl(t){for(var n=t.return;n!==null&&(bf(n)&&Bk(t.stateNode,n.stateNode),!yf(n));)n=n.return}function yf(t){return t.tag===5||t.tag===3||t.tag===27}function bf(t){return t&&t.tag===7&&t.stateNode!==null}function Sf(t){var n=t.type,o=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(C){ft(t,t.return,C)}}function wf(t,n,o){try{var u=t.stateNode;vk(u,t.type,o,n),u[Tn]=n}catch(C){ft(t,t.return,C)}}function s0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yr(t.type)||t.tag===4}function Cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||s0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ef(t,n,o,u){var C=t.tag;if(C===5||C===6)C=t.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(C,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(C),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Ei)),Zc(t,u),ot=!0;else if(C!==4&&(C===27&&(Zc(t,u),u=null,Yr(t.type)&&(o=t.stateNode,n=null)),t=t.child,t!==null))for(Ef(t,n,o,u),t=t.sibling;t!==null;)Ef(t,n,o,u),t=t.sibling}function Jc(t,n,o,u){var C=t.tag;if(C===5||C===6)C=t.stateNode,n?o.insertBefore(C,n):o.appendChild(C),Zc(t,u),ot=!0;else if(C!==4&&(C===27&&(Zc(t,u),u=null,Yr(t.type)&&(o=t.stateNode)),t=t.child,t!==null))for(Jc(t,n,o,u),t=t.sibling;t!==null;)Jc(t,n,o,u),t=t.sibling}function o0(t){var n=t.stateNode,o=t.memoizedProps;try{for(var u=t.type,C=n.attributes;C.length;)n.removeAttributeNode(C[0]);cn(n,u,o),n[rn]=t,n[Tn]=o}catch(k){ft(t,t.return,k)}}var eu=!1,qn=null;function a0(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(eu=!0)}var Ai=null;function l0(){var t=Ai;return Ai=null,t}var An=0;function ko(t,n,o,u,C){return An=0,c0(t.child,n,o,u,C)}function c0(t,n,o,u,C){for(var k=!1;t!==null;){if(t.tag===5){var N=t.stateNode;if(u!==null){var q=lp(N);u.push(q),q.view&&(k=!0)}else k||lp(N).view&&(k=!0);eu=!0,lx(N,An===0?n:n+"_"+An,o),An++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&C||c0(t.child,n,o,u,C)&&(k=!0));t=t.sibling}return k}function Li(t,n){for(;t!==null;)t.tag===5?cx(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Li(t.child,n)),t=t.sibling}function tu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(tu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(s(544));var o=n.name;n=Qi(n.default,n.share),n!=="none"&&(ko(t,o,n,null,!1)||Li(t.child,!1))}t=t.sibling}}function kf(t,n){if(t.tag===30){var o=t.stateNode,u=t.memoizedProps,C=Ki(u,o),k=Qi(u.default,o.paired?u.share:u.enter);k!=="none"?ko(t,C,k,null,!1)?(tu(t),o.paired||n||Oo(t,u.onEnter)):Li(t.child,!1):tu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)kf(t,n),t=t.sibling;else tu(t)}function Tf(t){if(qn!==null&&qn.size!==0){var n=qn;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var o=t.memoizedProps,u=o.name;if(u!=null&&u!=="auto"){var C=n.get(u);if(C!==void 0){var k=Qi(o.default,o.share);if(k!=="none"&&(ko(t,u,k,null,!1)?(k=t.stateNode,C.paired=k,k.paired=C,Oo(t,o.onShare)):Li(t.child,!1)),n.delete(u),n.size===0)break}}}Tf(t)}t=t.sibling}}}function Rf(t){if(t.tag===30){var n=t.memoizedProps,o=Ki(n,t.stateNode),u=qn!==null?qn.get(o):void 0,C=Qi(n.default,u!==void 0?n.share:n.exit);C!=="none"&&(ko(t,o,C,null,!1)?u!==void 0?(C=t.stateNode,u.paired=C,C.paired=u,qn.delete(o),Oo(t,n.onShare)):Oo(t,n.onExit):Li(t.child,!1)),qn!==null&&Tf(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Rf(t),t=t.sibling;else qn!==null&&Tf(t)}function u0(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,o=Ki(n,t.stateNode);n=Qi(n.default,n.update),t.flags&=-5,n!=="none"&&ko(t,o,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&u0(t);t=t.sibling}}function Af(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,Li(t.child,!1))}Af(t)}t=t.sibling}}function nu(t){if(t.tag===30)t.stateNode.paired=null,Li(t.child,!1),Af(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)nu(t),t=t.sibling;else Af(t)}function h0(t){for(t=t.child;t!==null;)t.tag===30?Li(t.child,!1):(t.subtreeFlags&33554432)!==0&&h0(t),t=t.sibling}function Lf(t,n,o,u,C,k,N){for(var q=!1;n!==null;){if(n.tag===5){var J=n.stateNode;if(k!==null&&An<k.length){var se=k[An],de=lp(J);(se.view||de.view)&&(q=!0);var me;if(me=(t.flags&4)===0)if(de.clip)me=!0;else{me=se.rect;var ie=de.rect;me=me.y!==ie.y||me.x!==ie.x||me.height!==ie.height||me.width!==ie.width}me&&(t.flags|=4),de.abs?de=!se.abs:(se=se.rect,de=de.rect,de=se.height!==de.height||se.width!==de.width),de&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&lx(J,An===0?o:o+"_"+An,C),q&&(t.flags&4)!==0||(Ai===null&&(Ai=[]),Ai.push(J,An===0?u:u+"_"+An,n.memoizedProps)),An++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&N?t.flags|=n.flags&32:Lf(t,n.child,o,u,C,k,N)&&(q=!0));n=n.sibling}return q}function d0(t,n){for(t=t.child;t!==null;){if(t.tag===30){var o=t.memoizedProps,u=t.stateNode,C=Ki(o,u),k=Qi(o.default,o.update),N;N=t.memoizedState,t.memoizedState=null,u=t;var q=t.child;An=0,C=Lf(u,q,C,C,k,N,!1),(t.flags&4)!==0&&C&&Oo(t,o.onUpdate)}else(t.subtreeFlags&33554432)!==0&&d0(t);t=t.sibling}}var Zt=!1,ct=!1,Di=!1,Df=!1,f0=typeof WeakSet=="function"?WeakSet:Set,Jt=null,Mi=!1,il=!1,iu=!1,Mf=!1;function WE(t,n,o){if(t=t.containerInfo,ip=qo,t=v_(t),vd(t)){if("selectionStart"in t)var u={start:t.selectionStart,end:t.selectionEnd};else e:{u=(u=t.ownerDocument)&&u.defaultView||window;var C=u.getSelection&&u.getSelection();if(C&&C.rangeCount!==0){u=C.anchorNode;var k=C.anchorOffset,N=C.focusNode;C=C.focusOffset;try{u.nodeType,N.nodeType}catch{u=null;break e}var q=0,J=-1,se=-1,de=0,me=0,ie=t,ce=null;t:for(;;){for(var Ce;ie!==u||k!==0&&ie.nodeType!==3||(J=q+k),ie!==N||C!==0&&ie.nodeType!==3||(se=q+C),ie.nodeType===3&&(q+=ie.nodeValue.length),(Ce=ie.firstChild)!==null;)ce=ie,ie=Ce;for(;;){if(ie===t)break t;if(ce===u&&++de===k&&(J=q),ce===N&&++me===C&&(se=q),(Ce=ie.nextSibling)!==null)break;ie=ce,ce=ie.parentNode}ie=Ce}u=J===-1||se===-1?null:{start:J,end:se}}else u=null}u=u||{start:0,end:0}}else u=null;for(rp={focusedElem:t,selectionRange:u},qo=!1,o=(o&335544064)===o,Jt=n,n=o?9270:1024;Jt!==null;){if(t=Jt,o&&(u=t.deletions,u!==null))for(k=0;k<u.length;k++)o&&Rf(u[k]);if(t.alternate===null&&(t.flags&2)!==0)o&&a0(t),ru(o);else{if(t.tag===22){if(u=t.alternate,t.memoizedState!==null){u!==null&&u.memoizedState===null&&o&&Rf(u),ru(o);continue}else if(u!==null&&u.memoizedState!==null){o&&a0(t),ru(o);continue}}u=t.child,(t.subtreeFlags&n)!==0&&u!==null?(u.return=t,Jt=u):(o&&u0(t),ru(o))}}qn=null}function ru(t){for(;Jt!==null;){var n=Jt,o=t,u=n.alternate,C=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((C&1024)!==0&&u!==null){o=void 0,C=u.memoizedProps,u=u.memoizedState;var k=n.stateNode;try{var N=js(n.type,C);o=k.getSnapshotBeforeUpdate(N,u),k.__reactInternalSnapshotBeforeUpdate=o}catch(q){ft(n,n.return,q)}}break;case 3:if((C&1024)!==0){if(u=n.stateNode.containerInfo,o=u.nodeType,o===9)hp(u);else if(o===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":hp(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:o&&u!==null&&(o=Ki(u.memoizedProps,u.stateNode),C=n.memoizedProps,C=Qi(C.default,C.update),C!=="none"&&ko(u,o,C,u.memoizedState=[],!0));break;default:if((C&1024)!==0)throw Error(s(163))}if(u=n.sibling,u!==null){u.return=n.return,Jt=u;break}Jt=n.return}}function p0(t,n,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:ji(t,o),u&4&&tl(5,o);break;case 1:if(ji(t,o),u&4)if(t=o.stateNode,n===null)try{t.componentDidMount()}catch(N){ft(o,o.return,N)}else{var C=js(o.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(C,n,t.__reactInternalSnapshotBeforeUpdate)}catch(N){ft(o,o.return,N)}}u&64&&n0(o),u&512&&Ri(o,o.return);break;case 3:if(ji(t,o),u&64&&(t=o.updateQueue,t!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{V_(t,n)}catch(N){ft(o,o.return,N)}}break;case 27:n===null&&u&4&&o0(o);case 26:case 5:ji(t,o),n===null&&u&4&&Sf(o),u&512&&Ri(o,o.return);break;case 12:ji(t,o);break;case 31:ji(t,o),u&4&&_0(t,o);break;case 13:ji(t,o),u&4&&x0(t,o),u&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=rk.bind(null,o),zk(t,o))));break;case 22:if(u=o.memoizedState!==null||Zt,!u){var k=n!==null&&n.memoizedState!==null||ct;n=Zt,C=ct,Zt=u,(ct=k)&&!C?(u=2,(o.subtreeFlags&8772)!==0&&(u|=1),_i(t,o,u)):ji(t,o),Zt=n,ct=C}break;case 30:ji(t,o),u&512&&Ri(o,o.return);break;case 7:u&512&&Ri(o,o.return);default:ji(t,o)}}function jf(t,n){for(t=t.child;t!==null;)m0(t,n),t=t.sibling}function m0(t,n){switch(t.tag){case 5:case 26:try{var o=t.stateNode;if(n){var u=o.style;typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"}else{var C=t.stateNode,k=t.memoizedProps.style,N=k!=null&&k.hasOwnProperty("display")?k.display:null;C.style.display=N==null||typeof N=="boolean"?"":(""+N).trim()}}catch(J){ft(t,t.return,J)}Of(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,ot=!0}catch(J){ft(t,t.return,J)}break;case 18:try{var q=t.stateNode;n?ax(q,!0):ax(t.stateNode,!1)}catch(J){ft(t,t.return,J)}break;case 22:case 23:t.memoizedState===null&&jf(t,n);break;default:jf(t,n)}}function Of(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var o=t,u=n;switch(o.tag){case 4:m0(o,u);break e;case 22:o.memoizedState===null&&Of(o,u);break e;default:Of(o,u)}}t=t.sibling}}function g0(t){var n=t.alternate;n!==null&&(t.alternate=null,g0(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&cc(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Et=null,Ln=!1;function gi(t,n,o){for(o=o.child;o!==null;)v0(t,n,o),o=o.sibling}function v0(t,n,o){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(ka,o)}catch{}switch(o.tag){case 26:ct||ln(o,n),gi(t,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!ct&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ct||ln(o,n),nl(o);var u=Et,C=Ln;Yr(o.type)&&(Et=o.stateNode,Ln=!1),gi(t,n,o),bx(o.stateNode,o.type,o.memoizedProps),Et=u,Ln=C;break;case 5:ct||ln(o,n),nl(o);case 6:if(o.tag===6&&nl(o),u=Et,C=Ln,Et=null,gi(t,n,o),Et=u,Ln=C,Et!==null)if(Ln)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(o.stateNode),ot=!0}catch(k){ft(o,n,k)}else try{Et.removeChild(o.stateNode),ot=!0}catch(k){ft(o,n,k)}break;case 18:Et!==null&&(Ln?(t=Et,ox(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),Vo(t)):ox(Et,o.stateNode));break;case 4:u=Et,C=Ln,Et=o.stateNode.containerInfo,Ln=!0,gi(t,n,o),Et=u,Ln=C;break;case 0:case 11:case 14:case 15:Fr(2,o,n),ct||Fr(4,o,n),gi(t,n,o);break;case 1:ct||(ln(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"&&i0(o,n,u)),gi(t,n,o);break;case 21:gi(t,n,o);break;case 22:ct=(u=ct)||o.memoizedState!==null,gi(t,n,o),ct=u;break;case 30:ln(o,n),gi(t,n,o);break;case 7:ct||ln(o,n),gi(t,n,o);break;default:gi(t,n,o)}}function _0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vo(t)}catch(o){ft(n,n.return,o)}}}function x0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vo(t)}catch(o){ft(n,n.return,o)}}function GE(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new f0),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new f0),n;default:throw Error(s(435,t.tag))}}function su(t,n){var o=GE(t);n.forEach(function(u){if(!o.has(u)){o.add(u);var C=sk.bind(null,t,u);u.then(C,C)}})}function bn(t,n,o){var u=n.deletions;if(u!==null)for(var C=0;C<u.length;C++){var k=u[C],N=t,q=n,J=q;e:for(;J!==null;){switch(J.tag){case 27:if(Yr(J.type)){Et=J.stateNode,Ln=!1;break e}break;case 5:Et=J.stateNode,Ln=!1;break e;case 3:case 4:Et=J.stateNode.containerInfo,Ln=!0;break e}J=J.return}if(Et===null)throw Error(s(160));v0(N,q,k),Et=null,Ln=!1,N=k.alternate,N!==null&&(N.return=null),k.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)y0(n,t,o),n=n.sibling}var vi=null;function y0(t,n,o){var u=t.alternate,C=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(C&4&&(u=t.updateQueue,u=u!==null?u.events:null,u!==null))for(var k=0;k<u.length;k++){var N=u[k];N.ref.impl=N.nextImpl}bn(n,t,o),Sn(t),C&4&&(Fr(3,t,t.return),tl(3,t),Fr(5,t,t.return));break;case 1:bn(n,t,o),Sn(t),C&512&&(ct||u===null||ln(u,u.return)),C&64&&Zt&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?n:o.concat(n))));break;case 26:if(k=vi,bn(n,t,o),Sn(t),C&512&&(ct||u===null||ln(u,u.return)),C&4)if(C=u!==null?u.memoizedState:null,o=t.memoizedState,u===null)if(o===null)if(t.stateNode===null)if(Zt)t.stateNode=ix(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,o=t.memoizedProps,C=k.ownerDocument||k;t:switch(n){case"title":u=C.getElementsByTagName("title")[0],(!u||u[Aa]||u[rn]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=C.createElement(n),C.head.insertBefore(u,C.querySelector("head > title"))),cn(u,n,o),u[rn]=t,Kt(u),n=u;break e;case"link":if(k=Tx("link","href",C).get(n+(o.href||""))){for(N=0;N<k.length;N++)if(u=k[N],u.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&u.getAttribute("rel")===(o.rel==null?null:o.rel)&&u.getAttribute("title")===(o.title==null?null:o.title)&&u.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(N,1);break t}}u=C.createElement(n),cn(u,n,o),C.head.appendChild(u);break;case"meta":if(k=Tx("meta","content",C).get(n+(o.content||""))){for(N=0;N<k.length;N++)if(u=k[N],u.getAttribute("content")===(o.content==null?null:""+o.content)&&u.getAttribute("name")===(o.name==null?null:o.name)&&u.getAttribute("property")===(o.property==null?null:o.property)&&u.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&u.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(N,1);break t}}u=C.createElement(n),cn(u,n,o),C.head.appendChild(u);break;default:throw Error(s(468,n))}u[rn]=t,Kt(u),n=u}t.stateNode=n}else Zt||_p(k,t.type,t.stateNode);else t.stateNode=kx(k,o,t.memoizedProps);else C!==o?(C===null?(n=u.stateNode,n===null||ct||n.parentNode.removeChild(n)):C.count--,o===null?Zt||_p(k,t.type,t.stateNode):kx(k,o,t.memoizedProps)):o===null&&t.stateNode!==null&&wf(t,t.memoizedProps,u.memoizedProps);break;case 27:bn(n,t,o),Sn(t),C&512&&(ct||u===null||ln(u,u.return)),u!==null&&C&4&&wf(t,t.memoizedProps,u.memoizedProps);break;case 5:if(k=Di,Di=!1,bn(n,t,o),Di=k,Sn(t),C&512&&(ct||u===null||ln(u,u.return)),t.flags&32){n=t.stateNode;try{ao(n,""),ot=!0}catch(de){ft(t,t.return,de)}}C&4&&t.stateNode!=null&&(n=t.memoizedProps,wf(t,n,u!==null?u.memoizedProps:n)),C&1024&&(Df=!0);break;case 6:if(bn(n,t,o),Sn(t),C&4){if(t.stateNode===null)throw Error(s(162));n=t.memoizedProps,o=t.stateNode;try{o.nodeValue=n,ot=!0}catch(de){ft(t,t.return,de)}}break;case 3:if(ot=!1,yu=null,k=vi,vi=dl(n.containerInfo),bn(n,t,o),vi=k,Sn(t),C&4&&u!==null&&u.memoizedState.isDehydrated)try{Vo(n.containerInfo)}catch(de){ft(t,t.return,de)}Df&&(Df=!1,b0(t)),ot=!1;break;case 4:C=Di,Di=Zt,u=Fv(),k=vi,vi=dl(t.stateNode.containerInfo),bn(n,t,o),Sn(t),vi=k,ot&&il&&(iu=!0),ot=u,Di=C;break;case 12:bn(n,t,o),Sn(t);break;case 31:bn(n,t,o),Sn(t),C&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,su(t,n)));break;case 13:bn(n,t,o),Sn(t),t.child.flags&8192&&t.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(lu=Vt()),C&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,su(t,n)));break;case 22:k=t.memoizedState!==null,N=u!==null&&u.memoizedState!==null;var q=Zt,J=ct,se=Di;Zt=q||k,Di=se||k,ct=J||N,bn(n,t,o),ct=J,Di=se,Zt=q,Sn(t),C&8192&&(n=t.stateNode,n._visibility=k?n._visibility&-2:n._visibility|1,!k||u===null||N||Zt||ct||(n=N||ct,o=Zt,u=ct,Zt=k||Zt,ct=n,Ur(t,2),Zt=o,ct=u),!k&&Di||jf(t,k)),C&4&&(n=t.updateQueue,n!==null&&(o=n.retryQueue,o!==null&&(n.retryQueue=null,su(t,o))));break;case 19:bn(n,t,o),Sn(t),C&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,su(t,n)));break;case 30:C&512&&(ct||u===null||ln(u,u.return)),C=Fv(),k=il,N=(o&335544064)===o,q=t.memoizedProps,il=N&&Qi(q.default,q.update)!=="none",bn(n,t,o),Sn(t),N&&u!==null&&ot&&(t.flags|=4),il=k,ot=C;break;case 21:break;case 7:C&512&&(ct||u===null||ln(u,u.return)),u&&u.stateNode!==null&&(u.stateNode._fragmentFiber=t);default:bn(n,t,o),Sn(t)}}function Sn(t){var n=t.flags;if(n&2){try{for(var o,u=t.return;u!==null;){if(s0(u)){o=u;break}u=u.return}u=null;for(var C=t.return;C!==null;){if(bf(C)){var k=C.stateNode;u===null?u=[k]:u.push(k)}if(yf(C))break;C=C.return}var N=u;if(o==null)throw Error(s(160));switch(o.tag){case 27:var q=o.stateNode,J=Cf(t);Jc(t,J,q,N);break;case 5:var se=o.stateNode;o.flags&32&&(ao(se,""),o.flags&=-33);var de=Cf(t);Jc(t,de,se,N);break;case 3:case 4:var me=o.stateNode.containerInfo,ie=Cf(t);Ef(t,ie,me,N);break;default:throw Error(s(161))}}catch(ce){ft(t,t.return,ce)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function b0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;b0(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,qo=!0,n.reset(),qo=!1),t=t.sibling}}function To(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)S0(n,t),n=n.sibling;else d0(n)}function S0(t,n){var o=t.alternate;if(o===null)kf(t,!1);else switch(t.tag){case 3:if(Mf=Mi=!1,l0(),To(n,t),!Mi&&!iu){if(t=Ai,t!==null)for(var u=0;u<t.length;u+=3){o=t[u];var C=t[u+1];cx(o,t[u+2]),o=o.ownerDocument.documentElement,o!==null&&o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+C+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Mf=!0}Ai=null;break;case 5:To(n,t);break;case 4:u=Mi,Mi=!1,To(n,t),Mi&&(iu=!0),Mi=u;break;case 22:t.memoizedState===null&&(o.memoizedState!==null?kf(t,!1):To(n,t));break;case 30:u=Mi,C=l0(),Mi=!1,To(n,t),Mi&&(t.flags|=4);var k=t.memoizedProps,N=t.stateNode;n=Ki(k,N),N=Ki(o.memoizedProps,N);var q=Qi(k.default,k.update);q==="none"?n=!1:(k=o.memoizedState,o.memoizedState=null,o=t.child,An=0,n=Lf(t,o,n,N,q,k,!0),An!==(k===null?0:k.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(Oo(t,t.memoizedProps.onUpdate),Ai=C):C!==null&&(C.push.apply(C,Ai),Ai=C),Mi=(t.flags&32)!==0?!0:u;break;default:To(n,t)}}function ji(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)p0(t,n.alternate,n),n=n.sibling}function Ur(t,n){for(t=t.child;t!==null;){var o=t,u=n;switch(o.tag){case 0:case 11:case 14:case 15:Fr(4,o,o.return),Ur(o,u);break;case 1:ln(o,o.return);var C=o.stateNode;typeof C.componentWillUnmount=="function"&&i0(o,o.return,C),Ur(o,u);break;case 27:(u&2)!==0&&bx(o.stateNode,o.type,o.memoizedProps);case 5:ln(o,o.return),o.tag!==5&&o.tag!==27||nl(o),Ur(o,u);break;case 6:nl(o);break;case 26:ln(o,o.return),C=o.stateNode,o.memoizedState!==null||C===null||ct||C.parentNode.removeChild(C),Ur(o,u);break;case 22:o.memoizedState===null&&Ur(o,u);break;case 30:ln(o,o.return),Ur(o,u);break;case 7:ln(o,o.return);default:Ur(o,u)}t=t.sibling}}function _i(t,n,o){for(o=(n.subtreeFlags&8772)!==0?o:o&-2,n=n.child;n!==null;){var u=n.alternate,C=t,k=n,N=k.flags,q=(o&1)!==0;switch(k.tag){case 0:case 11:case 15:_i(C,k,o),tl(4,k);break;case 1:if(_i(C,k,o),u=k,C=u.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(de){ft(u,u.return,de)}if(u=k,C=u.updateQueue,C!==null){var J=u.stateNode;try{var se=C.shared.hiddenCallbacks;if(se!==null)for(C.shared.hiddenCallbacks=null,C=0;C<se.length;C++)q_(se[C],J)}catch(de){ft(u,u.return,de)}}q&&N&64&&n0(k),Ri(k,k.return);break;case 27:(o&2)!==0&&o0(k);case 5:k.tag!==5&&k.tag!==27||r0(k),_i(C,k,o),q&&u===null&&N&4&&Sf(k),Ri(k,k.return);break;case 6:r0(k);break;case 26:J=k.stateNode,k.memoizedState!==null||J===null||Zt||_p(dl(J.ownerDocument),k.type,J),_i(C,k,o),q&&u===null&&N&4&&Sf(k),Ri(k,k.return);break;case 12:_i(C,k,o);break;case 31:_i(C,k,o),q&&N&4&&_0(C,k);break;case 13:_i(C,k,o),q&&N&4&&x0(C,k);break;case 22:k.memoizedState===null&&_i(C,k,o),Ri(k,k.return);break;case 30:_i(C,k,o),Ri(k,k.return);break;case 7:Ri(k,k.return);default:_i(C,k,o)}n=n.sibling}}function Nf(t,n){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Ua(o))}function Bf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ua(t))}function li(t,n,o,u){var C=(o&335544064)===o;if(n.subtreeFlags&(C?10262:10256))for(n=n.child;n!==null;)w0(t,n,o,u),n=n.sibling;else C&&h0(n)}function w0(t,n,o,u){var C=(o&335544064)===o;C&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&nu(n);var k=n.flags;switch(n.tag){case 0:case 11:case 15:li(t,n,o,u),k&2048&&tl(9,n);break;case 1:li(t,n,o,u);break;case 3:li(t,n,o,u),C&&Mf&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),k&2048&&(k=null,n.alternate!==null&&(k=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==k&&(n.refCount++,k!=null&&Ua(k)));break;case 12:if(k&2048){li(t,n,o,u),k=n.stateNode;try{var N=n.memoizedProps,q=N.id,J=N.onPostCommit;typeof J=="function"&&J(q,n.alternate===null?"mount":"update",k.passiveEffectDuration,-0)}catch(se){ft(n,n.return,se)}}else li(t,n,o,u);break;case 31:li(t,n,o,u);break;case 13:li(t,n,o,u);break;case 23:break;case 22:N=n.stateNode,q=n.alternate,n.memoizedState!==null?(C&&q!==null&&q.memoizedState===null&&nu(q),N._visibility&2?li(t,n,o,u):rl(t,n)):(C&&q!==null&&q.memoizedState!==null&&nu(n),N._visibility&2?li(t,n,o,u):(N._visibility|=2,Ro(t,n,o,u,(n.subtreeFlags&10256)!==0||!1))),k&2048&&Nf(q,n);break;case 24:li(t,n,o,u),k&2048&&Bf(n.alternate,n);break;case 30:C&&(k=n.alternate,k!==null&&(Li(k.child,!0),Li(n.child,!0))),li(t,n,o,u);break;default:li(t,n,o,u)}}function Ro(t,n,o,u,C){for(C=C&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var k=t,N=n,q=o,J=u,se=N.flags;switch(N.tag){case 0:case 11:case 15:Ro(k,N,q,J,C),tl(8,N);break;case 23:break;case 22:var de=N.stateNode;N.memoizedState!==null?de._visibility&2?Ro(k,N,q,J,C):rl(k,N):(de._visibility|=2,Ro(k,N,q,J,C)),C&&se&2048&&Nf(N.alternate,N);break;case 24:Ro(k,N,q,J,C),C&&se&2048&&Bf(N.alternate,N);break;default:Ro(k,N,q,J,C)}n=n.sibling}}function rl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=t,u=n,C=u.flags;switch(u.tag){case 22:rl(o,u),C&2048&&Nf(u.alternate,u);break;case 24:rl(o,u),C&2048&&Bf(u.alternate,u);break;default:rl(o,u)}n=n.sibling}}var Os=8192;function Ns(t,n,o){if(t.subtreeFlags&Os)for(t=t.child;t!==null;)C0(t,n,o),t=t.sibling}function C0(t,n,o){switch(t.tag){case 26:Ns(t,n,o),t.flags&Os&&(t.memoizedState!==null?Jk(o,vi,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&Dx(o,t)));break;case 5:Ns(t,n,o),t.flags&Os&&(t=t.stateNode,(n&335544128)===n&&Dx(o,t));break;case 3:case 4:var u=vi;vi=dl(t.stateNode.containerInfo),Ns(t,n,o),vi=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Os,Os=16777216,Ns(t,n,o),Os=u):Ns(t,n,o));break;case 30:if((t.flags&Os)!==0&&(u=t.memoizedProps.name,u!=null&&u!=="auto")){var C=t.stateNode;C.paired=null,qn===null&&(qn=new Map),qn.set(u,C)}Ns(t,n,o);break;default:Ns(t,n,o)}}function E0(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function sl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];Jt=u,T0(u,t)}E0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)k0(t),t=t.sibling}function k0(t){switch(t.tag){case 0:case 11:case 15:sl(t),t.flags&2048&&Fr(9,t,t.return);break;case 3:sl(t);break;case 12:sl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,ou(t)):sl(t);break;default:sl(t)}}function ou(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];Jt=u,T0(u,t)}E0(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Fr(8,n,n.return),ou(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,ou(n));break;default:ou(n)}t=t.sibling}}function T0(t,n){for(;Jt!==null;){var o=Jt;switch(o.tag){case 0:case 11:case 15:Fr(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Ua(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Jt=u;else e:for(o=t;Jt!==null;){u=Jt;var C=u.sibling,k=u.return;if(g0(u),u===o){Jt=null;break e}if(C!==null){C.return=k,Jt=C;break e}Jt=k}}}var YE={getCacheForType:function(t){var n=sn(Bt),o=n.data.get(t);return o===void 0&&(o=t(),n.data.set(t,o)),o},cacheSignal:function(){return sn(Bt).controller.signal}},XE=typeof WeakMap=="function"?WeakMap:Map,lt=0,_t=null,Qe=null,Je=0,dt=0,Vn=null,$r=!1,Ao=!1,Pf=!1,or=0,Lt=0,qr=0,Bs=0,au=0,Wn=0,Lo=0,ol=null,Dn=null,If=!1,lu=0,R0=0,cu=1/0,uu=null,Vr=null,Rt=0,xi=null,Ps=null,Oi=0,zf=0,Hf=null,A0=null,Do=null,Mo=null,jo=null,al=0,hu=null;function Gn(){return(lt&2)!==0&&Je!==0?Je&-Je:ue.T!==null?Kf():Mv()}function L0(){if(Wn===0)if((Je&536870912)===0||Xe){var t=sc;sc<<=1,(sc&3932160)===0&&(sc=262144),Wn=t}else Wn=536870912;return t=on.current,t!==null&&(t.flags|=32),Wn}function Oo(t,n){if(n!=null){var o=t.stateNode,u=o.ref;u===null&&(u=o.ref=ux(Ki(t.memoizedProps,o))),Mo===null&&(Mo=[]),Mo.push(n.bind(null,u))}}function Mn(t,n,o){(t===_t&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(No(t,0),Wr(t,Je,Wn,!1)),Ra(t,o),((lt&2)===0||t!==_t)&&(t===_t&&((lt&2)===0&&(Bs|=o),Lt===4&&Wr(t,Je,Wn,!1)),Ni(t))}function D0(t,n,o){if((lt&6)!==0)throw Error(s(327));var u=!o&&(n&127)===0&&(n&t.expiredLanes)===0||Ta(t,n),C=u?ZE(t,n):Uf(t,n,!0),k=u;do{if(C===0){Ao&&!u&&Wr(t,n,0,!1);break}else{if(o=t.current.alternate,k&&!KE(o)){C=Uf(t,n,!1),k=!1;continue}if(C===2){if(k=n,t.errorRecoveryDisabledLanes&k)var N=0;else N=t.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){n=N;e:{var q=t;C=ol;var J=q.current.memoizedState.isDehydrated;if(J&&(No(q,N).flags|=256),N=Uf(q,N,!1),N!==2&&N!==6){if(Pf&&!J){q.errorRecoveryDisabledLanes|=k,Bs|=k,C=4;break e}k=Dn,Dn=C,k!==null&&(Dn===null?Dn=k:Dn.push.apply(Dn,k))}C=N}if(k=!1,C!==2)continue}}if(C===1){No(t,0),Wr(t,n,0,!0);break}e:{switch(u=t,k=C,k){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:Wr(u,n,Wn,!$r);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(C=lu+300-Vt(),10<C)){if(Wr(u,n,Wn,!$r),ac(u,0,!0)!==0)break e;Oi=n,u.timeoutHandle=ap(M0.bind(null,u,o,Dn,uu,If,n,Wn,Bs,Lo,$r,k,"Throttled",-0,0),C);break e}M0(u,o,Dn,uu,If,n,Wn,Bs,Lo,$r,k,null,-0,0)}}break}while(!0);Ni(t)}function M0(t,n,o,u,C,k,N,q,J,se,de,me,ie,ce){t.timeoutHandle=-1;var Ce=n.subtreeFlags,je=(k&335544064)===k;if(me=null,(je||Ce&8192||(Ce&16785408)===16785408)&&(me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ei},qn=null,C0(n,k,me),je&&(Ce=me,je=t.containerInfo,je=(je.nodeType===9?je:je.ownerDocument).__reactViewTransition,je!=null&&(Ce.count++,Ce.waitingForViewTransition=!0,Ce=ml.bind(Ce),je.finished.then(Ce,Ce))),Ce=(k&62914560)===k?lu-Vt():(k&4194048)===k?R0-Vt():0,Ce=e3(me,Ce),Ce!==null)){Oi=k,t.cancelPendingCommit=Ce(H0.bind(null,t,n,k,o,u,C,N,q,J,se,de,me,null,ie,ce)),Wr(t,k,N,!se);return}H0(t,n,k,o,u,C,N,q,J,se,de,me)}function KE(t){for(var n=t;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var C=o[u],k=C.getSnapshot;C=C.value;try{if(!Un(k(),C))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Wr(t,n,o,u){n=Tv(t,n),n&=~au,n&=~Bs,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var C=n;0<C;){var k=31-Hn(C),N=1<<k;u[k]=-1,C&=~N}o!==0&&Av(t,o,n)}function du(){return(lt&6)===0?(ll(0),!1):!0}function Ff(){if(Qe!==null){if(dt===0)var t=Qe.return;else t=Qe,er=Cs=null,Yd(t),bo=null,Va=0,t=Qe;for(;t!==null;)t0(t.alternate,t),t=t.return;Qe=null}}function No(t,n){var o=t.timeoutHandle;return o!==-1&&(t.timeoutHandle=-1,yk(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),Oi=0,Ff(),_t=t,Qe=o=Zi(t.current,null),Je=n,dt=0,Vn=null,$r=!1,Ao=Ta(t,n),Pf=!1,Lo=Wn=au=Bs=qr=Lt=0,Dn=ol=null,If=!1,or=Tv(t,n),yc(),o}function j0(t,n){We=null,ue.H=Vc,n===yo||n===Dc?(n=H_(),dt=3):n===Nd?(n=H_(),dt=4):dt=n===uf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Vn=n,Qe===null&&(Lt=1,Wc(t,ri(n,t.current)))}function O0(){var t=on.current;return t===null?!0:(Je&4194048)===Je?mn===null:(Je&62914560)===Je||(Je&536870912)!==0?t===mn:!1}function N0(){var t=ue.H;return ue.H=Vc,t===null?Vc:t}function B0(){var t=ue.A;return ue.A=YE,t}function fu(){Lt=4,$r||(Je&4194048)!==Je&&on.current!==null||(Ao=!0),(qr&134217727)===0&&(Bs&134217727)===0||_t===null||Wr(_t,Je,Wn,!1)}function Uf(t,n,o){var u=lt;lt|=2;var C=N0(),k=B0();(_t!==t||Je!==n)&&(uu=null,No(t,n)),n=!1;var N=Lt;e:do try{if(dt!==0&&Qe!==null){var q=Qe,J=Vn;switch(dt){case 8:Ff(),N=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(n=!0);var se=dt;if(dt=0,Vn=null,Bo(t,q,J,se),o&&Ao){N=0;break e}break;default:se=dt,dt=0,Vn=null,Bo(t,q,J,se)}}QE(),N=Lt;break}catch(de){j0(t,de)}while(!0);return n&&t.shellSuspendCounter++,er=Cs=null,lt=u,ue.H=C,ue.A=k,Qe===null&&(_t=null,Je=0,yc()),N}function QE(){for(;Qe!==null;)P0(Qe)}function ZE(t,n){var o=lt;lt|=2;var u=N0(),C=B0();_t!==t||Je!==n?(uu=null,cu=Vt()+500,No(t,n)):Ao=Ta(t,n);e:do try{if(dt!==0&&Qe!==null){n=Qe;var k=Vn;t:switch(dt){case 1:dt=0,Vn=null,Bo(t,n,k,1);break;case 2:case 9:if(I_(k)){dt=0,Vn=null,I0(n);break}n=function(){dt!==2&&dt!==9||_t!==t||(dt=7),Ni(t)},k.then(n,n);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:I_(k)?(dt=0,Vn=null,I0(n)):(dt=0,Vn=null,Bo(t,n,k,7));break;case 5:var N=null;switch(Qe.tag){case 26:N=Qe.memoizedState;case 5:case 27:var q=Qe;if(N?Ax(N):q.stateNode.complete){dt=0,Vn=null;var J=q.sibling;if(J!==null)Qe=J;else{var se=q.return;se!==null?(Qe=se,pu(se)):Qe=null}break t}}dt=0,Vn=null,Bo(t,n,k,5);break;case 6:dt=0,Vn=null,Bo(t,n,k,6);break;case 8:Ff(),Lt=6;break e;default:throw Error(s(462))}}JE();break}catch(de){j0(t,de)}while(!0);return er=Cs=null,ue.H=u,ue.A=C,lt=o,Qe!==null?0:(_t=null,Je=0,yc(),Lt)}function JE(){for(;Qe!==null&&!ei();)P0(Qe)}function P0(t){var n=J1(t.alternate,t,or);t.memoizedProps=t.pendingProps,n===null?pu(t):Qe=n}function I0(t){var n=t,o=n.alternate;switch(n.tag){case 15:case 0:n=W1(o,n,n.pendingProps,n.type,void 0,Je);break;case 11:n=W1(o,n,n.pendingProps,n.type.render,n.ref,Je);break;case 5:Yd(n);var u=n;u===Qt&&(Xe?(kc(u),u.tag===5&&u.stateNode!=null&&(bt=u.stateNode)):(kc(u),Xe=!0));default:t0(o,n),n=Qe=T_(n,or),n=J1(o,n,or)}t.memoizedProps=t.pendingProps,n===null?pu(t):Qe=n}function Bo(t,n,o,u){er=Cs=null,Yd(n),bo=null,Va=0;var C=n.return;try{if(HE(t,C,n,o,Je)){Lt=1,Wc(t,ri(o,t.current)),Qe=null;return}}catch(k){if(C!==null)throw Qe=C,k;Lt=1,Wc(t,ri(o,t.current)),Qe=null;return}n.flags&32768?(Xe||u===1?t=!0:Ao||(Je&536870912)!==0?t=!1:($r=t=!0,(u===2||u===9||u===3||u===6)&&(u=on.current,u!==null&&u.tag===13&&(u.flags|=16384))),z0(n,t)):pu(n)}function pu(t){var n=t;do{if((n.flags&32768)!==0){z0(n,$r);return}t=n.return;var o=qE(n.alternate,n,or);if(o!==null){Qe=o;return}if(n=n.sibling,n!==null){Qe=n;return}Qe=n=t}while(n!==null);Lt===0&&(Lt=5)}function z0(t,n){do{var o=VE(t.alternate,t);if(o!==null){o.flags&=32767,Qe=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=o}while(t!==null);Lt=6,Qe=null}function H0(t,n,o,u,C,k,N,q,J,se,de,me){t.cancelPendingCommit=null;do mu();while(Rt!==0);if((lt&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));t===_t&&(Qe=_t=null,Je=0),Ps=n,xi=t,Oi=o,Hf=C,A0=u,ek(t,n,o,N,q,J,me)}}function ek(t,n,o,u,C,k,N){var q=n.lanes|n.childLanes;if(zf=q,q|=Sd,k5(t,o,q,u,C,k),Mo=null,(o&335544064)===o?(jo=RE(t),u=10262):(jo=null,u=10256),(n.subtreeFlags&u)!==0||(n.flags&u)!==0?(t.callbackNode=null,t.callbackPriority=0,ok(to,function(){return Wf(),null})):(t.callbackNode=null,t.callbackPriority=0),eu=!1,u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=ue.T,ue.T=null,C=he.p,he.p=2,k=lt,lt|=4;try{WE(t,n,o)}finally{lt=k,he.p=C,ue.T=u}}Rt=1,eu?Do=kk(N,t.containerInfo,jo,$f,qf,nk,Vf,Wf,tk):($f(),qf(),Vf())}function tk(t){if(Rt!==0){var n=xi.onRecoverableError;n(t,{componentStack:null})}}function nk(){Rt===3&&(Rt=0,S0(Ps,xi),Rt=4)}function $f(){if(Rt===1){Rt=0;var t=xi,n=Ps,o=Oi,u=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||u){u=ue.T,ue.T=null;var C=he.p;he.p=2;var k=lt;lt|=4;try{il=iu=!1,y0(n,t,o),o=rp;var N=v_(t.containerInfo),q=o.focusedElem,J=o.selectionRange;if(N!==q&&q&&q.ownerDocument&&g_(q.ownerDocument.documentElement,q)){if(J!==null&&vd(q)){var se=J.start,de=J.end;if(de===void 0&&(de=se),"selectionStart"in q)q.selectionStart=se,q.selectionEnd=Math.min(de,q.value.length);else{var me=q.ownerDocument||document,ie=me&&me.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Ce=q.textContent.length,je=Math.min(J.start,Ce),Ge=J.end===void 0?je:Math.min(J.end,Ce);!ce.extend&&je>Ge&&(N=Ge,Ge=je,je=N);var re=m_(q,je),te=m_(q,Ge);if(re&&te&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==te.node||ce.focusOffset!==te.offset)){var ae=me.createRange();ae.setStart(re.node,re.offset),ce.removeAllRanges(),je>Ge?(ce.addRange(ae),ce.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),ce.addRange(ae))}}}}for(me=[],ce=q;ce=ce.parentNode;)ce.nodeType===1&&me.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<me.length;q++){var pe=me[q];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}qo=!!ip,rp=ip=null}finally{lt=k,he.p=C,ue.T=u}}t.current=n,Rt=2}}function qf(){if(Rt===2){Rt=0;var t=xi,n=Ps,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=ue.T,ue.T=null;var u=he.p;he.p=2;var C=lt;lt|=4;try{p0(t,n.alternate,n)}finally{lt=C,he.p=u,ue.T=o}}Rt=3}}function Vf(){if(Rt===4||Rt===3){Rt=0;var t=Do;Do=null,eo();var n=xi,o=Ps,u=Oi,C=A0,k=(u&335544064)===u?10262:10256;if((o.subtreeFlags&k)!==0||(o.flags&k)!==0?Rt=5:(Rt=0,Ps=xi=null,F0(n,n.pendingLanes)),k=n.pendingLanes,k===0&&(Vr=null),Jh(u),o=o.stateNode,zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(ka,o,void 0,(o.current.flags&128)===128)}catch{}if(C!==null){o=ue.T,k=he.p,he.p=2,ue.T=null;try{for(var N=n.onRecoverableError,q=0;q<C.length;q++){var J=C[q];N(J.value,{componentStack:J.stack})}}finally{ue.T=o,he.p=k}}if(C=Mo,N=jo,jo=null,C!==null&&(Mo=null,N===null&&(N=[]),t!==null))for(J=0;J<C.length;J++)o=(0,C[J])(N),o!==void 0&&t.finished.finally(o);(Oi&3)!==0&&mu(),Ni(n),k=n.pendingLanes,(u&261930)!==0&&(k&42)!==0?n===hu?al++:(al=0,hu=n):(al=0,hu=null),ll(0)}}function F0(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ua(n)))}function mu(){return Do!==null&&(Do.skipTransition(),Do=null),$f(),qf(),Vf(),Wf()}function Wf(){if(Rt!==5)return!1;var t=xi,n=zf;zf=0;var o=Jh(Oi),u=ue.T,C=he.p;try{he.p=32>o?32:o,ue.T=null,o=Hf,Hf=null;var k=xi,N=Oi;if(Rt=0,Ps=xi=null,Oi=0,(lt&6)!==0)throw Error(s(331));var q=lt;if(lt|=4,k0(k.current),w0(k,k.current,N,o),lt=q,ll(0,!1),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(ka,k)}catch{}return!0}finally{he.p=C,ue.T=u,F0(t,n)}}function U0(t,n,o){n=ri(o,n),n=cf(t.stateNode,n,2),t=Pr(t,n,2),t!==null&&(Ra(t,2),Ni(t))}function ft(t,n,o){if(t.tag===3)U0(t,t,o);else for(;n!==null;){if(n.tag===3){U0(n,t,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Vr===null||!Vr.has(u))){t=ri(o,t),o=I1(2),u=Pr(n,o,2),u!==null&&(z1(o,u,n,t),Ra(u,2),Ni(u));break}}n=n.return}}function Gf(t,n,o){var u=t.pingCache;if(u===null){u=t.pingCache=new XE;var C=new Set;u.set(n,C)}else C=u.get(n),C===void 0&&(C=new Set,u.set(n,C));C.has(o)||(Pf=!0,C.add(o),t=ik.bind(null,t,n,o),n.then(t,t))}function ik(t,n,o){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,_t===t&&(Je&o)===o&&((Lt===4||Lt===3&&(Je&62914560)===Je&&300>Vt()-lu)&&(lt&2)===0?No(t,0):au|=o,Lo===Je&&(Lo=0)),Ni(t)}function $0(t,n){n===0&&(n=Rv()),t=bs(t,n),t!==null&&(Ra(t,n),Ni(t))}function rk(t){var n=t.memoizedState,o=0;n!==null&&(o=n.retryLane),$0(t,o)}function sk(t,n){var o=0;switch(t.tag){case 31:case 13:var u=t.stateNode,C=t.memoizedState;C!==null&&(o=C.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(n),$0(t,o)}function ok(t,n){return kn(t,n)}var Po=null,Io=null,Yf=!1,gu=!1,Xf=!1,Gr=0;function Ni(t){t!==Io&&t.next===null&&(Io===null?Po=Io=t:Io=Io.next=t),gu=!0,Yf||(Yf=!0,lk())}function ll(t,n){if(!Xf&&gu){Xf=!0;do for(var o=!1,u=Po;u!==null;){if(t!==0){var C=u.pendingLanes;if(C===0)var k=0;else{var N=u.suspendedLanes,q=u.pingedLanes;k=(1<<31-Hn(42|t)+1)-1,k&=C&~(N&~q),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(o=!0,G0(u,k))}else k=Je,k=ac(u,u===_t?k:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(k&3)===0||Ta(u,k)||(o=!0,G0(u,k));u=u.next}while(o);Xf=!1}}function ak(){q0()}function q0(){gu=Yf=!1;var t=0;Gr!==0&&xk()&&(t=Gr);for(var n=Vt(),o=null,u=Po;u!==null;){var C=u.next,k=V0(u,n);k===0?(u.next=null,o===null?Po=C:o.next=C,C===null&&(Io=o)):(o=u,(t!==0||(k&3)!==0)&&(gu=!0)),u=C}Rt!==0&&Rt!==5||ll(t),Gr!==0&&(Gr=0)}function V0(t,n){for(var o=t.suspendedLanes,u=t.pingedLanes,C=t.expirationTimes,k=t.pendingLanes&-62914561;0<k;){var N=31-Hn(k),q=1<<N,J=C[N];J===-1?((q&o)===0||(q&u)!==0)&&(C[N]=E5(q,n)):J<=n&&(t.expiredLanes|=q),k&=~q}if(n=_t,o=Je,o=ac(t,t===n?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,o===0||t===n&&(dt===2||dt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Jn(u),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||Ta(t,o)){if(n=o&-o,n===t.callbackPriority)return n;switch(u!==null&&Jn(u),Jh(o)){case 2:case 8:o=_n;break;case 32:o=to;break;case 268435456:o=kv;break;default:o=to}return u=W0.bind(null,t),o=kn(o,u),t.callbackPriority=n,t.callbackNode=o,n}return u!==null&&u!==null&&Jn(u),t.callbackPriority=2,t.callbackNode=null,2}function W0(t,n){if(Rt!==0&&Rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(mu()&&t.callbackNode!==o)return null;var u=Je;return u=ac(t,t===_t?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(D0(t,u,n),V0(t,Vt()),t.callbackNode!=null&&t.callbackNode===o?W0.bind(null,t):null)}function G0(t,n){if(mu())return null;D0(t,n,!0)}function lk(){bk(function(){(lt&6)!==0?kn(ti,ak):q0()})}function Kf(){if(Gr===0){var t=Ts;t===0&&(t=rc,rc<<=1,(rc&261888)===0&&(rc=256)),Gr=t}return Gr}function Y0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:dc(t)}function ck(t,n,o,u,C){if(n==="submit"&&o&&o.stateNode===C){var k=Y0((C[Tn]||null).action),N=u.submitter;N&&(n=(n=N[Tn]||null)?Y0(n.formAction):N.getAttribute("formAction"),n!==null&&(k=n,N=null));var q=new gc("action","action",null,u,C);t.push({event:q,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Gr!==0){var J=new FormData(C,N);rf(o,{pending:!0,data:J,method:C.method,action:k},null,J)}}else typeof k=="function"&&(q.preventDefault(),J=new FormData(C,N),rf(o,{pending:!0,data:J,method:C.method,action:k},k,J))},currentTarget:C}]})}}for(var Qf=0;Qf<bd.length;Qf++){var Zf=bd[Qf],uk=Zf.toLowerCase(),hk=Zf[0].toUpperCase()+Zf.slice(1);mi(uk,"on"+hk)}mi(y_,"onAnimationEnd"),mi(b_,"onAnimationIteration"),mi(S_,"onAnimationStart"),mi("dblclick","onDoubleClick"),mi("focusin","onFocus"),mi("focusout","onBlur"),mi(yE,"onTransitionRun"),mi(bE,"onTransitionStart"),mi(SE,"onTransitionCancel"),mi(w_,"onTransitionEnd"),so("onMouseEnter",["mouseout","mouseover"]),so("onMouseLeave",["mouseout","mouseover"]),so("onPointerEnter",["pointerout","pointerover"]),so("onPointerLeave",["pointerout","pointerover"]),_s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_s("onBeforeInput",["compositionend","keypress","textInput","paste"]),_s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cl="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(" "),dk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cl));function X0(t,n){n=(n&4)!==0;for(var o=0;o<t.length;o++){var u=t[o],C=u.event;u=u.listeners;e:{var k=void 0;if(n)for(var N=u.length-1;0<=N;N--){var q=u[N],J=q.instance,se=q.currentTarget;if(q=q.listener,J!==k&&C.isPropagationStopped())break e;k=q,C.currentTarget=se;try{k(C)}catch(de){xc(de)}C.currentTarget=null,k=J}else for(N=0;N<u.length;N++){if(q=u[N],J=q.instance,se=q.currentTarget,q=q.listener,J!==k&&C.isPropagationStopped())break e;k=q,C.currentTarget=se;try{k(C)}catch(de){xc(de)}C.currentTarget=null,k=J}}}}function Ze(t,n){var o=n[Ov];o===void 0&&(o=n[Ov]=new Set);var u=t+"__bubble";o.has(u)||(K0(n,t,2,!1),o.add(u))}function Jf(t,n,o){var u=0;n&&(u|=4),K0(o,t,u,n)}var vu="_reactListening"+Math.random().toString(36).slice(2);function ep(t){if(!t[vu]){t[vu]=!0,Pv.forEach(function(o){o!=="selectionchange"&&(dk.has(o)||Jf(o,!1,t),Jf(o,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[vu]||(n[vu]=!0,Jf("selectionchange",!1,n))}}function K0(t,n,o,u){switch(zx(n)){case 2:var C=r3;break;case 8:C=s3;break;default:C=yp}o=C.bind(null,n,o,t),C=void 0,!ad||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(C=!0),u?C!==void 0?t.addEventListener(n,o,{capture:!0,passive:C}):t.addEventListener(n,o,!0):C!==void 0?t.addEventListener(n,o,{passive:C}):t.addEventListener(n,o,!1)}function tp(t,n,o,u,C){var k=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var N=u.tag;if(N===3||N===4){var q=u.stateNode.containerInfo;if(q===C)break;if(N===4)for(N=u.return;N!==null;){var J=N.tag;if((J===3||J===4)&&N.stateNode.containerInfo===C)return;N=N.return}for(;q!==null;){if(N=vs(q),N===null)return;if(J=N.tag,J===5||J===6||J===26||J===27){u=k=N;continue e}q=q.parentNode}}u=u.return}Kv(function(){var se=k,de=sd(o),me=[];e:{var ie=C_.get(t);if(ie!==void 0){var ce=gc,Ce=t;switch(t){case"keypress":if(pc(o)===0)break e;case"keydown":case"keyup":ce=K5;break;case"focusin":Ce="focus",ce=hd;break;case"focusout":Ce="blur",ce=hd;break;case"beforeblur":case"afterblur":ce=hd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Jv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=I5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=tE;break;case y_:case b_:case S_:ce=F5;break;case w_:ce=iE;break;case"scroll":case"scrollend":ce=B5;break;case"wheel":ce=sE;break;case"copy":case"cut":case"paste":ce=$5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=t_;break;case"submit":ce=J5;break;case"toggle":case"beforetoggle":ce=aE}var je=(n&4)!==0,Ge=!je&&(t==="scroll"||t==="scrollend"),re=je?ie!==null?ie+"Capture":null:ie;je=[];for(var te=se,ae;te!==null;){var pe=te;if(ae=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ae===null||re===null||(pe=Da(te,re),pe!=null&&je.push(ul(te,pe,ae))),Ge)break;te=te.return}0<je.length&&(ie=new ce(ie,Ce,null,o,de),me.push({event:ie,listeners:je}))}}if((n&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",ce&&o!==rd&&(Ce=o.relatedTarget||o.fromElement)&&(vs(Ce)||Ce[no]))break e;(ie||ce)&&(Ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ie?(ce=o.relatedTarget||o.toElement,ie=se,ce=ce?vs(ce):null,ce!==null&&(Ge=f(ce),je=ce.tag,ce!==Ge||je!==5&&je!==27&&je!==6)&&(ce=null)):(ie=null,ce=se),ie!==ce&&(je=Jv,pe="onMouseLeave",re="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(je=t_,pe="onPointerLeave",re="onPointerEnter",te="pointer"),Ge=ie==null?Ce:La(ie),ae=ce==null?Ce:La(ce),Ce=new je(pe,te+"leave",ie,o,de),Ce.target=Ge,Ce.relatedTarget=ae,pe=null,vs(de)===se&&(je=new je(re,te+"enter",ce,o,de),je.target=ae,je.relatedTarget=Ge,pe=je),Ge=pe,je=ie&&ce?R(ie,ce,fk):null,ie!==null&&Q0(me,Ce,ie,je,!1),ce!==null&&Ge!==null&&Q0(me,Ge,ce,je,!0)))}e:{if(ie=se?La(se):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Ae=c_;else if(a_(ie))if(u_)Ae=vE;else{Ae=mE;var et=pE}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?se&&id(se.elementType)&&(Ae=c_):Ae=gE;if(Ae&&(Ae=Ae(t,se))){l_(me,Ae,o,de);break e}et&&et(t,ie,se)}switch(et=se?La(se):window,t){case"focusin":(a_(et)||et.contentEditable==="true")&&(ho=et,_d=se,za=null);break;case"focusout":za=_d=ho=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,__(me,o,de);break;case"selectionchange":if(xE)break;case"keydown":case"keyup":__(me,o,de)}var Oe;if(fd)e:{switch(t){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else uo?s_(t,o)&&(Pe="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Pe="onCompositionStart");Pe&&(n_&&o.locale!=="ko"&&(uo||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&uo&&(Oe=Qv()):(Rr=de,ld="value"in Rr?Rr.value:Rr.textContent,uo=!0)),et=_u(se,Pe),0<et.length&&(Pe=new e_(Pe,t,null,o,de),me.push({event:Pe,listeners:et}),Oe?Pe.data=Oe:(Oe=o_(o),Oe!==null&&(Pe.data=Oe)))),(Oe=cE?uE(t,o):hE(t,o))&&(Pe=_u(se,"onBeforeInput"),0<Pe.length&&(et=new e_("onBeforeInput","beforeinput",null,o,de),me.push({event:et,listeners:Pe}),et.data=Oe)),ck(me,t,se,o,de)}X0(me,n)})}function ul(t,n,o){return{instance:t,listener:n,currentTarget:o}}function _u(t,n){for(var o=n+"Capture",u=[];t!==null;){var C=t,k=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||k===null||(C=Da(t,o),C!=null&&u.unshift(ul(t,C,k)),C=Da(t,n),C!=null&&u.push(ul(t,C,k))),t.tag===3)return u;t=t.return}return[]}function fk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Q0(t,n,o,u,C){for(var k=n._reactName,N=[];o!==null&&o!==u;){var q=o,J=q.alternate,se=q.stateNode;if(q=q.tag,J!==null&&J===u)break;q!==5&&q!==26&&q!==27||se===null||(J=se,C?(se=Da(o,k),se!=null&&N.unshift(ul(o,se,J))):C||(se=Da(o,k),se!=null&&N.push(ul(o,se,J)))),o=o.return}N.length!==0&&t.push({event:n,listeners:N})}var pk=/\r\n?/g,mk=/\u0000|\uFFFD/g;function Z0(t){return(typeof t=="string"?t:""+t).replace(pk,`
50
- `).replace(mk,"")}function J0(t,n){return n=Z0(n),Z0(t)===n}function pt(t,n,o,u,C,k){switch(o){case"children":if(typeof u=="string")n==="body"||n==="textarea"&&u===""||ao(t,u);else if(typeof u=="number"||typeof u=="bigint")n!=="body"&&ao(t,""+u);else return;break;case"className":hc(t,"class",u);break;case"tabIndex":hc(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":hc(t,o,u);break;case"style":Yv(t,u,k);return;case"data":if(n!=="object"){hc(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||o!=="href")){t.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=dc(u),t.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(o,"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 k=="function"&&(o==="formAction"?(n!=="input"&&pt(t,n,"name",C.name,C,null),pt(t,n,"formEncType",C.formEncType,C,null),pt(t,n,"formMethod",C.formMethod,C,null),pt(t,n,"formTarget",C.formTarget,C,null)):(pt(t,n,"encType",C.encType,C,null),pt(t,n,"method",C.method,C,null),pt(t,n,"target",C.target,C,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=dc(u),t.setAttribute(o,u);break;case"onClick":u!=null&&(t.onclick=Ei);return;case"onScroll":u!=null&&Ze("scroll",t);return;case"onScrollEnd":u!=null&&Ze("scrollend",t);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(o=u.__html,o!=null){if(C.children!=null)throw Error(s(60));(k!=null?k.__html:void 0)!==o&&(t.innerHTML=o)}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}o=dc(u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":u===!0?t.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(o,u):t.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(o):t.setAttribute(o,u);break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),uc(t,"popover",u);break;case"xlinkActuate":Yi(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Yi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Yi(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Yi(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Yi(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Yi(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Yi(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Yi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Yi(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":uc(t,"is",u);break;case"innerText":case"textContent":return;default:if(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")o=O5.get(o)||o,uc(t,o,u);else return}ot=!0}function np(t,n,o,u,C,k){switch(o){case"style":Yv(t,u,k);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(o=u.__html,o!=null){if(C.children!=null)throw Error(s(60));(k!=null?k.__html:void 0)!==o&&(t.innerHTML=o)}}break;case"children":if(typeof u=="string")ao(t,u);else if(typeof u=="number"||typeof u=="bigint")ao(t,""+u);else return;break;case"onScroll":u!=null&&Ze("scroll",t);return;case"onScrollEnd":u!=null&&Ze("scrollend",t);return;case"onClick":u!=null&&(t.onclick=Ei);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Iv.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(C=o.endsWith("Capture"),k=o.slice(2,C?o.length-7:void 0),n=t[Tn]||null,n=n!=null?n[o]:null,typeof n=="function"&&t.removeEventListener(k,n,C),typeof u=="function")){typeof n!="function"&&n!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(k,u,C);break e}ot=!0,o in t?t[o]=u:u===!0?t.setAttribute(o,""):uc(t,o,u)}return}ot=!0}function cn(t,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var u=!1,C=!1,k;for(k in o)if(o.hasOwnProperty(k)){var N=o[k];if(N!=null)switch(k){case"src":u=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,k,N,o,null)}}C&&pt(t,n,"srcSet",o.srcSet,o,null),u&&pt(t,n,"src",o.src,o,null);return;case"input":Ze("invalid",t);var q=k=N=C=null,J=null,se=null;for(u in o)if(o.hasOwnProperty(u)){var de=o[u];if(de!=null)switch(u){case"name":C=de;break;case"type":N=de;break;case"checked":J=de;break;case"defaultChecked":se=de;break;case"value":k=de;break;case"defaultValue":q=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,n));break;default:pt(t,n,u,de,o,null)}}qv(t,k,q,J,se,N,C,!1);return;case"select":Ze("invalid",t),u=N=k=null;for(C in o)if(o.hasOwnProperty(C)&&(q=o[C],q!=null))switch(C){case"value":k=q;break;case"defaultValue":N=q;break;case"multiple":u=q;default:pt(t,n,C,q,o,null)}n=k,o=N,t.multiple=!!u,n!=null?oo(t,!!u,n,!1):o!=null&&oo(t,!!u,o,!0);return;case"textarea":Ze("invalid",t),k=C=u=null;for(N in o)if(o.hasOwnProperty(N)&&(q=o[N],q!=null))switch(N){case"value":u=q;break;case"defaultValue":C=q;break;case"children":k=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(91));break;default:pt(t,n,N,q,o,null)}Wv(t,u,C,k);return;case"option":for(J in o)if(o.hasOwnProperty(J)&&(u=o[J],u!=null))switch(J){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:pt(t,n,J,u,o,null)}return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(u=0;u<cl.length;u++)Ze(cl[u],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in o)if(o.hasOwnProperty(se)&&(u=o[se],u!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,se,u,o,null)}return;default:if(id(n)){for(de in o)o.hasOwnProperty(de)&&(u=o[de],u!==void 0&&np(t,n,de,u,o,void 0));return}}for(q in o)o.hasOwnProperty(q)&&(u=o[q],u!=null&&pt(t,n,q,u,o,null))}var gk={};function vk(t,n,o,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,k=null,N=null,q=null,J=null,se=null,de=null;for(ce in o){var me=o[ce];if(o.hasOwnProperty(ce)&&me!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":J=me;default:u.hasOwnProperty(ce)||pt(t,n,ce,null,u,me)}}for(var ie in u){var ce=u[ie];if(me=o[ie],u.hasOwnProperty(ie)&&(ce!=null||me!=null))switch(ie){case"type":ce!==me&&(ot=!0),k=ce;break;case"name":ce!==me&&(ot=!0),C=ce;break;case"checked":ce!==me&&(ot=!0),se=ce;break;case"defaultChecked":ce!==me&&(ot=!0),de=ce;break;case"value":ce!==me&&(ot=!0),N=ce;break;case"defaultValue":ce!==me&&(ot=!0),q=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,n));break;default:ce!==me&&pt(t,n,ie,ce,u,me)}}td(t,N,q,J,se,de,k,C);return;case"select":ce=N=q=ie=null;for(k in o)if(J=o[k],o.hasOwnProperty(k)&&J!=null)switch(k){case"value":break;case"multiple":ce=J;default:u.hasOwnProperty(k)||pt(t,n,k,null,u,J)}for(C in u)if(k=u[C],J=o[C],u.hasOwnProperty(C)&&(k!=null||J!=null))switch(C){case"value":k!==J&&(ot=!0),ie=k;break;case"defaultValue":k!==J&&(ot=!0),q=k;break;case"multiple":k!==J&&(ot=!0),N=k;default:k!==J&&pt(t,n,C,k,u,J)}n=q,o=N,u=ce,ie!=null?oo(t,!!o,ie,!1):!!u!=!!o&&(n!=null?oo(t,!!o,n,!0):oo(t,!!o,o?[]:"",!1));return;case"textarea":ce=ie=null;for(q in o)if(C=o[q],o.hasOwnProperty(q)&&C!=null&&!u.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:pt(t,n,q,null,u,C)}for(N in u)if(C=u[N],k=o[N],u.hasOwnProperty(N)&&(C!=null||k!=null))switch(N){case"value":C!==k&&(ot=!0),ie=C;break;case"defaultValue":C!==k&&(ot=!0),ce=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==k&&pt(t,n,N,C,u,k)}Vv(t,ie,ce);return;case"option":for(var Ce in o)if(ie=o[Ce],o.hasOwnProperty(Ce)&&ie!=null&&!u.hasOwnProperty(Ce))switch(Ce){case"selected":t.selected=!1;break;default:pt(t,n,Ce,null,u,ie)}for(J in u)if(ie=u[J],ce=o[J],u.hasOwnProperty(J)&&ie!==ce&&(ie!=null||ce!=null))switch(J){case"selected":ie!==ce&&(ot=!0),t.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:pt(t,n,J,ie,u,ce)}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 je in o)ie=o[je],o.hasOwnProperty(je)&&ie!=null&&!u.hasOwnProperty(je)&&pt(t,n,je,null,u,ie);for(se in u)if(ie=u[se],ce=o[se],u.hasOwnProperty(se)&&ie!==ce&&(ie!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,n));break;default:pt(t,n,se,ie,u,ce)}return;default:if(id(n)){for(var Ge in o)ie=o[Ge],o.hasOwnProperty(Ge)&&ie!==void 0&&!u.hasOwnProperty(Ge)&&np(t,n,Ge,void 0,u,ie);for(de in u)ie=u[de],ce=o[de],!u.hasOwnProperty(de)||ie===ce||ie===void 0&&ce===void 0||np(t,n,de,ie,u,ce);return}}for(var re in o)ie=o[re],o.hasOwnProperty(re)&&ie!=null&&!u.hasOwnProperty(re)&&pt(t,n,re,null,u,ie);for(me in u)ie=u[me],ce=o[me],!u.hasOwnProperty(me)||ie===ce||ie==null&&ce==null||pt(t,n,me,ie,u,ce)}function ex(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _k(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var C=o[u],k=C.transferSize,N=C.initiatorType,q=C.duration;if(k&&q&&ex(N)){for(N=0,q=C.responseEnd,u+=1;u<o.length;u++){var J=o[u],se=J.startTime;if(se>q)break;var de=J.transferSize,me=J.initiatorType;de&&ex(me)&&(J=J.responseEnd,N+=de*(J<q?1:(q-se)/(J-se)))}if(--u,n+=8*(k+N)/(C.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var ip=null,rp=null;function hl(t){return t.nodeType===9?t:t.ownerDocument}function tx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function ix(t,n,o,u){return o=hl(o).createElement(t),o[rn]=u,o[Tn]=n,cn(o,t,n),Kt(o),o}function sp(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var op=null;function xk(){var t=window.event;return t&&t.type==="popstate"?t===op?!1:(op=t,!0):(op=null,!1)}var ap=typeof setTimeout=="function"?setTimeout:void 0,yk=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,sx=typeof requestAnimationFrame=="function"?requestAnimationFrame:ap,bk=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(t){return rx.resolve(null).then(t).catch(Sk)}:ap;function Sk(t){setTimeout(function(){throw t})}function Yr(t){return t==="head"}function ox(t,n){var o=n,u=0;do{var C=o.nextSibling;if(t.removeChild(o),C&&C.nodeType===8)if(o=C.data,o==="/$"||o==="/&"){if(u===0){t.removeChild(C),Vo(n);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")mp(t.ownerDocument.documentElement);else if(o==="head"){o=t.ownerDocument.head,mp(o);for(var k=o.firstChild;k;){var N=k.nextSibling,q=k.nodeName;k[Aa]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&k.rel.toLowerCase()==="stylesheet"||o.removeChild(k),k=N}}else o==="body"&&mp(t.ownerDocument.body);o=C}while(o);Vo(n)}function ax(t,n){var o=t;t=0;do{var u=o.nextSibling;if(o.nodeType===1?n?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(n?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(t===0)break;t--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||t++;o=u}while(o)}function lx(t,n,o){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,o!=null&&(t.style.viewTransitionClass=o),o=getComputedStyle(t),o.display==="inline"){if(n=t.getClientRects(),n.length===1)var u=1;else for(var C=u=0;C<n.length;C++){var k=n[C];0<k.width&&0<k.height&&u++}u===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+o.paddingTop,t.marginBottom="-"+o.paddingBottom)}}function cx(t,n){t=t.style,n=n.style;var o=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=o==null||typeof o=="boolean"?"":(""+o).trim(),o=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=o==null||typeof o=="boolean"?"":(""+o).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(o=n.display,t.display=o==null||typeof o=="boolean"?"":o,o=n.margin,o!=null?t.margin=o:(o=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=o==null||typeof o=="boolean"?"":o,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function wk(t,n,o){return o=o.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=o.innerHeight&&t.left<=o.innerWidth}}function lp(t){var n=t.getBoundingClientRect(),o=getComputedStyle(t);return wk(n,o,t)}function Ck(t){return t.documentElement.clientHeight}function Ek(t){this.addEventListener("load",t),this.addEventListener("error",t)}function kk(t,n,o,u,C,k,N,q,J){var se=n.nodeType===9?n:n.ownerDocument;try{var de=se.startViewTransition({update:function(){var ie=se.defaultView,ce=ie.navigation&&ie.navigation.transition,Ce=se.fonts.status;u();var je=[];if(Ce==="loaded"&&(Ck(se),se.fonts.status==="loading"&&je.push(se.fonts.ready)),Ce=je.length,t!==null)for(var Ge=t.suspenseyImages,re=0,te=0;te<Ge.length;te++){var ae=Ge[te];if(!ae.complete){var pe=ae.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<ie.innerHeight&&pe.left<ie.innerWidth){if(re+=Lx(ae),re>bu){je.length=Ce;break}ae=new Promise(Ek.bind(ae)),je.push(ae)}}}if(0<je.length)return ie=Promise.race([Promise.all(je),new Promise(function(Ae){return setTimeout(Ae,500)})]).then(C,C),(ce?Promise.allSettled([ce.finished,ie]):ie).then(k,k);if(C(),ce)return ce.finished.then(k,k);k()},types:o});se.__reactViewTransition=de;var me=[];return de.ready.then(function(){for(var ie=se.documentElement.getAnimations({subtree:!0}),ce=0;ce<ie.length;ce++){var Ce=ie[ce],je=Ce.effect,Ge=je.pseudoElement;if(Ge!=null&&Ge.startsWith("::view-transition")){me.push(Ce),Ce=je.getKeyframes();for(var re=Ge=void 0,te=!0,ae=0;ae<Ce.length;ae++){var pe=Ce[ae],Ae=pe.width;if(Ge===void 0)Ge=Ae;else if(Ge!==Ae){te=!1;break}if(Ae=pe.height,re===void 0)re=Ae;else if(re!==Ae){te=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}te&&Ge!==void 0&&re!==void 0&&(je.setKeyframes(Ce),te=getComputedStyle(je.target,je.pseudoElement),te.width!==Ge||te.height!==re)&&(te=Ce[0],te.width=Ge,te.height=re,te=Ce[Ce.length-1],te.width=Ge,te.height=re,je.setKeyframes(Ce))}}N()},function(ie){se.__reactViewTransition===de&&(se.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&J(ie)}finally{u(),C(),N()}}),de.finished.finally(function(){for(var ie=0;ie<me.length;ie++)me[ie].cancel();se.__reactViewTransition===de&&(se.__reactViewTransition=null),q()}),de}catch{return u(),C(),N(),null}}function Is(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}Is.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:D({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},Is.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,o=t.getAnimations({subtree:!0}),u=[],C=0;C<o.length;C++){var k=o[C].effect;k!==null&&k.target===t&&k.pseudoElement===n&&u.push(o[C])}return u},Is.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ux(t){return{name:t,group:new Is("group",t),imagePair:new Is("image-pair",t),old:new Is("old",t),new:new Is("new",t)}}function Yn(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Yn.prototype.addEventListener=function(t,n,o){var u=null,C=null;if(!(o!=null&&typeof o!="boolean"&&(u=o.signal||null,u!==null&&u.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var k=this._eventListeners;if(dx(k,t,n,o)===-1){var N=this,q=n;o!=null&&typeof o!="boolean"&&o.once===!0&&(q=function(J){N.removeEventListener(t,n,o),typeof n=="function"?n.call(this,J):n.handleEvent(J)}),u!==null&&(C=N.removeEventListener.bind(N,t,n,o),u.addEventListener("abort",C,{once:!0}),C=u.removeEventListener.bind(u,"abort",C)),u=zo(o),k.push({type:t,listener:n,optionsOrUseCapture:o,attachedListener:q,cleanup:C}),c(this._fragmentFiber.child,!1,Tk,t,q,u)}this._eventListeners=k}};function Tk(t,n,o,u){return g(t).addEventListener(n,o,u),!1}Yn.prototype.removeEventListener=function(t,n,o){var u=this._eventListeners;if(u!==null&&(n=dx(u,t,n,o),n!==-1)){var C=u[n];o=C.attachedListener;var k=C.cleanup;C=zo(C.optionsOrUseCapture),c(this._fragmentFiber.child,!1,Rk,t,o,C),u.splice(n,1),k!==null&&k()}};function Rk(t,n,o,u){return g(t).removeEventListener(n,o,u),!1}function zo(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function hx(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function dx(t,n,o,u){if(t.length===0)return-1;u=hx(u);for(var C=0;C<t.length;C++){var k=t[C];if(k.type===n&&k.listener===o&&hx(k.optionsOrUseCapture)===u)return C}return-1}Yn.prototype.dispatchEvent=function(t){var n=_(this._fragmentFiber);if(n===null)return!0;n=g(n);var o=this._eventListeners;if(o!==null&&0<o.length||!t.bubbles){var u=n.nodeType===9?n.createComment(""):document.createTextNode("");if(o)for(var C=0;C<o.length;C++){var k=o[C];u.addEventListener(k.type,k.attachedListener,zo(k.optionsOrUseCapture))}if(n.appendChild(u),t=u.dispatchEvent(t),o)for(C=0;C<o.length;C++)k=o[C],u.removeEventListener(k.type,k.attachedListener,zo(k.optionsOrUseCapture));return n.removeChild(u),t}return n.dispatchEvent(t)},Yn.prototype.focus=function(t){c(this._fragmentFiber.child,!0,fx,t,void 0,void 0)};function fx(t,n){return t.tag===6?!1:(t=g(t),Hk(t,n))}Yn.prototype.focusLast=function(t){var n=[];c(this._fragmentFiber.child,!0,cp,n,void 0,void 0);for(var o=n.length-1;0<=o&&!fx(n[o],t);o--);};function cp(t,n){return n.push(t),!1}Yn.prototype.blur=function(){var t=_(this._fragmentFiber);t!==null&&(t=g(t),t=hl(t).activeElement,t!==null&&c(this._fragmentFiber.child,!1,Ak,t,void 0,void 0))};function Ak(t,n){return t.tag===6?!1:(t=g(t),t===n||t.contains(n)?(n.blur(),!0):!1)}Yn.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),c(this._fragmentFiber.child,!1,Lk,t,void 0,void 0)};function Lk(t,n){return t.tag===6||(t=g(t),n.observe(t)),!1}Yn.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),c(this._fragmentFiber.child,!1,Dk,t,void 0,void 0);for(var o=n=0;o<yi.length;o++){var u=yi[o];u.fragmentInstance===this&&u.observer===t?t.unobserve(u.instance):yi[n++]=u}yi.length=n}};function Dk(t,n){return t.tag===6||(t=g(t),n.unobserve(t)),!1}var yi=[],up=!1;function Mk(t,n,o){yi.push({fragmentInstance:t,observer:n,instance:o}),up||(up=!0,Fk(function(){up=!1;var u=yi;yi=[];for(var C=0;C<u.length;C++){var k=u[C];k.observer.unobserve(k.instance)}}))}Yn.prototype.getClientRects=function(){var t=[];return c(this._fragmentFiber.child,!1,jk,t,void 0,void 0),t};function jk(t,n){if(t.tag===6){t=t.stateNode;var o=t.ownerDocument.createRange();o.selectNodeContents(t),n.push.apply(n,o.getClientRects())}else t=g(t),n.push.apply(n,t.getClientRects());return!1}Yn.prototype.getRootNode=function(t){var n=_(this._fragmentFiber);return n===null?this:g(n).getRootNode(t)},Yn.prototype.compareDocumentPosition=function(t){var n=_(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];c(this._fragmentFiber.child,!1,cp,o,void 0,void 0);var u=g(n);if(o.length===0){if(o=u,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(o=n)}n=this._fragmentFiber;var C=u=o.compareDocumentPosition(t);return o===t?C=Node.DOCUMENT_POSITION_CONTAINS:u&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=E(n)[1],o===null?C=Node.DOCUMENT_POSITION_PRECEDING:(t=g(o).compareDocumentPosition(t),C=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),C|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=g(o[0]),C=g(o[o.length-1]);var k=x(this._fragmentFiber)?n.parentElement:u;if(k==null)return Node.DOCUMENT_POSITION_DISCONNECTED;u=k.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,k=k.compareDocumentPosition(C)&Node.DOCUMENT_POSITION_CONTAINED_BY;var N=n.compareDocumentPosition(t),q=C.compareDocumentPosition(t),J=N&Node.DOCUMENT_POSITION_CONTAINED_BY||q&Node.DOCUMENT_POSITION_CONTAINED_BY;return q=u&&k&&N&Node.DOCUMENT_POSITION_FOLLOWING&&q&Node.DOCUMENT_POSITION_PRECEDING,n=u&&n===t||k&&C===t||J||q?Node.DOCUMENT_POSITION_CONTAINED_BY:!u&&n===t||!k&&C===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:N,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Ok(n,this._fragmentFiber,o[0],o[o.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Ok(t,n,o,u,C){var k=vs(C);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(o=!!k)e:{for(;k!==null;){if(k.tag===7&&(k===n||k.alternate===n)){o=!0;break e}k=k.return}o=!1}return o}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(k===null)return k=C.ownerDocument,C===k||C===k.documentElement||C===k.body;e:{for(k=n,n=_(n);k!==null;){if(!(k.tag!==5&&k.tag!==3&&k.tag!==27||k!==n&&k.alternate!==n)){k=!0;break e}k=k.return}k=!1}return k}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!k)&&!(n=k===o)&&(n=R(o,k,L),n===null?n=!1:(c(n,!0,y,k,o),k=b,b=null,n=k!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!k)&&!(n=k===u)&&(n=R(u,k,L),n===null?n=!1:(c(n,!0,T,k,u),k=b,S=b=null,n=k!==null)),n):!1}function px(t,n){var o=t.ownerDocument.createRange();o.selectNodeContents(t),t=o.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Yn.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(s(566));var n=[];c(this._fragmentFiber.child,!1,cp,n,void 0,void 0);var o=t!==!1;if(n.length===0){var u=E(this._fragmentFiber);if(u=o?u[1]||u[0]||_(this._fragmentFiber):u[0]||u[1],u===null)return;if(u.tag===6){t=g(u),px(t,o);return}if(u=g(u),u.nodeType!==9){if(u.nodeType===11){o="host"in u?u.host:null,o!==null&&o.scrollIntoView(t);return}u.scrollIntoView(t)}}for(u=o?n.length-1:0;u!==(o?-1:n.length);){var C=n[u];C.tag===6?(C=g(C),px(C,o)):g(C).scrollIntoView(t),u+=o?-1:1}};function Nk(t,n){return t=g(t),mx(t,n),!1}function mx(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function gx(t,n){var o=n._eventListeners;if(o!==null)for(var u=0;u<o.length;u++){var C=o[u];t.addEventListener(C.type,C.attachedListener,zo(C.optionsOrUseCapture))}t.nodeType!==3&&(o=n._observers,o!==null&&o.forEach(function(k){for(var N=0,q=0;q<yi.length;q++){var J=yi[q];(J.fragmentInstance!==n||J.observer!==k||J.instance!==t)&&(yi[N++]=J)}yi.length=N,k.observe(t)}),mx(t,n))}function Bk(t,n){var o=n._eventListeners;if(o!==null)for(var u=0;u<o.length;u++){var C=o[u];t.removeEventListener(C.type,C.attachedListener,zo(C.optionsOrUseCapture))}t.nodeType!==3&&(o=n._observers,o!==null&&o.forEach(function(k){typeof k.rootMargin=="string"?Mk(n,k,t):k.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function hp(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":hp(o),cc(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function Pk(t,n,o,u){for(;t.nodeType===1;){var C=o;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Aa])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(k=t.getAttribute("rel"),k==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(k!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(k=t.getAttribute("src"),(k!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&k&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var k=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===k)return t}else return t;if(t=ci(t.nextSibling),t===null)break}return null}function Ik(t,n,o){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=ci(t.nextSibling),t===null))return null;return t}function vx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ci(t.nextSibling),t===null))return null;return t}function dp(t){return t.data==="$?"||t.data==="$~"}function fp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function zk(t,n){var o=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||o.readyState!=="loading")n();else{var u=function(){n(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function ci(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var pp=null;function _x(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"||o==="/&"){if(n===0)return ci(t.nextSibling);n--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||n++}t=t.nextSibling}return null}function xx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(n===0)return t;n--}else o!=="/$"&&o!=="/&"||n++}t=t.previousSibling}return null}function Hk(t,n){function o(){u=!0}if(t.ownerDocument.activeElement===t)return!0;var u=!1;try{t.ownerDocument.addEventListener("focus",o,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",o,!0)}return u}function Fk(t){sx(function(){sx(function(n){return t(n)})})}function yx(t,n,o){switch(n=hl(o),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function bx(t,n,o){for(var u in o){var C=o[u];o.hasOwnProperty(u)&&C!=null&&pt(t,n,u,null,gk,C)}o.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Ei&&(t.onclick=null),cc(t)}function mp(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);cc(t)}var ui=new Map,Sx=new Set;function dl(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var ar=he.d;he.d={f:Uk,r:$k,D:qk,C:Vk,L:Wk,m:Gk,X:Xk,S:Yk,M:Kk};function Uk(){var t=ar.f(),n=du();return t||n}function $k(t){var n=io(t);n!==null&&n.tag===5&&n.type==="form"?C1(n):ar.r(t)}var Ho=typeof document>"u"?null:document;function wx(t,n,o){var u=Ho;if(u&&typeof n=="string"&&n){var C=ni(n);C='link[rel="'+t+'"][href="'+C+'"]',typeof o=="string"&&(C+='[crossorigin="'+o+'"]'),Sx.has(C)||(Sx.add(C),t={rel:t,crossOrigin:o,href:n},u.querySelector(C)===null&&(n=u.createElement("link"),cn(n,"link",t),Kt(n),u.head.appendChild(n)))}}function qk(t){ar.D(t),wx("dns-prefetch",t,null)}function Vk(t,n){ar.C(t,n),wx("preconnect",t,n)}function Wk(t,n,o){ar.L(t,n,o);var u=Ho;if(u&&t&&n){var C='link[rel="preload"][as="'+ni(n)+'"]';n==="image"&&o&&o.imageSrcSet?(C+='[imagesrcset="'+ni(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(C+='[imagesizes="'+ni(o.imageSizes)+'"]')):C+='[href="'+ni(t)+'"]';var k=C;switch(n){case"style":k=Fo(t);break;case"script":k=Uo(t)}if(!(ui.has(k)||(t=D({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:t,as:n},o),ui.set(k,t),u.querySelector(C)!==null||n==="style"&&u.querySelector(fl(k))||n==="script"&&u.querySelector(pl(k))))){var N=u.createElement("link");cn(N,"link",t),n==="style"&&(N[lc]=!0,N.onload=N.onerror=function(){Bv(N)}),Kt(N),u.head.appendChild(N)}}}function Gk(t,n){ar.m(t,n);var o=Ho;if(o&&t){var u=n&&typeof n.as=="string"?n.as:"script",C='link[rel="modulepreload"][as="'+ni(u)+'"][href="'+ni(t)+'"]',k=C;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Uo(t)}if(!ui.has(k)&&(t=D({rel:"modulepreload",href:t},n),ui.set(k,t),o.querySelector(C)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(pl(k)))return}u=o.createElement("link"),cn(u,"link",t),Kt(u),o.head.appendChild(u)}}}function Yk(t,n,o){ar.S(t,n,o);var u=Ho;if(u&&t){var C=ro(u).hoistableStyles,k=Fo(t);n=n||"default";var N=C.get(k);if(!N){var q={loading:0,preload:null};if(N=u.querySelector(fl(k)))q.loading=5;else{t=D({rel:"stylesheet",href:t,"data-precedence":n},o),(o=ui.get(k))&&gp(t,o);var J=N=u.createElement("link");Kt(J),cn(J,"link",t),J._p=new Promise(function(se,de){J.onload=se,J.onerror=de}),J.addEventListener("load",function(){q.loading|=1}),J.addEventListener("error",function(){q.loading|=2}),q.loading|=4,xu(N,n,u)}N={type:"stylesheet",instance:N,count:1,state:q},C.set(k,N)}}}function Xk(t,n){ar.X(t,n);var o=Ho;if(o&&t){var u=ro(o).hoistableScripts,C=Uo(t),k=u.get(C);k||(k=o.querySelector(pl(C)),k||(t=D({src:t,async:!0},n),(n=ui.get(C))&&vp(t,n),k=o.createElement("script"),Kt(k),cn(k,"link",t),o.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},u.set(C,k))}}function Kk(t,n){ar.M(t,n);var o=Ho;if(o&&t){var u=ro(o).hoistableScripts,C=Uo(t),k=u.get(C);k||(k=o.querySelector(pl(C)),k||(t=D({src:t,async:!0,type:"module"},n),(n=ui.get(C))&&vp(t,n),k=o.createElement("script"),Kt(k),cn(k,"link",t),o.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},u.set(C,k))}}function Cx(t,n,o,u){var C=(C=Be.current)?dl(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=Fo(o.href),n=ro(C).hoistableStyles,u=n.get(o),u||(u={type:"style",instance:null,count:0,state:null},n.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Fo(o.href);var k=ro(C).hoistableStyles,N=k.get(t);if(N||(C=C.ownerDocument||C,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(t,N),(k=C.querySelector(fl(t)))?k._p||(N.instance=k,N.state.loading=5):(k=ui.get(t),k||(k={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ui.set(t,k)),Qk(C,t,k,N.state))),n&&u===null)throw Error(s(528,""));return N}if(n&&u!==null)throw Error(s(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(o=Uo(o),n=ro(C).hoistableScripts,u=n.get(o),u||(u={type:"script",instance:null,count:0,state:null},n.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Fo(t){return'href="'+ni(t)+'"'}function fl(t){return'link[rel="stylesheet"]['+t+"]"}function Ex(t){return D({},t,{"data-precedence":t.precedence,precedence:null})}function Qk(t,n,o,u){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[lc]!==!0){u.loading=1;return}}else n=t.createElement("link"),n[lc]=!0,n.onload=n.onerror=Bv.bind(null,n),cn(n,"link",o),Kt(n),t.head.appendChild(n);u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2})}function Uo(t){return'[src="'+ni(t)+'"]'}function pl(t){return"script[async]"+t}function kx(t,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+ni(o.href)+'"]');if(u)return n.instance=u,Kt(u),u;var C=D({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),Kt(u),cn(u,"style",C),xu(u,o.precedence,t),n.instance=u;case"stylesheet":C=Fo(o.href);var k=t.querySelector(fl(C));if(k)return n.state.loading|=4,n.instance=k,Kt(k),k;u=Ex(o),(C=ui.get(C))&&gp(u,C),k=(t.ownerDocument||t).createElement("link"),Kt(k);var N=k;return N._p=new Promise(function(q,J){N.onload=q,N.onerror=J}),cn(k,"link",u),n.state.loading|=4,xu(k,o.precedence,t),n.instance=k;case"script":return k=Uo(o.src),(C=t.querySelector(pl(k)))?(n.instance=C,Kt(C),C):(u=o,(C=ui.get(k))&&(u=D({},o),vp(u,C)),t=t.ownerDocument||t,C=t.createElement("script"),Kt(C),cn(C,"link",u),t.head.appendChild(C),n.instance=C);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,xu(u,o.precedence,t));return n.instance}function xu(t,n,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=u.length?u[u.length-1]:null,k=C,N=0;N<u.length;N++){var q=u[N];if(q.dataset.precedence===n)k=q;else if(k!==C)break}k?k.parentNode.insertBefore(t,k.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(t,n.firstChild))}function gp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function vp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var yu=null;function Tx(t,n,o){if(yu===null){var u=new Map,C=yu=new Map;C.set(o,u)}else C=yu,u=C.get(o),u||(u=new Map,C.set(o,u));if(u.has(t))return u;for(u.set(t,null),o=o.getElementsByTagName(t),C=0;C<o.length;C++){var k=o[C];if(!(k[Aa]||k[rn]||t==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var N=k.getAttribute(n)||"";N=t+N;var q=u.get(N);q?q.push(k):u.set(N,[k])}}return u}function _p(t,n,o){t=t.ownerDocument||t,t.head.insertBefore(o,n==="title"?t.querySelector("head > title"):null)}function Zk(t,n,o){if(o===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Rx(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Ax(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Lx(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Dx(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Lx(n),t.suspenseyImages.push(n)),t=t3.bind(t),n.decode().then(t,t))}function Jk(t,n,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var C=Fo(u.href),k=n.querySelector(fl(C));if(k){n=k._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ml.bind(t),n.then(t,t)),o.state.loading|=4,o.instance=k,Kt(k);return}k=n.ownerDocument||n,u=Ex(u),(C=ui.get(C))&&gp(u,C),k=k.createElement("link"),Kt(k);var N=k;N._p=new Promise(function(q,J){N.onload=q,N.onerror=J}),cn(k,"link",u),o.instance=k}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(o,n),(n=o.state.preload)&&(o.state.loading&3)===0&&(t.count++,o=ml.bind(t),n.addEventListener("load",o),n.addEventListener("error",o))}}var bu=0;function e3(t,n){return t.stylesheets&&t.count===0&&wu(t,t.stylesheets),0<t.count||0<t.imgCount?function(o){var u=setTimeout(function(){if(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend){var k=t.unsuspend;t.unsuspend=null,k()}},6e4+n);0<t.imgBytes&&bu===0&&(bu=62500*_k());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend)){var k=t.unsuspend;t.unsuspend=null,k()}},(t.imgBytes>bu?50:800)+n);return t.unsuspend=o,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(C)}}:null}function Mx(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)wu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function ml(){this.count--,Mx(this)}function t3(){this.imgCount--,Mx(this)}var Su=null;function wu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Su=new Map,n.forEach(n3,t),Su=null,ml.call(t))}function n3(t,n){if(!(n.state.loading&4)){var o=Su.get(t);if(o)var u=o.get(null);else{o=new Map,Su.set(t,o);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<C.length;k++){var N=C[k];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(o.set(N.dataset.precedence,N),u=N)}u&&o.set(null,u)}C=n.instance,N=C.getAttribute("data-precedence"),k=o.get(N)||u,k===u&&o.set(null,C),o.set(N,C),this.count++,u=ml.bind(this),C.addEventListener("load",u),C.addEventListener("error",u),k?k.parentNode.insertBefore(C,k.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),n.state.loading|=4}}var $o={$$typeof:W,Provider:null,Consumer:null,_currentValue:we,_currentValue2:we,_threadCount:0};function i3(t,n,o,u,C,k,N,q,J){this.tag=1,this.containerInfo=t,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=Qh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.hiddenUpdates=Qh(null),this.identifierPrefix=u,this.onUncaughtError=C,this.onCaughtError=k,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.transitionTypes=null,this.incompleteTransitions=new Map}function jx(t,n,o,u,C,k,N,q,J,se,de,me){return t=new i3(t,n,o,N,J,se,de,me,q),n=1,k===!0&&(n|=24),k=Rn(3,null,null,n),t.current=k,k.stateNode=t,n=Md(),n.refCount++,t.pooledCache=n,n.refCount++,k.memoizedState={element:u,isDehydrated:o,cache:n},Bd(k),t}function Ox(t){return t?(t=mo,t):mo}function Nx(t,n,o,u,C,k){C=Ox(C),u.context===null?u.context=C:u.pendingContext=C,u=Br(n),u.payload={element:o},k=k===void 0?null:k,k!==null&&(u.callback=k),o=Pr(t,u,n),o!==null&&(Mn(o,t,n),Wa(o,t,n))}function Bx(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<n?o:n}}function xp(t,n){Bx(t,n),(t=t.alternate)&&Bx(t,n)}function Px(t){if(t.tag===13||t.tag===31){var n=bs(t,67108864);n!==null&&Mn(n,t,67108864),xp(t,67108864)}}function Ix(t){if(t.tag===13||t.tag===31){var n=Gn();n=Zh(n);var o=bs(t,n);o!==null&&Mn(o,t,n),xp(t,n)}}var qo=!0;function r3(t,n,o,u){var C=ue.T;ue.T=null;var k=he.p;try{he.p=2,yp(t,n,o,u)}finally{he.p=k,ue.T=C}}function s3(t,n,o,u){var C=ue.T;ue.T=null;var k=he.p;try{he.p=8,yp(t,n,o,u)}finally{he.p=k,ue.T=C}}function yp(t,n,o,u){if(qo){var C=bp(u);if(C===null)tp(t,n,u,Cu,o),Hx(t,u);else if(a3(C,t,n,o,u))u.stopPropagation();else if(Hx(t,u),n&4&&-1<o3.indexOf(t)){for(;C!==null;){var k=io(C);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var N=gs(k.pendingLanes);if(N!==0){var q=k;for(q.pendingLanes|=2,q.entangledLanes|=2;N;){var J=1<<31-Hn(N);q.entanglements[1]|=J,N&=~J}Ni(k),(lt&6)===0&&(cu=Vt()+500,ll(0))}}break;case 31:case 13:q=bs(k,2),q!==null&&Mn(q,k,2),du(),xp(k,2)}if(k=bp(u),k===null&&tp(t,n,u,Cu,o),k===C)break;C=k}C!==null&&u.stopPropagation()}else tp(t,n,u,null,o)}}function bp(t){return t=sd(t),Sp(t)}var Cu=null;function Sp(t){if(Cu=null,t=vs(t),t!==null){var n=f(t);if(n===null)t=null;else{var o=n.tag;if(o===13){if(t=p(n),t!==null)return t;t=null}else if(o===31){if(t=a(n),t!==null)return t;t=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Cu=t,null}function zx(t){switch(t){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wt()){case ti:return 2;case _n:return 8;case to:case x5:return 32;case kv:return 268435456;default:return 32}default:return 32}}var wp=!1,Xr=null,Kr=null,Qr=null,gl=new Map,vl=new Map,Zr=[],o3="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 Hx(t,n){switch(t){case"focusin":case"focusout":Xr=null;break;case"dragenter":case"dragleave":Kr=null;break;case"mouseover":case"mouseout":Qr=null;break;case"pointerover":case"pointerout":gl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":vl.delete(n.pointerId)}}function _l(t,n,o,u,C,k){return t===null||t.nativeEvent!==k?(t={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:k,targetContainers:[C]},n!==null&&(n=io(n),n!==null&&Px(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,C!==null&&n.indexOf(C)===-1&&n.push(C),t)}function a3(t,n,o,u,C){switch(n){case"focusin":return Xr=_l(Xr,t,n,o,u,C),!0;case"dragenter":return Kr=_l(Kr,t,n,o,u,C),!0;case"mouseover":return Qr=_l(Qr,t,n,o,u,C),!0;case"pointerover":var k=C.pointerId;return gl.set(k,_l(gl.get(k)||null,t,n,o,u,C)),!0;case"gotpointercapture":return k=C.pointerId,vl.set(k,_l(vl.get(k)||null,t,n,o,u,C)),!0}return!1}function Fx(t){var n=vs(t.target);if(n!==null){var o=f(n);if(o!==null){if(n=o.tag,n===13){if(n=p(o),n!==null){t.blockedOn=n,jv(t.priority,function(){Ix(o)});return}}else if(n===31){if(n=a(o),n!==null){t.blockedOn=n,jv(t.priority,function(){Ix(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Eu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var o=bp(t.nativeEvent);if(o===null){o=t.nativeEvent;var u=new o.constructor(o.type,o);rd=u,o.target.dispatchEvent(u),rd=null}else return n=io(o),n!==null&&Px(n),t.blockedOn=o,!1;n.shift()}return!0}function Ux(t,n,o){Eu(t)&&o.delete(n)}function l3(){wp=!1,Xr!==null&&Eu(Xr)&&(Xr=null),Kr!==null&&Eu(Kr)&&(Kr=null),Qr!==null&&Eu(Qr)&&(Qr=null),gl.forEach(Ux),vl.forEach(Ux)}function ku(t,n){t.blockedOn===n&&(t.blockedOn=null,wp||(wp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l3)))}var Tu=null;function $x(t){Tu!==t&&(Tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tu===t&&(Tu=null);for(var n=0;n<t.length;n+=3){var o=t[n],u=t[n+1],C=t[n+2];if(typeof u!="function"){if(Sp(u||o)===null)continue;break}var k=io(o);k!==null&&(t.splice(n,3),n-=3,rf(k,{pending:!0,data:C,method:o.method,action:u},u,C))}}))}function Vo(t){function n(J){return ku(J,t)}Xr!==null&&ku(Xr,t),Kr!==null&&ku(Kr,t),Qr!==null&&ku(Qr,t),gl.forEach(n),vl.forEach(n);for(var o=0;o<Zr.length;o++){var u=Zr[o];u.blockedOn===t&&(u.blockedOn=null)}for(;0<Zr.length&&(o=Zr[0],o.blockedOn===null);)Fx(o),o.blockedOn===null&&Zr.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var C=o[u],k=o[u+1],N=C[Tn]||null;if(typeof k=="function")N||$x(o);else if(N){var q=null;if(k&&k.hasAttribute("formAction")){if(C=k,N=k[Tn]||null)q=N.formAction;else if(Sp(C)!==null)continue}else q=N.action;typeof q=="function"?o[u+1]=q:(o.splice(u,3),u-=3),$x(o)}}}function qx(){function t(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(N){return C=N})},focusReset:"manual",scroll:"manual"})}function n(){C!==null&&(C(),C=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),C!==null&&(C(),C=null)}}}function Cp(t){this._internalRoot=t}Ru.prototype.render=Cp.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var o=n.current,u=Gn();Nx(o,u,t,n,null,null)},Ru.prototype.unmount=Cp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Nx(t.current,2,null,t,null,null),du(),n[no]=null}};function Ru(t){this._internalRoot=t}Ru.prototype.unstable_scheduleHydration=function(t){if(t){var n=Mv();t={blockedOn:null,target:t,priority:n};for(var o=0;o<Zr.length&&n!==0&&n<Zr[o].priority;o++);Zr.splice(o,0,t),o===0&&Fx(t)}};var Vx=i.version;if(Vx!=="19.3.1")throw Error(s(527,Vx,"19.3.1"));he.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(n),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var c3={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ue,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Au.isDisabled&&Au.supportsFiber)try{ka=Au.inject(c3),zn=Au}catch{}}return yl.createRoot=function(t,n){if(!l(t))throw Error(s(299));var o=!1,u="",C=O1,k=N1,N=B1;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(C=n.onUncaughtError),n.onCaughtError!==void 0&&(k=n.onCaughtError),n.onRecoverableError!==void 0&&(N=n.onRecoverableError)),n=jx(t,1,!1,null,null,o,u,null,C,k,N,qx),t[no]=n.current,ep(t),new Cp(n)},yl.hydrateRoot=function(t,n,o){if(!l(t))throw Error(s(299));var u=!1,C="",k=O1,N=N1,q=B1,J=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(C=o.identifierPrefix),o.onUncaughtError!==void 0&&(k=o.onUncaughtError),o.onCaughtError!==void 0&&(N=o.onCaughtError),o.onRecoverableError!==void 0&&(q=o.onRecoverableError),o.formState!==void 0&&(J=o.formState)),n=jx(t,1,!0,n,o??null,u,C,J,k,N,q,qx),n.context=Ox(null),o=n.current,u=Gn(),u=Zh(u),C=Br(u),C.callback=null,Pr(o,C,u),o=u,n.current.lanes=o,Ra(n,o),Ni(n),t[no]=n.current,ep(t),new Ru(n)},yl.version="19.3.1",yl}var ry;function x3(){if(ry)return Rp.exports;ry=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Rp.exports=_3(),Rp.exports}var y3=x3();/**
49
+ `+u.stack}}var qt=Object.prototype.hasOwnProperty,kn=e.unstable_scheduleCallback,Jn=e.unstable_cancelCallback,ei=e.unstable_shouldYield,to=e.unstable_requestPaint,Vt=e.unstable_now,Wt=e.unstable_getCurrentPriorityLevel,ti=e.unstable_ImmediatePriority,xn=e.unstable_UserBlockingPriority,no=e.unstable_NormalPriority,x5=e.unstable_LowPriority,kv=e.unstable_IdlePriority,y5=e.log,b5=e.unstable_setDisableYieldValue,ka=null,zn=null;function Tr(t){if(typeof y5=="function"&&b5(t),zn&&typeof zn.setStrictMode=="function")try{zn.setStrictMode(ka,t)}catch{}}var Hn=Math.clz32?Math.clz32:C5,S5=Math.log,w5=Math.LN2;function C5(t){return t>>>=0,t===0?32:31-(S5(t)/w5|0)|0}var rc=256,sc=262144,oc=4194304;function gs(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ac(t,n,o){var u=t.pendingLanes;if(u===0)return 0;var C=0,k=t.suspendedLanes,N=t.pingedLanes;t=t.warmLanes;var q=u&134217727;return q!==0?(u=q&~k,u!==0?C=gs(u):(N&=q,N!==0?C=gs(N):o||(o=q&~t,o!==0&&(C=gs(o))))):(q=u&~k,q!==0?C=gs(q):N!==0?C=gs(N):o||(o=u&~t,o!==0&&(C=gs(o)))),C===0?0:n!==0&&n!==C&&(n&k)===0&&(k=C&-C,o=n&-n,k>=o||k===32&&(o&4194048)!==0)?n:C}function Ta(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Tv(t,n){(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var u=31-Hn(o),C=1<<u;n|=t[u],o&=~C}return n}function E5(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Rv(){var t=oc;return oc<<=1,(oc&62914560)===0&&(oc=4194304),t}function Qh(t){for(var n=[],o=0;31>o;o++)n.push(t);return n}function Ra(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function k5(t,n,o,u,C,k){var N=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var q=t.entanglements,J=t.expirationTimes,se=t.hiddenUpdates;for(o=N&~o;0<o;){var de=31-Hn(o),me=1<<de;q[de]=0,J[de]=-1;var ie=se[de];if(ie!==null)for(se[de]=null,de=0;de<ie.length;de++){var ce=ie[de];ce!==null&&(ce.lane&=-536870913)}o&=~me}u!==0&&Av(t,u,0),k!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=k&~(N&~n))}function Av(t,n,o){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-Hn(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|o&261930}function Lv(t,n){var o=t.entangledLanes|=n;for(t=t.entanglements;o;){var u=31-Hn(o),C=1<<u;C&n|t[u]&n&&(t[u]|=n),o&=~C}}function Dv(t,n){var o=n&-n;return o=(o&42)!==0?1:Zh(o),(o&(t.suspendedLanes|n))!==0?0:o}function Zh(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Jh(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Mv(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:zx(t.type))}function jv(t,n){var o=he.p;try{return he.p=t,n()}finally{he.p=o}}var Gi=Math.random().toString(36).slice(2),rn="__reactFiber$"+Gi,Tn="__reactProps$"+Gi,io="__reactContainer$"+Gi,Ov="__reactEvents$"+Gi,T5="__reactListeners$"+Gi,R5="__reactHandles$"+Gi,Nv="__reactResources$"+Gi,Aa="__reactMarker$"+Gi,lc="__reactLoad$"+Gi;function cc(t){delete t[rn],delete t[Tn],delete t[T5],delete t[R5]}function vs(t){var n;if(n=t[rn])return n;for(var o=t.parentNode;o;){if(n=o[io]||o[rn]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(t=xx(t);t!==null;){if(o=t[rn])return o;t=xx(t)}return n}t=o,o=t.parentNode}return null}function ro(t){if(t=t[rn]||t[io]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function La(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function so(t){var n=t[Nv];return n||(n=t[Nv]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(t){t[Aa]=!0}function Bv(t){t[lc]=void 0}var Pv=new Set,Iv={};function _s(t,n){oo(t,n),oo(t+"Capture",n)}function oo(t,n){for(Iv[t]=n,t=0;t<n.length;t++)Pv.add(n[t])}var A5=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]*$"),zv={},Hv={};function L5(t){return qt.call(Hv,t)?!0:qt.call(zv,t)?!1:A5.test(t)?Hv[t]=!0:(zv[t]=!0,!1)}var ot=!1;function Fv(){var t=ot;return ot=!1,t}function uc(t,n,o){if(L5(n))if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,o)}}function hc(t,n,o){if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,o)}}function Yi(t,n,o,u){if(u===null)t.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(n,o,u)}}function Fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Uv(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function D5(t,n,o){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var C=u.get,k=u.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return C.call(this)},set:function(N){o=""+N,k.call(this,N)}}),Object.defineProperty(t,n,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(N){o=""+N},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ed(t){if(!t._valueTracker){var n=Uv(t)?"checked":"value";t._valueTracker=D5(t,n,""+t[n])}}function $v(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return t&&(u=Uv(t)?t.checked?"true":"false":t.value),t=u,t!==o?(n.setValue(t),!0):!1}var M5=/[\n"\\]/g;function ni(t){return t.replace(M5,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function td(t,n,o,u,C,k,N,q){t.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.type=N:t.removeAttribute("type"),n!=null?N==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Fn(n)):t.value!==""+Fn(n)&&(t.value=""+Fn(n)):N!=="submit"&&N!=="reset"||t.removeAttribute("value"),n!=null?N==="number"&&t.value==n?nd(t,Fn(t.value)):nd(t,Fn(n)):o!=null?nd(t,Fn(o)):u!=null&&t.removeAttribute("value"),C==null&&k!=null&&(t.defaultChecked=!!k),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?t.name=""+Fn(q):t.removeAttribute("name")}function qv(t,n,o,u,C,k,N,q){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.type=k),n!=null||o!=null){if(!(k!=="submit"&&k!=="reset"||n!=null)){ed(t);return}o=o!=null?""+Fn(o):"",n=n!=null?""+Fn(n):o,q||n===t.value||(t.value=n),t.defaultValue=n}u=u??C,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=q?t.checked:!!u,t.defaultChecked=!!u,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(t.name=N),ed(t)}function nd(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function ao(t,n,o,u){if(t=t.options,n){n={};for(var C=0;C<o.length;C++)n["$"+o[C]]=!0;for(o=0;o<t.length;o++)C=n.hasOwnProperty("$"+t[o].value),t[o].selected!==C&&(t[o].selected=C),C&&u&&(t[o].defaultSelected=!0)}else{for(o=""+Fn(o),n=null,C=0;C<t.length;C++){if(t[C].value===o){t[C].selected=!0,u&&(t[C].defaultSelected=!0);return}n!==null||t[C].disabled||(n=t[C])}n!==null&&(n.selected=!0)}}function Vv(t,n,o){if(n!=null&&(n=""+Fn(n),n!==t.value&&(t.value=n),o==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=o!=null?""+Fn(o):""}function Wv(t,n,o,u){if(n==null){if(u!=null){if(o!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}o=u}o==null&&(o=""),n=o}o=Fn(n),t.defaultValue=o,u=t.textContent,u===o&&u!==""&&u!==null&&(t.value=u),ed(t)}function lo(t,n){if(n){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=n;return}}t.textContent=n}var j5=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 Gv(t,n,o){var u=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,o):typeof o!="number"||o===0||j5.has(n)?n==="float"?t.cssFloat=o:t[n]=(""+o).trim():t[n]=o+"px"}function Yv(t,n,o){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="",ot=!0);for(var C in n)u=n[C],n.hasOwnProperty(C)&&o[C]!==u&&(Gv(t,C,u),ot=!0)}else for(var k in n)n.hasOwnProperty(k)&&Gv(t,k,n[k])}function id(t){if(t.indexOf("-")===-1)return!1;switch(t){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 O5=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"],["maskType","mask-type"],["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"]]),N5=/^[\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 dc(t){return N5.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ei(){}var rd=null;function sd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var co=null,uo=null;function Xv(t){var n=ro(t);if(n&&(t=n.stateNode)){var o=t[Tn]||null;e:switch(t=n.stateNode,n.type){case"input":if(td(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+ni(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==t&&u.form===t.form){var C=u[Tn]||null;if(!C)throw Error(s(90));td(u,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(n=0;n<o.length;n++)u=o[n],u.form===t.form&&$v(u)}break e;case"textarea":Vv(t,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&ao(t,!!o.multiple,n,!1)}}}var od=!1;function Kv(t,n,o){if(od)return t(n,o);od=!0;try{var u=t(n);return u}finally{if(od=!1,(co!==null||uo!==null)&&(du(),co&&(n=co,t=uo,uo=co=null,Xv(n),t)))for(n=0;n<t.length;n++)Xv(t[n])}}function Da(t,n){var o=t.stateNode;if(o===null)return null;var u=o[Tn]||null;if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(s(231,n,typeof o));return o}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ad=!1;if(Xi)try{var Ma={};Object.defineProperty(Ma,"passive",{get:function(){ad=!0}}),window.addEventListener("test",Ma,Ma),window.removeEventListener("test",Ma,Ma)}catch{ad=!1}var Rr=null,ld=null,fc=null;function Qv(){if(fc)return fc;var t,n=ld,o=n.length,u,C="value"in Rr?Rr.value:Rr.textContent,k=C.length;for(t=0;t<o&&n[t]===C[t];t++);var N=o-t;for(u=1;u<=N&&n[o-u]===C[k-u];u++);return fc=C.slice(t,1<u?1-u:void 0)}function pc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function mc(){return!0}function Zv(){return!1}function yn(t){function n(o,u,C,k,N){this._reactName=o,this._targetInst=C,this.type=u,this.nativeEvent=k,this.target=N,this.currentTarget=null;for(var q in t)t.hasOwnProperty(q)&&(o=t[q],this[q]=o?o(k):k[q]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?mc:Zv,this.isPropagationStopped=Zv,this}return D(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mc)},persist:function(){},isPersistent:mc}),n}var Ar={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gc=yn(Ar),ja=D({},Ar,{view:0,detail:0}),B5=yn(ja),cd,ud,Oa,vc=D({},ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Oa&&(Oa&&t.type==="mousemove"?(cd=t.screenX-Oa.screenX,ud=t.screenY-Oa.screenY):ud=cd=0,Oa=t),cd)},movementY:function(t){return"movementY"in t?t.movementY:ud}}),Jv=yn(vc),P5=D({},vc,{dataTransfer:0}),I5=yn(P5),z5=D({},ja,{relatedTarget:0}),hd=yn(z5),H5=D({},Ar,{animationName:0,elapsedTime:0,pseudoElement:0}),F5=yn(H5),U5=D({},Ar,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),$5=yn(U5),q5=D({},Ar,{data:0}),e_=yn(q5),V5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W5={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"},G5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y5(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=G5[t])?!!n[t]:!1}function dd(){return Y5}var X5=D({},ja,{key:function(t){if(t.key){var n=V5[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=pc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?W5[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dd,charCode:function(t){return t.type==="keypress"?pc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),K5=yn(X5),Q5=D({},vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),t_=yn(Q5),Z5=D({},Ar,{submitter:0}),J5=yn(Z5),eE=D({},ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dd}),tE=yn(eE),nE=D({},Ar,{propertyName:0,elapsedTime:0,pseudoElement:0}),iE=yn(nE),rE=D({},vc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),sE=yn(rE),oE=D({},Ar,{newState:0,oldState:0,source:0}),aE=yn(oE),lE=[9,13,27,32],fd=Xi&&"CompositionEvent"in window,Na=null;Xi&&"documentMode"in document&&(Na=document.documentMode);var cE=Xi&&"TextEvent"in window&&!Na,n_=Xi&&(!fd||Na&&8<Na&&11>=Na),i_=" ",r_=!1;function s_(t,n){switch(t){case"keyup":return lE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function o_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ho=!1;function uE(t,n){switch(t){case"compositionend":return o_(n);case"keypress":return n.which!==32?null:(r_=!0,i_);case"textInput":return t=n.data,t===i_&&r_?null:t;default:return null}}function hE(t,n){if(ho)return t==="compositionend"||!fd&&s_(t,n)?(t=Qv(),fc=ld=Rr=null,ho=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return n_&&n.locale!=="ko"?null:n.data;default:return null}}var dE={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 a_(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!dE[t.type]:n==="textarea"}function l_(t,n,o,u){co?uo?uo.push(u):uo=[u]:co=u,n=_u(n,"onChange"),0<n.length&&(o=new gc("onChange","change",null,o,u),t.push({event:o,listeners:n}))}var Ba=null,Pa=null;function fE(t){X0(t,0)}function _c(t){var n=La(t);if($v(n))return t}function c_(t,n){if(t==="change")return n}var u_=!1;if(Xi){var pd;if(Xi){var md="oninput"in document;if(!md){var h_=document.createElement("div");h_.setAttribute("oninput","return;"),md=typeof h_.oninput=="function"}pd=md}else pd=!1;u_=pd&&(!document.documentMode||9<document.documentMode)}function d_(){Ba&&(Ba.detachEvent("onpropertychange",f_),Pa=Ba=null)}function f_(t){if(t.propertyName==="value"&&_c(Pa)){var n=[];l_(n,Pa,t,sd(t)),Kv(fE,n)}}function pE(t,n,o){t==="focusin"?(d_(),Ba=n,Pa=o,Ba.attachEvent("onpropertychange",f_)):t==="focusout"&&d_()}function mE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return _c(Pa)}function gE(t,n){if(t==="click")return _c(n)}function vE(t,n){if(t==="input"||t==="change")return _c(n)}function _E(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Un=typeof Object.is=="function"?Object.is:_E;function Ia(t,n){if(Un(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var o=Object.keys(t),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var C=o[u];if(!qt.call(n,C)||!Un(t[C],n[C]))return!1}return!0}function gd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function p_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function m_(t,n){var o=p_(t);t=0;for(var u;o;){if(o.nodeType===3){if(u=t+o.textContent.length,t<=n&&u>=n)return{node:o,offset:n-t};t=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=p_(o)}}function g_(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?g_(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function v_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=gd(t.document);n instanceof t.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)t=n.contentWindow;else break;n=gd(t.document)}return n}function vd(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var xE=Xi&&"documentMode"in document&&11>=document.documentMode,fo=null,_d=null,za=null,xd=!1;function __(t,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;xd||fo==null||fo!==gd(u)||(u=fo,"selectionStart"in u&&vd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),za&&Ia(za,u)||(za=u,u=_u(_d,"onSelect"),0<u.length&&(n=new gc("onSelect","select",null,n,o),t.push({event:n,listeners:u}),n.target=fo)))}function xs(t,n){var o={};return o[t.toLowerCase()]=n.toLowerCase(),o["Webkit"+t]="webkit"+n,o["Moz"+t]="moz"+n,o}var po={animationend:xs("Animation","AnimationEnd"),animationiteration:xs("Animation","AnimationIteration"),animationstart:xs("Animation","AnimationStart"),transitionrun:xs("Transition","TransitionRun"),transitionstart:xs("Transition","TransitionStart"),transitioncancel:xs("Transition","TransitionCancel"),transitionend:xs("Transition","TransitionEnd")},yd={},x_={};Xi&&(x_=document.createElement("div").style,"AnimationEvent"in window||(delete po.animationend.animation,delete po.animationiteration.animation,delete po.animationstart.animation),"TransitionEvent"in window||delete po.transitionend.transition);function ys(t){if(yd[t])return yd[t];if(!po[t])return t;var n=po[t],o;for(o in n)if(n.hasOwnProperty(o)&&o in x_)return yd[t]=n[o];return t}var y_=ys("animationend"),b_=ys("animationiteration"),S_=ys("animationstart"),yE=ys("transitionrun"),bE=ys("transitionstart"),SE=ys("transitioncancel"),w_=ys("transitionend"),C_=new Map,bd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");bd.push("scrollEnd");function mi(t,n){C_.set(t,n),_s(n,[t])}var wE=0;function Ki(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=xi.identifierPrefix;var o=wE++;return t="_"+t+"t_"+o.toString(32)+"_",n.autoName=t}function E_(t){if(t==null||typeof t=="string")return t;var n=null,o=Oo;if(o!==null)for(var u=0;u<o.length;u++){var C=t[o[u]];if(C!=null){if(C==="none")return"none";n=n==null?C:n+(" "+C)}}return n??t.default}function Qi(t,n){return t=E_(t),n=E_(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var xc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ii=[],mo=0,Sd=0;function yc(){for(var t=mo,n=Sd=mo=0;n<t;){var o=ii[n];ii[n++]=null;var u=ii[n];ii[n++]=null;var C=ii[n];ii[n++]=null;var k=ii[n];if(ii[n++]=null,u!==null&&C!==null){var N=u.pending;N===null?C.next=C:(C.next=N.next,N.next=C),u.pending=C}k!==0&&k_(o,C,k)}}function bc(t,n,o,u){ii[mo++]=t,ii[mo++]=n,ii[mo++]=o,ii[mo++]=u,Sd|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function wd(t,n,o,u){return bc(t,n,o,u),Sc(t)}function bs(t,n){return bc(t,null,null,n),Sc(t)}function k_(t,n,o){t.lanes|=o;var u=t.alternate;u!==null&&(u.lanes|=o);for(var C=!1,k=t.return;k!==null;)k.childLanes|=o,u=k.alternate,u!==null&&(u.childLanes|=o),k.tag===22&&(t=k.stateNode,t===null||t._visibility&1||(C=!0)),t=k,k=k.return;return t.tag===3?(k=t.stateNode,C&&n!==null&&(C=31-Hn(o),t=k.hiddenUpdates,u=t[C],u===null?t[C]=[n]:u.push(n),n.lane=o|536870912),k):null}function Sc(t){if(50<al)throw al=0,hu=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var go={};function CE(t,n,o,u){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(t,n,o,u){return new CE(t,n,o,u)}function Cd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Zi(t,n){var o=t.alternate;return o===null?(o=Rn(t.tag,n,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=n,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&1206910976,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,n=t.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function T_(t,n){t.flags&=1206910978;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,n=o.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function wc(t,n,o,u,C,k){var N=0;if(u=t,typeof u=="function")Cd(u)&&(N=1);else if(typeof u=="string")N=Zk(t,o,Mt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(u){case G:return t=Rn(31,o,n,C),t.elementType=G,t.lanes=k,t;case I:return Ss(o.children,C,k,n);case B:N=8,C|=24;break;case H:return t=Rn(12,o,n,C|2),t.elementType=H,t.lanes=k,t;case Q:return t=Rn(13,o,n,C),t.elementType=Q,t.lanes=k,t;case K:return t=Rn(19,o,n,C),t.elementType=K,t.lanes=k,t;case Z:case V:return t=C|32,t=Rn(30,o,n,t),t.elementType=V,t.lanes=k,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case W:N=10;break e;case U:N=9;break e;case Y:N=11;break e;case z:N=14;break e;case O:N=16,u=null;break e}N=29,o=Error(s(130,t===null?"null":typeof t,"")),u=null}return n=Rn(N,o,n,C),n.elementType=t,n.type=u,n.lanes=k,n}function Ss(t,n,o,u){return t=Rn(7,t,u,n),t.lanes=o,t}function Ed(t,n,o){return t=Rn(6,t,null,n),t.lanes=o,t}function R_(t){var n=Rn(18,null,null,0);return n.stateNode=t,n}function kd(t,n,o){return n=Rn(4,t.children!==null?t.children:[],t.key,n),n.lanes=o,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var A_=new WeakMap;function ri(t,n){if(typeof t=="object"&&t!==null){var o=A_.get(t);return o!==void 0?o:(n={value:t,source:n,stack:Tt(n)},A_.set(t,n),n)}return{value:t,source:n,stack:Tt(n)}}var vo=[],_o=0,Cc=null,Ha=0,si=[],oi=0,Lr=null,ki=1,Ti="";function Ji(t,n){vo[_o++]=Ha,vo[_o++]=Cc,Cc=t,Ha=n}function L_(t,n,o){si[oi++]=ki,si[oi++]=Ti,si[oi++]=Lr,Lr=t;var u=ki;t=Ti;var C=32-Hn(u)-1;u&=~(1<<C),o+=1;var k=32-Hn(n)+C;if(30<k){var N=C-C%5;k=(u&(1<<N)-1).toString(32),u>>=N,C-=N,ki=1<<32-Hn(n)+C|o<<C|u,Ti=k+t}else ki=1<<k|o<<C|u,Ti=t}function Ec(t){t.return!==null&&(Ji(t,1),L_(t,1,0))}function Td(t){for(;t===Cc;)Cc=vo[--_o],vo[_o]=null,Ha=vo[--_o],vo[_o]=null;for(;t===Lr;)Lr=si[--oi],si[oi]=null,Ti=si[--oi],si[oi]=null,ki=si[--oi],si[oi]=null}function D_(t,n){si[oi++]=ki,si[oi++]=Ti,si[oi++]=Lr,ki=n.id,Ti=n.overflow,Lr=t}var Qt=null,bt=null,Xe=!1,Dr=null,ai=!1,Rd=Error(s(519));function Mr(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fa(ri(n,t)),Rd}function M_(t){var n=t.stateNode,o=t.type,u=t.memoizedProps;switch(n[rn]=t,n[Tn]=u,o){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(o=0;o<cl.length;o++)Ze(cl[o],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),qv(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),Wv(n,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||u.suppressHydrationWarning===!0||J0(n.textContent,o)?(u.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),u.onScroll!=null&&Ze("scroll",n),u.onScrollEnd!=null&&Ze("scrollend",n),u.onClick!=null&&(n.onclick=Ei),n=!0):n=!1,n||Mr(t,!0)}function kc(t){for(Qt=t.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:ai=!1;return;case 27:case 3:ai=!0;return;default:Qt=Qt.return}}function xo(t){if(t!==Qt)return!1;if(!Xe)return kc(t),Xe=!0,!1;var n=t.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||sp(t.type,t.memoizedProps)),o=!o),o&&bt&&Mr(t),kc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=_x(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=_x(t)}else n===27?(n=bt,Yr(t.type)?(t=pp,pp=null,bt=t):bt=n):bt=Qt?ci(t.stateNode.nextSibling):null;return!0}function ws(){bt=Qt=null,Xe=!1}function Ad(){var t=Dr;return t!==null&&(Dn===null?Dn=t:Dn.push.apply(Dn,t),Dr=null),t}function Fa(t){Dr===null?Dr=[t]:Dr.push(t)}var Ld=qe(null),Cs=null,er=null;function jr(t,n,o){ze(Ld,n._currentValue),n._currentValue=o}function tr(t){t._currentValue=Ld.current,ke(Ld)}function Tc(t,n,o){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===o)break;t=t.return}}function Dd(t,n,o,u){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var k=C.dependencies;if(k!==null){var N=C.child;k=k.firstContext;e:for(;k!==null;){var q=k;k=C;for(var J=0;J<n.length;J++)if(q.context===n[J]){k.lanes|=o,q=k.alternate,q!==null&&(q.lanes|=o),Tc(k.return,o,t),u||(N=null);break e}k=q.next}}else if(C.tag===18){if(N=C.return,N===null)throw Error(s(341));N.lanes|=o,k=N.alternate,k!==null&&(k.lanes|=o),Tc(N,o,t),N=null}else C.tag===13&&C.memoizedState!==null&&C.memoizedState.dehydrated===null?(C.lanes|=o,N=C.alternate,N!==null&&(N.lanes|=o),Tc(C.return,o,t),N=C.child,N=N!==null?N.sibling:null):N=C.child;if(N!==null)N.return=C;else for(N=C;N!==null;){if(N===t){N=null;break}if(C=N.sibling,C!==null){C.return=N.return,N=C;break}N=N.return}C=N}}function Es(t,n,o,u){t=null;for(var C=n,k=!1;C!==null;){if(!k){if((C.flags&524288)!==0)k=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var N=C.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var q=C.type;Un(C.pendingProps.value,N.value)||(t!==null?t.push(q):t=[q])}}else if(C===Ie.current){if(N=C.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(qo):t=[qo])}C=C.return}return t!==null&&Dd(n,t,o,u),n.flags|=262144,t!==null}function Rc(t){for(t=t.firstContext;t!==null;){if(!Un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ks(t){Cs=t,er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function sn(t){return j_(Cs,t)}function Ac(t,n){return Cs===null&&ks(t),j_(t,n)}function j_(t,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},er===null){if(t===null)throw Error(s(308));er=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else er=er.next=n;return o}var EE=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(o,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(o){return o()})}},kE=e.unstable_scheduleCallback,TE=e.unstable_NormalPriority,Bt={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new EE,data:new Map,refCount:0}}function Ua(t){t.refCount--,t.refCount===0&&kE(TE,function(){t.controller.abort()})}function O_(t,n){if((t.pendingLanes&4194048)!==0){var o=t.transitionTypes;for(o===null&&(o=t.transitionTypes=[]),t=0;t<n.length;t++){var u=n[t];o.indexOf(u)===-1&&o.push(u)}}}var $a=null;function RE(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var qa=null,jd=0,Ts=0,yo=null;function AE(t,n){if(qa===null){var o=qa=[];jd=0,Ts=Kf(),yo={status:"pending",value:void 0,then:function(u){o.push(u)}}}return jd++,n.then(N_,N_),n}function N_(){if(--jd===0&&($a=null,qa!==null)){yo!==null&&(yo.status="fulfilled");var t=qa;qa=null,Ts=0,yo=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function LE(t,n){var o=[],u={status:"pending",value:null,reason:null,then:function(C){o.push(C)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var C=0;C<o.length;C++)(0,o[C])(n)},function(C){for(u.status="rejected",u.reason=C,C=0;C<o.length;C++)(0,o[C])(void 0)}),u}var B_=ue.S;ue.S=function(t,n){if(R0=Vt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&AE(t,n),$a!==null)for(var o=Io;o!==null;)O_(o,$a),o=o.next;if(o=t.types,o!==null){for(var u=Io;u!==null;)O_(u,o),u=u.next;if(Ts!==0){u=$a,u===null&&(u=$a=[]);for(var C=0;C<o.length;C++){var k=o[C];u.indexOf(k)===-1&&u.push(k)}}}B_!==null&&B_(t,n)};var Rs=qe(null);function Od(){var t=Rs.current;return t!==null?t:_t.pooledCache}function Lc(t,n){n===null?ze(Rs,Rs.current):ze(Rs,n.pool)}function P_(){var t=Od();return t===null?null:{parent:Bt._currentValue,pool:t}}var bo=Error(s(460)),Nd=Error(s(474)),Dc=Error(s(542)),Mc={then:function(){}};function I_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function z_(t,n,o){switch(o=t[o],o===void 0?t.push(n):o!==n&&(n.then(Ei,Ei),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,F_(t),t===void 0&&!("reason"in n)?Error(s(600)):t;default:if(typeof n.status=="string")n.then(Ei,Ei);else{if(t=_t,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var C=n;C.status="fulfilled",C.value=u}},function(u){if(n.status==="pending"){var C=n;C.status="rejected",C.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,F_(t),t}throw Ls=n,bo}}function As(t){try{var n=t._init;return n(t._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ls=o,bo):o}}var Ls=null;function H_(){if(Ls===null)throw Error(s(459));var t=Ls;return Ls=null,t}function F_(t){if(t===bo||t===Dc)throw Error(s(483))}var So=null,Va=0;function jc(t){var n=Va;return Va+=1,So===null&&(So=[]),z_(So,t,n)}function Or(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Oc(t,n){throw n.$$typeof===A?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function U_(t){function n(re,te){if(t){var ae=re.deletions;ae===null?(re.deletions=[te],re.flags|=16):ae.push(te)}}function o(re,te){if(!t)return null;for(;te!==null;)n(re,te),te=te.sibling;return null}function u(re){for(var te=new Map;re!==null;)re.key===null?te.set(re.index,re):te.set(re.key,re),re=re.sibling;return te}function C(re,te){return re=Zi(re,te),re.index=0,re.sibling=null,re}function k(re,te,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<te?(re.flags|=2,te):ae):(re.flags|=134217730,te)):(re.flags|=1048576,te)}function N(re){return t&&re.alternate===null&&(re.flags|=134217730),re}function q(re,te,ae,pe){return te===null||te.tag!==6?(te=Ed(ae,re.mode,pe),te.return=re,te):(te=C(te,ae),te.return=re,te)}function J(re,te,ae,pe){var Ae=ae.type;return Ae===I?(re=de(re,te,ae.props.children,pe,ae.key),Or(re,ae),re):te!==null&&(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&As(Ae)===te.type)?(te=C(te,ae.props),Or(te,ae),te.return=re,te):(te=wc(ae.type,ae.key,ae.props,null,re.mode,pe),Or(te,ae),te.return=re,te)}function se(re,te,ae,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=kd(ae,re.mode,pe),te.return=re,te):(te=C(te,ae.children||[]),te.return=re,te)}function de(re,te,ae,pe,Ae){return te===null||te.tag!==7?(te=Ss(ae,re.mode,pe,Ae),te.return=re,te):(te=C(te,ae),te.return=re,te)}function me(re,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Ed(""+te,re.mode,ae),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case j:return ae=wc(te.type,te.key,te.props,null,re.mode,ae),Or(ae,te),ae.return=re,ae;case M:return te=kd(te,re.mode,ae),te.return=re,te;case O:return te=As(te),me(re,te,ae)}if(ee(te)||X(te))return te=Ss(te,re.mode,ae,null),te.return=re,te;if(typeof te.then=="function")return me(re,jc(te),ae);if(te.$$typeof===W)return me(re,Ac(re,te),ae);Oc(re,te)}return null}function ie(re,te,ae,pe){var Ae=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ae!==null?null:q(re,te,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:return ae.key===Ae?J(re,te,ae,pe):null;case M:return ae.key===Ae?se(re,te,ae,pe):null;case O:return ae=As(ae),ie(re,te,ae,pe)}if(ee(ae)||X(ae))return Ae!==null?null:de(re,te,ae,pe,null);if(typeof ae.then=="function")return ie(re,te,jc(ae),pe);if(ae.$$typeof===W)return ie(re,te,Ac(re,ae),pe);Oc(re,ae)}return null}function ce(re,te,ae,pe,Ae){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return re=re.get(ae)||null,q(te,re,""+pe,Ae);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case j:return re=re.get(pe.key===null?ae:pe.key)||null,J(te,re,pe,Ae);case M:return re=re.get(pe.key===null?ae:pe.key)||null,se(te,re,pe,Ae);case O:return pe=As(pe),ce(re,te,ae,pe,Ae)}if(ee(pe)||X(pe))return re=re.get(ae)||null,de(te,re,pe,Ae,null);if(typeof pe.then=="function")return ce(re,te,ae,jc(pe),Ae);if(pe.$$typeof===W)return ce(re,te,ae,Ac(te,pe),Ae);Oc(te,pe)}return null}function Ce(re,te,ae,pe){for(var Ae=null,et=null,Oe=te,Pe=te=0,zt=null;Oe!==null&&Pe<ae.length;Pe++){Oe.index>Pe?(zt=Oe,Oe=null):zt=Oe.sibling;var it=ie(re,Oe,ae[Pe],pe);if(it===null){Oe===null&&(Oe=zt);break}t&&Oe&&it.alternate===null&&n(re,Oe),te=k(it,te,Pe),et===null?Ae=it:et.sibling=it,et=it,Oe=zt}if(Pe===ae.length)return o(re,Oe),Xe&&Ji(re,Pe),Ae;if(Oe===null){for(;Pe<ae.length;Pe++)Oe=me(re,ae[Pe],pe),Oe!==null&&(te=k(Oe,te,Pe),et===null?Ae=Oe:et.sibling=Oe,et=Oe);return Xe&&Ji(re,Pe),Ae}for(Oe=u(Oe);Pe<ae.length;Pe++)zt=ce(Oe,re,Pe,ae[Pe],pe),zt!==null&&(t&&(it=zt.alternate,it!==null&&Oe.delete(it.key===null?Pe:it.key)),te=k(zt,te,Pe),et===null?Ae=zt:et.sibling=zt,et=zt);return t&&Oe.forEach(function(Jr){return n(re,Jr)}),Xe&&Ji(re,Pe),Ae}function je(re,te,ae,pe){if(ae==null)throw Error(s(151));for(var Ae=null,et=null,Oe=te,Pe=te=0,zt=null,it=ae.next();Oe!==null&&!it.done;Pe++,it=ae.next()){Oe.index>Pe?(zt=Oe,Oe=null):zt=Oe.sibling;var Jr=ie(re,Oe,it.value,pe);if(Jr===null){Oe===null&&(Oe=zt);break}t&&Oe&&Jr.alternate===null&&n(re,Oe),te=k(Jr,te,Pe),et===null?Ae=Jr:et.sibling=Jr,et=Jr,Oe=zt}if(it.done)return o(re,Oe),Xe&&Ji(re,Pe),Ae;if(Oe===null){for(;!it.done;Pe++,it=ae.next())it=me(re,it.value,pe),it!==null&&(te=k(it,te,Pe),et===null?Ae=it:et.sibling=it,et=it);return Xe&&Ji(re,Pe),Ae}for(Oe=u(Oe);!it.done;Pe++,it=ae.next())it=ce(Oe,re,Pe,it.value,pe),it!==null&&(t&&(zt=it.alternate,zt!==null&&Oe.delete(zt.key===null?Pe:zt.key)),te=k(it,te,Pe),et===null?Ae=it:et.sibling=it,et=it);return t&&Oe.forEach(function(u3){return n(re,u3)}),Xe&&Ji(re,Pe),Ae}function Ge(re,te,ae,pe){if(typeof ae=="object"&&ae!==null&&ae.type===I&&ae.key===null&&ae.props.ref===void 0&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:e:{for(var Ae=ae.key;te!==null;){if(te.key===Ae){if(Ae=ae.type,Ae===I){if(te.tag===7){o(re,te.sibling),pe=C(te,ae.props.children),Or(pe,ae),pe.return=re,re=pe;break e}}else if(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&As(Ae)===te.type){o(re,te.sibling),pe=C(te,ae.props),Or(pe,ae),pe.return=re,re=pe;break e}o(re,te);break}else n(re,te);te=te.sibling}ae.type===I?(pe=Ss(ae.props.children,re.mode,pe,ae.key),Or(pe,ae),pe.return=re,re=pe):(pe=wc(ae.type,ae.key,ae.props,null,re.mode,pe),Or(pe,ae),pe.return=re,re=pe)}return N(re);case M:e:{for(Ae=ae.key;te!==null;){if(te.key===Ae)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){o(re,te.sibling),pe=C(te,ae.children||[]),pe.return=re,re=pe;break e}else{o(re,te);break}else n(re,te);te=te.sibling}pe=kd(ae,re.mode,pe),pe.return=re,re=pe}return N(re);case O:return ae=As(ae),Ge(re,te,ae,pe)}if(ee(ae))return Ce(re,te,ae,pe);if(X(ae)){if(Ae=X(ae),typeof Ae!="function")throw Error(s(150));return ae=Ae.call(ae),je(re,te,ae,pe)}if(typeof ae.then=="function")return Ge(re,te,jc(ae),pe);if(ae.$$typeof===W)return Ge(re,te,Ac(re,ae),pe);Oc(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(o(re,te.sibling),pe=C(te,ae),pe.return=re,re=pe):(o(re,te),pe=Ed(ae,re.mode,pe),pe.return=re,re=pe),N(re)):o(re,te)}return function(re,te,ae,pe){try{Va=0;var Ae=Ge(re,te,ae,pe);return So=null,Ae}catch(Oe){if(Oe===bo||Oe===Dc)throw Oe;var et=Rn(29,Oe,null,re.mode);return et.lanes=pe,et.return=re,et}finally{}}}var Ds=U_(!0),$_=U_(!1),Nr=!1;function Bd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Br(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(t,n,o){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(lt&2)!==0){var C=u.pending;return C===null?n.next=n:(n.next=C.next,C.next=n),u.pending=n,n=Sc(t),k_(t,null,o),n}return bc(t,u,n,o),Sc(t)}function Wa(t,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,Lv(t,o)}}function Id(t,n){var o=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var C=null,k=null;if(o=o.firstBaseUpdate,o!==null){do{var N={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};k===null?C=k=N:k=k.next=N,o=o.next}while(o!==null);k===null?C=k=n:k=k.next=n}else C=k=n;o={baseState:u.baseState,firstBaseUpdate:C,lastBaseUpdate:k,shared:u.shared,callbacks:u.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=n:t.next=n,o.lastBaseUpdate=n}var zd=!1;function Ga(){if(zd){var t=yo;if(t!==null)throw t}}function Ya(t,n,o,u){zd=!1;var C=t.updateQueue;Nr=!1;var k=C.firstBaseUpdate,N=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,se=J.next;J.next=null,N===null?k=se:N.next=se,N=J;var de=t.alternate;de!==null&&(de=de.updateQueue,q=de.lastBaseUpdate,q!==N&&(q===null?de.firstBaseUpdate=se:q.next=se,de.lastBaseUpdate=J))}if(k!==null){var me=C.baseState;N=0,de=se=J=null,q=k;do{var ie=q.lane&-536870913,ce=ie!==q.lane;if(ce?(Je&ie)===ie:(u&ie)===ie){ie!==0&&ie===Ts&&(zd=!0),de!==null&&(de=de.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ce=t,je=q;ie=n;var Ge=o;switch(je.tag){case 1:if(Ce=je.payload,typeof Ce=="function"){me=Ce.call(Ge,me,ie);break e}me=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=je.payload,ie=typeof Ce=="function"?Ce.call(Ge,me,ie):Ce,ie==null)break e;me=D({},me,ie);break e;case 2:Nr=!0}}ie=q.callback,ie!==null&&(t.flags|=64,ce&&(t.flags|=8192),ce=C.callbacks,ce===null?C.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:q.tag,payload:q.payload,callback:q.callback,next:null},de===null?(se=de=ce,J=me):de=de.next=ce,N|=ie;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;ce=q,q=ce.next,ce.next=null,C.lastBaseUpdate=ce,C.shared.pending=null}}while(!0);de===null&&(J=me),C.baseState=J,C.firstBaseUpdate=se,C.lastBaseUpdate=de,k===null&&(C.shared.lanes=0),qr|=N,t.lanes=N,t.memoizedState=me}}function q_(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function V_(t,n){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)q_(o[t],n)}var Ir=qe(null),Nc=qe(0);function W_(t,n){t=or,ze(Nc,t),ze(Ir,n),or=t|n.baseLanes}function Hd(){ze(Nc,or),ze(Ir,Ir.current)}function Fd(){or=Nc.current,ke(Ir),ke(Nc)}var on=qe(null),mn=null;function zr(t){var n=t.alternate;ze(an,an.current&1),ze(on,t),mn===null&&(n===null||Ir.current!==null||n.memoizedState!==null)&&(mn=t)}function Ud(t){ze(an,an.current),ze(on,t),mn===null&&(mn=t)}function G_(t){t.tag===22?(ze(an,an.current),ze(on,t),mn===null&&(mn=t)):Hr()}function Hr(){ze(an,an.current),ze(on,on.current)}function $n(t){ke(on),mn===t&&(mn=null),ke(an)}var an=qe(0);function Xa(t,n){ze(on,on.current),ze(an,n)}function $d(t){ke(an),ke(on),mn===t&&(mn=null)}function Bc(t){for(var n=t;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||dp(o)||fp(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var nr=0,We=null,vt=null,Pt=null,Pc=!1,wo=!1,Ms=!1,Ic=0,Ka=0,Co=null,DE=0;function At(){throw Error(s(321))}function qd(t,n){if(n===null)return!1;for(var o=0;o<n.length&&o<t.length;o++)if(!Un(t[o],n[o]))return!1;return!0}function Vd(t,n,o,u,C,k){return nr=k,We=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ue.H=t===null||t.memoizedState===null?L1:D1,Ms=!1,k=o(u,C),Ms=!1,wo&&(k=X_(n,o,u,C)),Y_(t),k}function Y_(t){ue.H=Vc;var n=vt!==null&&vt.next!==null;if(nr=0,Pt=vt=We=null,Pc=!1,Ka=0,Co=null,n)throw Error(s(300));t===null||It||(t=t.dependencies,t!==null&&Rc(t)&&(It=!0))}function X_(t,n,o,u){We=t;var C=0;do{if(wo&&(Co=null),Ka=0,wo=!1,25<=C)throw Error(s(301));if(C+=1,Pt=vt=null,t.updateQueue!=null){var k=t.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}ue.H=zE,k=n(o,u)}while(wo);return k}function ME(){var t=ue.H,n=t.useState()[0];return n=typeof n.then=="function"?Qa(n):n,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(We.flags|=1024),n}function Wd(){var t=Ic!==0;return Ic=0,t}function Gd(t,n,o){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~o}function Yd(t){if(Pc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Pc=!1}nr=0,Pt=vt=We=null,wo=!1,Ka=Ic=0,Co=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?We.memoizedState=Pt=t:Pt=Pt.next=t,Pt}function jt(){if(vt===null){var t=We.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var n=Pt===null?We.memoizedState:Pt.next;if(n!==null)Pt=n,vt=t;else{if(t===null)throw We.alternate===null?Error(s(467)):Error(s(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Pt===null?We.memoizedState=Pt=t:Pt=Pt.next=t}return Pt}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qa(t){var n=Ka;return Ka+=1,Co===null&&(Co=[]),t=z_(Co,t,n),n=We,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,ue.H=n===null||n.memoizedState===null?L1:D1),t}function Hc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Qa(t);if(t.$$typeof===ne)return;if(t.$$typeof===W)return sn(t)}throw Error(s(438,String(t)))}function Xd(t){var n=null,o=We.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var u=We.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(C){return C.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=zc(),We.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(t),u=0;u<t;u++)o[u]=F;return n.index++,o}function ir(t,n){return typeof n=="function"?n(t):n}function Fc(t){var n=jt();return Kd(n,vt,t)}function Kd(t,n,o){var u=t.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=o;var C=t.baseQueue,k=u.pending;if(k!==null){if(C!==null){var N=C.next;C.next=k.next,k.next=N}n.baseQueue=C=k,u.pending=null}if(k=t.baseState,C===null)t.memoizedState=k;else{n=C.next;var q=N=null,J=null,se=n,de=!1;do{var me=se.lane&-536870913;if(me!==se.lane?(Je&me)===me:(nr&me)===me){var ie=se.revertLane;if(ie===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),me===Ts&&(de=!0);else if((nr&ie)===ie){se=se.next,ie===Ts&&(de=!0);continue}else me={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=me,N=k):J=J.next=me,We.lanes|=ie,qr|=ie;me=se.action,Ms&&o(k,me),k=se.hasEagerState?se.eagerState:o(k,me)}else ie={lane:me,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=ie,N=k):J=J.next=ie,We.lanes|=me,qr|=me;se=se.next}while(se!==null&&se!==n);if(J===null?N=k:J.next=q,!Un(k,t.memoizedState)&&(It=!0,de&&(o=yo,o!==null)))throw o;t.memoizedState=k,t.baseState=N,t.baseQueue=J,u.lastRenderedState=k}return C===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Qd(t){var n=jt(),o=n.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var u=o.dispatch,C=o.pending,k=n.memoizedState;if(C!==null){o.pending=null;var N=C=C.next;do k=t(k,N.action),N=N.next;while(N!==C);Un(k,n.memoizedState)||(It=!0),n.memoizedState=k,n.baseQueue===null&&(n.baseState=k),o.lastRenderedState=k}return[k,u]}function K_(t,n,o){var u=We,C=jt(),k=Xe;if(k){if(o===void 0)throw Error(s(407));o=o()}else o=n();var N=!Un((vt||C).memoizedState,o);if(N&&(C.memoizedState=o,It=!0),C=C.queue,ef(J_.bind(null,u,C,t),[t]),t=C.getSnapshot!==n||N||Pt!==null&&(Pt.memoizedState.tag&1)!==0,Eo(t?9:8,{destroy:void 0},Z_.bind(null,u,C,o,n),null),t){if(u.flags|=2048,_t===null)throw Error(s(349));k||(nr&127)!==0||Q_(u,n,o)}return o}function Q_(t,n,o){t.flags|=16384,t={getSnapshot:n,value:o},n=We.updateQueue,n===null?(n=zc(),We.updateQueue=n,n.stores=[t]):(o=n.stores,o===null?n.stores=[t]:o.push(t))}function Z_(t,n,o,u){n.value=o,n.getSnapshot=u,e1(n)&&t1(t)}function J_(t,n,o){return o(function(){e1(n)&&t1(t)})}function e1(t){var n=t.getSnapshot;t=t.value;try{var o=n();return!Un(t,o)}catch{return!0}}function t1(t){var n=bs(t,2);n!==null&&Mn(n,t,2)}function Zd(t){var n=bn();if(typeof t=="function"){var o=t;if(t=o(),Ms){Tr(!0);try{o()}finally{Tr(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:t},n}function n1(t,n,o,u){return t.baseState=o,Kd(t,vt,typeof u=="function"?u:ir)}function jE(t,n,o,u,C){if(qc(t))throw Error(s(485));if(t=n.action,t!==null){var k={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){k.listeners.push(N)}};ue.T!==null?o(!0):k.isTransition=!1,u(k),o=n.pending,o===null?(k.next=n.pending=k,i1(n,k)):(k.next=o.next,n.pending=o.next=k)}}function i1(t,n){var o=n.action,u=n.payload,C=t.state;if(n.isTransition){var k=ue.T,N={};N.types=k!==null?k.types:null,ue.T=N;try{var q=o(C,u),J=ue.S;J!==null&&J(N,q),r1(t,n,q)}catch(se){Jd(t,n,se)}finally{k!==null&&N.types!==null&&(k.types=N.types),ue.T=k}}else try{k=o(C,u),r1(t,n,k)}catch(se){Jd(t,n,se)}}function r1(t,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){s1(t,n,u)},function(u){return Jd(t,n,u)}):s1(t,n,o)}function s1(t,n,o){n.status="fulfilled",n.value=o,o1(n),t.state=o,n=t.pending,n!==null&&(o=n.next,o===n?t.pending=null:(o=o.next,n.next=o,i1(t,o)))}function Jd(t,n,o){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=o,o1(n),n=n.next;while(n!==u)}t.action=null}function o1(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function a1(t,n){return n}function l1(t,n){if(Xe){var o=_t.formState;if(o!==null){e:{var u=We;if(Xe){if(bt){t:{for(var C=bt,k=ai;C.nodeType!==8;){if(!k){C=null;break t}if(C=ci(C.nextSibling),C===null){C=null;break t}}k=C.data,C=k==="F!"||k==="F"?C:null}if(C){bt=ci(C.nextSibling),u=C.data==="F!";break e}}Mr(u)}u=!1}u&&(n=o[0])}}return o=bn(),o.memoizedState=o.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a1,lastRenderedState:n},o.queue=u,o=T1.bind(null,We,u),u.dispatch=o,u=Zd(!1),k=of.bind(null,We,!1,u.queue),u=bn(),C={state:n,dispatch:null,action:t,pending:null},u.queue=C,o=jE.bind(null,We,C,k,o),C.dispatch=o,u.memoizedState=t,[n,o,!1]}function c1(t){var n=jt();return u1(n,vt,t)}function u1(t,n,o){if(n=Kd(t,n,a1)[0],t=Fc(ir)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=Qa(n)}catch(N){throw N===bo?Dc:N}else u=n;n=jt();var C=n.queue,k=C.dispatch;return o!==n.memoizedState&&(We.flags|=2048,Eo(9,{destroy:void 0},OE.bind(null,C,o),null)),[u,k,t]}function OE(t,n){t.action=n}function h1(t){var n=jt(),o=vt;if(o!==null)return u1(n,o,t);jt(),n=n.memoizedState,o=jt();var u=o.queue.dispatch;return o.memoizedState=t,[n,u,!1]}function Eo(t,n,o,u){return t={tag:t,create:o,deps:u,inst:n,next:null},n=We.updateQueue,n===null&&(n=zc(),We.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=t.next=t:(u=o.next,o.next=t,t.next=u,n.lastEffect=t),t}function d1(){return jt().memoizedState}function Uc(t,n,o,u){var C=bn();We.flags|=t,C.memoizedState=Eo(1|n,{destroy:void 0},o,u===void 0?null:u)}function $c(t,n,o,u){var C=jt();u=u===void 0?null:u;var k=C.memoizedState.inst;vt!==null&&u!==null&&qd(u,vt.memoizedState.deps)?C.memoizedState=Eo(n,k,o,u):(We.flags|=t,C.memoizedState=Eo(1|n,k,o,u))}function f1(t,n){Uc(8390656,8,t,n)}function ef(t,n){$c(2048,8,t,n)}function NE(t){We.flags|=4;var n=We.updateQueue;if(n===null)n=zc(),We.updateQueue=n,n.events=[t];else{var o=n.events;o===null?n.events=[t]:o.push(t)}}function p1(t){var n=jt().memoizedState;return NE({ref:n,nextImpl:t}),function(){if((lt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function m1(t,n){return $c(4,2,t,n)}function g1(t,n){return $c(4,4,t,n)}function v1(t,n){if(typeof n=="function"){t=t();var o=n(t);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function _1(t,n,o){o=o!=null?o.concat([t]):null,$c(4,4,v1.bind(null,n,t),o)}function tf(){}function x1(t,n){var o=jt();n=n===void 0?null:n;var u=o.memoizedState;return n!==null&&qd(n,u[1])?u[0]:(o.memoizedState=[t,n],t)}function y1(t,n){var o=jt();n=n===void 0?null:n;var u=o.memoizedState;if(n!==null&&qd(n,u[1]))return u[0];if(u=t(),Ms){Tr(!0);try{t()}finally{Tr(!1)}}return o.memoizedState=[u,n],u}function nf(t,n,o){return o===void 0||(nr&1073741824)!==0&&(Je&261930)===0?t.memoizedState=n:(t.memoizedState=o,t=L0(),We.lanes|=t,qr|=t,o)}function b1(t,n,o,u){return Un(o,n)?o:Ir.current!==null?(t=nf(t,o,u),Un(t,n)||(It=!0),t):(nr&106)===0||(nr&1073741824)!==0&&(Je&261930)===0?(It=!0,t.memoizedState=o):(t=L0(),We.lanes|=t,qr|=t,n)}function S1(t,n,o,u,C){var k=he.p;he.p=k!==0&&8>k?k:8;var N=ue.T,q={};q.types=N!==null?N.types:null,ue.T=q,of(t,!1,n,o);try{var J=C(),se=ue.S;if(se!==null&&se(q,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var de=LE(J,u);Za(t,n,de,Gn(t))}else Za(t,n,u,Gn(t))}catch(me){Za(t,n,{then:function(){},status:"rejected",reason:me},Gn())}finally{he.p=k,N!==null&&q.types!==null&&(N.types=q.types),ue.T=N}}function BE(){}function rf(t,n,o,u){if(t.tag!==5)throw Error(s(476));var C=w1(t).queue;S1(t,C,n,we,o===null?BE:function(){return C1(t),o(u)})}function w1(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:we,baseState:we,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:we},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:o},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function C1(t){var n=w1(t);n.next===null&&(n=t.alternate.memoizedState),Za(t,n.next.queue,{},Gn())}function sf(){return sn(qo)}function E1(){return jt().memoizedState}function k1(){return jt().memoizedState}function PE(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var o=Gn();t=Br(o);var u=Pr(n,t,o);u!==null&&(Mn(u,n,o),Wa(u,n,o)),n={cache:Md()},t.payload=n;return}n=n.return}}function IE(t,n,o){var u=Gn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},qc(t)?R1(n,o):(o=wd(t,n,o,u),o!==null&&(Mn(o,t,u),A1(o,n,u)))}function T1(t,n,o){var u=Gn();Za(t,n,o,u)}function Za(t,n,o,u){var C={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(qc(t))R1(n,C);else{var k=t.alternate;if(t.lanes===0&&(k===null||k.lanes===0)&&(k=n.lastRenderedReducer,k!==null))try{var N=n.lastRenderedState,q=k(N,o);if(C.hasEagerState=!0,C.eagerState=q,Un(q,N))return bc(t,n,C,0),_t===null&&yc(),!1}catch{}finally{}if(o=wd(t,n,C,u),o!==null)return Mn(o,t,u),A1(o,n,u),!0}return!1}function of(t,n,o,u){if(u={lane:2,revertLane:Kf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},qc(t)){if(n)throw Error(s(479))}else n=wd(t,o,u,2),n!==null&&Mn(n,t,2)}function qc(t){var n=t.alternate;return t===We||n!==null&&n===We}function R1(t,n){wo=Pc=!0;var o=t.pending;o===null?n.next=n:(n.next=o.next,o.next=n),t.pending=n}function A1(t,n,o){if((o&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,Lv(t,o)}}var Vc={readContext:sn,use:Hc,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At,useEffectEvent:At},L1={readContext:sn,use:Hc,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:sn,useEffect:f1,useImperativeHandle:function(t,n,o){o=o!=null?o.concat([t]):null,Uc(4194308,4,v1.bind(null,n,t),o)},useLayoutEffect:function(t,n){return Uc(4194308,4,t,n)},useInsertionEffect:function(t,n){Uc(4,2,t,n)},useMemo:function(t,n){var o=bn();n=n===void 0?null:n;var u=t();if(Ms){Tr(!0);try{t()}finally{Tr(!1)}}return o.memoizedState=[u,n],u},useReducer:function(t,n,o){var u=bn();if(o!==void 0){var C=o(n);if(Ms){Tr(!0);try{o(n)}finally{Tr(!1)}}}else C=n;return u.memoizedState=u.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},u.queue=t,t=t.dispatch=IE.bind(null,We,t),[u.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=Zd(t);var n=t.queue,o=T1.bind(null,We,n);return n.dispatch=o,[t.memoizedState,o]},useDebugValue:tf,useDeferredValue:function(t,n){var o=bn();return nf(o,t,n)},useTransition:function(){var t=Zd(!1);return t=S1.bind(null,We,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,o){var u=We,C=bn();if(Xe){if(o===void 0)throw Error(s(407));o=o()}else{if(o=n(),_t===null)throw Error(s(349));(Je&127)!==0||Q_(u,n,o)}C.memoizedState=o;var k={value:o,getSnapshot:n};return C.queue=k,f1(J_.bind(null,u,k,t),[t]),u.flags|=2048,Eo(9,{destroy:void 0},Z_.bind(null,u,k,o,n),null),o},useId:function(){var t=bn(),n=_t.identifierPrefix;if(Xe){var o=Ti,u=ki;o=(u&~(1<<32-Hn(u)-1)).toString(32)+o,n="_"+n+"R_"+o,o=Ic++,0<o&&(n+="H"+o.toString(32)),n+="_"}else o=DE++,n="_"+n+"r_"+o.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:sf,useFormState:l1,useActionState:l1,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=of.bind(null,We,!0,o),o.dispatch=n,[t,n]},useMemoCache:Xd,useCacheRefresh:function(){return bn().memoizedState=PE.bind(null,We)},useEffectEvent:function(t){var n=bn(),o={impl:t};return n.memoizedState=o,function(){if((lt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},D1={readContext:sn,use:Hc,useCallback:x1,useContext:sn,useEffect:ef,useImperativeHandle:_1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:y1,useReducer:Fc,useRef:d1,useState:function(){return Fc(ir)},useDebugValue:tf,useDeferredValue:function(t,n){var o=jt();return b1(o,vt.memoizedState,t,n)},useTransition:function(){var t=Fc(ir)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:Qa(t),n]},useSyncExternalStore:K_,useId:E1,useHostTransitionStatus:sf,useFormState:c1,useActionState:c1,useOptimistic:function(t,n){var o=jt();return n1(o,vt,t,n)},useMemoCache:Xd,useCacheRefresh:k1,useEffectEvent:p1},zE={readContext:sn,use:Hc,useCallback:x1,useContext:sn,useEffect:ef,useImperativeHandle:_1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:y1,useReducer:Qd,useRef:d1,useState:function(){return Qd(ir)},useDebugValue:tf,useDeferredValue:function(t,n){var o=jt();return vt===null?nf(o,t,n):b1(o,vt.memoizedState,t,n)},useTransition:function(){var t=Qd(ir)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:Qa(t),n]},useSyncExternalStore:K_,useId:E1,useHostTransitionStatus:sf,useFormState:h1,useActionState:h1,useOptimistic:function(t,n){var o=jt();return vt!==null?n1(o,vt,t,n):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:Xd,useCacheRefresh:k1,useEffectEvent:p1};function af(t,n,o,u){n=t.memoizedState,o=o(u,n),o=o==null?n:D({},n,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var lf={enqueueSetState:function(t,n,o){t=t._reactInternals;var u=Gn(),C=Br(u);C.payload=n,o!=null&&(C.callback=o),n=Pr(t,C,u),n!==null&&(Mn(n,t,u),Wa(n,t,u))},enqueueReplaceState:function(t,n,o){t=t._reactInternals;var u=Gn(),C=Br(u);C.tag=1,C.payload=n,o!=null&&(C.callback=o),n=Pr(t,C,u),n!==null&&(Mn(n,t,u),Wa(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var o=Gn(),u=Br(o);u.tag=2,n!=null&&(u.callback=n),n=Pr(t,u,o),n!==null&&(Mn(n,t,o),Wa(n,t,o))}};function M1(t,n,o,u,C,k,N){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,k,N):n.prototype&&n.prototype.isPureReactComponent?!Ia(o,u)||!Ia(C,k):!0}function j1(t,n,o,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==t&&lf.enqueueReplaceState(n,n.state,null)}function js(t,n){var o=n;if("ref"in n){o={};for(var u in n)u!=="ref"&&(o[u]=n[u])}if(t=t.defaultProps){o===n&&(o=D({},o));for(var C in t)o[C]===void 0&&(o[C]=t[C])}return o}function O1(t){xc(t)}function N1(t){console.error(t)}function B1(t){xc(t)}function Wc(t,n){try{var o=t.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function P1(t,n,o){try{var u=t.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function cf(t,n,o){return o=Br(o),o.tag=3,o.payload={element:null},o.callback=function(){Wc(t,n)},o}function I1(t){return t=Br(t),t.tag=3,t}function z1(t,n,o,u){var C=o.type.getDerivedStateFromError;if(typeof C=="function"){var k=u.value;t.payload=function(){return C(k)},t.callback=function(){P1(n,o,u)}}var N=o.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(t.callback=function(){P1(n,o,u),typeof C!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var q=u.stack;this.componentDidCatch(u.value,{componentStack:q!==null?q:""})})}function HE(t,n,o,u,C){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=o.alternate,n!==null&&Es(n,o,C,!0),o=on.current,o!==null){switch(o.tag){case 31:case 13:case 19:return mn===null?fu():o.alternate===null&&Lt===0&&(Lt=3),o.flags&=-257,o.flags|=65536,o.lanes=C,u===Mc?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([u]):n.add(u),Gf(t,u,C)),!1;case 22:return o.flags|=65536,u===Mc?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([u]):o.add(u)),Gf(t,u,C)),!1}throw Error(s(435,o.tag))}return Gf(t,u,C),fu(),!1}if(Xe)return n=on.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=C,u!==Rd&&(t=Error(s(422),{cause:u}),Fa(ri(t,o)))):(u!==Rd&&(n=Error(s(423),{cause:u}),Fa(ri(n,o))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,u=ri(u,o),C=cf(t.stateNode,u,C),Id(t,C),Lt!==4&&(Lt=2)),!1;var k=Error(s(520),{cause:u});if(k=ri(k,o),ol===null?ol=[k]:ol.push(k),Lt!==4&&(Lt=2),n===null)return!0;u=ri(u,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,t=C&-C,o.lanes|=t,t=cf(o.stateNode,u,t),Id(o,t),!1;case 1:if(n=o.type,k=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Vr===null||!Vr.has(k))))return o.flags|=65536,C&=-C,o.lanes|=C,C=I1(C),z1(C,t,o,u),Id(o,C),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var uf=Error(s(461)),It=!1;function Gt(t,n,o,u){n.child=t===null?$_(n,null,o,u):Ds(n,t.child,o,u)}function H1(t,n,o,u,C){o=o.render;var k=n.ref;if("ref"in u){var N={};for(var q in u)q!=="ref"&&(N[q]=u[q])}else N=u;return ks(n),u=Vd(t,n,o,N,k,C),q=Wd(),t!==null&&!It?(Gd(t,n,C),rr(t,n,C)):(Xe&&q&&Ec(n),n.flags|=1,Gt(t,n,u,C),n.child)}function F1(t,n,o,u,C){if(t===null){var k=o.type;return typeof k=="function"&&!Cd(k)&&k.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=k,U1(t,n,k,u,C)):(t=wc(o.type,null,u,n,n.mode,C),t.ref=n.ref,t.return=n,n.child=t)}if(k=t.child,!_f(t,C)){var N=k.memoizedProps;if(o=o.compare,o=o!==null?o:Ia,o(N,u)&&t.ref===n.ref)return rr(t,n,C)}return n.flags|=1,t=Zi(k,u),t.ref=n.ref,t.return=n,n.child=t}function U1(t,n,o,u,C){if(t!==null){var k=t.memoizedProps;if(Ia(k,u)&&t.ref===n.ref)if(It=!1,n.pendingProps=u=k,_f(t,C))(t.flags&131072)!==0&&(It=!0);else return n.lanes=t.lanes,rr(t,n,C)}return hf(t,n,o,u,C)}function $1(t,n,o,u){var C=u.children,k=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(k=k!==null?k.baseLanes|o:o,t!==null){for(u=n.child=t.child,C=0;u!==null;)C=C|u.lanes|u.childLanes,u=u.sibling;u=C&~k}else u=0,n.child=null;return q1(t,n,k,o,u)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Lc(n,k!==null?k.cachePool:null),k!==null?W_(n,k):Hd(),G_(n);else return u=n.lanes=536870912,q1(t,n,k!==null?k.baseLanes|o:o,o,u)}else k!==null?(Lc(n,k.cachePool),W_(n,k),Hr(),n.memoizedState=null):(t!==null&&Lc(n,null),Hd(),Hr());return Gt(t,n,C,o),n.child}function Ja(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function q1(t,n,o,u,C){var k=Od();return k=k===null?null:{parent:Bt._currentValue,pool:k},n.memoizedState={baseLanes:o,cachePool:k},t!==null&&Lc(n,null),Hd(),G_(n),t!==null&&Es(t,n,u,!0),n.childLanes=C,null}function Gc(t,n){return n=Yc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function V1(t,n,o){return Ds(n,t.child,null,o),t=Gc(n,n.pendingProps),t.flags|=2,$n(n),n.memoizedState=null,t}function FE(t,n,o){var u=n.pendingProps,C=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Xe){if(u.mode==="hidden")return t=Gc(n,u),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Ja(null,t);if(Ud(n),(t=bt)?(t=vx(t,ai),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Lr!==null?{id:ki,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},o=R_(t),o.return=n,n.child=o,Qt=n,bt=null)):t=null,t===null)throw Mr(n);return n.lanes=536870912,null}return Gc(n,u)}var k=t.memoizedState;if(k!==null){var N=k.dehydrated;if(Ud(n),C)if(n.flags&256)n.flags&=-257,n=V1(t,n,o);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(It||Es(t,n,o,!1),C=(o&t.childLanes)!==0,It||C){if(Ir.current===null){if(u=_t,u!==null&&(N=Dv(u,o),N!==0&&N!==k.retryLane))throw k.retryLane=N,bs(t,N),Mn(u,t,N),uf;fu()}n=V1(t,n,o)}else t=k.treeContext,bt=ci(N.nextSibling),Qt=n,Xe=!0,Dr=null,ai=!1,t!==null&&D_(n,t),n=Gc(n,u),n.flags|=134221824;return n}return t=Zi(t.child,{mode:u.mode,children:u.children}),t.ref=n.ref,n.child=t,t.return=n,t}function ko(t,n){var o=n.ref;if(o===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(t===null||t.ref!==o)&&(n.flags|=4194816)}}function hf(t,n,o,u,C){return ks(n),o=Vd(t,n,o,u,void 0,C),u=Wd(),t!==null&&!It?(Gd(t,n,C),rr(t,n,C)):(Xe&&u&&Ec(n),n.flags|=1,Gt(t,n,o,C),n.child)}function W1(t,n,o,u,C,k){return ks(n),n.updateQueue=null,o=X_(n,u,o,C),Y_(t),u=Wd(),t!==null&&!It?(Gd(t,n,k),rr(t,n,k)):(Xe&&u&&Ec(n),n.flags|=1,Gt(t,n,o,k),n.child)}function G1(t,n,o,u,C){if(ks(n),n.stateNode===null){var k=go,N=o.contextType;typeof N=="object"&&N!==null&&(k=sn(N)),k=new o(u,k),n.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=lf,n.stateNode=k,k._reactInternals=n,k=n.stateNode,k.props=u,k.state=n.memoizedState,k.refs={},Bd(n),N=o.contextType,k.context=typeof N=="object"&&N!==null?sn(N):go,k.state=n.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(af(n,o,N,u),k.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(N=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),N!==k.state&&lf.enqueueReplaceState(k,k.state,null),Ya(n,u,k,C),Ga(),k.state=n.memoizedState),typeof k.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){k=n.stateNode;var q=n.memoizedProps,J=js(o,q);k.props=J;var se=k.context,de=o.contextType;N=go,typeof de=="object"&&de!==null&&(N=sn(de));var me=o.getDerivedStateFromProps;de=typeof me=="function"||typeof k.getSnapshotBeforeUpdate=="function",q=n.pendingProps!==q,de||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(q||se!==N)&&j1(n,k,u,N),Nr=!1;var ie=n.memoizedState;k.state=ie,Ya(n,u,k,C),Ga(),se=n.memoizedState,q||ie!==se||Nr?(typeof me=="function"&&(af(n,o,me,u),se=n.memoizedState),(J=Nr||M1(n,o,J,u,ie,se,N))?(de||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(n.flags|=4194308)):(typeof k.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=se),k.props=u,k.state=se,k.context=N,u=J):(typeof k.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{k=n.stateNode,Pd(t,n),N=n.memoizedProps,de=js(o,N),k.props=de,me=n.pendingProps,ie=k.context,se=o.contextType,J=go,typeof se=="object"&&se!==null&&(J=sn(se)),q=o.getDerivedStateFromProps,(se=typeof q=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(N!==me||ie!==J)&&j1(n,k,u,J),Nr=!1,ie=n.memoizedState,k.state=ie,Ya(n,u,k,C),Ga();var ce=n.memoizedState;N!==me||ie!==ce||Nr||t!==null&&t.dependencies!==null&&Rc(t.dependencies)?(typeof q=="function"&&(af(n,o,q,u),ce=n.memoizedState),(de=Nr||M1(n,o,de,u,ie,ce,J)||t!==null&&t.dependencies!==null&&Rc(t.dependencies))?(se||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(u,ce,J),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(u,ce,J)),typeof k.componentDidUpdate=="function"&&(n.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof k.componentDidUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=ce),k.props=u,k.state=ce,k.context=J,u=de):(typeof k.componentDidUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),u=!1)}return k=u,ko(t,n),u=(n.flags&128)!==0,k||u?(k=n.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:k.render(),n.flags|=1,t!==null&&u?(n.child=Ds(n,t.child,null,C),n.child=Ds(n,null,o,C)):Gt(t,n,o,C),n.memoizedState=k.state,t=n.child):t=rr(t,n,C),t}function Y1(t,n,o,u){return ws(),n.flags|=256,Gt(t,n,o,u),n.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ff(t){return{baseLanes:t,cachePool:P_()}}function pf(t,n,o){return t=t!==null?t.childLanes&~o:0,n&&(t|=Wn),t}function X1(t,n,o){var u=n.pendingProps,C=!1,k=(n.flags&128)!==0,N;if((N=k)||(N=t!==null&&t.memoizedState===null?!1:(an.current&2)!==0),N&&(C=!0,n.flags&=-129),N=(n.flags&32)!==0,n.flags&=-33,t===null){if(Xe){if(C?zr(n):Hr(),(t=bt)?(t=vx(t,ai),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Lr!==null?{id:ki,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},o=R_(t),o.return=n,n.child=o,Qt=n,bt=null)):t=null,t===null)throw Mr(n);return fp(t)?n.lanes=32:n.lanes=536870912,null}return k=u.children,u=u.fallback,C?(Hr(),C=n.mode,k=Yc({mode:"hidden",children:k},C),u=Ss(u,C,o,null),k.return=n,u.return=n,k.sibling=u,n.child=k,u=n.child,u.memoizedState=ff(o),u.childLanes=pf(t,N,o),n.memoizedState=df,Ja(null,u)):(zr(n),mf(n,k))}var q=t.memoizedState;if(q!==null){var J=q.dehydrated;if(J!==null)return UE(t,n,k,N,u,J,q,o)}return C?(Hr(),C=u.fallback,k=n.mode,q=t.child,J=q.sibling,u=Zi(q,{mode:"hidden",children:u.children}),u.subtreeFlags=q.subtreeFlags&1206910976,J!==null?C=Zi(J,C):(C=Ss(C,k,o,null),C.flags|=2),C.return=n,u.return=n,u.sibling=C,n.child=u,Ja(null,u),u=n.child,C=t.child.memoizedState,C===null?C=ff(o):(k=C.cachePool,k!==null?(q=Bt._currentValue,k=k.parent!==q?{parent:q,pool:q}:k):k=P_(),C={baseLanes:C.baseLanes|o,cachePool:k}),u.memoizedState=C,u.childLanes=pf(t,N,o),n.memoizedState=df,Ja(t.child,u)):(zr(n),o=t.child,t=o.sibling,o=Zi(o,{mode:"visible",children:u.children}),o.return=n,o.sibling=null,t!==null&&(N=n.deletions,N===null?(n.deletions=[t],n.flags|=16):N.push(t)),n.child=o,n.memoizedState=null,o)}function mf(t,n){return n=Yc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Yc(t,n){return t=Rn(22,t,null,n),t.lanes=0,t}function Xc(t,n,o){return Ds(n,t.child,null,o),t=mf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function UE(t,n,o,u,C,k,N,q){if(o)return n.flags&256?(zr(n),n.flags&=-257,Xc(t,n,q)):n.memoizedState!==null?(Hr(),n.child=t.child,n.flags|=128,null):(Hr(),k=C.fallback,N=n.mode,C=Yc({mode:"visible",children:C.children},N),k=Ss(k,N,q,null),k.flags|=2,C.return=n,k.return=n,C.sibling=k,n.child=C,Ds(n,t.child,null,q),C=n.child,C.memoizedState=ff(q),C.childLanes=pf(t,u,q),n.memoizedState=df,Ja(null,C));if(zr(n),fp(k)){if(u=k.nextSibling&&k.nextSibling.dataset,u)var J=u.dgst;return u=J,u!==""&&(C=Error(s(419)),C.stack="",C.digest=u,Fa({value:C,source:null,stack:null})),Xc(t,n,q)}if(It||Es(t,n,q,!1),u=(q&t.childLanes)!==0,It||u){if(Ir.current!==null)return Xc(t,n,q);if(u=_t,u!==null&&(C=Dv(u,q),C!==0&&C!==N.retryLane))throw N.retryLane=C,bs(t,C),Mn(u,t,C),uf;return dp(k)||fu(),Xc(t,n,q)}return dp(k)?(n.flags|=192,n.child=t.child,null):(t=N.treeContext,bt=ci(k.nextSibling),Qt=n,Xe=!0,Dr=null,ai=!1,t!==null&&D_(n,t),n=mf(n,C.children),n.flags|=134221824,n)}function K1(t,n,o){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),Tc(t.return,n,o)}function Q1(t){for(var n=null;t!==null;){var o=t.alternate;o!==null&&Bc(o)===null&&(n=t),t=t.sibling}return n}function Kc(t,n,o,u,C,k){var N=t.memoizedState;N===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:C,treeForkCount:k}:(N.isBackwards=n,N.rendering=null,N.renderingStartTime=0,N.last=u,N.tail=o,N.tailMode=C,N.treeForkCount=k)}function gf(t){var n=t.child;for(t.child=null;n!==null;){var o=n.sibling;n.sibling=t.child,t.child=n,n=o}}function vf(t,n,o){var u=n.pendingProps,C=u.revealOrder,k=u.tail;u=u.children;var N=an.current;if(n.flags&128)return Xa(n,N),null;var q=(N&2)!==0;if(q?(N=N&1|2,n.flags|=128):N&=1,Xa(n,N),C==="backwards"&&t!==null?(gf(t),Gt(t,n,u,o),gf(t)):Gt(t,n,u,o),u=Xe?Ha:0,!q&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&K1(t,o,n);else if(t.tag===19)K1(t,o,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"backwards":o=Q1(n.child),o===null?(C=n.child,n.child=null):(C=o.sibling,o.sibling=null,gf(n)),Kc(n,!0,C,null,k,u);break;case"unstable_legacy-backwards":for(o=null,C=n.child,n.child=null;C!==null;){if(t=C.alternate,t!==null&&Bc(t)===null){n.child=C;break}t=C.sibling,C.sibling=o,o=C,C=t}Kc(n,!0,o,null,k,u);break;case"together":Kc(n,!1,null,null,void 0,u);break;case"independent":n.memoizedState=null;break;default:o=Q1(n.child),o===null?(C=n.child,n.child=null):(C=o.sibling,o.sibling=null),Kc(n,!1,C,o,k,u)}return n.child}function Z1(t,n,o){var u=n.pendingProps;return jr(n,n.type,u.value),Gt(t,n,u.children,o),n.child}function rr(t,n,o){if(t!==null&&(n.dependencies=t.dependencies),qr|=n.lanes,(o&n.childLanes)===0)if(t!==null){if(Es(t,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,o=Zi(t,t.pendingProps),n.child=o,o.return=n;t.sibling!==null;)t=t.sibling,o=o.sibling=Zi(t,t.pendingProps),o.return=n;o.sibling=null}return n.child}function _f(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Rc(t)))}function $E(t,n,o){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),jr(n,Bt,t.memoizedState.cache),ws();break;case 27:case 5:gt(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:jr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ud(n),null;break;case 13:var u=n.memoizedState;if(u!==null){if(u.dehydrated!==null)return zr(n),n.flags|=128,null;u=Es(t,n,o,!1);var C=n.child.childLanes;return u||(o&C)!==0?X1(t,n,o):(zr(n),t=rr(t,n,o),t!==null?t.sibling:null)}zr(n);break;case 19:if(n.flags&128)return vf(t,n,o);if(C=(t.flags&128)!==0,u=(o&n.childLanes)!==0,u||(Es(t,n,o,!1),u=(o&n.childLanes)!==0),C){if(u)return vf(t,n,o);n.flags|=128}if(C=n.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Xa(n,an.current),u)break;return null;case 22:return n.lanes=0,$1(t,n,o,n.pendingProps);case 24:jr(n,Bt,t.memoizedState.cache)}return rr(t,n,o)}function J1(t,n,o){if(t!==null)if(t.memoizedProps!==n.pendingProps)It=!0;else{if(!_f(t,o)&&(n.flags&128)===0)return It=!1,$E(t,n,o);It=(t.flags&131072)!==0}else It=!1,Xe&&(n.flags&1048576)!==0&&L_(n,Ha,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(t=As(n.elementType),n.type=t,typeof t=="function")Cd(t)?(u=js(t,u),n.tag=1,n=G1(null,n,t,u,o)):(n.tag=0,n=hf(null,n,t,u,o));else{if(t!=null){var C=t.$$typeof;if(C===Y){n.tag=11,n=H1(null,n,t,u,o);break e}else if(C===z){n.tag=14,n=F1(null,n,t,u,o);break e}else if(C===W){n.tag=10,n.type=t,n=Z1(null,n,o);break e}}throw n=oe(t)||t,Error(s(306,n,""))}}return n;case 0:return hf(t,n,n.type,n.pendingProps,o);case 1:return u=n.type,C=js(u,n.pendingProps),G1(t,n,u,C,o);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(s(387));u=n.pendingProps;var k=n.memoizedState;C=k.element,Pd(t,n),Ya(n,u,null,o);var N=n.memoizedState;if(u=N.cache,jr(n,Bt,u),u!==k.cache&&Dd(n,[Bt],o,!0),Ga(),u=N.element,k.isDehydrated)if(k={element:u,isDehydrated:!1,cache:N.cache},n.updateQueue.baseState=k,n.memoizedState=k,n.flags&256){n=Y1(t,n,u,o);break e}else if(u!==C){C=ri(Error(s(424)),n),Fa(C),n=Y1(t,n,u,o);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(bt=ci(t.firstChild),Qt=n,Xe=!0,Dr=null,ai=!0,o=$_(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling}else{if(ws(),u===C){n=rr(t,n,o);break e}Gt(t,n,u,o)}n=n.child}return n;case 26:return ko(t,n),t===null?(o=Cx(n.type,null,n.pendingProps,null))?n.memoizedState=o:Xe||(n.stateNode=ix(n.type,n.pendingProps,Be.current,n)):n.memoizedState=Cx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return gt(n),t===null&&Xe&&(u=n.stateNode=yx(n.type,n.pendingProps,Be.current),Qt=n,ai=!0,C=bt,Yr(n.type)?(pp=C,bt=ci(u.firstChild)):bt=C),Gt(t,n,n.pendingProps.children,o),ko(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Xe&&((C=u=bt)&&(u=Pk(u,n.type,n.pendingProps,ai),u!==null?(n.stateNode=u,Qt=n,bt=ci(u.firstChild),ai=!1,C=!0):C=!1),C||Mr(n)),gt(n),C=n.type,k=n.pendingProps,N=t!==null?t.memoizedProps:null,u=k.children,sp(C,k)?u=null:N!==null&&sp(C,N)&&(n.flags|=32),n.memoizedState!==null&&(C=Vd(t,n,ME,null,null,o),qo._currentValue=C),ko(t,n),Gt(t,n,u,o),n.child;case 6:return t===null&&Xe&&((t=o=bt)&&(o=Ik(o,n.pendingProps,ai),o!==null?(n.stateNode=o,Qt=n,bt=null,t=!0):t=!1),t||Mr(n)),null;case 13:return X1(t,n,o);case 4:return Te(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Ds(n,null,u,o):Gt(t,n,u,o),n.child;case 11:return H1(t,n,n.type,n.pendingProps,o);case 7:return u=n.pendingProps,ko(t,n),Gt(t,n,u,o),n.child;case 8:return Gt(t,n,n.pendingProps.children,o),n.child;case 12:return Gt(t,n,n.pendingProps.children,o),n.child;case 10:return Z1(t,n,o);case 9:return C=n.type._context,u=n.pendingProps.children,ks(n),C=sn(C),u=u(C),n.flags|=1,Gt(t,n,u,o),n.child;case 14:return F1(t,n,n.type,n.pendingProps,o);case 15:return U1(t,n,n.type,n.pendingProps,o);case 19:return vf(t,n,o);case 31:return FE(t,n,o);case 22:return $1(t,n,o,n.pendingProps);case 24:return ks(n),u=sn(Bt),t===null?(C=Od(),C===null&&(C=_t,k=Md(),C.pooledCache=k,k.refCount++,k!==null&&(C.pooledCacheLanes|=o),C=k),n.memoizedState={parent:u,cache:C},Bd(n),jr(n,Bt,C)):((t.lanes&o)!==0&&(Pd(t,n),Ya(n,null,null,o),Ga()),C=t.memoizedState,k=n.memoizedState,C.parent!==u?(C={parent:u,cache:u},n.memoizedState=C,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=C),jr(n,Bt,u)):(u=k.cache,jr(n,Bt,u),u!==C.cache&&Dd(n,[Bt],o,!0))),Gt(t,n,n.pendingProps.children,o),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),u=n.pendingProps,u.name!=null&&u.name!=="auto"?n.flags|=t===null?18882560:18874368:Xe&&Ec(n),t!==null&&t.memoizedProps.name!==u.name?n.flags|=4194816:ko(t,n),Gt(t,n,u.children,o),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function sr(t){t.flags|=4}function xf(t,n,o,u,C){var k;if((k=(t.mode&32)!==0)&&(k=o===null?Rx(n,u):Rx(n,u)&&(u.src!==o.src||u.srcSet!==o.srcSet)),k){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(O0())t.flags|=8192;else throw Ls=Mc,Nd}else t.flags&=-16777217}function e0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ax(n))if(O0())t.flags|=8192;else throw Ls=Mc,Nd}function Qc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Rv():536870912,t.lanes|=n,Do|=n)}function el(t,n){if(!Xe)switch(t.tailMode){case"visible":break;case"collapsed":for(var o=t.tail,u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null;break;default:for(n=t.tail,o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t.tail=null:o.sibling=null}}function St(t){var n=t.alternate!==null&&t.alternate.child===t.child,o=0,u=0;if(n)for(var C=t.child;C!==null;)o|=C.lanes|C.childLanes,u|=C.subtreeFlags&1206910976,u|=C.flags&1206910976,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)o|=C.lanes|C.childLanes,u|=C.subtreeFlags,u|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=u,t.childLanes=o,n}function qE(t,n,o){var u=n.pendingProps;switch(Td(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(n),null;case 1:return St(n),null;case 3:return o=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),tr(Bt),Ve(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(xo(n)?sr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Ad())),St(n),null;case 26:var C=n.type,k=n.memoizedState;return t===null?(sr(n),k!==null?(St(n),e0(n,k)):(St(n),xf(n,C,null,u,o))):k?k!==t.memoizedState?(sr(n),St(n),e0(n,k)):(St(n),n.flags&=-16777217):(t=t.memoizedProps,t!==u&&sr(n),St(n),xf(n,C,t,u,o)),null;case 27:if(st(n),o=Be.current,C=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&sr(n);else{if(!u){if(n.stateNode===null)throw Error(s(166));return St(n),n.subtreeFlags&=-33554433,null}t=Mt.current,xo(n)?M_(n):(t=yx(C,u,o),n.stateNode=t,sr(n))}return St(n),n.subtreeFlags&=-33554433,null;case 5:if(st(n),C=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&sr(n);else{if(!u){if(n.stateNode===null)throw Error(s(166));return St(n),n.subtreeFlags&=-33554433,null}if(k=Mt.current,xo(n))M_(n);else{var N=hl(Be.current);switch(k){case 1:k=N.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:k=N.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":k=N.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":k=N.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":k=N.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof u.is=="string"?N.createElement("select",{is:u.is}):N.createElement("select"),u.multiple?k.multiple=!0:u.size&&(k.size=u.size);break;default:k=typeof u.is=="string"?N.createElement(C,{is:u.is}):N.createElement(C)}}k[rn]=n,k[Tn]=u;e:for(N=n.child;N!==null;){if(N.tag===5||N.tag===6)k.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===n)break e;for(;N.sibling===null;){if(N.return===null||N.return===n)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}n.stateNode=k;e:switch(cn(k,C,u),C){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&sr(n)}}return St(n),n.subtreeFlags&=-33554433,xf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,o),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&sr(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(s(166));if(t=Be.current,xo(n)){if(t=n.stateNode,o=n.memoizedProps,u=null,C=Qt,C!==null)switch(C.tag){case 27:case 5:u=C.memoizedProps}t[rn]=n,t=!!(t.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||J0(t.nodeValue,o)),t||Mr(n,!0)}else t=hl(t).createTextNode(u),t[rn]=n,n.stateNode=t}return St(n),null;case 31:if(o=n.memoizedState,t===null||t.memoizedState!==null){if(u=xo(n),o!==null){if(t===null){if(!u)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;St(n),t=!1}else o=Ad(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),t=!0;if(!t)return n.flags&256?($n(n),n):($n(n),null);if((n.flags&128)!==0)throw Error(s(558))}return St(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=xo(n),u!==null&&u.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=n.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;St(n),C=!1}else C=Ad(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return n.flags&256?($n(n),n):($n(n),null)}return $n(n),(n.flags&128)!==0?(n.lanes=o,n):(o=u!==null,t=t!==null&&t.memoizedState!==null,o&&(u=n.child,C=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(C=u.alternate.memoizedState.cachePool.pool),k=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(k=u.memoizedState.cachePool.pool),k!==C&&(u.flags|=2048)),o!==t&&o&&(n.child.flags|=8192),Qc(n,n.updateQueue),St(n),null);case 4:return Ve(),t===null&&ep(n.stateNode.containerInfo),n.flags|=67108864,St(n),null;case 10:return tr(n.type),St(n),null;case 19:if($d(n),u=n.memoizedState,u===null)return St(n),null;if(C=(n.flags&128)!==0,k=u.rendering,k===null)if(C)el(u,!1);else{if(Lt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(k=Bc(t),k!==null){for(n.flags|=128,el(u,!1),t=k.updateQueue,n.updateQueue=t,Qc(n,t),n.subtreeFlags=0,t=o,o=n.child;o!==null;)T_(o,t),o=o.sibling;return Xa(n,an.current&1|2),Xe&&Ji(n,u.treeForkCount),n.child}t=t.sibling}u.tail!==null&&Vt()>cu&&(n.flags|=128,C=!0,el(u,!1),n.lanes=4194304)}else{if(!C)if(t=Bc(k),t!==null){if(n.flags|=128,C=!0,t=t.updateQueue,n.updateQueue=t,Qc(n,t),el(u,!0),u.tail===null&&u.tailMode!=="collapsed"&&u.tailMode!=="visible"&&!k.alternate&&!Xe)return St(n),null}else 2*Vt()-u.renderingStartTime>cu&&o!==536870912&&(n.flags|=128,C=!0,el(u,!1),n.lanes=4194304);u.isBackwards?(k.sibling=n.child,n.child=k):(t=u.last,t!==null?t.sibling=k:n.child=k,u.last=k)}if(u.tail!==null){t=u.tail;e:{for(o=t;o!==null;){if(o.alternate!==null){o=!1;break e}o=o.sibling}o=!0}return u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Vt(),t.sibling=null,k=an.current,k=C?k&1|2:k&1,u.tailMode==="visible"||u.tailMode==="collapsed"||!o||Xe?Xa(n,k):(o=k,ze(on,n),ze(an,o),mn===null&&(mn=n)),Xe&&Ji(n,u.treeForkCount),t}return St(n),null;case 22:case 23:return $n(n),Fd(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(o&536870912)!==0&&(n.flags&128)===0&&(St(n),n.subtreeFlags&6&&(n.flags|=8192)):St(n),o=n.updateQueue,o!==null&&Qc(n,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==o&&(n.flags|=2048),t!==null&&ke(Rs),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),tr(Bt),St(n),null;case 25:return null;case 30:return n.flags|=33554432,St(n),null}throw Error(s(156,n.tag))}function VE(t,n){switch(Td(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return tr(Bt),Ve(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return st(n),null;case 31:if(n.memoizedState!==null){if($n(n),n.alternate===null)throw Error(s(340));ws()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if($n(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));ws()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return $d(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return Ve(),null;case 10:return tr(n.type),null;case 22:case 23:return $n(n),Fd(),t!==null&&ke(Rs),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return tr(Bt),null;case 25:return null;default:return null}}function t0(t,n){switch(Td(n),n.tag){case 3:tr(Bt),Ve();break;case 26:case 27:case 5:st(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&$n(n);break;case 13:$n(n);break;case 19:$d(n);break;case 10:tr(n.type);break;case 22:case 23:$n(n),Fd(),t!==null&&ke(Rs);break;case 24:tr(Bt)}}function tl(t,n){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var C=u.next;o=C;do{if((o.tag&t)===t){u=void 0;var k=o.create,N=o.inst;u=k(),N.destroy=u}o=o.next}while(o!==C)}}catch(q){ft(n,n.return,q)}}function Fr(t,n,o){try{var u=n.updateQueue,C=u!==null?u.lastEffect:null;if(C!==null){var k=C.next;u=k;do{if((u.tag&t)===t){var N=u.inst,q=N.destroy;if(q!==void 0){N.destroy=void 0,C=n;var J=o,se=q;try{se()}catch(de){ft(C,J,de)}}}u=u.next}while(u!==k)}}catch(de){ft(n,n.return,de)}}function n0(t){var n=t.updateQueue;if(n!==null){var o=t.stateNode;try{V_(n,o)}catch(u){ft(t,t.return,u)}}}function i0(t,n,o){o.props=js(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(u){ft(t,n,u)}}function Ri(t,n){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:var C=t.stateNode,k=Ki(t.memoizedProps,C);(C.ref===null||C.ref.name!==k)&&(C.ref=ux(k)),u=C.ref;break;case 7:if(t.stateNode===null){var N=new Yn(t);c(t.child,!1,Nk,N,void 0,void 0),t.stateNode=N}u=t.stateNode;break;default:u=t.stateNode}typeof o=="function"?t.refCleanup=o(u):o.current=u}}catch(q){ft(t,n,q)}}function ln(t,n){var o=t.ref,u=t.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(C){ft(t,n,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(C){ft(t,n,C)}else o.current=null}function Zc(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var o=0;o<n.length;o++)gx(t.stateNode,n[o])}function r0(t){for(var n=t.return;n!==null&&(bf(n)&&gx(t.stateNode,n.stateNode),!yf(n));)n=n.return}function nl(t){for(var n=t.return;n!==null&&(bf(n)&&Bk(t.stateNode,n.stateNode),!yf(n));)n=n.return}function yf(t){return t.tag===5||t.tag===3||t.tag===27}function bf(t){return t&&t.tag===7&&t.stateNode!==null}function Sf(t){var n=t.type,o=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(C){ft(t,t.return,C)}}function wf(t,n,o){try{var u=t.stateNode;vk(u,t.type,o,n),u[Tn]=n}catch(C){ft(t,t.return,C)}}function s0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yr(t.type)||t.tag===4}function Cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||s0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ef(t,n,o,u){var C=t.tag;if(C===5||C===6)C=t.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(C,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(C),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Ei)),Zc(t,u),ot=!0;else if(C!==4&&(C===27&&(Zc(t,u),u=null,Yr(t.type)&&(o=t.stateNode,n=null)),t=t.child,t!==null))for(Ef(t,n,o,u),t=t.sibling;t!==null;)Ef(t,n,o,u),t=t.sibling}function Jc(t,n,o,u){var C=t.tag;if(C===5||C===6)C=t.stateNode,n?o.insertBefore(C,n):o.appendChild(C),Zc(t,u),ot=!0;else if(C!==4&&(C===27&&(Zc(t,u),u=null,Yr(t.type)&&(o=t.stateNode)),t=t.child,t!==null))for(Jc(t,n,o,u),t=t.sibling;t!==null;)Jc(t,n,o,u),t=t.sibling}function o0(t){var n=t.stateNode,o=t.memoizedProps;try{for(var u=t.type,C=n.attributes;C.length;)n.removeAttributeNode(C[0]);cn(n,u,o),n[rn]=t,n[Tn]=o}catch(k){ft(t,t.return,k)}}var eu=!1,qn=null;function a0(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(eu=!0)}var Ai=null;function l0(){var t=Ai;return Ai=null,t}var An=0;function To(t,n,o,u,C){return An=0,c0(t.child,n,o,u,C)}function c0(t,n,o,u,C){for(var k=!1;t!==null;){if(t.tag===5){var N=t.stateNode;if(u!==null){var q=lp(N);u.push(q),q.view&&(k=!0)}else k||lp(N).view&&(k=!0);eu=!0,lx(N,An===0?n:n+"_"+An,o),An++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&C||c0(t.child,n,o,u,C)&&(k=!0));t=t.sibling}return k}function Li(t,n){for(;t!==null;)t.tag===5?cx(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Li(t.child,n)),t=t.sibling}function tu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(tu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(s(544));var o=n.name;n=Qi(n.default,n.share),n!=="none"&&(To(t,o,n,null,!1)||Li(t.child,!1))}t=t.sibling}}function kf(t,n){if(t.tag===30){var o=t.stateNode,u=t.memoizedProps,C=Ki(u,o),k=Qi(u.default,o.paired?u.share:u.enter);k!=="none"?To(t,C,k,null,!1)?(tu(t),o.paired||n||No(t,u.onEnter)):Li(t.child,!1):tu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)kf(t,n),t=t.sibling;else tu(t)}function Tf(t){if(qn!==null&&qn.size!==0){var n=qn;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var o=t.memoizedProps,u=o.name;if(u!=null&&u!=="auto"){var C=n.get(u);if(C!==void 0){var k=Qi(o.default,o.share);if(k!=="none"&&(To(t,u,k,null,!1)?(k=t.stateNode,C.paired=k,k.paired=C,No(t,o.onShare)):Li(t.child,!1)),n.delete(u),n.size===0)break}}}Tf(t)}t=t.sibling}}}function Rf(t){if(t.tag===30){var n=t.memoizedProps,o=Ki(n,t.stateNode),u=qn!==null?qn.get(o):void 0,C=Qi(n.default,u!==void 0?n.share:n.exit);C!=="none"&&(To(t,o,C,null,!1)?u!==void 0?(C=t.stateNode,u.paired=C,C.paired=u,qn.delete(o),No(t,n.onShare)):No(t,n.onExit):Li(t.child,!1)),qn!==null&&Tf(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Rf(t),t=t.sibling;else qn!==null&&Tf(t)}function u0(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,o=Ki(n,t.stateNode);n=Qi(n.default,n.update),t.flags&=-5,n!=="none"&&To(t,o,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&u0(t);t=t.sibling}}function Af(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,Li(t.child,!1))}Af(t)}t=t.sibling}}function nu(t){if(t.tag===30)t.stateNode.paired=null,Li(t.child,!1),Af(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)nu(t),t=t.sibling;else Af(t)}function h0(t){for(t=t.child;t!==null;)t.tag===30?Li(t.child,!1):(t.subtreeFlags&33554432)!==0&&h0(t),t=t.sibling}function Lf(t,n,o,u,C,k,N){for(var q=!1;n!==null;){if(n.tag===5){var J=n.stateNode;if(k!==null&&An<k.length){var se=k[An],de=lp(J);(se.view||de.view)&&(q=!0);var me;if(me=(t.flags&4)===0)if(de.clip)me=!0;else{me=se.rect;var ie=de.rect;me=me.y!==ie.y||me.x!==ie.x||me.height!==ie.height||me.width!==ie.width}me&&(t.flags|=4),de.abs?de=!se.abs:(se=se.rect,de=de.rect,de=se.height!==de.height||se.width!==de.width),de&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&lx(J,An===0?o:o+"_"+An,C),q&&(t.flags&4)!==0||(Ai===null&&(Ai=[]),Ai.push(J,An===0?u:u+"_"+An,n.memoizedProps)),An++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&N?t.flags|=n.flags&32:Lf(t,n.child,o,u,C,k,N)&&(q=!0));n=n.sibling}return q}function d0(t,n){for(t=t.child;t!==null;){if(t.tag===30){var o=t.memoizedProps,u=t.stateNode,C=Ki(o,u),k=Qi(o.default,o.update),N;N=t.memoizedState,t.memoizedState=null,u=t;var q=t.child;An=0,C=Lf(u,q,C,C,k,N,!1),(t.flags&4)!==0&&C&&No(t,o.onUpdate)}else(t.subtreeFlags&33554432)!==0&&d0(t);t=t.sibling}}var Zt=!1,ct=!1,Di=!1,Df=!1,f0=typeof WeakSet=="function"?WeakSet:Set,Jt=null,Mi=!1,il=!1,iu=!1,Mf=!1;function WE(t,n,o){if(t=t.containerInfo,ip=Vo,t=v_(t),vd(t)){if("selectionStart"in t)var u={start:t.selectionStart,end:t.selectionEnd};else e:{u=(u=t.ownerDocument)&&u.defaultView||window;var C=u.getSelection&&u.getSelection();if(C&&C.rangeCount!==0){u=C.anchorNode;var k=C.anchorOffset,N=C.focusNode;C=C.focusOffset;try{u.nodeType,N.nodeType}catch{u=null;break e}var q=0,J=-1,se=-1,de=0,me=0,ie=t,ce=null;t:for(;;){for(var Ce;ie!==u||k!==0&&ie.nodeType!==3||(J=q+k),ie!==N||C!==0&&ie.nodeType!==3||(se=q+C),ie.nodeType===3&&(q+=ie.nodeValue.length),(Ce=ie.firstChild)!==null;)ce=ie,ie=Ce;for(;;){if(ie===t)break t;if(ce===u&&++de===k&&(J=q),ce===N&&++me===C&&(se=q),(Ce=ie.nextSibling)!==null)break;ie=ce,ce=ie.parentNode}ie=Ce}u=J===-1||se===-1?null:{start:J,end:se}}else u=null}u=u||{start:0,end:0}}else u=null;for(rp={focusedElem:t,selectionRange:u},Vo=!1,o=(o&335544064)===o,Jt=n,n=o?9270:1024;Jt!==null;){if(t=Jt,o&&(u=t.deletions,u!==null))for(k=0;k<u.length;k++)o&&Rf(u[k]);if(t.alternate===null&&(t.flags&2)!==0)o&&a0(t),ru(o);else{if(t.tag===22){if(u=t.alternate,t.memoizedState!==null){u!==null&&u.memoizedState===null&&o&&Rf(u),ru(o);continue}else if(u!==null&&u.memoizedState!==null){o&&a0(t),ru(o);continue}}u=t.child,(t.subtreeFlags&n)!==0&&u!==null?(u.return=t,Jt=u):(o&&u0(t),ru(o))}}qn=null}function ru(t){for(;Jt!==null;){var n=Jt,o=t,u=n.alternate,C=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((C&1024)!==0&&u!==null){o=void 0,C=u.memoizedProps,u=u.memoizedState;var k=n.stateNode;try{var N=js(n.type,C);o=k.getSnapshotBeforeUpdate(N,u),k.__reactInternalSnapshotBeforeUpdate=o}catch(q){ft(n,n.return,q)}}break;case 3:if((C&1024)!==0){if(u=n.stateNode.containerInfo,o=u.nodeType,o===9)hp(u);else if(o===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":hp(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:o&&u!==null&&(o=Ki(u.memoizedProps,u.stateNode),C=n.memoizedProps,C=Qi(C.default,C.update),C!=="none"&&To(u,o,C,u.memoizedState=[],!0));break;default:if((C&1024)!==0)throw Error(s(163))}if(u=n.sibling,u!==null){u.return=n.return,Jt=u;break}Jt=n.return}}function p0(t,n,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:ji(t,o),u&4&&tl(5,o);break;case 1:if(ji(t,o),u&4)if(t=o.stateNode,n===null)try{t.componentDidMount()}catch(N){ft(o,o.return,N)}else{var C=js(o.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(C,n,t.__reactInternalSnapshotBeforeUpdate)}catch(N){ft(o,o.return,N)}}u&64&&n0(o),u&512&&Ri(o,o.return);break;case 3:if(ji(t,o),u&64&&(t=o.updateQueue,t!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{V_(t,n)}catch(N){ft(o,o.return,N)}}break;case 27:n===null&&u&4&&o0(o);case 26:case 5:ji(t,o),n===null&&u&4&&Sf(o),u&512&&Ri(o,o.return);break;case 12:ji(t,o);break;case 31:ji(t,o),u&4&&_0(t,o);break;case 13:ji(t,o),u&4&&x0(t,o),u&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=rk.bind(null,o),zk(t,o))));break;case 22:if(u=o.memoizedState!==null||Zt,!u){var k=n!==null&&n.memoizedState!==null||ct;n=Zt,C=ct,Zt=u,(ct=k)&&!C?(u=2,(o.subtreeFlags&8772)!==0&&(u|=1),_i(t,o,u)):ji(t,o),Zt=n,ct=C}break;case 30:ji(t,o),u&512&&Ri(o,o.return);break;case 7:u&512&&Ri(o,o.return);default:ji(t,o)}}function jf(t,n){for(t=t.child;t!==null;)m0(t,n),t=t.sibling}function m0(t,n){switch(t.tag){case 5:case 26:try{var o=t.stateNode;if(n){var u=o.style;typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"}else{var C=t.stateNode,k=t.memoizedProps.style,N=k!=null&&k.hasOwnProperty("display")?k.display:null;C.style.display=N==null||typeof N=="boolean"?"":(""+N).trim()}}catch(J){ft(t,t.return,J)}Of(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,ot=!0}catch(J){ft(t,t.return,J)}break;case 18:try{var q=t.stateNode;n?ax(q,!0):ax(t.stateNode,!1)}catch(J){ft(t,t.return,J)}break;case 22:case 23:t.memoizedState===null&&jf(t,n);break;default:jf(t,n)}}function Of(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var o=t,u=n;switch(o.tag){case 4:m0(o,u);break e;case 22:o.memoizedState===null&&Of(o,u);break e;default:Of(o,u)}}t=t.sibling}}function g0(t){var n=t.alternate;n!==null&&(t.alternate=null,g0(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&cc(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Et=null,Ln=!1;function gi(t,n,o){for(o=o.child;o!==null;)v0(t,n,o),o=o.sibling}function v0(t,n,o){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(ka,o)}catch{}switch(o.tag){case 26:ct||ln(o,n),gi(t,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!ct&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ct||ln(o,n),nl(o);var u=Et,C=Ln;Yr(o.type)&&(Et=o.stateNode,Ln=!1),gi(t,n,o),bx(o.stateNode,o.type,o.memoizedProps),Et=u,Ln=C;break;case 5:ct||ln(o,n),nl(o);case 6:if(o.tag===6&&nl(o),u=Et,C=Ln,Et=null,gi(t,n,o),Et=u,Ln=C,Et!==null)if(Ln)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(o.stateNode),ot=!0}catch(k){ft(o,n,k)}else try{Et.removeChild(o.stateNode),ot=!0}catch(k){ft(o,n,k)}break;case 18:Et!==null&&(Ln?(t=Et,ox(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),Wo(t)):ox(Et,o.stateNode));break;case 4:u=Et,C=Ln,Et=o.stateNode.containerInfo,Ln=!0,gi(t,n,o),Et=u,Ln=C;break;case 0:case 11:case 14:case 15:Fr(2,o,n),ct||Fr(4,o,n),gi(t,n,o);break;case 1:ct||(ln(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"&&i0(o,n,u)),gi(t,n,o);break;case 21:gi(t,n,o);break;case 22:ct=(u=ct)||o.memoizedState!==null,gi(t,n,o),ct=u;break;case 30:ln(o,n),gi(t,n,o);break;case 7:ct||ln(o,n),gi(t,n,o);break;default:gi(t,n,o)}}function _0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Wo(t)}catch(o){ft(n,n.return,o)}}}function x0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Wo(t)}catch(o){ft(n,n.return,o)}}function GE(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new f0),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new f0),n;default:throw Error(s(435,t.tag))}}function su(t,n){var o=GE(t);n.forEach(function(u){if(!o.has(u)){o.add(u);var C=sk.bind(null,t,u);u.then(C,C)}})}function Sn(t,n,o){var u=n.deletions;if(u!==null)for(var C=0;C<u.length;C++){var k=u[C],N=t,q=n,J=q;e:for(;J!==null;){switch(J.tag){case 27:if(Yr(J.type)){Et=J.stateNode,Ln=!1;break e}break;case 5:Et=J.stateNode,Ln=!1;break e;case 3:case 4:Et=J.stateNode.containerInfo,Ln=!0;break e}J=J.return}if(Et===null)throw Error(s(160));v0(N,q,k),Et=null,Ln=!1,N=k.alternate,N!==null&&(N.return=null),k.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)y0(n,t,o),n=n.sibling}var vi=null;function y0(t,n,o){var u=t.alternate,C=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(C&4&&(u=t.updateQueue,u=u!==null?u.events:null,u!==null))for(var k=0;k<u.length;k++){var N=u[k];N.ref.impl=N.nextImpl}Sn(n,t,o),wn(t),C&4&&(Fr(3,t,t.return),tl(3,t),Fr(5,t,t.return));break;case 1:Sn(n,t,o),wn(t),C&512&&(ct||u===null||ln(u,u.return)),C&64&&Zt&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?n:o.concat(n))));break;case 26:if(k=vi,Sn(n,t,o),wn(t),C&512&&(ct||u===null||ln(u,u.return)),C&4)if(C=u!==null?u.memoizedState:null,o=t.memoizedState,u===null)if(o===null)if(t.stateNode===null)if(Zt)t.stateNode=ix(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,o=t.memoizedProps,C=k.ownerDocument||k;t:switch(n){case"title":u=C.getElementsByTagName("title")[0],(!u||u[Aa]||u[rn]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=C.createElement(n),C.head.insertBefore(u,C.querySelector("head > title"))),cn(u,n,o),u[rn]=t,Kt(u),n=u;break e;case"link":if(k=Tx("link","href",C).get(n+(o.href||""))){for(N=0;N<k.length;N++)if(u=k[N],u.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&u.getAttribute("rel")===(o.rel==null?null:o.rel)&&u.getAttribute("title")===(o.title==null?null:o.title)&&u.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(N,1);break t}}u=C.createElement(n),cn(u,n,o),C.head.appendChild(u);break;case"meta":if(k=Tx("meta","content",C).get(n+(o.content||""))){for(N=0;N<k.length;N++)if(u=k[N],u.getAttribute("content")===(o.content==null?null:""+o.content)&&u.getAttribute("name")===(o.name==null?null:o.name)&&u.getAttribute("property")===(o.property==null?null:o.property)&&u.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&u.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(N,1);break t}}u=C.createElement(n),cn(u,n,o),C.head.appendChild(u);break;default:throw Error(s(468,n))}u[rn]=t,Kt(u),n=u}t.stateNode=n}else Zt||_p(k,t.type,t.stateNode);else t.stateNode=kx(k,o,t.memoizedProps);else C!==o?(C===null?(n=u.stateNode,n===null||ct||n.parentNode.removeChild(n)):C.count--,o===null?Zt||_p(k,t.type,t.stateNode):kx(k,o,t.memoizedProps)):o===null&&t.stateNode!==null&&wf(t,t.memoizedProps,u.memoizedProps);break;case 27:Sn(n,t,o),wn(t),C&512&&(ct||u===null||ln(u,u.return)),u!==null&&C&4&&wf(t,t.memoizedProps,u.memoizedProps);break;case 5:if(k=Di,Di=!1,Sn(n,t,o),Di=k,wn(t),C&512&&(ct||u===null||ln(u,u.return)),t.flags&32){n=t.stateNode;try{lo(n,""),ot=!0}catch(de){ft(t,t.return,de)}}C&4&&t.stateNode!=null&&(n=t.memoizedProps,wf(t,n,u!==null?u.memoizedProps:n)),C&1024&&(Df=!0);break;case 6:if(Sn(n,t,o),wn(t),C&4){if(t.stateNode===null)throw Error(s(162));n=t.memoizedProps,o=t.stateNode;try{o.nodeValue=n,ot=!0}catch(de){ft(t,t.return,de)}}break;case 3:if(ot=!1,yu=null,k=vi,vi=dl(n.containerInfo),Sn(n,t,o),vi=k,wn(t),C&4&&u!==null&&u.memoizedState.isDehydrated)try{Wo(n.containerInfo)}catch(de){ft(t,t.return,de)}Df&&(Df=!1,b0(t)),ot=!1;break;case 4:C=Di,Di=Zt,u=Fv(),k=vi,vi=dl(t.stateNode.containerInfo),Sn(n,t,o),wn(t),vi=k,ot&&il&&(iu=!0),ot=u,Di=C;break;case 12:Sn(n,t,o),wn(t);break;case 31:Sn(n,t,o),wn(t),C&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,su(t,n)));break;case 13:Sn(n,t,o),wn(t),t.child.flags&8192&&t.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(lu=Vt()),C&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,su(t,n)));break;case 22:k=t.memoizedState!==null,N=u!==null&&u.memoizedState!==null;var q=Zt,J=ct,se=Di;Zt=q||k,Di=se||k,ct=J||N,Sn(n,t,o),ct=J,Di=se,Zt=q,wn(t),C&8192&&(n=t.stateNode,n._visibility=k?n._visibility&-2:n._visibility|1,!k||u===null||N||Zt||ct||(n=N||ct,o=Zt,u=ct,Zt=k||Zt,ct=n,Ur(t,2),Zt=o,ct=u),!k&&Di||jf(t,k)),C&4&&(n=t.updateQueue,n!==null&&(o=n.retryQueue,o!==null&&(n.retryQueue=null,su(t,o))));break;case 19:Sn(n,t,o),wn(t),C&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,su(t,n)));break;case 30:C&512&&(ct||u===null||ln(u,u.return)),C=Fv(),k=il,N=(o&335544064)===o,q=t.memoizedProps,il=N&&Qi(q.default,q.update)!=="none",Sn(n,t,o),wn(t),N&&u!==null&&ot&&(t.flags|=4),il=k,ot=C;break;case 21:break;case 7:C&512&&(ct||u===null||ln(u,u.return)),u&&u.stateNode!==null&&(u.stateNode._fragmentFiber=t);default:Sn(n,t,o),wn(t)}}function wn(t){var n=t.flags;if(n&2){try{for(var o,u=t.return;u!==null;){if(s0(u)){o=u;break}u=u.return}u=null;for(var C=t.return;C!==null;){if(bf(C)){var k=C.stateNode;u===null?u=[k]:u.push(k)}if(yf(C))break;C=C.return}var N=u;if(o==null)throw Error(s(160));switch(o.tag){case 27:var q=o.stateNode,J=Cf(t);Jc(t,J,q,N);break;case 5:var se=o.stateNode;o.flags&32&&(lo(se,""),o.flags&=-33);var de=Cf(t);Jc(t,de,se,N);break;case 3:case 4:var me=o.stateNode.containerInfo,ie=Cf(t);Ef(t,ie,me,N);break;default:throw Error(s(161))}}catch(ce){ft(t,t.return,ce)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function b0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;b0(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Vo=!0,n.reset(),Vo=!1),t=t.sibling}}function Ro(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)S0(n,t),n=n.sibling;else d0(n)}function S0(t,n){var o=t.alternate;if(o===null)kf(t,!1);else switch(t.tag){case 3:if(Mf=Mi=!1,l0(),Ro(n,t),!Mi&&!iu){if(t=Ai,t!==null)for(var u=0;u<t.length;u+=3){o=t[u];var C=t[u+1];cx(o,t[u+2]),o=o.ownerDocument.documentElement,o!==null&&o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+C+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Mf=!0}Ai=null;break;case 5:Ro(n,t);break;case 4:u=Mi,Mi=!1,Ro(n,t),Mi&&(iu=!0),Mi=u;break;case 22:t.memoizedState===null&&(o.memoizedState!==null?kf(t,!1):Ro(n,t));break;case 30:u=Mi,C=l0(),Mi=!1,Ro(n,t),Mi&&(t.flags|=4);var k=t.memoizedProps,N=t.stateNode;n=Ki(k,N),N=Ki(o.memoizedProps,N);var q=Qi(k.default,k.update);q==="none"?n=!1:(k=o.memoizedState,o.memoizedState=null,o=t.child,An=0,n=Lf(t,o,n,N,q,k,!0),An!==(k===null?0:k.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(No(t,t.memoizedProps.onUpdate),Ai=C):C!==null&&(C.push.apply(C,Ai),Ai=C),Mi=(t.flags&32)!==0?!0:u;break;default:Ro(n,t)}}function ji(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)p0(t,n.alternate,n),n=n.sibling}function Ur(t,n){for(t=t.child;t!==null;){var o=t,u=n;switch(o.tag){case 0:case 11:case 14:case 15:Fr(4,o,o.return),Ur(o,u);break;case 1:ln(o,o.return);var C=o.stateNode;typeof C.componentWillUnmount=="function"&&i0(o,o.return,C),Ur(o,u);break;case 27:(u&2)!==0&&bx(o.stateNode,o.type,o.memoizedProps);case 5:ln(o,o.return),o.tag!==5&&o.tag!==27||nl(o),Ur(o,u);break;case 6:nl(o);break;case 26:ln(o,o.return),C=o.stateNode,o.memoizedState!==null||C===null||ct||C.parentNode.removeChild(C),Ur(o,u);break;case 22:o.memoizedState===null&&Ur(o,u);break;case 30:ln(o,o.return),Ur(o,u);break;case 7:ln(o,o.return);default:Ur(o,u)}t=t.sibling}}function _i(t,n,o){for(o=(n.subtreeFlags&8772)!==0?o:o&-2,n=n.child;n!==null;){var u=n.alternate,C=t,k=n,N=k.flags,q=(o&1)!==0;switch(k.tag){case 0:case 11:case 15:_i(C,k,o),tl(4,k);break;case 1:if(_i(C,k,o),u=k,C=u.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(de){ft(u,u.return,de)}if(u=k,C=u.updateQueue,C!==null){var J=u.stateNode;try{var se=C.shared.hiddenCallbacks;if(se!==null)for(C.shared.hiddenCallbacks=null,C=0;C<se.length;C++)q_(se[C],J)}catch(de){ft(u,u.return,de)}}q&&N&64&&n0(k),Ri(k,k.return);break;case 27:(o&2)!==0&&o0(k);case 5:k.tag!==5&&k.tag!==27||r0(k),_i(C,k,o),q&&u===null&&N&4&&Sf(k),Ri(k,k.return);break;case 6:r0(k);break;case 26:J=k.stateNode,k.memoizedState!==null||J===null||Zt||_p(dl(J.ownerDocument),k.type,J),_i(C,k,o),q&&u===null&&N&4&&Sf(k),Ri(k,k.return);break;case 12:_i(C,k,o);break;case 31:_i(C,k,o),q&&N&4&&_0(C,k);break;case 13:_i(C,k,o),q&&N&4&&x0(C,k);break;case 22:k.memoizedState===null&&_i(C,k,o),Ri(k,k.return);break;case 30:_i(C,k,o),Ri(k,k.return);break;case 7:Ri(k,k.return);default:_i(C,k,o)}n=n.sibling}}function Nf(t,n){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Ua(o))}function Bf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ua(t))}function li(t,n,o,u){var C=(o&335544064)===o;if(n.subtreeFlags&(C?10262:10256))for(n=n.child;n!==null;)w0(t,n,o,u),n=n.sibling;else C&&h0(n)}function w0(t,n,o,u){var C=(o&335544064)===o;C&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&nu(n);var k=n.flags;switch(n.tag){case 0:case 11:case 15:li(t,n,o,u),k&2048&&tl(9,n);break;case 1:li(t,n,o,u);break;case 3:li(t,n,o,u),C&&Mf&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),k&2048&&(k=null,n.alternate!==null&&(k=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==k&&(n.refCount++,k!=null&&Ua(k)));break;case 12:if(k&2048){li(t,n,o,u),k=n.stateNode;try{var N=n.memoizedProps,q=N.id,J=N.onPostCommit;typeof J=="function"&&J(q,n.alternate===null?"mount":"update",k.passiveEffectDuration,-0)}catch(se){ft(n,n.return,se)}}else li(t,n,o,u);break;case 31:li(t,n,o,u);break;case 13:li(t,n,o,u);break;case 23:break;case 22:N=n.stateNode,q=n.alternate,n.memoizedState!==null?(C&&q!==null&&q.memoizedState===null&&nu(q),N._visibility&2?li(t,n,o,u):rl(t,n)):(C&&q!==null&&q.memoizedState!==null&&nu(n),N._visibility&2?li(t,n,o,u):(N._visibility|=2,Ao(t,n,o,u,(n.subtreeFlags&10256)!==0||!1))),k&2048&&Nf(q,n);break;case 24:li(t,n,o,u),k&2048&&Bf(n.alternate,n);break;case 30:C&&(k=n.alternate,k!==null&&(Li(k.child,!0),Li(n.child,!0))),li(t,n,o,u);break;default:li(t,n,o,u)}}function Ao(t,n,o,u,C){for(C=C&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var k=t,N=n,q=o,J=u,se=N.flags;switch(N.tag){case 0:case 11:case 15:Ao(k,N,q,J,C),tl(8,N);break;case 23:break;case 22:var de=N.stateNode;N.memoizedState!==null?de._visibility&2?Ao(k,N,q,J,C):rl(k,N):(de._visibility|=2,Ao(k,N,q,J,C)),C&&se&2048&&Nf(N.alternate,N);break;case 24:Ao(k,N,q,J,C),C&&se&2048&&Bf(N.alternate,N);break;default:Ao(k,N,q,J,C)}n=n.sibling}}function rl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=t,u=n,C=u.flags;switch(u.tag){case 22:rl(o,u),C&2048&&Nf(u.alternate,u);break;case 24:rl(o,u),C&2048&&Bf(u.alternate,u);break;default:rl(o,u)}n=n.sibling}}var Os=8192;function Ns(t,n,o){if(t.subtreeFlags&Os)for(t=t.child;t!==null;)C0(t,n,o),t=t.sibling}function C0(t,n,o){switch(t.tag){case 26:Ns(t,n,o),t.flags&Os&&(t.memoizedState!==null?Jk(o,vi,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&Dx(o,t)));break;case 5:Ns(t,n,o),t.flags&Os&&(t=t.stateNode,(n&335544128)===n&&Dx(o,t));break;case 3:case 4:var u=vi;vi=dl(t.stateNode.containerInfo),Ns(t,n,o),vi=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Os,Os=16777216,Ns(t,n,o),Os=u):Ns(t,n,o));break;case 30:if((t.flags&Os)!==0&&(u=t.memoizedProps.name,u!=null&&u!=="auto")){var C=t.stateNode;C.paired=null,qn===null&&(qn=new Map),qn.set(u,C)}Ns(t,n,o);break;default:Ns(t,n,o)}}function E0(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function sl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];Jt=u,T0(u,t)}E0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)k0(t),t=t.sibling}function k0(t){switch(t.tag){case 0:case 11:case 15:sl(t),t.flags&2048&&Fr(9,t,t.return);break;case 3:sl(t);break;case 12:sl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,ou(t)):sl(t);break;default:sl(t)}}function ou(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];Jt=u,T0(u,t)}E0(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Fr(8,n,n.return),ou(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,ou(n));break;default:ou(n)}t=t.sibling}}function T0(t,n){for(;Jt!==null;){var o=Jt;switch(o.tag){case 0:case 11:case 15:Fr(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Ua(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Jt=u;else e:for(o=t;Jt!==null;){u=Jt;var C=u.sibling,k=u.return;if(g0(u),u===o){Jt=null;break e}if(C!==null){C.return=k,Jt=C;break e}Jt=k}}}var YE={getCacheForType:function(t){var n=sn(Bt),o=n.data.get(t);return o===void 0&&(o=t(),n.data.set(t,o)),o},cacheSignal:function(){return sn(Bt).controller.signal}},XE=typeof WeakMap=="function"?WeakMap:Map,lt=0,_t=null,Qe=null,Je=0,dt=0,Vn=null,$r=!1,Lo=!1,Pf=!1,or=0,Lt=0,qr=0,Bs=0,au=0,Wn=0,Do=0,ol=null,Dn=null,If=!1,lu=0,R0=0,cu=1/0,uu=null,Vr=null,Rt=0,xi=null,Ps=null,Oi=0,zf=0,Hf=null,A0=null,Mo=null,jo=null,Oo=null,al=0,hu=null;function Gn(){return(lt&2)!==0&&Je!==0?Je&-Je:ue.T!==null?Kf():Mv()}function L0(){if(Wn===0)if((Je&536870912)===0||Xe){var t=sc;sc<<=1,(sc&3932160)===0&&(sc=262144),Wn=t}else Wn=536870912;return t=on.current,t!==null&&(t.flags|=32),Wn}function No(t,n){if(n!=null){var o=t.stateNode,u=o.ref;u===null&&(u=o.ref=ux(Ki(t.memoizedProps,o))),jo===null&&(jo=[]),jo.push(n.bind(null,u))}}function Mn(t,n,o){(t===_t&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(Bo(t,0),Wr(t,Je,Wn,!1)),Ra(t,o),((lt&2)===0||t!==_t)&&(t===_t&&((lt&2)===0&&(Bs|=o),Lt===4&&Wr(t,Je,Wn,!1)),Ni(t))}function D0(t,n,o){if((lt&6)!==0)throw Error(s(327));var u=!o&&(n&127)===0&&(n&t.expiredLanes)===0||Ta(t,n),C=u?ZE(t,n):Uf(t,n,!0),k=u;do{if(C===0){Lo&&!u&&Wr(t,n,0,!1);break}else{if(o=t.current.alternate,k&&!KE(o)){C=Uf(t,n,!1),k=!1;continue}if(C===2){if(k=n,t.errorRecoveryDisabledLanes&k)var N=0;else N=t.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){n=N;e:{var q=t;C=ol;var J=q.current.memoizedState.isDehydrated;if(J&&(Bo(q,N).flags|=256),N=Uf(q,N,!1),N!==2&&N!==6){if(Pf&&!J){q.errorRecoveryDisabledLanes|=k,Bs|=k,C=4;break e}k=Dn,Dn=C,k!==null&&(Dn===null?Dn=k:Dn.push.apply(Dn,k))}C=N}if(k=!1,C!==2)continue}}if(C===1){Bo(t,0),Wr(t,n,0,!0);break}e:{switch(u=t,k=C,k){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:Wr(u,n,Wn,!$r);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(C=lu+300-Vt(),10<C)){if(Wr(u,n,Wn,!$r),ac(u,0,!0)!==0)break e;Oi=n,u.timeoutHandle=ap(M0.bind(null,u,o,Dn,uu,If,n,Wn,Bs,Do,$r,k,"Throttled",-0,0),C);break e}M0(u,o,Dn,uu,If,n,Wn,Bs,Do,$r,k,null,-0,0)}}break}while(!0);Ni(t)}function M0(t,n,o,u,C,k,N,q,J,se,de,me,ie,ce){t.timeoutHandle=-1;var Ce=n.subtreeFlags,je=(k&335544064)===k;if(me=null,(je||Ce&8192||(Ce&16785408)===16785408)&&(me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ei},qn=null,C0(n,k,me),je&&(Ce=me,je=t.containerInfo,je=(je.nodeType===9?je:je.ownerDocument).__reactViewTransition,je!=null&&(Ce.count++,Ce.waitingForViewTransition=!0,Ce=ml.bind(Ce),je.finished.then(Ce,Ce))),Ce=(k&62914560)===k?lu-Vt():(k&4194048)===k?R0-Vt():0,Ce=e3(me,Ce),Ce!==null)){Oi=k,t.cancelPendingCommit=Ce(H0.bind(null,t,n,k,o,u,C,N,q,J,se,de,me,null,ie,ce)),Wr(t,k,N,!se);return}H0(t,n,k,o,u,C,N,q,J,se,de,me)}function KE(t){for(var n=t;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var C=o[u],k=C.getSnapshot;C=C.value;try{if(!Un(k(),C))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Wr(t,n,o,u){n=Tv(t,n),n&=~au,n&=~Bs,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var C=n;0<C;){var k=31-Hn(C),N=1<<k;u[k]=-1,C&=~N}o!==0&&Av(t,o,n)}function du(){return(lt&6)===0?(ll(0),!1):!0}function Ff(){if(Qe!==null){if(dt===0)var t=Qe.return;else t=Qe,er=Cs=null,Yd(t),So=null,Va=0,t=Qe;for(;t!==null;)t0(t.alternate,t),t=t.return;Qe=null}}function Bo(t,n){var o=t.timeoutHandle;return o!==-1&&(t.timeoutHandle=-1,yk(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),Oi=0,Ff(),_t=t,Qe=o=Zi(t.current,null),Je=n,dt=0,Vn=null,$r=!1,Lo=Ta(t,n),Pf=!1,Do=Wn=au=Bs=qr=Lt=0,Dn=ol=null,If=!1,or=Tv(t,n),yc(),o}function j0(t,n){We=null,ue.H=Vc,n===bo||n===Dc?(n=H_(),dt=3):n===Nd?(n=H_(),dt=4):dt=n===uf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Vn=n,Qe===null&&(Lt=1,Wc(t,ri(n,t.current)))}function O0(){var t=on.current;return t===null?!0:(Je&4194048)===Je?mn===null:(Je&62914560)===Je||(Je&536870912)!==0?t===mn:!1}function N0(){var t=ue.H;return ue.H=Vc,t===null?Vc:t}function B0(){var t=ue.A;return ue.A=YE,t}function fu(){Lt=4,$r||(Je&4194048)!==Je&&on.current!==null||(Lo=!0),(qr&134217727)===0&&(Bs&134217727)===0||_t===null||Wr(_t,Je,Wn,!1)}function Uf(t,n,o){var u=lt;lt|=2;var C=N0(),k=B0();(_t!==t||Je!==n)&&(uu=null,Bo(t,n)),n=!1;var N=Lt;e:do try{if(dt!==0&&Qe!==null){var q=Qe,J=Vn;switch(dt){case 8:Ff(),N=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(n=!0);var se=dt;if(dt=0,Vn=null,Po(t,q,J,se),o&&Lo){N=0;break e}break;default:se=dt,dt=0,Vn=null,Po(t,q,J,se)}}QE(),N=Lt;break}catch(de){j0(t,de)}while(!0);return n&&t.shellSuspendCounter++,er=Cs=null,lt=u,ue.H=C,ue.A=k,Qe===null&&(_t=null,Je=0,yc()),N}function QE(){for(;Qe!==null;)P0(Qe)}function ZE(t,n){var o=lt;lt|=2;var u=N0(),C=B0();_t!==t||Je!==n?(uu=null,cu=Vt()+500,Bo(t,n)):Lo=Ta(t,n);e:do try{if(dt!==0&&Qe!==null){n=Qe;var k=Vn;t:switch(dt){case 1:dt=0,Vn=null,Po(t,n,k,1);break;case 2:case 9:if(I_(k)){dt=0,Vn=null,I0(n);break}n=function(){dt!==2&&dt!==9||_t!==t||(dt=7),Ni(t)},k.then(n,n);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:I_(k)?(dt=0,Vn=null,I0(n)):(dt=0,Vn=null,Po(t,n,k,7));break;case 5:var N=null;switch(Qe.tag){case 26:N=Qe.memoizedState;case 5:case 27:var q=Qe;if(N?Ax(N):q.stateNode.complete){dt=0,Vn=null;var J=q.sibling;if(J!==null)Qe=J;else{var se=q.return;se!==null?(Qe=se,pu(se)):Qe=null}break t}}dt=0,Vn=null,Po(t,n,k,5);break;case 6:dt=0,Vn=null,Po(t,n,k,6);break;case 8:Ff(),Lt=6;break e;default:throw Error(s(462))}}JE();break}catch(de){j0(t,de)}while(!0);return er=Cs=null,ue.H=u,ue.A=C,lt=o,Qe!==null?0:(_t=null,Je=0,yc(),Lt)}function JE(){for(;Qe!==null&&!ei();)P0(Qe)}function P0(t){var n=J1(t.alternate,t,or);t.memoizedProps=t.pendingProps,n===null?pu(t):Qe=n}function I0(t){var n=t,o=n.alternate;switch(n.tag){case 15:case 0:n=W1(o,n,n.pendingProps,n.type,void 0,Je);break;case 11:n=W1(o,n,n.pendingProps,n.type.render,n.ref,Je);break;case 5:Yd(n);var u=n;u===Qt&&(Xe?(kc(u),u.tag===5&&u.stateNode!=null&&(bt=u.stateNode)):(kc(u),Xe=!0));default:t0(o,n),n=Qe=T_(n,or),n=J1(o,n,or)}t.memoizedProps=t.pendingProps,n===null?pu(t):Qe=n}function Po(t,n,o,u){er=Cs=null,Yd(n),So=null,Va=0;var C=n.return;try{if(HE(t,C,n,o,Je)){Lt=1,Wc(t,ri(o,t.current)),Qe=null;return}}catch(k){if(C!==null)throw Qe=C,k;Lt=1,Wc(t,ri(o,t.current)),Qe=null;return}n.flags&32768?(Xe||u===1?t=!0:Lo||(Je&536870912)!==0?t=!1:($r=t=!0,(u===2||u===9||u===3||u===6)&&(u=on.current,u!==null&&u.tag===13&&(u.flags|=16384))),z0(n,t)):pu(n)}function pu(t){var n=t;do{if((n.flags&32768)!==0){z0(n,$r);return}t=n.return;var o=qE(n.alternate,n,or);if(o!==null){Qe=o;return}if(n=n.sibling,n!==null){Qe=n;return}Qe=n=t}while(n!==null);Lt===0&&(Lt=5)}function z0(t,n){do{var o=VE(t.alternate,t);if(o!==null){o.flags&=32767,Qe=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=o}while(t!==null);Lt=6,Qe=null}function H0(t,n,o,u,C,k,N,q,J,se,de,me){t.cancelPendingCommit=null;do mu();while(Rt!==0);if((lt&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));t===_t&&(Qe=_t=null,Je=0),Ps=n,xi=t,Oi=o,Hf=C,A0=u,ek(t,n,o,N,q,J,me)}}function ek(t,n,o,u,C,k,N){var q=n.lanes|n.childLanes;if(zf=q,q|=Sd,k5(t,o,q,u,C,k),jo=null,(o&335544064)===o?(Oo=RE(t),u=10262):(Oo=null,u=10256),(n.subtreeFlags&u)!==0||(n.flags&u)!==0?(t.callbackNode=null,t.callbackPriority=0,ok(no,function(){return Wf(),null})):(t.callbackNode=null,t.callbackPriority=0),eu=!1,u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=ue.T,ue.T=null,C=he.p,he.p=2,k=lt,lt|=4;try{WE(t,n,o)}finally{lt=k,he.p=C,ue.T=u}}Rt=1,eu?Mo=kk(N,t.containerInfo,Oo,$f,qf,nk,Vf,Wf,tk):($f(),qf(),Vf())}function tk(t){if(Rt!==0){var n=xi.onRecoverableError;n(t,{componentStack:null})}}function nk(){Rt===3&&(Rt=0,S0(Ps,xi),Rt=4)}function $f(){if(Rt===1){Rt=0;var t=xi,n=Ps,o=Oi,u=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||u){u=ue.T,ue.T=null;var C=he.p;he.p=2;var k=lt;lt|=4;try{il=iu=!1,y0(n,t,o),o=rp;var N=v_(t.containerInfo),q=o.focusedElem,J=o.selectionRange;if(N!==q&&q&&q.ownerDocument&&g_(q.ownerDocument.documentElement,q)){if(J!==null&&vd(q)){var se=J.start,de=J.end;if(de===void 0&&(de=se),"selectionStart"in q)q.selectionStart=se,q.selectionEnd=Math.min(de,q.value.length);else{var me=q.ownerDocument||document,ie=me&&me.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Ce=q.textContent.length,je=Math.min(J.start,Ce),Ge=J.end===void 0?je:Math.min(J.end,Ce);!ce.extend&&je>Ge&&(N=Ge,Ge=je,je=N);var re=m_(q,je),te=m_(q,Ge);if(re&&te&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==te.node||ce.focusOffset!==te.offset)){var ae=me.createRange();ae.setStart(re.node,re.offset),ce.removeAllRanges(),je>Ge?(ce.addRange(ae),ce.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),ce.addRange(ae))}}}}for(me=[],ce=q;ce=ce.parentNode;)ce.nodeType===1&&me.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<me.length;q++){var pe=me[q];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Vo=!!ip,rp=ip=null}finally{lt=k,he.p=C,ue.T=u}}t.current=n,Rt=2}}function qf(){if(Rt===2){Rt=0;var t=xi,n=Ps,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=ue.T,ue.T=null;var u=he.p;he.p=2;var C=lt;lt|=4;try{p0(t,n.alternate,n)}finally{lt=C,he.p=u,ue.T=o}}Rt=3}}function Vf(){if(Rt===4||Rt===3){Rt=0;var t=Mo;Mo=null,to();var n=xi,o=Ps,u=Oi,C=A0,k=(u&335544064)===u?10262:10256;if((o.subtreeFlags&k)!==0||(o.flags&k)!==0?Rt=5:(Rt=0,Ps=xi=null,F0(n,n.pendingLanes)),k=n.pendingLanes,k===0&&(Vr=null),Jh(u),o=o.stateNode,zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(ka,o,void 0,(o.current.flags&128)===128)}catch{}if(C!==null){o=ue.T,k=he.p,he.p=2,ue.T=null;try{for(var N=n.onRecoverableError,q=0;q<C.length;q++){var J=C[q];N(J.value,{componentStack:J.stack})}}finally{ue.T=o,he.p=k}}if(C=jo,N=Oo,Oo=null,C!==null&&(jo=null,N===null&&(N=[]),t!==null))for(J=0;J<C.length;J++)o=(0,C[J])(N),o!==void 0&&t.finished.finally(o);(Oi&3)!==0&&mu(),Ni(n),k=n.pendingLanes,(u&261930)!==0&&(k&42)!==0?n===hu?al++:(al=0,hu=n):(al=0,hu=null),ll(0)}}function F0(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ua(n)))}function mu(){return Mo!==null&&(Mo.skipTransition(),Mo=null),$f(),qf(),Vf(),Wf()}function Wf(){if(Rt!==5)return!1;var t=xi,n=zf;zf=0;var o=Jh(Oi),u=ue.T,C=he.p;try{he.p=32>o?32:o,ue.T=null,o=Hf,Hf=null;var k=xi,N=Oi;if(Rt=0,Ps=xi=null,Oi=0,(lt&6)!==0)throw Error(s(331));var q=lt;if(lt|=4,k0(k.current),w0(k,k.current,N,o),lt=q,ll(0,!1),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(ka,k)}catch{}return!0}finally{he.p=C,ue.T=u,F0(t,n)}}function U0(t,n,o){n=ri(o,n),n=cf(t.stateNode,n,2),t=Pr(t,n,2),t!==null&&(Ra(t,2),Ni(t))}function ft(t,n,o){if(t.tag===3)U0(t,t,o);else for(;n!==null;){if(n.tag===3){U0(n,t,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Vr===null||!Vr.has(u))){t=ri(o,t),o=I1(2),u=Pr(n,o,2),u!==null&&(z1(o,u,n,t),Ra(u,2),Ni(u));break}}n=n.return}}function Gf(t,n,o){var u=t.pingCache;if(u===null){u=t.pingCache=new XE;var C=new Set;u.set(n,C)}else C=u.get(n),C===void 0&&(C=new Set,u.set(n,C));C.has(o)||(Pf=!0,C.add(o),t=ik.bind(null,t,n,o),n.then(t,t))}function ik(t,n,o){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,_t===t&&(Je&o)===o&&((Lt===4||Lt===3&&(Je&62914560)===Je&&300>Vt()-lu)&&(lt&2)===0?Bo(t,0):au|=o,Do===Je&&(Do=0)),Ni(t)}function $0(t,n){n===0&&(n=Rv()),t=bs(t,n),t!==null&&(Ra(t,n),Ni(t))}function rk(t){var n=t.memoizedState,o=0;n!==null&&(o=n.retryLane),$0(t,o)}function sk(t,n){var o=0;switch(t.tag){case 31:case 13:var u=t.stateNode,C=t.memoizedState;C!==null&&(o=C.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(n),$0(t,o)}function ok(t,n){return kn(t,n)}var Io=null,zo=null,Yf=!1,gu=!1,Xf=!1,Gr=0;function Ni(t){t!==zo&&t.next===null&&(zo===null?Io=zo=t:zo=zo.next=t),gu=!0,Yf||(Yf=!0,lk())}function ll(t,n){if(!Xf&&gu){Xf=!0;do for(var o=!1,u=Io;u!==null;){if(t!==0){var C=u.pendingLanes;if(C===0)var k=0;else{var N=u.suspendedLanes,q=u.pingedLanes;k=(1<<31-Hn(42|t)+1)-1,k&=C&~(N&~q),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(o=!0,G0(u,k))}else k=Je,k=ac(u,u===_t?k:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(k&3)===0||Ta(u,k)||(o=!0,G0(u,k));u=u.next}while(o);Xf=!1}}function ak(){q0()}function q0(){gu=Yf=!1;var t=0;Gr!==0&&xk()&&(t=Gr);for(var n=Vt(),o=null,u=Io;u!==null;){var C=u.next,k=V0(u,n);k===0?(u.next=null,o===null?Io=C:o.next=C,C===null&&(zo=o)):(o=u,(t!==0||(k&3)!==0)&&(gu=!0)),u=C}Rt!==0&&Rt!==5||ll(t),Gr!==0&&(Gr=0)}function V0(t,n){for(var o=t.suspendedLanes,u=t.pingedLanes,C=t.expirationTimes,k=t.pendingLanes&-62914561;0<k;){var N=31-Hn(k),q=1<<N,J=C[N];J===-1?((q&o)===0||(q&u)!==0)&&(C[N]=E5(q,n)):J<=n&&(t.expiredLanes|=q),k&=~q}if(n=_t,o=Je,o=ac(t,t===n?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,o===0||t===n&&(dt===2||dt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Jn(u),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||Ta(t,o)){if(n=o&-o,n===t.callbackPriority)return n;switch(u!==null&&Jn(u),Jh(o)){case 2:case 8:o=xn;break;case 32:o=no;break;case 268435456:o=kv;break;default:o=no}return u=W0.bind(null,t),o=kn(o,u),t.callbackPriority=n,t.callbackNode=o,n}return u!==null&&u!==null&&Jn(u),t.callbackPriority=2,t.callbackNode=null,2}function W0(t,n){if(Rt!==0&&Rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(mu()&&t.callbackNode!==o)return null;var u=Je;return u=ac(t,t===_t?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(D0(t,u,n),V0(t,Vt()),t.callbackNode!=null&&t.callbackNode===o?W0.bind(null,t):null)}function G0(t,n){if(mu())return null;D0(t,n,!0)}function lk(){bk(function(){(lt&6)!==0?kn(ti,ak):q0()})}function Kf(){if(Gr===0){var t=Ts;t===0&&(t=rc,rc<<=1,(rc&261888)===0&&(rc=256)),Gr=t}return Gr}function Y0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:dc(t)}function ck(t,n,o,u,C){if(n==="submit"&&o&&o.stateNode===C){var k=Y0((C[Tn]||null).action),N=u.submitter;N&&(n=(n=N[Tn]||null)?Y0(n.formAction):N.getAttribute("formAction"),n!==null&&(k=n,N=null));var q=new gc("action","action",null,u,C);t.push({event:q,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Gr!==0){var J=new FormData(C,N);rf(o,{pending:!0,data:J,method:C.method,action:k},null,J)}}else typeof k=="function"&&(q.preventDefault(),J=new FormData(C,N),rf(o,{pending:!0,data:J,method:C.method,action:k},k,J))},currentTarget:C}]})}}for(var Qf=0;Qf<bd.length;Qf++){var Zf=bd[Qf],uk=Zf.toLowerCase(),hk=Zf[0].toUpperCase()+Zf.slice(1);mi(uk,"on"+hk)}mi(y_,"onAnimationEnd"),mi(b_,"onAnimationIteration"),mi(S_,"onAnimationStart"),mi("dblclick","onDoubleClick"),mi("focusin","onFocus"),mi("focusout","onBlur"),mi(yE,"onTransitionRun"),mi(bE,"onTransitionStart"),mi(SE,"onTransitionCancel"),mi(w_,"onTransitionEnd"),oo("onMouseEnter",["mouseout","mouseover"]),oo("onMouseLeave",["mouseout","mouseover"]),oo("onPointerEnter",["pointerout","pointerover"]),oo("onPointerLeave",["pointerout","pointerover"]),_s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_s("onBeforeInput",["compositionend","keypress","textInput","paste"]),_s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cl="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(" "),dk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cl));function X0(t,n){n=(n&4)!==0;for(var o=0;o<t.length;o++){var u=t[o],C=u.event;u=u.listeners;e:{var k=void 0;if(n)for(var N=u.length-1;0<=N;N--){var q=u[N],J=q.instance,se=q.currentTarget;if(q=q.listener,J!==k&&C.isPropagationStopped())break e;k=q,C.currentTarget=se;try{k(C)}catch(de){xc(de)}C.currentTarget=null,k=J}else for(N=0;N<u.length;N++){if(q=u[N],J=q.instance,se=q.currentTarget,q=q.listener,J!==k&&C.isPropagationStopped())break e;k=q,C.currentTarget=se;try{k(C)}catch(de){xc(de)}C.currentTarget=null,k=J}}}}function Ze(t,n){var o=n[Ov];o===void 0&&(o=n[Ov]=new Set);var u=t+"__bubble";o.has(u)||(K0(n,t,2,!1),o.add(u))}function Jf(t,n,o){var u=0;n&&(u|=4),K0(o,t,u,n)}var vu="_reactListening"+Math.random().toString(36).slice(2);function ep(t){if(!t[vu]){t[vu]=!0,Pv.forEach(function(o){o!=="selectionchange"&&(dk.has(o)||Jf(o,!1,t),Jf(o,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[vu]||(n[vu]=!0,Jf("selectionchange",!1,n))}}function K0(t,n,o,u){switch(zx(n)){case 2:var C=r3;break;case 8:C=s3;break;default:C=yp}o=C.bind(null,n,o,t),C=void 0,!ad||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(C=!0),u?C!==void 0?t.addEventListener(n,o,{capture:!0,passive:C}):t.addEventListener(n,o,!0):C!==void 0?t.addEventListener(n,o,{passive:C}):t.addEventListener(n,o,!1)}function tp(t,n,o,u,C){var k=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var N=u.tag;if(N===3||N===4){var q=u.stateNode.containerInfo;if(q===C)break;if(N===4)for(N=u.return;N!==null;){var J=N.tag;if((J===3||J===4)&&N.stateNode.containerInfo===C)return;N=N.return}for(;q!==null;){if(N=vs(q),N===null)return;if(J=N.tag,J===5||J===6||J===26||J===27){u=k=N;continue e}q=q.parentNode}}u=u.return}Kv(function(){var se=k,de=sd(o),me=[];e:{var ie=C_.get(t);if(ie!==void 0){var ce=gc,Ce=t;switch(t){case"keypress":if(pc(o)===0)break e;case"keydown":case"keyup":ce=K5;break;case"focusin":Ce="focus",ce=hd;break;case"focusout":Ce="blur",ce=hd;break;case"beforeblur":case"afterblur":ce=hd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Jv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=I5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=tE;break;case y_:case b_:case S_:ce=F5;break;case w_:ce=iE;break;case"scroll":case"scrollend":ce=B5;break;case"wheel":ce=sE;break;case"copy":case"cut":case"paste":ce=$5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=t_;break;case"submit":ce=J5;break;case"toggle":case"beforetoggle":ce=aE}var je=(n&4)!==0,Ge=!je&&(t==="scroll"||t==="scrollend"),re=je?ie!==null?ie+"Capture":null:ie;je=[];for(var te=se,ae;te!==null;){var pe=te;if(ae=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ae===null||re===null||(pe=Da(te,re),pe!=null&&je.push(ul(te,pe,ae))),Ge)break;te=te.return}0<je.length&&(ie=new ce(ie,Ce,null,o,de),me.push({event:ie,listeners:je}))}}if((n&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",ce&&o!==rd&&(Ce=o.relatedTarget||o.fromElement)&&(vs(Ce)||Ce[io]))break e;(ie||ce)&&(Ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ie?(ce=o.relatedTarget||o.toElement,ie=se,ce=ce?vs(ce):null,ce!==null&&(Ge=f(ce),je=ce.tag,ce!==Ge||je!==5&&je!==27&&je!==6)&&(ce=null)):(ie=null,ce=se),ie!==ce&&(je=Jv,pe="onMouseLeave",re="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(je=t_,pe="onPointerLeave",re="onPointerEnter",te="pointer"),Ge=ie==null?Ce:La(ie),ae=ce==null?Ce:La(ce),Ce=new je(pe,te+"leave",ie,o,de),Ce.target=Ge,Ce.relatedTarget=ae,pe=null,vs(de)===se&&(je=new je(re,te+"enter",ce,o,de),je.target=ae,je.relatedTarget=Ge,pe=je),Ge=pe,je=ie&&ce?R(ie,ce,fk):null,ie!==null&&Q0(me,Ce,ie,je,!1),ce!==null&&Ge!==null&&Q0(me,Ge,ce,je,!0)))}e:{if(ie=se?La(se):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Ae=c_;else if(a_(ie))if(u_)Ae=vE;else{Ae=mE;var et=pE}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?se&&id(se.elementType)&&(Ae=c_):Ae=gE;if(Ae&&(Ae=Ae(t,se))){l_(me,Ae,o,de);break e}et&&et(t,ie,se)}switch(et=se?La(se):window,t){case"focusin":(a_(et)||et.contentEditable==="true")&&(fo=et,_d=se,za=null);break;case"focusout":za=_d=fo=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,__(me,o,de);break;case"selectionchange":if(xE)break;case"keydown":case"keyup":__(me,o,de)}var Oe;if(fd)e:{switch(t){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else ho?s_(t,o)&&(Pe="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Pe="onCompositionStart");Pe&&(n_&&o.locale!=="ko"&&(ho||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&ho&&(Oe=Qv()):(Rr=de,ld="value"in Rr?Rr.value:Rr.textContent,ho=!0)),et=_u(se,Pe),0<et.length&&(Pe=new e_(Pe,t,null,o,de),me.push({event:Pe,listeners:et}),Oe?Pe.data=Oe:(Oe=o_(o),Oe!==null&&(Pe.data=Oe)))),(Oe=cE?uE(t,o):hE(t,o))&&(Pe=_u(se,"onBeforeInput"),0<Pe.length&&(et=new e_("onBeforeInput","beforeinput",null,o,de),me.push({event:et,listeners:Pe}),et.data=Oe)),ck(me,t,se,o,de)}X0(me,n)})}function ul(t,n,o){return{instance:t,listener:n,currentTarget:o}}function _u(t,n){for(var o=n+"Capture",u=[];t!==null;){var C=t,k=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||k===null||(C=Da(t,o),C!=null&&u.unshift(ul(t,C,k)),C=Da(t,n),C!=null&&u.push(ul(t,C,k))),t.tag===3)return u;t=t.return}return[]}function fk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Q0(t,n,o,u,C){for(var k=n._reactName,N=[];o!==null&&o!==u;){var q=o,J=q.alternate,se=q.stateNode;if(q=q.tag,J!==null&&J===u)break;q!==5&&q!==26&&q!==27||se===null||(J=se,C?(se=Da(o,k),se!=null&&N.unshift(ul(o,se,J))):C||(se=Da(o,k),se!=null&&N.push(ul(o,se,J)))),o=o.return}N.length!==0&&t.push({event:n,listeners:N})}var pk=/\r\n?/g,mk=/\u0000|\uFFFD/g;function Z0(t){return(typeof t=="string"?t:""+t).replace(pk,`
50
+ `).replace(mk,"")}function J0(t,n){return n=Z0(n),Z0(t)===n}function pt(t,n,o,u,C,k){switch(o){case"children":if(typeof u=="string")n==="body"||n==="textarea"&&u===""||lo(t,u);else if(typeof u=="number"||typeof u=="bigint")n!=="body"&&lo(t,""+u);else return;break;case"className":hc(t,"class",u);break;case"tabIndex":hc(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":hc(t,o,u);break;case"style":Yv(t,u,k);return;case"data":if(n!=="object"){hc(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||o!=="href")){t.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=dc(u),t.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(o,"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 k=="function"&&(o==="formAction"?(n!=="input"&&pt(t,n,"name",C.name,C,null),pt(t,n,"formEncType",C.formEncType,C,null),pt(t,n,"formMethod",C.formMethod,C,null),pt(t,n,"formTarget",C.formTarget,C,null)):(pt(t,n,"encType",C.encType,C,null),pt(t,n,"method",C.method,C,null),pt(t,n,"target",C.target,C,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=dc(u),t.setAttribute(o,u);break;case"onClick":u!=null&&(t.onclick=Ei);return;case"onScroll":u!=null&&Ze("scroll",t);return;case"onScrollEnd":u!=null&&Ze("scrollend",t);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(o=u.__html,o!=null){if(C.children!=null)throw Error(s(60));(k!=null?k.__html:void 0)!==o&&(t.innerHTML=o)}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}o=dc(u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":u===!0?t.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(o,u):t.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(o):t.setAttribute(o,u);break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),uc(t,"popover",u);break;case"xlinkActuate":Yi(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Yi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Yi(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Yi(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Yi(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Yi(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Yi(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Yi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Yi(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":uc(t,"is",u);break;case"innerText":case"textContent":return;default:if(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")o=O5.get(o)||o,uc(t,o,u);else return}ot=!0}function np(t,n,o,u,C,k){switch(o){case"style":Yv(t,u,k);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(o=u.__html,o!=null){if(C.children!=null)throw Error(s(60));(k!=null?k.__html:void 0)!==o&&(t.innerHTML=o)}}break;case"children":if(typeof u=="string")lo(t,u);else if(typeof u=="number"||typeof u=="bigint")lo(t,""+u);else return;break;case"onScroll":u!=null&&Ze("scroll",t);return;case"onScrollEnd":u!=null&&Ze("scrollend",t);return;case"onClick":u!=null&&(t.onclick=Ei);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Iv.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(C=o.endsWith("Capture"),k=o.slice(2,C?o.length-7:void 0),n=t[Tn]||null,n=n!=null?n[o]:null,typeof n=="function"&&t.removeEventListener(k,n,C),typeof u=="function")){typeof n!="function"&&n!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(k,u,C);break e}ot=!0,o in t?t[o]=u:u===!0?t.setAttribute(o,""):uc(t,o,u)}return}ot=!0}function cn(t,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var u=!1,C=!1,k;for(k in o)if(o.hasOwnProperty(k)){var N=o[k];if(N!=null)switch(k){case"src":u=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,k,N,o,null)}}C&&pt(t,n,"srcSet",o.srcSet,o,null),u&&pt(t,n,"src",o.src,o,null);return;case"input":Ze("invalid",t);var q=k=N=C=null,J=null,se=null;for(u in o)if(o.hasOwnProperty(u)){var de=o[u];if(de!=null)switch(u){case"name":C=de;break;case"type":N=de;break;case"checked":J=de;break;case"defaultChecked":se=de;break;case"value":k=de;break;case"defaultValue":q=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,n));break;default:pt(t,n,u,de,o,null)}}qv(t,k,q,J,se,N,C,!1);return;case"select":Ze("invalid",t),u=N=k=null;for(C in o)if(o.hasOwnProperty(C)&&(q=o[C],q!=null))switch(C){case"value":k=q;break;case"defaultValue":N=q;break;case"multiple":u=q;default:pt(t,n,C,q,o,null)}n=k,o=N,t.multiple=!!u,n!=null?ao(t,!!u,n,!1):o!=null&&ao(t,!!u,o,!0);return;case"textarea":Ze("invalid",t),k=C=u=null;for(N in o)if(o.hasOwnProperty(N)&&(q=o[N],q!=null))switch(N){case"value":u=q;break;case"defaultValue":C=q;break;case"children":k=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(91));break;default:pt(t,n,N,q,o,null)}Wv(t,u,C,k);return;case"option":for(J in o)if(o.hasOwnProperty(J)&&(u=o[J],u!=null))switch(J){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:pt(t,n,J,u,o,null)}return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(u=0;u<cl.length;u++)Ze(cl[u],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in o)if(o.hasOwnProperty(se)&&(u=o[se],u!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,se,u,o,null)}return;default:if(id(n)){for(de in o)o.hasOwnProperty(de)&&(u=o[de],u!==void 0&&np(t,n,de,u,o,void 0));return}}for(q in o)o.hasOwnProperty(q)&&(u=o[q],u!=null&&pt(t,n,q,u,o,null))}var gk={};function vk(t,n,o,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,k=null,N=null,q=null,J=null,se=null,de=null;for(ce in o){var me=o[ce];if(o.hasOwnProperty(ce)&&me!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":J=me;default:u.hasOwnProperty(ce)||pt(t,n,ce,null,u,me)}}for(var ie in u){var ce=u[ie];if(me=o[ie],u.hasOwnProperty(ie)&&(ce!=null||me!=null))switch(ie){case"type":ce!==me&&(ot=!0),k=ce;break;case"name":ce!==me&&(ot=!0),C=ce;break;case"checked":ce!==me&&(ot=!0),se=ce;break;case"defaultChecked":ce!==me&&(ot=!0),de=ce;break;case"value":ce!==me&&(ot=!0),N=ce;break;case"defaultValue":ce!==me&&(ot=!0),q=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,n));break;default:ce!==me&&pt(t,n,ie,ce,u,me)}}td(t,N,q,J,se,de,k,C);return;case"select":ce=N=q=ie=null;for(k in o)if(J=o[k],o.hasOwnProperty(k)&&J!=null)switch(k){case"value":break;case"multiple":ce=J;default:u.hasOwnProperty(k)||pt(t,n,k,null,u,J)}for(C in u)if(k=u[C],J=o[C],u.hasOwnProperty(C)&&(k!=null||J!=null))switch(C){case"value":k!==J&&(ot=!0),ie=k;break;case"defaultValue":k!==J&&(ot=!0),q=k;break;case"multiple":k!==J&&(ot=!0),N=k;default:k!==J&&pt(t,n,C,k,u,J)}n=q,o=N,u=ce,ie!=null?ao(t,!!o,ie,!1):!!u!=!!o&&(n!=null?ao(t,!!o,n,!0):ao(t,!!o,o?[]:"",!1));return;case"textarea":ce=ie=null;for(q in o)if(C=o[q],o.hasOwnProperty(q)&&C!=null&&!u.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:pt(t,n,q,null,u,C)}for(N in u)if(C=u[N],k=o[N],u.hasOwnProperty(N)&&(C!=null||k!=null))switch(N){case"value":C!==k&&(ot=!0),ie=C;break;case"defaultValue":C!==k&&(ot=!0),ce=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==k&&pt(t,n,N,C,u,k)}Vv(t,ie,ce);return;case"option":for(var Ce in o)if(ie=o[Ce],o.hasOwnProperty(Ce)&&ie!=null&&!u.hasOwnProperty(Ce))switch(Ce){case"selected":t.selected=!1;break;default:pt(t,n,Ce,null,u,ie)}for(J in u)if(ie=u[J],ce=o[J],u.hasOwnProperty(J)&&ie!==ce&&(ie!=null||ce!=null))switch(J){case"selected":ie!==ce&&(ot=!0),t.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:pt(t,n,J,ie,u,ce)}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 je in o)ie=o[je],o.hasOwnProperty(je)&&ie!=null&&!u.hasOwnProperty(je)&&pt(t,n,je,null,u,ie);for(se in u)if(ie=u[se],ce=o[se],u.hasOwnProperty(se)&&ie!==ce&&(ie!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,n));break;default:pt(t,n,se,ie,u,ce)}return;default:if(id(n)){for(var Ge in o)ie=o[Ge],o.hasOwnProperty(Ge)&&ie!==void 0&&!u.hasOwnProperty(Ge)&&np(t,n,Ge,void 0,u,ie);for(de in u)ie=u[de],ce=o[de],!u.hasOwnProperty(de)||ie===ce||ie===void 0&&ce===void 0||np(t,n,de,ie,u,ce);return}}for(var re in o)ie=o[re],o.hasOwnProperty(re)&&ie!=null&&!u.hasOwnProperty(re)&&pt(t,n,re,null,u,ie);for(me in u)ie=u[me],ce=o[me],!u.hasOwnProperty(me)||ie===ce||ie==null&&ce==null||pt(t,n,me,ie,u,ce)}function ex(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _k(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var C=o[u],k=C.transferSize,N=C.initiatorType,q=C.duration;if(k&&q&&ex(N)){for(N=0,q=C.responseEnd,u+=1;u<o.length;u++){var J=o[u],se=J.startTime;if(se>q)break;var de=J.transferSize,me=J.initiatorType;de&&ex(me)&&(J=J.responseEnd,N+=de*(J<q?1:(q-se)/(J-se)))}if(--u,n+=8*(k+N)/(C.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var ip=null,rp=null;function hl(t){return t.nodeType===9?t:t.ownerDocument}function tx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function ix(t,n,o,u){return o=hl(o).createElement(t),o[rn]=u,o[Tn]=n,cn(o,t,n),Kt(o),o}function sp(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var op=null;function xk(){var t=window.event;return t&&t.type==="popstate"?t===op?!1:(op=t,!0):(op=null,!1)}var ap=typeof setTimeout=="function"?setTimeout:void 0,yk=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,sx=typeof requestAnimationFrame=="function"?requestAnimationFrame:ap,bk=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(t){return rx.resolve(null).then(t).catch(Sk)}:ap;function Sk(t){setTimeout(function(){throw t})}function Yr(t){return t==="head"}function ox(t,n){var o=n,u=0;do{var C=o.nextSibling;if(t.removeChild(o),C&&C.nodeType===8)if(o=C.data,o==="/$"||o==="/&"){if(u===0){t.removeChild(C),Wo(n);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")mp(t.ownerDocument.documentElement);else if(o==="head"){o=t.ownerDocument.head,mp(o);for(var k=o.firstChild;k;){var N=k.nextSibling,q=k.nodeName;k[Aa]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&k.rel.toLowerCase()==="stylesheet"||o.removeChild(k),k=N}}else o==="body"&&mp(t.ownerDocument.body);o=C}while(o);Wo(n)}function ax(t,n){var o=t;t=0;do{var u=o.nextSibling;if(o.nodeType===1?n?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(n?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(t===0)break;t--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||t++;o=u}while(o)}function lx(t,n,o){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,o!=null&&(t.style.viewTransitionClass=o),o=getComputedStyle(t),o.display==="inline"){if(n=t.getClientRects(),n.length===1)var u=1;else for(var C=u=0;C<n.length;C++){var k=n[C];0<k.width&&0<k.height&&u++}u===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+o.paddingTop,t.marginBottom="-"+o.paddingBottom)}}function cx(t,n){t=t.style,n=n.style;var o=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=o==null||typeof o=="boolean"?"":(""+o).trim(),o=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=o==null||typeof o=="boolean"?"":(""+o).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(o=n.display,t.display=o==null||typeof o=="boolean"?"":o,o=n.margin,o!=null?t.margin=o:(o=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=o==null||typeof o=="boolean"?"":o,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function wk(t,n,o){return o=o.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=o.innerHeight&&t.left<=o.innerWidth}}function lp(t){var n=t.getBoundingClientRect(),o=getComputedStyle(t);return wk(n,o,t)}function Ck(t){return t.documentElement.clientHeight}function Ek(t){this.addEventListener("load",t),this.addEventListener("error",t)}function kk(t,n,o,u,C,k,N,q,J){var se=n.nodeType===9?n:n.ownerDocument;try{var de=se.startViewTransition({update:function(){var ie=se.defaultView,ce=ie.navigation&&ie.navigation.transition,Ce=se.fonts.status;u();var je=[];if(Ce==="loaded"&&(Ck(se),se.fonts.status==="loading"&&je.push(se.fonts.ready)),Ce=je.length,t!==null)for(var Ge=t.suspenseyImages,re=0,te=0;te<Ge.length;te++){var ae=Ge[te];if(!ae.complete){var pe=ae.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<ie.innerHeight&&pe.left<ie.innerWidth){if(re+=Lx(ae),re>bu){je.length=Ce;break}ae=new Promise(Ek.bind(ae)),je.push(ae)}}}if(0<je.length)return ie=Promise.race([Promise.all(je),new Promise(function(Ae){return setTimeout(Ae,500)})]).then(C,C),(ce?Promise.allSettled([ce.finished,ie]):ie).then(k,k);if(C(),ce)return ce.finished.then(k,k);k()},types:o});se.__reactViewTransition=de;var me=[];return de.ready.then(function(){for(var ie=se.documentElement.getAnimations({subtree:!0}),ce=0;ce<ie.length;ce++){var Ce=ie[ce],je=Ce.effect,Ge=je.pseudoElement;if(Ge!=null&&Ge.startsWith("::view-transition")){me.push(Ce),Ce=je.getKeyframes();for(var re=Ge=void 0,te=!0,ae=0;ae<Ce.length;ae++){var pe=Ce[ae],Ae=pe.width;if(Ge===void 0)Ge=Ae;else if(Ge!==Ae){te=!1;break}if(Ae=pe.height,re===void 0)re=Ae;else if(re!==Ae){te=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}te&&Ge!==void 0&&re!==void 0&&(je.setKeyframes(Ce),te=getComputedStyle(je.target,je.pseudoElement),te.width!==Ge||te.height!==re)&&(te=Ce[0],te.width=Ge,te.height=re,te=Ce[Ce.length-1],te.width=Ge,te.height=re,je.setKeyframes(Ce))}}N()},function(ie){se.__reactViewTransition===de&&(se.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&J(ie)}finally{u(),C(),N()}}),de.finished.finally(function(){for(var ie=0;ie<me.length;ie++)me[ie].cancel();se.__reactViewTransition===de&&(se.__reactViewTransition=null),q()}),de}catch{return u(),C(),N(),null}}function Is(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}Is.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:D({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},Is.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,o=t.getAnimations({subtree:!0}),u=[],C=0;C<o.length;C++){var k=o[C].effect;k!==null&&k.target===t&&k.pseudoElement===n&&u.push(o[C])}return u},Is.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ux(t){return{name:t,group:new Is("group",t),imagePair:new Is("image-pair",t),old:new Is("old",t),new:new Is("new",t)}}function Yn(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Yn.prototype.addEventListener=function(t,n,o){var u=null,C=null;if(!(o!=null&&typeof o!="boolean"&&(u=o.signal||null,u!==null&&u.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var k=this._eventListeners;if(dx(k,t,n,o)===-1){var N=this,q=n;o!=null&&typeof o!="boolean"&&o.once===!0&&(q=function(J){N.removeEventListener(t,n,o),typeof n=="function"?n.call(this,J):n.handleEvent(J)}),u!==null&&(C=N.removeEventListener.bind(N,t,n,o),u.addEventListener("abort",C,{once:!0}),C=u.removeEventListener.bind(u,"abort",C)),u=Ho(o),k.push({type:t,listener:n,optionsOrUseCapture:o,attachedListener:q,cleanup:C}),c(this._fragmentFiber.child,!1,Tk,t,q,u)}this._eventListeners=k}};function Tk(t,n,o,u){return g(t).addEventListener(n,o,u),!1}Yn.prototype.removeEventListener=function(t,n,o){var u=this._eventListeners;if(u!==null&&(n=dx(u,t,n,o),n!==-1)){var C=u[n];o=C.attachedListener;var k=C.cleanup;C=Ho(C.optionsOrUseCapture),c(this._fragmentFiber.child,!1,Rk,t,o,C),u.splice(n,1),k!==null&&k()}};function Rk(t,n,o,u){return g(t).removeEventListener(n,o,u),!1}function Ho(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function hx(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function dx(t,n,o,u){if(t.length===0)return-1;u=hx(u);for(var C=0;C<t.length;C++){var k=t[C];if(k.type===n&&k.listener===o&&hx(k.optionsOrUseCapture)===u)return C}return-1}Yn.prototype.dispatchEvent=function(t){var n=_(this._fragmentFiber);if(n===null)return!0;n=g(n);var o=this._eventListeners;if(o!==null&&0<o.length||!t.bubbles){var u=n.nodeType===9?n.createComment(""):document.createTextNode("");if(o)for(var C=0;C<o.length;C++){var k=o[C];u.addEventListener(k.type,k.attachedListener,Ho(k.optionsOrUseCapture))}if(n.appendChild(u),t=u.dispatchEvent(t),o)for(C=0;C<o.length;C++)k=o[C],u.removeEventListener(k.type,k.attachedListener,Ho(k.optionsOrUseCapture));return n.removeChild(u),t}return n.dispatchEvent(t)},Yn.prototype.focus=function(t){c(this._fragmentFiber.child,!0,fx,t,void 0,void 0)};function fx(t,n){return t.tag===6?!1:(t=g(t),Hk(t,n))}Yn.prototype.focusLast=function(t){var n=[];c(this._fragmentFiber.child,!0,cp,n,void 0,void 0);for(var o=n.length-1;0<=o&&!fx(n[o],t);o--);};function cp(t,n){return n.push(t),!1}Yn.prototype.blur=function(){var t=_(this._fragmentFiber);t!==null&&(t=g(t),t=hl(t).activeElement,t!==null&&c(this._fragmentFiber.child,!1,Ak,t,void 0,void 0))};function Ak(t,n){return t.tag===6?!1:(t=g(t),t===n||t.contains(n)?(n.blur(),!0):!1)}Yn.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),c(this._fragmentFiber.child,!1,Lk,t,void 0,void 0)};function Lk(t,n){return t.tag===6||(t=g(t),n.observe(t)),!1}Yn.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),c(this._fragmentFiber.child,!1,Dk,t,void 0,void 0);for(var o=n=0;o<yi.length;o++){var u=yi[o];u.fragmentInstance===this&&u.observer===t?t.unobserve(u.instance):yi[n++]=u}yi.length=n}};function Dk(t,n){return t.tag===6||(t=g(t),n.unobserve(t)),!1}var yi=[],up=!1;function Mk(t,n,o){yi.push({fragmentInstance:t,observer:n,instance:o}),up||(up=!0,Fk(function(){up=!1;var u=yi;yi=[];for(var C=0;C<u.length;C++){var k=u[C];k.observer.unobserve(k.instance)}}))}Yn.prototype.getClientRects=function(){var t=[];return c(this._fragmentFiber.child,!1,jk,t,void 0,void 0),t};function jk(t,n){if(t.tag===6){t=t.stateNode;var o=t.ownerDocument.createRange();o.selectNodeContents(t),n.push.apply(n,o.getClientRects())}else t=g(t),n.push.apply(n,t.getClientRects());return!1}Yn.prototype.getRootNode=function(t){var n=_(this._fragmentFiber);return n===null?this:g(n).getRootNode(t)},Yn.prototype.compareDocumentPosition=function(t){var n=_(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];c(this._fragmentFiber.child,!1,cp,o,void 0,void 0);var u=g(n);if(o.length===0){if(o=u,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(o=n)}n=this._fragmentFiber;var C=u=o.compareDocumentPosition(t);return o===t?C=Node.DOCUMENT_POSITION_CONTAINS:u&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=E(n)[1],o===null?C=Node.DOCUMENT_POSITION_PRECEDING:(t=g(o).compareDocumentPosition(t),C=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),C|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=g(o[0]),C=g(o[o.length-1]);var k=x(this._fragmentFiber)?n.parentElement:u;if(k==null)return Node.DOCUMENT_POSITION_DISCONNECTED;u=k.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,k=k.compareDocumentPosition(C)&Node.DOCUMENT_POSITION_CONTAINED_BY;var N=n.compareDocumentPosition(t),q=C.compareDocumentPosition(t),J=N&Node.DOCUMENT_POSITION_CONTAINED_BY||q&Node.DOCUMENT_POSITION_CONTAINED_BY;return q=u&&k&&N&Node.DOCUMENT_POSITION_FOLLOWING&&q&Node.DOCUMENT_POSITION_PRECEDING,n=u&&n===t||k&&C===t||J||q?Node.DOCUMENT_POSITION_CONTAINED_BY:!u&&n===t||!k&&C===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:N,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Ok(n,this._fragmentFiber,o[0],o[o.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Ok(t,n,o,u,C){var k=vs(C);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(o=!!k)e:{for(;k!==null;){if(k.tag===7&&(k===n||k.alternate===n)){o=!0;break e}k=k.return}o=!1}return o}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(k===null)return k=C.ownerDocument,C===k||C===k.documentElement||C===k.body;e:{for(k=n,n=_(n);k!==null;){if(!(k.tag!==5&&k.tag!==3&&k.tag!==27||k!==n&&k.alternate!==n)){k=!0;break e}k=k.return}k=!1}return k}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!k)&&!(n=k===o)&&(n=R(o,k,L),n===null?n=!1:(c(n,!0,y,k,o),k=b,b=null,n=k!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!k)&&!(n=k===u)&&(n=R(u,k,L),n===null?n=!1:(c(n,!0,T,k,u),k=b,S=b=null,n=k!==null)),n):!1}function px(t,n){var o=t.ownerDocument.createRange();o.selectNodeContents(t),t=o.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Yn.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(s(566));var n=[];c(this._fragmentFiber.child,!1,cp,n,void 0,void 0);var o=t!==!1;if(n.length===0){var u=E(this._fragmentFiber);if(u=o?u[1]||u[0]||_(this._fragmentFiber):u[0]||u[1],u===null)return;if(u.tag===6){t=g(u),px(t,o);return}if(u=g(u),u.nodeType!==9){if(u.nodeType===11){o="host"in u?u.host:null,o!==null&&o.scrollIntoView(t);return}u.scrollIntoView(t)}}for(u=o?n.length-1:0;u!==(o?-1:n.length);){var C=n[u];C.tag===6?(C=g(C),px(C,o)):g(C).scrollIntoView(t),u+=o?-1:1}};function Nk(t,n){return t=g(t),mx(t,n),!1}function mx(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function gx(t,n){var o=n._eventListeners;if(o!==null)for(var u=0;u<o.length;u++){var C=o[u];t.addEventListener(C.type,C.attachedListener,Ho(C.optionsOrUseCapture))}t.nodeType!==3&&(o=n._observers,o!==null&&o.forEach(function(k){for(var N=0,q=0;q<yi.length;q++){var J=yi[q];(J.fragmentInstance!==n||J.observer!==k||J.instance!==t)&&(yi[N++]=J)}yi.length=N,k.observe(t)}),mx(t,n))}function Bk(t,n){var o=n._eventListeners;if(o!==null)for(var u=0;u<o.length;u++){var C=o[u];t.removeEventListener(C.type,C.attachedListener,Ho(C.optionsOrUseCapture))}t.nodeType!==3&&(o=n._observers,o!==null&&o.forEach(function(k){typeof k.rootMargin=="string"?Mk(n,k,t):k.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function hp(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":hp(o),cc(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function Pk(t,n,o,u){for(;t.nodeType===1;){var C=o;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Aa])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(k=t.getAttribute("rel"),k==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(k!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(k=t.getAttribute("src"),(k!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&k&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var k=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===k)return t}else return t;if(t=ci(t.nextSibling),t===null)break}return null}function Ik(t,n,o){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=ci(t.nextSibling),t===null))return null;return t}function vx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ci(t.nextSibling),t===null))return null;return t}function dp(t){return t.data==="$?"||t.data==="$~"}function fp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function zk(t,n){var o=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||o.readyState!=="loading")n();else{var u=function(){n(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function ci(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var pp=null;function _x(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"||o==="/&"){if(n===0)return ci(t.nextSibling);n--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||n++}t=t.nextSibling}return null}function xx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(n===0)return t;n--}else o!=="/$"&&o!=="/&"||n++}t=t.previousSibling}return null}function Hk(t,n){function o(){u=!0}if(t.ownerDocument.activeElement===t)return!0;var u=!1;try{t.ownerDocument.addEventListener("focus",o,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",o,!0)}return u}function Fk(t){sx(function(){sx(function(n){return t(n)})})}function yx(t,n,o){switch(n=hl(o),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function bx(t,n,o){for(var u in o){var C=o[u];o.hasOwnProperty(u)&&C!=null&&pt(t,n,u,null,gk,C)}o.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Ei&&(t.onclick=null),cc(t)}function mp(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);cc(t)}var ui=new Map,Sx=new Set;function dl(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var ar=he.d;he.d={f:Uk,r:$k,D:qk,C:Vk,L:Wk,m:Gk,X:Xk,S:Yk,M:Kk};function Uk(){var t=ar.f(),n=du();return t||n}function $k(t){var n=ro(t);n!==null&&n.tag===5&&n.type==="form"?C1(n):ar.r(t)}var Fo=typeof document>"u"?null:document;function wx(t,n,o){var u=Fo;if(u&&typeof n=="string"&&n){var C=ni(n);C='link[rel="'+t+'"][href="'+C+'"]',typeof o=="string"&&(C+='[crossorigin="'+o+'"]'),Sx.has(C)||(Sx.add(C),t={rel:t,crossOrigin:o,href:n},u.querySelector(C)===null&&(n=u.createElement("link"),cn(n,"link",t),Kt(n),u.head.appendChild(n)))}}function qk(t){ar.D(t),wx("dns-prefetch",t,null)}function Vk(t,n){ar.C(t,n),wx("preconnect",t,n)}function Wk(t,n,o){ar.L(t,n,o);var u=Fo;if(u&&t&&n){var C='link[rel="preload"][as="'+ni(n)+'"]';n==="image"&&o&&o.imageSrcSet?(C+='[imagesrcset="'+ni(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(C+='[imagesizes="'+ni(o.imageSizes)+'"]')):C+='[href="'+ni(t)+'"]';var k=C;switch(n){case"style":k=Uo(t);break;case"script":k=$o(t)}if(!(ui.has(k)||(t=D({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:t,as:n},o),ui.set(k,t),u.querySelector(C)!==null||n==="style"&&u.querySelector(fl(k))||n==="script"&&u.querySelector(pl(k))))){var N=u.createElement("link");cn(N,"link",t),n==="style"&&(N[lc]=!0,N.onload=N.onerror=function(){Bv(N)}),Kt(N),u.head.appendChild(N)}}}function Gk(t,n){ar.m(t,n);var o=Fo;if(o&&t){var u=n&&typeof n.as=="string"?n.as:"script",C='link[rel="modulepreload"][as="'+ni(u)+'"][href="'+ni(t)+'"]',k=C;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=$o(t)}if(!ui.has(k)&&(t=D({rel:"modulepreload",href:t},n),ui.set(k,t),o.querySelector(C)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(pl(k)))return}u=o.createElement("link"),cn(u,"link",t),Kt(u),o.head.appendChild(u)}}}function Yk(t,n,o){ar.S(t,n,o);var u=Fo;if(u&&t){var C=so(u).hoistableStyles,k=Uo(t);n=n||"default";var N=C.get(k);if(!N){var q={loading:0,preload:null};if(N=u.querySelector(fl(k)))q.loading=5;else{t=D({rel:"stylesheet",href:t,"data-precedence":n},o),(o=ui.get(k))&&gp(t,o);var J=N=u.createElement("link");Kt(J),cn(J,"link",t),J._p=new Promise(function(se,de){J.onload=se,J.onerror=de}),J.addEventListener("load",function(){q.loading|=1}),J.addEventListener("error",function(){q.loading|=2}),q.loading|=4,xu(N,n,u)}N={type:"stylesheet",instance:N,count:1,state:q},C.set(k,N)}}}function Xk(t,n){ar.X(t,n);var o=Fo;if(o&&t){var u=so(o).hoistableScripts,C=$o(t),k=u.get(C);k||(k=o.querySelector(pl(C)),k||(t=D({src:t,async:!0},n),(n=ui.get(C))&&vp(t,n),k=o.createElement("script"),Kt(k),cn(k,"link",t),o.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},u.set(C,k))}}function Kk(t,n){ar.M(t,n);var o=Fo;if(o&&t){var u=so(o).hoistableScripts,C=$o(t),k=u.get(C);k||(k=o.querySelector(pl(C)),k||(t=D({src:t,async:!0,type:"module"},n),(n=ui.get(C))&&vp(t,n),k=o.createElement("script"),Kt(k),cn(k,"link",t),o.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},u.set(C,k))}}function Cx(t,n,o,u){var C=(C=Be.current)?dl(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=Uo(o.href),n=so(C).hoistableStyles,u=n.get(o),u||(u={type:"style",instance:null,count:0,state:null},n.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Uo(o.href);var k=so(C).hoistableStyles,N=k.get(t);if(N||(C=C.ownerDocument||C,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(t,N),(k=C.querySelector(fl(t)))?k._p||(N.instance=k,N.state.loading=5):(k=ui.get(t),k||(k={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ui.set(t,k)),Qk(C,t,k,N.state))),n&&u===null)throw Error(s(528,""));return N}if(n&&u!==null)throw Error(s(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(o=$o(o),n=so(C).hoistableScripts,u=n.get(o),u||(u={type:"script",instance:null,count:0,state:null},n.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Uo(t){return'href="'+ni(t)+'"'}function fl(t){return'link[rel="stylesheet"]['+t+"]"}function Ex(t){return D({},t,{"data-precedence":t.precedence,precedence:null})}function Qk(t,n,o,u){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[lc]!==!0){u.loading=1;return}}else n=t.createElement("link"),n[lc]=!0,n.onload=n.onerror=Bv.bind(null,n),cn(n,"link",o),Kt(n),t.head.appendChild(n);u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2})}function $o(t){return'[src="'+ni(t)+'"]'}function pl(t){return"script[async]"+t}function kx(t,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+ni(o.href)+'"]');if(u)return n.instance=u,Kt(u),u;var C=D({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),Kt(u),cn(u,"style",C),xu(u,o.precedence,t),n.instance=u;case"stylesheet":C=Uo(o.href);var k=t.querySelector(fl(C));if(k)return n.state.loading|=4,n.instance=k,Kt(k),k;u=Ex(o),(C=ui.get(C))&&gp(u,C),k=(t.ownerDocument||t).createElement("link"),Kt(k);var N=k;return N._p=new Promise(function(q,J){N.onload=q,N.onerror=J}),cn(k,"link",u),n.state.loading|=4,xu(k,o.precedence,t),n.instance=k;case"script":return k=$o(o.src),(C=t.querySelector(pl(k)))?(n.instance=C,Kt(C),C):(u=o,(C=ui.get(k))&&(u=D({},o),vp(u,C)),t=t.ownerDocument||t,C=t.createElement("script"),Kt(C),cn(C,"link",u),t.head.appendChild(C),n.instance=C);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,xu(u,o.precedence,t));return n.instance}function xu(t,n,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=u.length?u[u.length-1]:null,k=C,N=0;N<u.length;N++){var q=u[N];if(q.dataset.precedence===n)k=q;else if(k!==C)break}k?k.parentNode.insertBefore(t,k.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(t,n.firstChild))}function gp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function vp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var yu=null;function Tx(t,n,o){if(yu===null){var u=new Map,C=yu=new Map;C.set(o,u)}else C=yu,u=C.get(o),u||(u=new Map,C.set(o,u));if(u.has(t))return u;for(u.set(t,null),o=o.getElementsByTagName(t),C=0;C<o.length;C++){var k=o[C];if(!(k[Aa]||k[rn]||t==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var N=k.getAttribute(n)||"";N=t+N;var q=u.get(N);q?q.push(k):u.set(N,[k])}}return u}function _p(t,n,o){t=t.ownerDocument||t,t.head.insertBefore(o,n==="title"?t.querySelector("head > title"):null)}function Zk(t,n,o){if(o===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Rx(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Ax(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Lx(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Dx(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Lx(n),t.suspenseyImages.push(n)),t=t3.bind(t),n.decode().then(t,t))}function Jk(t,n,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var C=Uo(u.href),k=n.querySelector(fl(C));if(k){n=k._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ml.bind(t),n.then(t,t)),o.state.loading|=4,o.instance=k,Kt(k);return}k=n.ownerDocument||n,u=Ex(u),(C=ui.get(C))&&gp(u,C),k=k.createElement("link"),Kt(k);var N=k;N._p=new Promise(function(q,J){N.onload=q,N.onerror=J}),cn(k,"link",u),o.instance=k}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(o,n),(n=o.state.preload)&&(o.state.loading&3)===0&&(t.count++,o=ml.bind(t),n.addEventListener("load",o),n.addEventListener("error",o))}}var bu=0;function e3(t,n){return t.stylesheets&&t.count===0&&wu(t,t.stylesheets),0<t.count||0<t.imgCount?function(o){var u=setTimeout(function(){if(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend){var k=t.unsuspend;t.unsuspend=null,k()}},6e4+n);0<t.imgBytes&&bu===0&&(bu=62500*_k());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend)){var k=t.unsuspend;t.unsuspend=null,k()}},(t.imgBytes>bu?50:800)+n);return t.unsuspend=o,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(C)}}:null}function Mx(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)wu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function ml(){this.count--,Mx(this)}function t3(){this.imgCount--,Mx(this)}var Su=null;function wu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Su=new Map,n.forEach(n3,t),Su=null,ml.call(t))}function n3(t,n){if(!(n.state.loading&4)){var o=Su.get(t);if(o)var u=o.get(null);else{o=new Map,Su.set(t,o);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<C.length;k++){var N=C[k];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(o.set(N.dataset.precedence,N),u=N)}u&&o.set(null,u)}C=n.instance,N=C.getAttribute("data-precedence"),k=o.get(N)||u,k===u&&o.set(null,C),o.set(N,C),this.count++,u=ml.bind(this),C.addEventListener("load",u),C.addEventListener("error",u),k?k.parentNode.insertBefore(C,k.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),n.state.loading|=4}}var qo={$$typeof:W,Provider:null,Consumer:null,_currentValue:we,_currentValue2:we,_threadCount:0};function i3(t,n,o,u,C,k,N,q,J){this.tag=1,this.containerInfo=t,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=Qh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.hiddenUpdates=Qh(null),this.identifierPrefix=u,this.onUncaughtError=C,this.onCaughtError=k,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.transitionTypes=null,this.incompleteTransitions=new Map}function jx(t,n,o,u,C,k,N,q,J,se,de,me){return t=new i3(t,n,o,N,J,se,de,me,q),n=1,k===!0&&(n|=24),k=Rn(3,null,null,n),t.current=k,k.stateNode=t,n=Md(),n.refCount++,t.pooledCache=n,n.refCount++,k.memoizedState={element:u,isDehydrated:o,cache:n},Bd(k),t}function Ox(t){return t?(t=go,t):go}function Nx(t,n,o,u,C,k){C=Ox(C),u.context===null?u.context=C:u.pendingContext=C,u=Br(n),u.payload={element:o},k=k===void 0?null:k,k!==null&&(u.callback=k),o=Pr(t,u,n),o!==null&&(Mn(o,t,n),Wa(o,t,n))}function Bx(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<n?o:n}}function xp(t,n){Bx(t,n),(t=t.alternate)&&Bx(t,n)}function Px(t){if(t.tag===13||t.tag===31){var n=bs(t,67108864);n!==null&&Mn(n,t,67108864),xp(t,67108864)}}function Ix(t){if(t.tag===13||t.tag===31){var n=Gn();n=Zh(n);var o=bs(t,n);o!==null&&Mn(o,t,n),xp(t,n)}}var Vo=!0;function r3(t,n,o,u){var C=ue.T;ue.T=null;var k=he.p;try{he.p=2,yp(t,n,o,u)}finally{he.p=k,ue.T=C}}function s3(t,n,o,u){var C=ue.T;ue.T=null;var k=he.p;try{he.p=8,yp(t,n,o,u)}finally{he.p=k,ue.T=C}}function yp(t,n,o,u){if(Vo){var C=bp(u);if(C===null)tp(t,n,u,Cu,o),Hx(t,u);else if(a3(C,t,n,o,u))u.stopPropagation();else if(Hx(t,u),n&4&&-1<o3.indexOf(t)){for(;C!==null;){var k=ro(C);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var N=gs(k.pendingLanes);if(N!==0){var q=k;for(q.pendingLanes|=2,q.entangledLanes|=2;N;){var J=1<<31-Hn(N);q.entanglements[1]|=J,N&=~J}Ni(k),(lt&6)===0&&(cu=Vt()+500,ll(0))}}break;case 31:case 13:q=bs(k,2),q!==null&&Mn(q,k,2),du(),xp(k,2)}if(k=bp(u),k===null&&tp(t,n,u,Cu,o),k===C)break;C=k}C!==null&&u.stopPropagation()}else tp(t,n,u,null,o)}}function bp(t){return t=sd(t),Sp(t)}var Cu=null;function Sp(t){if(Cu=null,t=vs(t),t!==null){var n=f(t);if(n===null)t=null;else{var o=n.tag;if(o===13){if(t=p(n),t!==null)return t;t=null}else if(o===31){if(t=a(n),t!==null)return t;t=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Cu=t,null}function zx(t){switch(t){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wt()){case ti:return 2;case xn:return 8;case no:case x5:return 32;case kv:return 268435456;default:return 32}default:return 32}}var wp=!1,Xr=null,Kr=null,Qr=null,gl=new Map,vl=new Map,Zr=[],o3="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 Hx(t,n){switch(t){case"focusin":case"focusout":Xr=null;break;case"dragenter":case"dragleave":Kr=null;break;case"mouseover":case"mouseout":Qr=null;break;case"pointerover":case"pointerout":gl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":vl.delete(n.pointerId)}}function _l(t,n,o,u,C,k){return t===null||t.nativeEvent!==k?(t={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:k,targetContainers:[C]},n!==null&&(n=ro(n),n!==null&&Px(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,C!==null&&n.indexOf(C)===-1&&n.push(C),t)}function a3(t,n,o,u,C){switch(n){case"focusin":return Xr=_l(Xr,t,n,o,u,C),!0;case"dragenter":return Kr=_l(Kr,t,n,o,u,C),!0;case"mouseover":return Qr=_l(Qr,t,n,o,u,C),!0;case"pointerover":var k=C.pointerId;return gl.set(k,_l(gl.get(k)||null,t,n,o,u,C)),!0;case"gotpointercapture":return k=C.pointerId,vl.set(k,_l(vl.get(k)||null,t,n,o,u,C)),!0}return!1}function Fx(t){var n=vs(t.target);if(n!==null){var o=f(n);if(o!==null){if(n=o.tag,n===13){if(n=p(o),n!==null){t.blockedOn=n,jv(t.priority,function(){Ix(o)});return}}else if(n===31){if(n=a(o),n!==null){t.blockedOn=n,jv(t.priority,function(){Ix(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Eu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var o=bp(t.nativeEvent);if(o===null){o=t.nativeEvent;var u=new o.constructor(o.type,o);rd=u,o.target.dispatchEvent(u),rd=null}else return n=ro(o),n!==null&&Px(n),t.blockedOn=o,!1;n.shift()}return!0}function Ux(t,n,o){Eu(t)&&o.delete(n)}function l3(){wp=!1,Xr!==null&&Eu(Xr)&&(Xr=null),Kr!==null&&Eu(Kr)&&(Kr=null),Qr!==null&&Eu(Qr)&&(Qr=null),gl.forEach(Ux),vl.forEach(Ux)}function ku(t,n){t.blockedOn===n&&(t.blockedOn=null,wp||(wp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l3)))}var Tu=null;function $x(t){Tu!==t&&(Tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tu===t&&(Tu=null);for(var n=0;n<t.length;n+=3){var o=t[n],u=t[n+1],C=t[n+2];if(typeof u!="function"){if(Sp(u||o)===null)continue;break}var k=ro(o);k!==null&&(t.splice(n,3),n-=3,rf(k,{pending:!0,data:C,method:o.method,action:u},u,C))}}))}function Wo(t){function n(J){return ku(J,t)}Xr!==null&&ku(Xr,t),Kr!==null&&ku(Kr,t),Qr!==null&&ku(Qr,t),gl.forEach(n),vl.forEach(n);for(var o=0;o<Zr.length;o++){var u=Zr[o];u.blockedOn===t&&(u.blockedOn=null)}for(;0<Zr.length&&(o=Zr[0],o.blockedOn===null);)Fx(o),o.blockedOn===null&&Zr.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var C=o[u],k=o[u+1],N=C[Tn]||null;if(typeof k=="function")N||$x(o);else if(N){var q=null;if(k&&k.hasAttribute("formAction")){if(C=k,N=k[Tn]||null)q=N.formAction;else if(Sp(C)!==null)continue}else q=N.action;typeof q=="function"?o[u+1]=q:(o.splice(u,3),u-=3),$x(o)}}}function qx(){function t(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(N){return C=N})},focusReset:"manual",scroll:"manual"})}function n(){C!==null&&(C(),C=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),C!==null&&(C(),C=null)}}}function Cp(t){this._internalRoot=t}Ru.prototype.render=Cp.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var o=n.current,u=Gn();Nx(o,u,t,n,null,null)},Ru.prototype.unmount=Cp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Nx(t.current,2,null,t,null,null),du(),n[io]=null}};function Ru(t){this._internalRoot=t}Ru.prototype.unstable_scheduleHydration=function(t){if(t){var n=Mv();t={blockedOn:null,target:t,priority:n};for(var o=0;o<Zr.length&&n!==0&&n<Zr[o].priority;o++);Zr.splice(o,0,t),o===0&&Fx(t)}};var Vx=i.version;if(Vx!=="19.3.1")throw Error(s(527,Vx,"19.3.1"));he.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(n),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var c3={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ue,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Au.isDisabled&&Au.supportsFiber)try{ka=Au.inject(c3),zn=Au}catch{}}return yl.createRoot=function(t,n){if(!l(t))throw Error(s(299));var o=!1,u="",C=O1,k=N1,N=B1;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(C=n.onUncaughtError),n.onCaughtError!==void 0&&(k=n.onCaughtError),n.onRecoverableError!==void 0&&(N=n.onRecoverableError)),n=jx(t,1,!1,null,null,o,u,null,C,k,N,qx),t[io]=n.current,ep(t),new Cp(n)},yl.hydrateRoot=function(t,n,o){if(!l(t))throw Error(s(299));var u=!1,C="",k=O1,N=N1,q=B1,J=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(C=o.identifierPrefix),o.onUncaughtError!==void 0&&(k=o.onUncaughtError),o.onCaughtError!==void 0&&(N=o.onCaughtError),o.onRecoverableError!==void 0&&(q=o.onRecoverableError),o.formState!==void 0&&(J=o.formState)),n=jx(t,1,!0,n,o??null,u,C,J,k,N,q,qx),n.context=Ox(null),o=n.current,u=Gn(),u=Zh(u),C=Br(u),C.callback=null,Pr(o,C,u),o=u,n.current.lanes=o,Ra(n,o),Ni(n),t[io]=n.current,ep(t),new Ru(n)},yl.version="19.3.1",yl}var ry;function x3(){if(ry)return Rp.exports;ry=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Rp.exports=_3(),Rp.exports}var y3=x3();/**
51
51
  * @license lucide-react v0.469.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
@@ -152,7 +152,7 @@ Error generating stack: `+u.message+`
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const $s=Ee("CircleX",[["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"}]]);/**
155
+ */const qs=Ee("CircleX",[["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"}]]);/**
156
156
  * @license lucide-react v0.469.0 - ISC
157
157
  *
158
158
  * This source code is licensed under the ISC license.
@@ -462,7 +462,7 @@ Error generating stack: `+u.message+`
462
462
  *
463
463
  * This source code is licensed under the ISC license.
464
464
  * See the LICENSE file in the root directory of this source tree.
465
- */const En=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);let th=null;const hr="global";function t4(e){th=e}function Lu(){return th}function Hi(){if(!th)throw new Error("No project is open.");return`/api/p/${encodeURIComponent(th)}`}function kt(e,i){return na(`${Hi()}${e}`,i)}function gn(e,i){return na(`/api${e}`,i)}async function na(e,i){const r=await fetch(e,{...i,headers:{"Content-Type":"application/json",...(i==null?void 0:i.headers)??{}}}),s=await r.text();let l={};try{l=s?JSON.parse(s):{}}catch{throw r.ok?new Error("The server returned a response that was not JSON."):new Error(`${r.status} ${r.statusText}`)}if(!r.ok)throw new Error(l.error??r.statusText);return l}const Ot=(e,i)=>kt(e,{method:"POST",body:i===void 0?void 0:JSON.stringify(i)}),wn=(e,i)=>kt(e,{method:"PUT",body:JSON.stringify(i)}),Wo=e=>kt(e,{method:"DELETE"}),ve={health:()=>kt("/health"),hub:()=>gn("/hub"),checkClaude:()=>gn("/claude/check",{method:"POST"}),projects:()=>gn("/projects"),addProject:e=>gn("/projects",{method:"POST",body:JSON.stringify({path:e})}),openedProject:e=>gn(`/projects/${encodeURIComponent(e)}/open`,{method:"POST"}),removeProject:e=>gn(`/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),folders:e=>gn(`/folders${e?`?path=${encodeURIComponent(e)}`:""}`),globalOverview:()=>gn("/global/overview"),globalInbox:()=>gn("/global/inbox"),globalLive:()=>gn("/global/live"),startSessionIn:(e,i)=>na(`/api/p/${encodeURIComponent(e)}/sessions`,{method:"POST",body:JSON.stringify(i)}),setMuted:(e,i)=>gn(`/global/muted/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({muted:i})}),answerIn:(e,i,r)=>gn(`/p/${encodeURIComponent(e)}/interactions/${i}/answer`,{method:"POST",body:JSON.stringify({answer:r})}),chooseIn:(e,i,r)=>gn(`/p/${encodeURIComponent(e)}/interactions/${i}/choose`,{method:"POST",body:JSON.stringify({ref:r})}),pauseNotificationsIn:(e,i)=>gn(`/p/${encodeURIComponent(e)}/notifications/paused`,{method:"PUT",body:JSON.stringify({paused:i})}),revealIn:e=>gn(`/p/${encodeURIComponent(e)}/files/reveal`,{method:"POST",body:JSON.stringify({path:""})}),dismissIn:(e,i)=>gn(`/p/${encodeURIComponent(e)}/interactions/${i}/dismiss`,{method:"POST"}),sessions:()=>kt("/sessions"),sessionsIn:e=>na(`/api/p/${encodeURIComponent(e)}/sessions`),session:e=>kt(`/sessions/${e}`),startSession:e=>Ot("/sessions",e),startPurpose:(e,i,r={})=>Ot("/purpose-sessions",{kind:e,targetId:i,...r}),resumeSession:(e,i={})=>Ot(`/sessions/${e}/resume`,i),killSession:(e,i)=>i?na(`/api/p/${encodeURIComponent(i)}/sessions/${e}/kill`,{method:"POST"}):Ot(`/sessions/${e}/kill`),renameSession:(e,i,r)=>r?na(`/api/p/${encodeURIComponent(r)}/sessions/${e}/title`,{method:"PUT",body:JSON.stringify({title:i})}):wn(`/sessions/${e}/title`,{title:i}),deletionPlan:e=>kt(`/sessions/${e}/deletion`),deleteSession:(e,i=!0)=>Wo(`/sessions/${e}?temp=${i?1:0}`),interactions:e=>kt(`/interactions${e?`?status=${e}`:""}`),answer:(e,i)=>Ot(`/interactions/${e}/answer`,{answer:i}),choose:(e,i)=>Ot(`/interactions/${e}/choose`,{ref:i}),dismiss:e=>Ot(`/interactions/${e}/dismiss`),inventory:()=>kt("/inventory"),stats:()=>kt("/stats"),categories:()=>kt("/categories"),saveCategory:e=>e.id?wn(`/categories/${e.id}`,e):Ot("/categories",e),deleteCategory:e=>Wo(`/categories/${e}`),prompts:()=>kt("/prompts"),savePrompt:(e,i)=>wn(`/prompts/${e}`,{text:i}),previewSystemPrompt:e=>kt(`/prompts/preview?category=${encodeURIComponent(e)}`),memory:()=>kt("/memory"),memoryFile:e=>kt(`/memory/file?path=${encodeURIComponent(e)}`),saveMemoryFile:(e,i)=>wn("/memory/file",{path:e,content:i}),channels:()=>kt("/channels"),setNotificationsPaused:e=>wn("/notifications/paused",{paused:e}),setNotifyKinds:e=>wn("/notifications/kinds",{kinds:e}),setSessionQuiet:(e,i)=>wn(`/sessions/${e}/quiet`,{quiet:i}),dismissWaiting:e=>Ot(`/sessions/${e}/dismiss-waiting`),saveChannel:e=>e.id?wn(`/channels/${e.id}`,e):Ot("/channels",e),deleteChannel:e=>Wo(`/channels/${e}`),testChannel:e=>Ot(`/channels/${e}/test`),jobs:()=>kt("/jobs"),saveJob:e=>e.id?wn(`/jobs/${e.id}`,e):Ot("/jobs",e),deleteJob:e=>Wo(`/jobs/${e}`),rotateJobToken:e=>Ot(`/jobs/${e}/rotate`),runJob:e=>Ot(`/jobs/${e}/run`,{}),runs:()=>kt("/runs"),queueRun:(e,i)=>Ot("/runs",{prompt:e,category:i}),cancelRun:e=>Ot(`/runs/${e}/cancel`),stopRun:e=>Ot(`/runs/${e}/stop`),resumeRun:e=>Ot(`/runs/${e}/resume`),toolsetCatalog:()=>kt("/toolset/catalog"),setSessionToolset:(e,i)=>wn(`/sessions/${e}/toolset`,{toolset:i}),setSessionSetup:(e,i)=>wn(`/sessions/${e}/setup`,i),presets:()=>kt("/presets"),savePreset:e=>e.id?wn(`/presets/${e.id}`,e):Ot("/presets",e),deletePreset:e=>Wo(`/presets/${e}`),setDefaultItem:(e,i,r)=>wn("/toolset/default",{kind:e,id:i,enabled:r}),claudeSettings:()=>kt("/claude-settings"),saveClaudeSettings:e=>wn("/claude-settings",e),mcpCatalog:()=>kt("/mcp/catalog"),suggestions:()=>kt("/mcp/suggestions"),mcpSuggestionsEnabled:()=>kt("/mcp-suggestions/enabled"),setMcpSuggestionsEnabled:e=>wn("/mcp-suggestions/enabled",{enabled:e}),installSuggestion:e=>Ot(`/mcp/suggestions/${e}/install`),skipSuggestion:(e,i="")=>Ot(`/mcp/suggestions/${e}/skip`,{note:i}),deleteSuggestion:e=>Wo(`/mcp/suggestions/${e}`)};function DS(e){var i,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(i=0;i<l;i++)e[i]&&(r=DS(e[i]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function MS(){for(var e,i,r=0,s="",l=arguments.length;r<l;r++)(e=arguments[r])&&(i=DS(e))&&(s&&(s+=" "),s+=i);return s}const ug="-",n4=e=>{const i=r4(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:p=>{const a=p.split(ug);return a[0]===""&&a.length!==1&&a.shift(),jS(a,i)||i4(p)},getConflictingClassGroupIds:(p,a)=>{const h=r[p]||[];return a&&s[p]?[...h,...s[p]]:h}}},jS=(e,i)=>{var p;if(e.length===0)return i.classGroupId;const r=e[0],s=i.nextPart.get(r),l=s?jS(e.slice(1),s):void 0;if(l)return l;if(i.validators.length===0)return;const f=e.join(ug);return(p=i.validators.find(({validator:a})=>a(f)))==null?void 0:p.classGroupId},sy=/^\[(.+)\]$/,i4=e=>{if(sy.test(e)){const i=sy.exec(e)[1],r=i==null?void 0:i.substring(0,i.indexOf(":"));if(r)return"arbitrary.."+r}},r4=e=>{const{theme:i,prefix:r}=e,s={nextPart:new Map,validators:[]};return o4(Object.entries(e.classGroups),r).forEach(([f,p])=>{vm(p,s,f,i)}),s},vm=(e,i,r,s)=>{e.forEach(l=>{if(typeof l=="string"){const f=l===""?i:oy(i,l);f.classGroupId=r;return}if(typeof l=="function"){if(s4(l)){vm(l(s),i,r,s);return}i.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([f,p])=>{vm(p,oy(i,f),r,s)})})},oy=(e,i)=>{let r=e;return i.split(ug).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},s4=e=>e.isThemeGetter,o4=(e,i)=>i?e.map(([r,s])=>{const l=s.map(f=>typeof f=="string"?i+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([p,a])=>[i+p,a])):f);return[r,l]}):e,a4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,r=new Map,s=new Map;const l=(f,p)=>{r.set(f,p),i++,i>e&&(i=0,s=r,r=new Map)};return{get(f){let p=r.get(f);if(p!==void 0)return p;if((p=s.get(f))!==void 0)return l(f,p),p},set(f,p){r.has(f)?r.set(f,p):l(f,p)}}},OS="!",l4=e=>{const{separator:i,experimentalParseClassName:r}=e,s=i.length===1,l=i[0],f=i.length,p=a=>{const h=[];let d=0,m=0,c;for(let g=0;g<a.length;g++){let b=a[g];if(d===0){if(b===l&&(s||a.slice(g,g+f)===i)){h.push(a.slice(m,g)),m=g+f;continue}if(b==="/"){c=g;continue}}b==="["?d++:b==="]"&&d--}const _=h.length===0?a:a.substring(m),x=_.startsWith(OS),E=x?_.substring(1):_,w=c&&c>m?c-m:void 0;return{modifiers:h,hasImportantModifier:x,baseClassName:E,maybePostfixModifierPosition:w}};return r?a=>r({className:a,parseClassName:p}):p},c4=e=>{if(e.length<=1)return e;const i=[];let r=[];return e.forEach(s=>{s[0]==="["?(i.push(...r.sort(),s),r=[]):r.push(s)}),i.push(...r.sort()),i},u4=e=>({cache:a4(e.cacheSize),parseClassName:l4(e),...n4(e)}),h4=/\s+/,d4=(e,i)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:l}=i,f=[],p=e.trim().split(h4);let a="";for(let h=p.length-1;h>=0;h-=1){const d=p[h],{modifiers:m,hasImportantModifier:c,baseClassName:_,maybePostfixModifierPosition:x}=r(d);let E=!!x,w=s(E?_.substring(0,x):_);if(!w){if(!E){a=d+(a.length>0?" "+a:a);continue}if(w=s(_),!w){a=d+(a.length>0?" "+a:a);continue}E=!1}const g=c4(m).join(":"),b=c?g+OS:g,S=b+w;if(f.includes(S))continue;f.push(S);const y=l(w,E);for(let T=0;T<y.length;++T){const L=y[T];f.push(b+L)}a=d+(a.length>0?" "+a:a)}return a};function f4(){let e=0,i,r,s="";for(;e<arguments.length;)(i=arguments[e++])&&(r=NS(i))&&(s&&(s+=" "),s+=r);return s}const NS=e=>{if(typeof e=="string")return e;let i,r="";for(let s=0;s<e.length;s++)e[s]&&(i=NS(e[s]))&&(r&&(r+=" "),r+=i);return r};function p4(e,...i){let r,s,l,f=p;function p(h){const d=i.reduce((m,c)=>c(m),e());return r=u4(d),s=r.cache.get,l=r.cache.set,f=a,a(h)}function a(h){const d=s(h);if(d)return d;const m=d4(h,r);return l(h,m),m}return function(){return f(f4.apply(null,arguments))}}const Ct=e=>{const i=r=>r[e]||[];return i.isThemeGetter=!0,i},BS=/^\[(?:([a-z-]+):)?(.+)\]$/i,m4=/^\d+\/\d+$/,g4=new Set(["px","full","screen"]),v4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,x4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lr=e=>ra(e)||g4.has(e)||m4.test(e),es=e=>ga(e,"length",A4),ra=e=>!!e&&!Number.isNaN(Number(e)),Mp=e=>ga(e,"number",ra),bl=e=>!!e&&Number.isInteger(Number(e)),S4=e=>e.endsWith("%")&&ra(e.slice(0,-1)),Ye=e=>BS.test(e),ts=e=>v4.test(e),w4=new Set(["length","size","percentage"]),C4=e=>ga(e,w4,PS),E4=e=>ga(e,"position",PS),k4=new Set(["image","url"]),T4=e=>ga(e,k4,D4),R4=e=>ga(e,"",L4),Sl=()=>!0,ga=(e,i,r)=>{const s=BS.exec(e);return s?s[1]?typeof i=="string"?s[1]===i:i.has(s[1]):r(s[2]):!1},A4=e=>_4.test(e)&&!x4.test(e),PS=()=>!1,L4=e=>y4.test(e),D4=e=>b4.test(e),M4=()=>{const e=Ct("colors"),i=Ct("spacing"),r=Ct("blur"),s=Ct("brightness"),l=Ct("borderColor"),f=Ct("borderRadius"),p=Ct("borderSpacing"),a=Ct("borderWidth"),h=Ct("contrast"),d=Ct("grayscale"),m=Ct("hueRotate"),c=Ct("invert"),_=Ct("gap"),x=Ct("gradientColorStops"),E=Ct("gradientColorStopPositions"),w=Ct("inset"),g=Ct("margin"),b=Ct("opacity"),S=Ct("padding"),y=Ct("saturate"),T=Ct("scale"),L=Ct("sepia"),R=Ct("skew"),D=Ct("space"),A=Ct("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ye,i],B=()=>[Ye,i],H=()=>["",lr,es],U=()=>["auto",ra,Ye],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Ye],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[ra,Ye];return{cacheSize:500,separator:":",theme:{colors:[Sl],spacing:[lr,es],blur:["none","",ts,Ye],brightness:G(),borderColor:[e],borderRadius:["none","","full",ts,Ye],borderSpacing:B(),borderWidth:H(),contrast:G(),grayscale:z(),hueRotate:G(),invert:z(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[S4,es],inset:I(),margin:I(),opacity:G(),padding:B(),saturate:G(),scale:G(),sepia:z(),skew:G(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[ts]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Ye]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bl,Ye]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",bl,Ye]}],"grid-cols":[{"grid-cols":[Sl]}],"col-start-end":[{col:["auto",{span:["full",bl,Ye]},Ye]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Sl]}],"row-start-end":[{row:["auto",{span:[bl,Ye]},Ye]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,i]}],"min-w":[{"min-w":[Ye,i,"min","max","fit"]}],"max-w":[{"max-w":[Ye,i,"none","full","min","max","fit","prose",{screen:[ts]},ts]}],h:[{h:[Ye,i,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,i,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,i,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,i,"auto","min","max","fit"]}],"font-size":[{text:["base",ts,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mp]}],"font-family":[{font:[Sl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",ra,Mp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lr,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lr,es]}],"underline-offset":[{"underline-offset":["auto",lr,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),E4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",C4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},T4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Y()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[lr,Ye]}],"outline-w":[{outline:[lr,es]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[lr,es]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ts,R4]}],"shadow-color":[{shadow:[Sl]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",ts,Ye]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[c]}],saturate:[{saturate:[y]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[p]}],"border-spacing-x":[{"border-spacing-x":[p]}],"border-spacing-y":[{"border-spacing-y":[p]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[bl,Ye]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lr,es,Mp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},j4=p4(M4);function xe(...e){return j4(MS(e))}function On(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function hg(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(1)} GB`}function os(e){return e?e.input+e.output+e.cacheRead+e.cacheCreation:0}function va(e){if(!e)return"";const i=Math.max(0,(Date.now()-Date.parse(e))/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function Vs(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function O4(e){return e==="Agent"||e==="Task"?"agents":e==="Skill"?"skills":e.startsWith("mcp__")?"mcp":"built-in"}function N4(e){const i=e.slice(5),r=i.indexOf("__");return r===-1?{server:i,tool:""}:{server:i.slice(0,r),tool:i.slice(r+2)}}function B4(e){const i={"built-in":[],agents:[],skills:[],mcp:[]};for(const[r,s]of Object.entries(e))i[O4(r)].push({name:r,...s});for(const r of Object.values(i))r.sort((s,l)=>l.count-s.count);return i}const ay=e=>{let i;const r=new Set,s=(d,m)=>{const c=typeof d=="function"?d(i):d;if(!Object.is(c,i)){const _=i;i=m??(typeof c!="object"||c===null)?c:Object.assign({},i,c),r.forEach(x=>x(i,_))}},l=()=>i,a={setState:s,getState:l,getInitialState:()=>h,subscribe:d=>(r.add(d),()=>r.delete(d))},h=i=e(s,l,a);return a},P4=(e=>e?ay(e):ay),I4=e=>e;function z4(e,i=I4){const r=Tl.useSyncExternalStore(e.subscribe,Tl.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return Tl.useDebugValue(r),r}const ly=e=>{const i=P4(e),r=s=>z4(i,s);return Object.assign(r,i),r},_a=(e=>e?ly(e):ly),dr=_a(e=>({item:null,set:i=>e({item:i})})),en=_a(e=>({drafts:{},put:(i,r)=>e(s=>({drafts:{...s.drafts,[i]:r}})),drop:i=>e(r=>{const{[i]:s,...l}=r.drafts;return{drafts:l}}),move:(i,r)=>e(s=>({drafts:Object.fromEntries(Object.entries(s.drafts).map(([l,f])=>[l===i?r:l.startsWith(`${i}/`)?r+l.slice(i.length):l,f]))}))})),rs=e=>!!(e&&e.text!==e.base),Wu=new Map;let Du=null;function H4(e){e!==Du&&(Du&&Wu.set(Du,en.getState().drafts),en.setState({drafts:e&&Wu.get(e)||{}}),e&&Wu.delete(e),Du=e)}window.addEventListener("beforeunload",e=>{[en.getState().drafts,...Wu.values()].some(r=>Object.values(r).some(rs))&&e.preventDefault()});const cy="clauder-hub:auto-save",uy=_a(e=>({on:(()=>{try{return localStorage.getItem(cy)==="1"}catch{return!1}})(),set:i=>{try{localStorage.setItem(cy,i?"1":"0")}catch{}e({on:i})}}));let jl=null;function IS(){if(!jl)return[];try{const e=JSON.parse(localStorage.getItem(jl)??"[]");return Array.isArray(e)?e.filter(i=>typeof(i==null?void 0:i.path)=="string").map(i=>({path:i.path,preview:!!i.preview})):[]}catch{return[]}}function F4(e){if(jl)try{localStorage.setItem(jl,JSON.stringify(e))}catch{}}const zS=(e,i)=>e===i||e.startsWith(`${i}/`),Bn=_a((e,i)=>{const r=s=>{F4(s),e({tabs:s})};return{tabs:IS(),show:s=>{const l=i().tabs;if(l.some(p=>p.path===s))return;const f=l.findIndex(p=>p.preview);if(f===-1)return r([...l,{path:s,preview:!0}]);r(l.map((p,a)=>a===f?{path:s,preview:!0}:p))},pin:s=>{const l=i().tabs;if(!l.some(f=>f.path===s&&f.preview)){l.some(f=>f.path===s)||r([...l,{path:s,preview:!1}]);return}r(l.map(f=>f.path===s?{...f,preview:!1}:f))},close:(s,l)=>{var c;const f=i().tabs,p=new Set(s),a=f.filter(_=>!p.has(_.path));if(r(a),!l||!p.has(l))return l;const h=f.findIndex(_=>_.path===l),d=f.slice(h+1).find(_=>!p.has(_.path)),m=f.slice(0,h).reverse().find(_=>!p.has(_.path));return((c=d??m)==null?void 0:c.path)??null},reorder:(s,l)=>{const f=[...i().tabs],p=f.findIndex(d=>d.path===s),a=f.findIndex(d=>d.path===l);if(p===-1||a===-1||p===a)return;const[h]=f.splice(p,1);f.splice(a,0,h),r(f)},rename:(s,l)=>r(i().tabs.map(f=>zS(f.path,s)?{...f,path:l+f.path.slice(s.length)}:f))}}),nh=new Map;function U4(e,i){nh.set(e,i)}function $4(e){const i=nh.get(e)??null;return nh.delete(e),i}function q4(e){nh.clear(),jl=e?`clauder-hub:open-files:${e}`:null,Bn.setState({tabs:IS()})}function V4(e){return Bn.getState().tabs.filter(i=>zS(i.path,e)).map(i=>i.path)}function W4(e){H4(e),q4(e),dr.getState().set(null)}function G4(e){const i=r=>[...r].sort((s,l)=>(l.lastAt??l.startedAt??"").localeCompare(s.lastAt??s.startedAt??""))[0]??null;return i(e.filter(r=>r.live&&r.status==="waiting"))??i(e.filter(r=>r.live&&r.status==="running"))??i(e.filter(r=>r.status==="done"))??i(e.filter(r=>!r.purpose))}const Y4=["overview","inbox","automation","instructions","agents","skills","commands","mcp-servers","hooks","plugins","channels","hub-prompts","claude-settings","mcp-suggestions","presets","categories"];let Go=null,jp=null;function hy(e){try{return decodeURIComponent(e)}catch{return e}}function dy(){let e=window.location.hash.replace(/^#\/?/,"");const i=e.startsWith("w/");i&&(e=e.slice(2));const r=e.indexOf("/"),s=hy(r===-1?e:e.slice(0,r))||hr;return e=r===-1?"":e.slice(r+1),e.startsWith("session/")?{projectId:s,view:{kind:"session",id:e.slice(8)},windowed:i}:e.startsWith("file/")?{projectId:s,view:{kind:"file",path:e.slice(5).split("/").map(hy).join("/")},windowed:i}:{projectId:s,view:{kind:"page",page:Y4.find(l=>l===e)??"overview"},windowed:i}}function Al(e,i,r){if(!e)return Al(hr,i,r);const s=i.kind==="session"?`session/${i.id}`:i.kind==="file"?`file/${i.path.split("/").map(encodeURIComponent).join("/")}`:i.page;return`#/${r?"w/":""}${encodeURIComponent(e)}/${s}`}function dg(e){const i=ye.getState().projectId,r=e.kind==="session"?`clauder-${i}-${e.id}`:e.kind==="file"?`clauder-file-${i}-${e.path}`:`clauder-${i}-${e.page}`;window.open(`${location.origin}${location.pathname}${Al(i,e,!0)}`,r,"popup,width=1280,height=820")}const X4={sessions:0,transcript:0,interactions:0,runs:0,jobs:0,mcp:0,channels:0,files:0,projects:0},ye=_a((e,i)=>{const r=async s=>{if(t4(s),W4(s),e({projectId:s,health:null,sessions:[],open:[],transcriptTicks:{}}),!!s)try{const[l]=await Promise.all([ve.health(),i().refreshSessions(),i().refreshOpen()]);i().projectId===s&&e({health:l}),s!==hr&&ve.openedProject(s).catch(()=>{})}catch(l){if(i().projectId!==s)return;/no such project/i.test(l.message)?(i().notify(`The hub has no project '${s}'. Open its folder again from here.`,"error"),i().openProject(hr)):i().notify(`Could not open the project: ${l.message}`,"error")}};return{health:null,sessions:[],open:[],...dy(),ticks:{...X4},transcriptTicks:{},toast:null,boot:async()=>{window.addEventListener("hashchange",()=>{const p=dy(),a=p.projectId!==i().projectId;e({view:p.view,windowed:p.windowed}),a&&r(p.projectId)}),Go==null||Go.close(),Go=new EventSource("/api/stream");const s=new Set;let l=null;const f=()=>{l=null;const p={...i().ticks},a={...i().transcriptTicks};for(const d of s)d.startsWith("transcript:")?a[d.slice(11)]=Date.now():p[d]+=1;const h=new Set(s);s.clear(),e({ticks:p,transcriptTicks:a}),i().projectId&&((h.has("sessions")||h.has("transcript")||h.has("interactions"))&&i().refreshSessions(),h.has("interactions")&&i().refreshOpen())};Go.onmessage=p=>{const a=JSON.parse(p.data);a.project&&a.project!==i().projectId?s.add("projects"):(s.add(a.topic==="transcript"?`transcript:${a.payload.sessionId}`:a.topic),a.topic==="transcript"&&s.add("transcript")),l??(l=setTimeout(f,400))},Go.onopen=()=>{i().projectId&&(i().refreshSessions(),i().refreshOpen())},await r(i().projectId)},go:s=>{window.location.hash=Al(i().projectId,s,i().windowed).slice(1),e({view:s})},openProject:s=>{const l=f=>{const p=Al(s,f,!1);window.location.hash===p&&s!==i().projectId&&r(s),window.location.hash=p.slice(1)};if(!s||s===hr||s===i().projectId)return l({kind:"page",page:"overview"});ve.sessionsIn(s).then(f=>{const p=G4(f);if(!p)return l({kind:"page",page:"overview"});l({kind:"session",id:p.id})},()=>l({kind:"page",page:"overview"}))},openSessionIn:(s,l)=>{if(s===i().projectId)return i().go({kind:"session",id:l});window.location.hash=Al(s,{kind:"session",id:l},!1).slice(1)},refreshSessions:async()=>{const s=i().projectId;if(!s)return;const l=await ve.sessions();i().projectId===s&&e({sessions:l})},refreshOpen:async()=>{const s=i().projectId;if(!s)return;const l=await ve.interactions("open");i().projectId===s&&e({open:l})},notify:(s,l="info")=>{jp&&clearTimeout(jp),e({toast:{text:s,tone:l}}),jp=setTimeout(()=>e({toast:null}),l==="error"?6e3:3e3)}}});function ut(e,i,r=null){const s=ye(c=>i.map(_=>c.ticks[_]).join(",")),[l,f]=P.useState(null),[p,a]=P.useState(null),[h,d]=P.useState(0);P.useEffect(()=>{let c=!1;return e().then(_=>{c||(f(_),a(null))},_=>!c&&a(_.message)),()=>{c=!0}},[s,h,JSON.stringify(r)]);const m=P.useCallback(()=>d(c=>c+1),[]);return{data:l,error:p,reload:m}}async function rt(e,i){try{const r=await e();return i&&ye.getState().notify(i),r}catch(r){ye.getState().notify(r.message,"error");return}}function Qs(){const e=ye(l=>l.go),[i,r]=P.useState(!1);return{starting:i,start:async(l,f)=>{if(i)return;r(!0);const p=Math.max(80,Math.floor((window.innerWidth-340)/7.8)),a=Math.max(24,Math.floor((window.innerHeight-220)/17)),h=await rt(()=>ve.startPurpose(l,f,{cols:p,rows:a}));r(!1),h&&(await ye.getState().refreshSessions(),e({kind:"session",id:h.sessionId}))}}}const fy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,py=MS,K4=(e,i)=>r=>{var s;if((i==null?void 0:i.variants)==null)return py(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:f}=i,p=Object.keys(l).map(d=>{const m=r==null?void 0:r[d],c=f==null?void 0:f[d];if(m===null)return null;const _=fy(m)||fy(c);return l[d][_]}),a=r&&Object.entries(r).reduce((d,m)=>{let[c,_]=m;return _===void 0||(d[c]=_),d},{}),h=i==null||(s=i.compoundVariants)===null||s===void 0?void 0:s.reduce((d,m)=>{let{class:c,className:_,...x}=m;return Object.entries(x).every(E=>{let[w,g]=E;return Array.isArray(g)?g.includes({...f,...a}[w]):{...f,...a}[w]===g})?[...d,c,_]:d},[]);return py(e,p,h,r==null?void 0:r.class,r==null?void 0:r.className)},Q4=K4("inline-flex items-center justify-center gap-1.5 font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0",{variants:{variant:{foreground:"bg-foreground text-background hover:bg-foreground/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground",ghost:"text-muted-foreground hover:bg-muted hover:text-foreground",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",success:"bg-success text-success-foreground hover:bg-success/90"},size:{sm:"text-xs px-3 py-1.5 rounded",md:"text-sm px-4 py-2 rounded-md",lg:"text-base px-5 py-2.5 rounded-md",icon:"p-1.5 rounded-md"}},defaultVariants:{variant:"muted",size:"sm"}}),_e=P.forwardRef(({className:e,variant:i,size:r,...s},l)=>v.jsx("button",{ref:l,className:xe(Q4({variant:i,size:r}),e),...s}));_e.displayName="Button";var Z4=Object.defineProperty,xa=(e,i)=>Z4(e,"name",{value:i,configurable:!0}),HS=!!(typeof window<"u"&&window.document&&window.document.createElement);function tt(e,i,{checkForDefaultPrevented:r=!0}={}){return xa(function(l){if(e==null||e(l),r===!1||!l||!l.defaultPrevented)return i==null?void 0:i(l)},"handleEvent")}xa(tt,"composeEventHandlers");function J4(e){var i;if(!HS)throw new Error("Cannot access window outside of the DOM");return((i=e==null?void 0:e.ownerDocument)==null?void 0:i.defaultView)??window}xa(J4,"getOwnerWindow");function _m(e){if(!HS)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}xa(_m,"getOwnerDocument");function FS(e,i=!1){const{activeElement:r}=_m(e);if(!(r!=null&&r.nodeName))return null;if(US(r)&&r.contentDocument)return FS(r.contentDocument.body,i);if(i){const s=r.getAttribute("aria-activedescendant");if(s){const l=_m(r).getElementById(s);if(l)return l}}return r}xa(FS,"getActiveElement");function US(e){return e.tagName==="IFRAME"}xa(US,"isFrame");var eT=Object.defineProperty,fg=(e,i)=>eT(e,"name",{value:i,configurable:!0});function xm(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}fg(xm,"setRef");function $S(...e){return i=>{let r=!1;const s=e.map(l=>{const f=xm(l,i);return!r&&typeof f=="function"&&(r=!0),f});if(r)return()=>{for(let l=0;l<s.length;l++){const f=s[l];typeof f=="function"?f():xm(e[l],null)}}}}fg($S,"composeRefs");function ht(...e){return P.useCallback($S(...e),e)}fg(ht,"useComposedRefs");var tT=Object.defineProperty,di=(e,i)=>tT(e,"name",{value:i,configurable:!0});function nT(e,i){const r=P.createContext(i);r.displayName=e+"Context";const s=di(f=>{const{children:p,...a}=f,h=P.useMemo(()=>a,Object.values(a));return v.jsx(r.Provider,{value:h,children:p})},"Provider");s.displayName=e+"Provider";function l(f,p={}){const{optional:a=!1}=p,h=P.useContext(r);if(h)return h;if(i!==void 0)return i;if(!a)throw new Error(`\`${f}\` must be used within \`${e}\``)}return di(l,"useContext"),[s,l]}di(nT,"createContext");function br(e,i=[]){let r=[];function s(f,p){const a=P.createContext(p);a.displayName=f+"Context";const h=r.length;r=[...r,p];const d=di(c=>{var b;const{scope:_,children:x,...E}=c,w=((b=_==null?void 0:_[e])==null?void 0:b[h])||a,g=P.useMemo(()=>E,Object.values(E));return v.jsx(w.Provider,{value:g,children:x})},"Provider");d.displayName=f+"Provider";function m(c,_,x={}){var b;const{optional:E=!1}=x,w=((b=_==null?void 0:_[e])==null?void 0:b[h])||a,g=P.useContext(w);if(g)return g;if(p!==void 0)return p;if(!E)throw new Error(`\`${c}\` must be used within \`${f}\``)}return di(m,"useContext"),[d,m]}di(s,"createContext");const l=di(()=>{const f=r.map(p=>P.createContext(p));return di(function(a){const h=(a==null?void 0:a[e])||f;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])},"useScope")},"createScope");return l.scopeName=e,[s,qS(l,...i)]}di(br,"createContextScope");function qS(...e){const i=e[0];if(e.length===1)return i;const r=di(()=>{const s=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return di(function(f){const p=s.reduce((a,{useScope:h,scopeName:d})=>{const c=h(f)[`__scope${d}`];return{...a,...c}},{});return P.useMemo(()=>({[`__scope${i.scopeName}`]:p}),[p])},"useComposedScopes")},"createScope");return r.scopeName=i.scopeName,r}di(qS,"composeContextScopes");var $t=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},iT=Object.defineProperty,rT=(e,i)=>iT(e,"name",{value:i,configurable:!0}),sT=fa[" useId ".trim().toString()]||(()=>{}),oT=0;function Fi(e){const[i,r]=P.useState(sT());return $t(()=>{e||r(s=>s??String(oT++))},[e]),e||(i?`radix-${i}`:"")}rT(Fi,"useId");var aT=Object.defineProperty,lT=(e,i)=>aT(e,"name",{value:i,configurable:!0}),my=fa[" useEffectEvent ".trim().toString()],gy=fa[" useInsertionEffect ".trim().toString()];function VS(e){if(typeof my=="function")return my(e);const i=P.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof gy=="function"?gy(()=>{i.current=e}):$t(()=>{i.current=e}),P.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}lT(VS,"useEffectEvent");var cT=Object.defineProperty,Yl=(e,i)=>cT(e,"name",{value:i,configurable:!0}),uT=fa[" useInsertionEffect ".trim().toString()]||$t;function Ws({prop:e,defaultProp:i,onChange:r=Yl(()=>{},"onChange"),caller:s}){const[l,f,p]=WS({defaultProp:i,onChange:r}),a=e!==void 0,h=a?e:l,d=P.useCallback(m=>{var c;if(a){const _=GS(m)?m(e):m;_!==e&&((c=p.current)==null||c.call(p,_))}else f(m)},[a,e,f,p]);return[h,d]}Yl(Ws,"useControllableState");function WS({defaultProp:e,onChange:i}){const[r,s]=P.useState(e),l=P.useRef(r),f=P.useRef(i);return uT(()=>{f.current=i},[i]),P.useEffect(()=>{var p;l.current!==r&&((p=f.current)==null||p.call(f,r),l.current=r)},[r,l]),[r,s,f]}Yl(WS,"useUncontrolledState");function GS(e){return typeof e=="function"}Yl(GS,"isFunction");var vy=Symbol("RADIX:SYNC_STATE");function hT(e,i,r,s){const{prop:l,defaultProp:f,onChange:p,caller:a}=i,h=l!==void 0,d=VS(p),m=[{...r,state:f}];s&&m.push(s);const[c,_]=P.useReducer((g,b)=>{if(b.type===vy)return{...g,state:b.state};const S=e(g,b);return h&&!Object.is(S.state,g.state)&&d(S.state),S},...m),x=c.state,E=P.useRef(x);P.useEffect(()=>{E.current!==x&&(E.current=x,h||d(x))},[x,E,h]);const w=P.useMemo(()=>l!==void 0?{...c,state:l}:c,[c,l]);return P.useEffect(()=>{h&&!Object.is(l,c.state)&&_({type:vy,state:l})},[l,c.state,h]),[w,_]}Yl(hT,"useControllableStateReducer");var Xl=fS(),dT=Object.defineProperty,Zn=(e,i)=>dT(e,"name",{value:i,configurable:!0});function gr(e){const i=P.forwardRef((r,s)=>{let{children:l,...f}=r,p=null,a=!1;const h=[];l=ew(l),P.Children.forEach(l,_=>{var x;if(ZS(_)){a=!0;const E=_;let w="child"in E.props?E.props.child:E.props.children;for(;pg(w)&&typeof ih=="function";)w=ih(w._payload);p=fT(E,w),h.push((x=p==null?void 0:p.props)==null?void 0:x.children)}else h.push(_)}),p?p=P.cloneElement(p,void 0,h):!a&&P.Children.count(l)===1&&P.isValidElement(l)&&(p=l);const d=p?QS(p):void 0,m=ht(s,d);if(!p){if(l||l===0)throw new Error(a?gT(e):mT(e));return l}const c=KS(f,p.props??{});return p.type!==P.Fragment&&(c.ref=s?m:d),P.cloneElement(p,c)});return i.displayName=`${e}.Slot`,i}Zn(gr,"createSlot");var YS=Symbol.for("radix.slottable");function XS(e){const i=Zn(r=>"child"in r?r.children(r.child):r.children,"Slottable");return i.displayName=`${e}.Slottable`,i.__radixId=YS,i}Zn(XS,"createSlottable");var fT=Zn((e,i)=>"child"in e.props?P.isValidElement(i)?P.cloneElement(i,void 0,e.props.children(i.props.children)):null:P.isValidElement(i)?i:null,"getSlottableElementFromSlottable");function KS(e,i){const r={...i};for(const s in i){const l=e[s],f=i[s];/^on[A-Z]/.test(s)?l&&f?r[s]=(...a)=>{const h=f(...a);return l(...a),h}:l&&(r[s]=l):s==="style"?r[s]={...l,...f}:s==="className"?r[s]=[l,f].filter(Boolean).join(" "):s==="aria-describedby"&&(r[s]=tw(f,l))}return{...e,...r}}Zn(KS,"mergeProps");function QS(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Zn(QS,"getElementRef");function ZS(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YS}Zn(ZS,"isSlottable");var pT=Symbol.for("react.lazy");function pg(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pT&&"_payload"in e&&JS(e._payload)}Zn(pg,"isLazyComponent");function JS(e){return typeof e=="object"&&e!==null&&"then"in e}Zn(JS,"isPromiseLike");function ew(e){let i=e;for(;pg(i)&&typeof ih=="function";)i=ih(i._payload);return i}Zn(ew,"useUnwrappedLazy");function tw(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Zn(tw,"concatAriaDescribedby");var mT=Zn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),gT=Zn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ih=fa[" use ".trim().toString()],vT=Object.defineProperty,_T=(e,i)=>vT(e,"name",{value:i,configurable:!0}),xT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wt=xT.reduce((e,i)=>{const r=gr(`Primitive.${i}`),s=P.forwardRef((l,f)=>{const{asChild:p,...a}=l,h=p?r:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(h,{...a,ref:f})});return s.displayName=`Primitive.${i}`,{...e,[i]:s}},{});function nw(e,i){e&&Xl.flushSync(()=>e.dispatchEvent(i))}_T(nw,"dispatchDiscreteCustomEvent");var yT=Object.defineProperty,bT=(e,i)=>yT(e,"name",{value:i,configurable:!0}),_y=fa[" useInsertionEffect ".trim().toString()];function Ui(e){const i=P.useRef(e);return typeof _y=="function"?_y(()=>{i.current=e}):$t(()=>{i.current=e}),P.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}bT(Ui,"useCallbackRef");var ST=Object.defineProperty,tn=(e,i)=>ST(e,"name",{value:i,configurable:!0}),ym="dismissableLayer.update",wT="dismissableLayer.pointerDownOutside",CT="dismissableLayer.focusOutside",xy,iw=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Sh=P.forwardRef(tn(function(i,r){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:a,onInteractOutside:h,onDismiss:d,...m}=i,c=P.useContext(iw),[_,x]=P.useState(null),E=(_==null?void 0:_.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=P.useState({}),g=ht(r,x),b=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=S?b.indexOf(S):-1,T=_?b.indexOf(_):-1,L=c.layersWithOutsidePointerEventsDisabled.size>0,R=T>=y,D=P.useRef(!1),A=sw(B=>{p==null||p(B),h==null||h(B),B.defaultPrevented||d==null||d()},{ownerDocument:E,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:P.useCallback(B=>{if(!(B instanceof Node))return!1;const H=[...c.branches].some(U=>U.contains(B));return R&&!H},[c.branches,R])}),j=ow(B=>{if(l&&D.current)return;const H=B.target;[...c.branches].some(W=>W.contains(H))||(a==null||a(B),h==null||h(B),B.defaultPrevented||d==null||d())},E),M=_?T===b.length-1:!1,I=Ui(B=>{B.key==="Escape"&&(f==null||f(B),!B.defaultPrevented&&d&&(B.preventDefault(),d()))});return P.useEffect(()=>{if(M)return E.addEventListener("keydown",I,{capture:!0}),()=>E.removeEventListener("keydown",I,{capture:!0})},[E,M,I]),P.useEffect(()=>{if(_)return s&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(xy=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(_)),c.layers.add(_),bm(),()=>{s&&(c.layersWithOutsidePointerEventsDisabled.delete(_),c.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=xy))}},[_,E,s,c]),P.useEffect(()=>()=>{_&&(c.layers.delete(_),c.layersWithOutsidePointerEventsDisabled.delete(_),bm())},[_,c]),P.useEffect(()=>{const B=tn(()=>w({}),"handleUpdate");return document.addEventListener(ym,B),()=>document.removeEventListener(ym,B)},[]),v.jsx(wt.div,{...m,ref:g,style:{pointerEvents:L?R?"auto":"none":void 0,...i.style},onFocusCapture:tt(i.onFocusCapture,j.onFocusCapture),onBlurCapture:tt(i.onBlurCapture,j.onBlurCapture),onPointerDownCapture:tt(i.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function rw(){const e=P.useContext(iw),[i,r]=P.useState(null);return P.useEffect(()=>{if(i)return e.dismissableSurfaces.add(i),()=>{e.dismissableSurfaces.delete(i)}},[i,e.dismissableSurfaces]),r}tn(rw,"useDismissableLayerSurface");var ET=tn(()=>!0,"IS_TRUE");function sw(e,i){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:f,shouldHandlePointerDownOutside:p=ET}=i,a=Ui(e),h=P.useRef(!1),d=P.useRef(!1),m=P.useRef(new Map),c=P.useRef(()=>{});return P.useEffect(()=>{function _(){d.current=!1,l.current=!1,m.current.clear()}tn(_,"resetOutsideInteraction");function x(){return Array.from(m.current.values()).some(Boolean)}tn(x,"isOutsideInteractionIntercepted");function E(y){if(!d.current)return;const T=y.target;T instanceof Node&&[...f].some(R=>R.contains(T))||m.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{d.current&&c.current()},0)}tn(E,"handleInteractionCapture");function w(y){d.current&&m.current.set(y.type,!1)}tn(w,"handleInteractionBubble");const g=tn(y=>{if(y.target&&!h.current){let T=function(){r.removeEventListener("click",c.current);const R=x();_(),R||mg(wT,a,L,{discrete:!0})};if(tn(T,"handleAndDispatchPointerDownOutsideEvent"),!p(y.target)){r.removeEventListener("click",c.current),_(),h.current=!1;return}const L={originalEvent:y};d.current=!0,l.current=s&&y.button===0,m.current.clear(),!s||y.button!==0?T():(r.removeEventListener("click",c.current),c.current=T,r.addEventListener("click",c.current,{once:!0}))}else r.removeEventListener("click",c.current),_();h.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of b)r.addEventListener(y,E,!0),r.addEventListener(y,w);const S=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(S),r.removeEventListener("pointerdown",g),r.removeEventListener("click",c.current);for(const y of b)r.removeEventListener(y,E,!0),r.removeEventListener(y,w)}},[r,a,s,l,f,p]),{onPointerDownCapture:tn(()=>h.current=!0,"onPointerDownCapture")}}tn(sw,"usePointerDownOutside");function ow(e,i=globalThis==null?void 0:globalThis.document){const r=Ui(e),s=P.useRef(!1);return P.useEffect(()=>{const l=tn(f=>{f.target&&!s.current&&mg(CT,r,{originalEvent:f},{discrete:!1})},"handleFocus");return i.addEventListener("focusin",l),()=>i.removeEventListener("focusin",l)},[i,r]),{onFocusCapture:tn(()=>s.current=!0,"onFocusCapture"),onBlurCapture:tn(()=>s.current=!1,"onBlurCapture")}}tn(ow,"useFocusOutside");function bm(){const e=new CustomEvent(ym);document.dispatchEvent(e)}tn(bm,"dispatchUpdate");function mg(e,i,r,{discrete:s}){const l=r.originalEvent.target,f=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});i&&l.addEventListener(e,i,{once:!0}),s?nw(l,f):l.dispatchEvent(f)}tn(mg,"handleAndDispatchCustomEvent");var kT=Object.defineProperty,Ft=(e,i)=>kT(e,"name",{value:i,configurable:!0}),Op="focusScope.autoFocusOnMount",Np="focusScope.autoFocusOnUnmount",yy={bubbles:!1,cancelable:!0},gg=P.forwardRef(Ft(function(i,r){const{loop:s=!1,trapped:l=!1,branches:f,onMountAutoFocus:p,onUnmountAutoFocus:a,...h}=i,[d,m]=P.useState(null),c=Ui(p),_=Ui(a),x=P.useRef(null),E=ht(r,m),w=P.useRef(f);P.useEffect(()=>{w.current=f});const g=P.useCallback(y=>{var T;return y?d!=null&&d.contains(y)?!0:!!((T=w.current)!=null&&T.some(L=>L.contains(y))):!1},[d]),b=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(l){let y=function(D){if(b.paused||!d)return;const A=D.target;g(A)?x.current=A:cr(x.current,{select:!0})},T=function(D){if(b.paused||!d)return;const A=D.relatedTarget;A!==null&&(g(A)||cr(x.current,{select:!0}))},L=function(D){if(document.activeElement===document.body)for(const j of D)j.removedNodes.length>0&&cr(d)};Ft(y,"handleFocusIn"),Ft(T,"handleFocusOut"),Ft(L,"handleMutations"),document.addEventListener("focusin",y),document.addEventListener("focusout",T);const R=new MutationObserver(L);return d&&R.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",T),R.disconnect()}}},[l,d,b.paused,g]),P.useEffect(()=>{if(d){by.add(b);const y=document.activeElement;if(!d.contains(y)){const L=new CustomEvent(Op,yy);d.addEventListener(Op,c),d.dispatchEvent(L),L.defaultPrevented||(lw(fw(yg(d)),{select:!0}),document.activeElement===y&&cr(d))}return()=>{d.removeEventListener(Op,c);const L=d.ownerDocument,R=CustomEvent;setTimeout(()=>{const D=new R(Np,yy);d.addEventListener(Np,_),d.dispatchEvent(D),D.defaultPrevented||cr(y??L.body,{select:!0}),d.removeEventListener(Np,_),by.remove(b)},0)}}},[d,c,_,b]);const S=P.useCallback(y=>{if(!s&&!l||b.paused)return;const T=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,L=document.activeElement;if(T&&L){const R=y.currentTarget,[D,A]=cw(R);D&&A?!y.shiftKey&&L===A?(y.preventDefault(),s&&cr(D,{select:!0})):y.shiftKey&&L===D&&(y.preventDefault(),s&&cr(A,{select:!0})):L===R&&y.preventDefault()}},[s,l,b.paused]);return v.jsx(wt.div,{tabIndex:-1,...h,ref:E,onKeyDown:S})},"FocusScope")),aw=P.createContext(null);function vg({registry:e,children:i}){return e?v.jsx(aw.Provider,{value:e,children:i}):i}Ft(vg,"FocusScopeBranchProvider");function _g(){const[e,i]=P.useState([]),r=P.useMemo(()=>({add:Ft(s=>i(l=>l.includes(s)?l:[...l,s]),"add"),remove:Ft(s=>i(l=>l.filter(f=>f!==s)),"remove")}),[]);return{nodes:e,registry:r}}Ft(_g,"useFocusScopeBranchRegistry");function xg(e){const i=P.useContext(aw);P.useEffect(()=>{if(!(!e||!i))return i.add(e),()=>i.remove(e)},[e,i])}Ft(xg,"useFocusScopeBranch");function lw(e,{select:i=!1}={}){const r=document.activeElement;for(const s of e)if(cr(s,{select:i}),document.activeElement!==r)return}Ft(lw,"focusFirst");function cw(e){const i=yg(e),r=Sm(i,e),s=Sm(i.reverse(),e);return[r,s]}Ft(cw,"getTabbableEdges");function yg(e){const i=[],s=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ft(l=>{const f=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||f?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)i.push(s.currentNode);return i}Ft(yg,"getTabbableCandidates");function Sm(e,i){const r=typeof i.checkVisibility=="function"&&i.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(r?!s.checkVisibility({checkVisibilityCSS:!0}):uw(s,{upTo:i})))return s}Ft(Sm,"findVisible");function uw(e,{upTo:i}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(i!==void 0&&e===i)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ft(uw,"isHidden");function hw(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ft(hw,"isSelectableInput");function cr(e,{select:i=!1}={}){if(e&&e.focus){const s=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==s&&hw(e)&&i&&e.select()}}Ft(cr,"focus");var by=dw();function dw(){let e=[];return{add(i){const r=e[0];i!==r&&(r==null||r.pause()),e=wm(e,i),e.unshift(i)},remove(i){var r;e=wm(e,i),(r=e[0])==null||r.resume()}}}Ft(dw,"createFocusScopesStack");function wm(e,i){const r=[...e],s=r.indexOf(i);return s!==-1&&r.splice(s,1),r}Ft(wm,"arrayRemove");function fw(e){return e.filter(i=>i.tagName!=="A")}Ft(fw,"removeLinks");var TT=Object.defineProperty,RT=(e,i)=>TT(e,"name",{value:i,configurable:!0}),wh=P.forwardRef(RT(function(i,r){var h;const{container:s,...l}=i,[f,p]=P.useState(!1);$t(()=>p(!0),[]);const a=s||f&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return a?Xl.createPortal(v.jsx(wt.div,{...l,ref:r}),a):null},"Portal")),AT=Object.defineProperty,vr=(e,i)=>AT(e,"name",{value:i,configurable:!0});function pw(e,i){return P.useReducer((r,s)=>i[r][s]??r,e)}vr(pw,"useStateMachine");var Sr=vr(e=>{const{present:i,children:r}=e,s=mw(i),l=typeof r=="function"?r({present:s.isPresent}):P.Children.only(r),f=gw(s.ref,vw(l));return typeof r=="function"||s.isPresent?P.cloneElement(l,{ref:f}):null},"Presence");function mw(e){const[i,r]=P.useState(),s=P.useRef(null),l=P.useRef(e),f=P.useRef("none"),p=P.useRef(void 0),a=e?"mounted":"unmounted",[h,d]=pw(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{h==="mounted"?(f.current=p.current??Jo(s.current),p.current=void 0):f.current="none"},[h]),$t(()=>{const m=s.current,c=l.current;if(c!==e){const x=f.current,E=Jo(m);e?(p.current=E,d("MOUNT")):E==="none"||(m==null?void 0:m.display)==="none"?d("UNMOUNT"):d(c&&x!==E?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,d]),$t(()=>{if(i){let m;const c=i.ownerDocument.defaultView??window,_=vr(E=>{const g=Jo(s.current).includes(CSS.escape(E.animationName));if(E.target===i&&g&&(d("ANIMATION_END"),!l.current)){const b=i.style.animationFillMode;i.style.animationFillMode="forwards",m=c.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=b)})}},"handleAnimationEnd"),x=vr(E=>{E.target===i&&(f.current=Jo(s.current))},"handleAnimationStart");return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",_),i.addEventListener("animationend",_),()=>{c.clearTimeout(m),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",_),i.removeEventListener("animationend",_)}}else d("ANIMATION_END")},[i,d]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:P.useCallback(m=>{if(m){const c=getComputedStyle(m);s.current=c,p.current=Jo(c)}else s.current=null;r(m)},[])}}vr(mw,"usePresence");function Cm(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}vr(Cm,"setRef");function gw(...e){const i=P.useRef(e);return i.current=e,P.useCallback(r=>{const s=i.current;let l=!1;const f=s.map(p=>{const a=Cm(p,r);return!l&&typeof a=="function"&&(l=!0),a});if(l)return()=>{for(let p=0;p<f.length;p++){const a=f[p];typeof a=="function"?a():Cm(s[p],null)}}},[])}vr(gw,"useStableComposedRefs");function Jo(e){return(e==null?void 0:e.animationName)||"none"}vr(Jo,"getAnimationName");function vw(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}vr(vw,"getElementRef");var LT=Object.defineProperty,bg=(e,i)=>LT(e,"name",{value:i,configurable:!0}),Mu=0,Bi=null;function DT(e){return Kl(),e.children}bg(DT,"FocusGuards");function Kl(){P.useEffect(()=>{Bi||(Bi={start:Em(),end:Em()});const{start:e,end:i}=Bi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==i&&document.body.insertAdjacentElement("beforeend",i),Mu++,()=>{Mu===1&&(Bi==null||Bi.start.remove(),Bi==null||Bi.end.remove(),Bi=null),Mu=Math.max(0,Mu-1)}},[])}bg(Kl,"useFocusGuards");function Em(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}bg(Em,"createFocusGuard");var Ii=function(){return Ii=Object.assign||function(i){for(var r,s=1,l=arguments.length;s<l;s++){r=arguments[s];for(var f in r)Object.prototype.hasOwnProperty.call(r,f)&&(i[f]=r[f])}return i},Ii.apply(this,arguments)};function _w(e,i){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(e);l<s.length;l++)i.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(r[s[l]]=e[s[l]]);return r}function MT(e,i,r){if(r||arguments.length===2)for(var s=0,l=i.length,f;s<l;s++)(f||!(s in i))&&(f||(f=Array.prototype.slice.call(i,0,s)),f[s]=i[s]);return e.concat(f||Array.prototype.slice.call(i))}var Gu="right-scroll-bar-position",Yu="width-before-scroll-bar",jT="with-scroll-bars-hidden",OT="--removed-body-scroll-bar-size";function Bp(e,i){return typeof e=="function"?e(i):e&&(e.current=i),e}function NT(e,i){var r=P.useState(function(){return{value:e,callback:i,facade:{get current(){return r.value},set current(s){var l=r.value;l!==s&&(r.value=s,r.callback(s,l))}}}})[0];return r.callback=i,r.facade}var BT=typeof window<"u"?P.useLayoutEffect:P.useEffect,Sy=new WeakMap;function PT(e,i){var r=NT(null,function(s){return e.forEach(function(l){return Bp(l,s)})});return BT(function(){var s=Sy.get(r);if(s){var l=new Set(s),f=new Set(e),p=r.current;l.forEach(function(a){f.has(a)||Bp(a,null)}),f.forEach(function(a){l.has(a)||Bp(a,p)})}Sy.set(r,e)},[e]),r}function IT(e){return e}function zT(e,i){i===void 0&&(i=IT);var r=[],s=!1,l={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(f){var p=i(f,s);return r.push(p),function(){r=r.filter(function(a){return a!==p})}},assignSyncMedium:function(f){for(s=!0;r.length;){var p=r;r=[],p.forEach(f)}r={push:function(a){return f(a)},filter:function(){return r}}},assignMedium:function(f){s=!0;var p=[];if(r.length){var a=r;r=[],a.forEach(f),p=r}var h=function(){var m=p;p=[],m.forEach(f)},d=function(){return Promise.resolve().then(h)};d(),r={push:function(m){p.push(m),d()},filter:function(m){return p=p.filter(m),r}}}};return l}function HT(e){e===void 0&&(e={});var i=zT(null);return i.options=Ii({async:!0,ssr:!1},e),i}var xw=function(e){var i=e.sideCar,r=_w(e,["sideCar"]);if(!i)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=i.read();if(!s)throw new Error("Sidecar medium not found");return P.createElement(s,Ii({},r))};xw.isSideCarExport=!0;function FT(e,i){return e.useMedium(i),xw}var yw=HT(),Pp=function(){},Ch=P.forwardRef(function(e,i){var r=P.useRef(null),s=P.useState({onScrollCapture:Pp,onWheelCapture:Pp,onTouchMoveCapture:Pp}),l=s[0],f=s[1],p=e.forwardProps,a=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,c=e.shards,_=e.sideCar,x=e.noRelative,E=e.noIsolation,w=e.inert,g=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,y=e.gapMode,T=_w(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=_,R=PT([r,i]),D=Ii(Ii({},T),l);return P.createElement(P.Fragment,null,m&&P.createElement(L,{sideCar:yw,removeScrollBar:d,shards:c,noRelative:x,noIsolation:E,inert:w,setCallbacks:f,allowPinchZoom:!!g,lockRef:r,gapMode:y}),p?P.cloneElement(P.Children.only(a),Ii(Ii({},D),{ref:R})):P.createElement(S,Ii({},D,{className:h,ref:R}),a))});Ch.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ch.classNames={fullWidth:Yu,zeroRight:Gu};var UT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $T(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var i=UT();return i&&e.setAttribute("nonce",i),e}function qT(e,i){e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i))}function VT(e){var i=document.head||document.getElementsByTagName("head")[0];i.appendChild(e)}var WT=function(){var e=0,i=null;return{add:function(r){e==0&&(i=$T())&&(qT(i,r),VT(i)),e++},remove:function(){e--,!e&&i&&(i.parentNode&&i.parentNode.removeChild(i),i=null)}}},GT=function(){var e=WT();return function(i,r){P.useEffect(function(){return e.add(i),function(){e.remove()}},[i&&r])}},bw=function(){var e=GT(),i=function(r){var s=r.styles,l=r.dynamic;return e(s,l),null};return i},YT={left:0,top:0,right:0,gap:0},Ip=function(e){return parseInt(e||"",10)||0},XT=function(e){var i=window.getComputedStyle(document.body),r=i[e==="padding"?"paddingLeft":"marginLeft"],s=i[e==="padding"?"paddingTop":"marginTop"],l=i[e==="padding"?"paddingRight":"marginRight"];return[Ip(r),Ip(s),Ip(l)]},KT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return YT;var i=XT(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,s-r+i[2]-i[0])}},QT=bw(),sa="data-scroll-locked",ZT=function(e,i,r,s){var l=e.left,f=e.top,p=e.right,a=e.gap;return r===void 0&&(r="margin"),`
465
+ */const vn=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);let th=null;const hr="global";function t4(e){th=e}function Lu(){return th}function Hi(){if(!th)throw new Error("No project is open.");return`/api/p/${encodeURIComponent(th)}`}function kt(e,i){return $s(`${Hi()}${e}`,i)}function gn(e,i){return $s(`/api${e}`,i)}async function $s(e,i){const r=await fetch(e,{...i,headers:{"Content-Type":"application/json",...(i==null?void 0:i.headers)??{}}}),s=await r.text();let l={};try{l=s?JSON.parse(s):{}}catch{throw r.ok?new Error("The server returned a response that was not JSON."):new Error(`${r.status} ${r.statusText}`)}if(!r.ok)throw new Error(l.error??r.statusText);return l}const Ot=(e,i)=>kt(e,{method:"POST",body:i===void 0?void 0:JSON.stringify(i)}),Cn=(e,i)=>kt(e,{method:"PUT",body:JSON.stringify(i)}),Go=e=>kt(e,{method:"DELETE"}),ve={health:()=>kt("/health"),hub:()=>gn("/hub"),checkClaude:()=>gn("/claude/check",{method:"POST"}),projects:()=>gn("/projects"),addProject:e=>gn("/projects",{method:"POST",body:JSON.stringify({path:e})}),openedProject:e=>gn(`/projects/${encodeURIComponent(e)}/open`,{method:"POST"}),removeProject:e=>gn(`/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),folders:e=>gn(`/folders${e?`?path=${encodeURIComponent(e)}`:""}`),globalOverview:()=>gn("/global/overview"),globalInbox:()=>gn("/global/inbox"),globalLive:()=>gn("/global/live"),closeOpenSessions:(e,i)=>$s(`/api/p/${encodeURIComponent(e)}/open-sessions/close`,{method:"POST",body:JSON.stringify({ids:i})}),startSessionIn:(e,i)=>$s(`/api/p/${encodeURIComponent(e)}/sessions`,{method:"POST",body:JSON.stringify(i)}),setMuted:(e,i)=>gn(`/global/muted/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({muted:i})}),answerIn:(e,i,r)=>gn(`/p/${encodeURIComponent(e)}/interactions/${i}/answer`,{method:"POST",body:JSON.stringify({answer:r})}),chooseIn:(e,i,r)=>gn(`/p/${encodeURIComponent(e)}/interactions/${i}/choose`,{method:"POST",body:JSON.stringify({ref:r})}),pauseNotificationsIn:(e,i)=>gn(`/p/${encodeURIComponent(e)}/notifications/paused`,{method:"PUT",body:JSON.stringify({paused:i})}),revealIn:e=>gn(`/p/${encodeURIComponent(e)}/files/reveal`,{method:"POST",body:JSON.stringify({path:""})}),dismissIn:(e,i)=>gn(`/p/${encodeURIComponent(e)}/interactions/${i}/dismiss`,{method:"POST"}),sessions:()=>kt("/sessions"),sessionsIn:e=>$s(`/api/p/${encodeURIComponent(e)}/sessions`),session:e=>kt(`/sessions/${e}`),startSession:e=>Ot("/sessions",e),startPurpose:(e,i,r={})=>Ot("/purpose-sessions",{kind:e,targetId:i,...r}),resumeSession:(e,i={})=>Ot(`/sessions/${e}/resume`,i),killSession:(e,i)=>i?$s(`/api/p/${encodeURIComponent(i)}/sessions/${e}/kill`,{method:"POST"}):Ot(`/sessions/${e}/kill`),renameSession:(e,i,r)=>r?$s(`/api/p/${encodeURIComponent(r)}/sessions/${e}/title`,{method:"PUT",body:JSON.stringify({title:i})}):Cn(`/sessions/${e}/title`,{title:i}),deletionPlan:e=>kt(`/sessions/${e}/deletion`),deleteSession:(e,i=!0)=>Go(`/sessions/${e}?temp=${i?1:0}`),interactions:e=>kt(`/interactions${e?`?status=${e}`:""}`),answer:(e,i)=>Ot(`/interactions/${e}/answer`,{answer:i}),choose:(e,i)=>Ot(`/interactions/${e}/choose`,{ref:i}),dismiss:e=>Ot(`/interactions/${e}/dismiss`),inventory:()=>kt("/inventory"),stats:()=>kt("/stats"),categories:()=>kt("/categories"),saveCategory:e=>e.id?Cn(`/categories/${e.id}`,e):Ot("/categories",e),deleteCategory:e=>Go(`/categories/${e}`),prompts:()=>kt("/prompts"),savePrompt:(e,i)=>Cn(`/prompts/${e}`,{text:i}),previewSystemPrompt:e=>kt(`/prompts/preview?category=${encodeURIComponent(e)}`),memory:()=>kt("/memory"),memoryFile:e=>kt(`/memory/file?path=${encodeURIComponent(e)}`),saveMemoryFile:(e,i)=>Cn("/memory/file",{path:e,content:i}),channels:()=>kt("/channels"),setNotificationsPaused:e=>Cn("/notifications/paused",{paused:e}),setNotifyKinds:e=>Cn("/notifications/kinds",{kinds:e}),setSessionQuiet:(e,i)=>Cn(`/sessions/${e}/quiet`,{quiet:i}),dismissWaiting:e=>Ot(`/sessions/${e}/dismiss-waiting`),saveChannel:e=>e.id?Cn(`/channels/${e.id}`,e):Ot("/channels",e),deleteChannel:e=>Go(`/channels/${e}`),testChannel:e=>Ot(`/channels/${e}/test`),jobs:()=>kt("/jobs"),saveJob:e=>e.id?Cn(`/jobs/${e.id}`,e):Ot("/jobs",e),deleteJob:e=>Go(`/jobs/${e}`),rotateJobToken:e=>Ot(`/jobs/${e}/rotate`),runJob:e=>Ot(`/jobs/${e}/run`,{}),runs:()=>kt("/runs"),queueRun:(e,i)=>Ot("/runs",{prompt:e,category:i}),cancelRun:e=>Ot(`/runs/${e}/cancel`),stopRun:e=>Ot(`/runs/${e}/stop`),resumeRun:e=>Ot(`/runs/${e}/resume`),toolsetCatalog:()=>kt("/toolset/catalog"),setSessionToolset:(e,i)=>Cn(`/sessions/${e}/toolset`,{toolset:i}),setSessionSetup:(e,i)=>Cn(`/sessions/${e}/setup`,i),presets:()=>kt("/presets"),savePreset:e=>e.id?Cn(`/presets/${e.id}`,e):Ot("/presets",e),deletePreset:e=>Go(`/presets/${e}`),setDefaultItem:(e,i,r)=>Cn("/toolset/default",{kind:e,id:i,enabled:r}),claudeSettings:()=>kt("/claude-settings"),saveClaudeSettings:e=>Cn("/claude-settings",e),mcpCatalog:()=>kt("/mcp/catalog"),suggestions:()=>kt("/mcp/suggestions"),mcpSuggestionsEnabled:()=>kt("/mcp-suggestions/enabled"),setMcpSuggestionsEnabled:e=>Cn("/mcp-suggestions/enabled",{enabled:e}),installSuggestion:e=>Ot(`/mcp/suggestions/${e}/install`),skipSuggestion:(e,i="")=>Ot(`/mcp/suggestions/${e}/skip`,{note:i}),deleteSuggestion:e=>Go(`/mcp/suggestions/${e}`)};function DS(e){var i,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(i=0;i<l;i++)e[i]&&(r=DS(e[i]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function MS(){for(var e,i,r=0,s="",l=arguments.length;r<l;r++)(e=arguments[r])&&(i=DS(e))&&(s&&(s+=" "),s+=i);return s}const ug="-",n4=e=>{const i=r4(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:p=>{const a=p.split(ug);return a[0]===""&&a.length!==1&&a.shift(),jS(a,i)||i4(p)},getConflictingClassGroupIds:(p,a)=>{const h=r[p]||[];return a&&s[p]?[...h,...s[p]]:h}}},jS=(e,i)=>{var p;if(e.length===0)return i.classGroupId;const r=e[0],s=i.nextPart.get(r),l=s?jS(e.slice(1),s):void 0;if(l)return l;if(i.validators.length===0)return;const f=e.join(ug);return(p=i.validators.find(({validator:a})=>a(f)))==null?void 0:p.classGroupId},sy=/^\[(.+)\]$/,i4=e=>{if(sy.test(e)){const i=sy.exec(e)[1],r=i==null?void 0:i.substring(0,i.indexOf(":"));if(r)return"arbitrary.."+r}},r4=e=>{const{theme:i,prefix:r}=e,s={nextPart:new Map,validators:[]};return o4(Object.entries(e.classGroups),r).forEach(([f,p])=>{vm(p,s,f,i)}),s},vm=(e,i,r,s)=>{e.forEach(l=>{if(typeof l=="string"){const f=l===""?i:oy(i,l);f.classGroupId=r;return}if(typeof l=="function"){if(s4(l)){vm(l(s),i,r,s);return}i.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([f,p])=>{vm(p,oy(i,f),r,s)})})},oy=(e,i)=>{let r=e;return i.split(ug).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},s4=e=>e.isThemeGetter,o4=(e,i)=>i?e.map(([r,s])=>{const l=s.map(f=>typeof f=="string"?i+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([p,a])=>[i+p,a])):f);return[r,l]}):e,a4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,r=new Map,s=new Map;const l=(f,p)=>{r.set(f,p),i++,i>e&&(i=0,s=r,r=new Map)};return{get(f){let p=r.get(f);if(p!==void 0)return p;if((p=s.get(f))!==void 0)return l(f,p),p},set(f,p){r.has(f)?r.set(f,p):l(f,p)}}},OS="!",l4=e=>{const{separator:i,experimentalParseClassName:r}=e,s=i.length===1,l=i[0],f=i.length,p=a=>{const h=[];let d=0,m=0,c;for(let g=0;g<a.length;g++){let b=a[g];if(d===0){if(b===l&&(s||a.slice(g,g+f)===i)){h.push(a.slice(m,g)),m=g+f;continue}if(b==="/"){c=g;continue}}b==="["?d++:b==="]"&&d--}const _=h.length===0?a:a.substring(m),x=_.startsWith(OS),E=x?_.substring(1):_,w=c&&c>m?c-m:void 0;return{modifiers:h,hasImportantModifier:x,baseClassName:E,maybePostfixModifierPosition:w}};return r?a=>r({className:a,parseClassName:p}):p},c4=e=>{if(e.length<=1)return e;const i=[];let r=[];return e.forEach(s=>{s[0]==="["?(i.push(...r.sort(),s),r=[]):r.push(s)}),i.push(...r.sort()),i},u4=e=>({cache:a4(e.cacheSize),parseClassName:l4(e),...n4(e)}),h4=/\s+/,d4=(e,i)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:l}=i,f=[],p=e.trim().split(h4);let a="";for(let h=p.length-1;h>=0;h-=1){const d=p[h],{modifiers:m,hasImportantModifier:c,baseClassName:_,maybePostfixModifierPosition:x}=r(d);let E=!!x,w=s(E?_.substring(0,x):_);if(!w){if(!E){a=d+(a.length>0?" "+a:a);continue}if(w=s(_),!w){a=d+(a.length>0?" "+a:a);continue}E=!1}const g=c4(m).join(":"),b=c?g+OS:g,S=b+w;if(f.includes(S))continue;f.push(S);const y=l(w,E);for(let T=0;T<y.length;++T){const L=y[T];f.push(b+L)}a=d+(a.length>0?" "+a:a)}return a};function f4(){let e=0,i,r,s="";for(;e<arguments.length;)(i=arguments[e++])&&(r=NS(i))&&(s&&(s+=" "),s+=r);return s}const NS=e=>{if(typeof e=="string")return e;let i,r="";for(let s=0;s<e.length;s++)e[s]&&(i=NS(e[s]))&&(r&&(r+=" "),r+=i);return r};function p4(e,...i){let r,s,l,f=p;function p(h){const d=i.reduce((m,c)=>c(m),e());return r=u4(d),s=r.cache.get,l=r.cache.set,f=a,a(h)}function a(h){const d=s(h);if(d)return d;const m=d4(h,r);return l(h,m),m}return function(){return f(f4.apply(null,arguments))}}const Ct=e=>{const i=r=>r[e]||[];return i.isThemeGetter=!0,i},BS=/^\[(?:([a-z-]+):)?(.+)\]$/i,m4=/^\d+\/\d+$/,g4=new Set(["px","full","screen"]),v4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,x4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lr=e=>ra(e)||g4.has(e)||m4.test(e),es=e=>ga(e,"length",A4),ra=e=>!!e&&!Number.isNaN(Number(e)),Mp=e=>ga(e,"number",ra),bl=e=>!!e&&Number.isInteger(Number(e)),S4=e=>e.endsWith("%")&&ra(e.slice(0,-1)),Ye=e=>BS.test(e),ts=e=>v4.test(e),w4=new Set(["length","size","percentage"]),C4=e=>ga(e,w4,PS),E4=e=>ga(e,"position",PS),k4=new Set(["image","url"]),T4=e=>ga(e,k4,D4),R4=e=>ga(e,"",L4),Sl=()=>!0,ga=(e,i,r)=>{const s=BS.exec(e);return s?s[1]?typeof i=="string"?s[1]===i:i.has(s[1]):r(s[2]):!1},A4=e=>_4.test(e)&&!x4.test(e),PS=()=>!1,L4=e=>y4.test(e),D4=e=>b4.test(e),M4=()=>{const e=Ct("colors"),i=Ct("spacing"),r=Ct("blur"),s=Ct("brightness"),l=Ct("borderColor"),f=Ct("borderRadius"),p=Ct("borderSpacing"),a=Ct("borderWidth"),h=Ct("contrast"),d=Ct("grayscale"),m=Ct("hueRotate"),c=Ct("invert"),_=Ct("gap"),x=Ct("gradientColorStops"),E=Ct("gradientColorStopPositions"),w=Ct("inset"),g=Ct("margin"),b=Ct("opacity"),S=Ct("padding"),y=Ct("saturate"),T=Ct("scale"),L=Ct("sepia"),R=Ct("skew"),D=Ct("space"),A=Ct("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ye,i],B=()=>[Ye,i],H=()=>["",lr,es],U=()=>["auto",ra,Ye],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Ye],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[ra,Ye];return{cacheSize:500,separator:":",theme:{colors:[Sl],spacing:[lr,es],blur:["none","",ts,Ye],brightness:G(),borderColor:[e],borderRadius:["none","","full",ts,Ye],borderSpacing:B(),borderWidth:H(),contrast:G(),grayscale:z(),hueRotate:G(),invert:z(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[S4,es],inset:I(),margin:I(),opacity:G(),padding:B(),saturate:G(),scale:G(),sepia:z(),skew:G(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[ts]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Ye]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bl,Ye]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",bl,Ye]}],"grid-cols":[{"grid-cols":[Sl]}],"col-start-end":[{col:["auto",{span:["full",bl,Ye]},Ye]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Sl]}],"row-start-end":[{row:["auto",{span:[bl,Ye]},Ye]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,i]}],"min-w":[{"min-w":[Ye,i,"min","max","fit"]}],"max-w":[{"max-w":[Ye,i,"none","full","min","max","fit","prose",{screen:[ts]},ts]}],h:[{h:[Ye,i,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,i,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,i,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,i,"auto","min","max","fit"]}],"font-size":[{text:["base",ts,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mp]}],"font-family":[{font:[Sl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",ra,Mp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lr,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lr,es]}],"underline-offset":[{"underline-offset":["auto",lr,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),E4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",C4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},T4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Y()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[lr,Ye]}],"outline-w":[{outline:[lr,es]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[lr,es]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ts,R4]}],"shadow-color":[{shadow:[Sl]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",ts,Ye]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[c]}],saturate:[{saturate:[y]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[p]}],"border-spacing-x":[{"border-spacing-x":[p]}],"border-spacing-y":[{"border-spacing-y":[p]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[bl,Ye]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lr,es,Mp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},j4=p4(M4);function xe(...e){return j4(MS(e))}function On(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function hg(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(1)} GB`}function os(e){return e?e.input+e.output+e.cacheRead+e.cacheCreation:0}function va(e){if(!e)return"";const i=Math.max(0,(Date.now()-Date.parse(e))/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function Ws(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function O4(e){return e==="Agent"||e==="Task"?"agents":e==="Skill"?"skills":e.startsWith("mcp__")?"mcp":"built-in"}function N4(e){const i=e.slice(5),r=i.indexOf("__");return r===-1?{server:i,tool:""}:{server:i.slice(0,r),tool:i.slice(r+2)}}function B4(e){const i={"built-in":[],agents:[],skills:[],mcp:[]};for(const[r,s]of Object.entries(e))i[O4(r)].push({name:r,...s});for(const r of Object.values(i))r.sort((s,l)=>l.count-s.count);return i}const ay=e=>{let i;const r=new Set,s=(d,m)=>{const c=typeof d=="function"?d(i):d;if(!Object.is(c,i)){const _=i;i=m??(typeof c!="object"||c===null)?c:Object.assign({},i,c),r.forEach(x=>x(i,_))}},l=()=>i,a={setState:s,getState:l,getInitialState:()=>h,subscribe:d=>(r.add(d),()=>r.delete(d))},h=i=e(s,l,a);return a},P4=(e=>e?ay(e):ay),I4=e=>e;function z4(e,i=I4){const r=Tl.useSyncExternalStore(e.subscribe,Tl.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return Tl.useDebugValue(r),r}const ly=e=>{const i=P4(e),r=s=>z4(i,s);return Object.assign(r,i),r},_a=(e=>e?ly(e):ly),dr=_a(e=>({item:null,set:i=>e({item:i})})),en=_a(e=>({drafts:{},put:(i,r)=>e(s=>({drafts:{...s.drafts,[i]:r}})),drop:i=>e(r=>{const{[i]:s,...l}=r.drafts;return{drafts:l}}),move:(i,r)=>e(s=>({drafts:Object.fromEntries(Object.entries(s.drafts).map(([l,f])=>[l===i?r:l.startsWith(`${i}/`)?r+l.slice(i.length):l,f]))}))})),rs=e=>!!(e&&e.text!==e.base),Wu=new Map;let Du=null;function H4(e){e!==Du&&(Du&&Wu.set(Du,en.getState().drafts),en.setState({drafts:e&&Wu.get(e)||{}}),e&&Wu.delete(e),Du=e)}window.addEventListener("beforeunload",e=>{[en.getState().drafts,...Wu.values()].some(r=>Object.values(r).some(rs))&&e.preventDefault()});const cy="clauder-hub:auto-save",uy=_a(e=>({on:(()=>{try{return localStorage.getItem(cy)==="1"}catch{return!1}})(),set:i=>{try{localStorage.setItem(cy,i?"1":"0")}catch{}e({on:i})}}));let jl=null;function IS(){if(!jl)return[];try{const e=JSON.parse(localStorage.getItem(jl)??"[]");return Array.isArray(e)?e.filter(i=>typeof(i==null?void 0:i.path)=="string").map(i=>({path:i.path,preview:!!i.preview})):[]}catch{return[]}}function F4(e){if(jl)try{localStorage.setItem(jl,JSON.stringify(e))}catch{}}const zS=(e,i)=>e===i||e.startsWith(`${i}/`),Bn=_a((e,i)=>{const r=s=>{F4(s),e({tabs:s})};return{tabs:IS(),show:s=>{const l=i().tabs;if(l.some(p=>p.path===s))return;const f=l.findIndex(p=>p.preview);if(f===-1)return r([...l,{path:s,preview:!0}]);r(l.map((p,a)=>a===f?{path:s,preview:!0}:p))},pin:s=>{const l=i().tabs;if(!l.some(f=>f.path===s&&f.preview)){l.some(f=>f.path===s)||r([...l,{path:s,preview:!1}]);return}r(l.map(f=>f.path===s?{...f,preview:!1}:f))},close:(s,l)=>{var c;const f=i().tabs,p=new Set(s),a=f.filter(_=>!p.has(_.path));if(r(a),!l||!p.has(l))return l;const h=f.findIndex(_=>_.path===l),d=f.slice(h+1).find(_=>!p.has(_.path)),m=f.slice(0,h).reverse().find(_=>!p.has(_.path));return((c=d??m)==null?void 0:c.path)??null},reorder:(s,l)=>{const f=[...i().tabs],p=f.findIndex(d=>d.path===s),a=f.findIndex(d=>d.path===l);if(p===-1||a===-1||p===a)return;const[h]=f.splice(p,1);f.splice(a,0,h),r(f)},rename:(s,l)=>r(i().tabs.map(f=>zS(f.path,s)?{...f,path:l+f.path.slice(s.length)}:f))}}),nh=new Map;function U4(e,i){nh.set(e,i)}function $4(e){const i=nh.get(e)??null;return nh.delete(e),i}function q4(e){nh.clear(),jl=e?`clauder-hub:open-files:${e}`:null,Bn.setState({tabs:IS()})}function V4(e){return Bn.getState().tabs.filter(i=>zS(i.path,e)).map(i=>i.path)}function W4(e){H4(e),q4(e),dr.getState().set(null)}function G4(e){const i=r=>[...r].sort((s,l)=>(l.lastAt??l.startedAt??"").localeCompare(s.lastAt??s.startedAt??""))[0]??null;return i(e.filter(r=>r.live&&r.status==="waiting"))??i(e.filter(r=>r.live&&r.status==="running"))??i(e.filter(r=>r.status==="done"))??i(e.filter(r=>!r.purpose))}const Y4=["overview","inbox","automation","instructions","agents","skills","commands","mcp-servers","hooks","plugins","channels","hub-prompts","claude-settings","mcp-suggestions","presets","categories"];let Yo=null,jp=null;function hy(e){try{return decodeURIComponent(e)}catch{return e}}function dy(){let e=window.location.hash.replace(/^#\/?/,"");const i=e.startsWith("w/");i&&(e=e.slice(2));const r=e.indexOf("/"),s=hy(r===-1?e:e.slice(0,r))||hr;return e=r===-1?"":e.slice(r+1),e.startsWith("session/")?{projectId:s,view:{kind:"session",id:e.slice(8)},windowed:i}:e.startsWith("file/")?{projectId:s,view:{kind:"file",path:e.slice(5).split("/").map(hy).join("/")},windowed:i}:{projectId:s,view:{kind:"page",page:Y4.find(l=>l===e)??"overview"},windowed:i}}function Al(e,i,r){if(!e)return Al(hr,i,r);const s=i.kind==="session"?`session/${i.id}`:i.kind==="file"?`file/${i.path.split("/").map(encodeURIComponent).join("/")}`:i.page;return`#/${r?"w/":""}${encodeURIComponent(e)}/${s}`}function dg(e){const i=ye.getState().projectId,r=e.kind==="session"?`clauder-${i}-${e.id}`:e.kind==="file"?`clauder-file-${i}-${e.path}`:`clauder-${i}-${e.page}`;window.open(`${location.origin}${location.pathname}${Al(i,e,!0)}`,r,"popup,width=1280,height=820")}const X4={sessions:0,transcript:0,interactions:0,runs:0,jobs:0,mcp:0,channels:0,files:0,projects:0},ye=_a((e,i)=>{const r=async s=>{if(t4(s),W4(s),e({projectId:s,health:null,sessions:[],open:[],transcriptTicks:{}}),!!s)try{const[l]=await Promise.all([ve.health(),i().refreshSessions(),i().refreshOpen()]);i().projectId===s&&e({health:l}),s!==hr&&ve.openedProject(s).catch(()=>{})}catch(l){if(i().projectId!==s)return;/no such project/i.test(l.message)?(i().notify(`The hub has no project '${s}'. Open its folder again from here.`,"error"),i().openProject(hr)):i().notify(`Could not open the project: ${l.message}`,"error")}};return{health:null,sessions:[],open:[],...dy(),ticks:{...X4},transcriptTicks:{},toast:null,boot:async()=>{window.addEventListener("hashchange",()=>{const p=dy(),a=p.projectId!==i().projectId;e({view:p.view,windowed:p.windowed}),a&&r(p.projectId)}),Yo==null||Yo.close(),Yo=new EventSource("/api/stream");const s=new Set;let l=null;const f=()=>{l=null;const p={...i().ticks},a={...i().transcriptTicks};for(const d of s)d.startsWith("transcript:")?a[d.slice(11)]=Date.now():p[d]+=1;const h=new Set(s);s.clear(),e({ticks:p,transcriptTicks:a}),i().projectId&&((h.has("sessions")||h.has("transcript")||h.has("interactions"))&&i().refreshSessions(),h.has("interactions")&&i().refreshOpen())};Yo.onmessage=p=>{const a=JSON.parse(p.data);a.project&&a.project!==i().projectId?s.add("projects"):(s.add(a.topic==="transcript"?`transcript:${a.payload.sessionId}`:a.topic),a.topic==="transcript"&&s.add("transcript")),l??(l=setTimeout(f,400))},Yo.onopen=()=>{i().projectId&&(i().refreshSessions(),i().refreshOpen())},await r(i().projectId)},go:s=>{window.location.hash=Al(i().projectId,s,i().windowed).slice(1),e({view:s})},openProject:s=>{const l=f=>{const p=Al(s,f,!1);window.location.hash===p&&s!==i().projectId&&r(s),window.location.hash=p.slice(1)};if(!s||s===hr||s===i().projectId)return l({kind:"page",page:"overview"});ve.sessionsIn(s).then(f=>{const p=G4(f);if(!p)return l({kind:"page",page:"overview"});l({kind:"session",id:p.id})},()=>l({kind:"page",page:"overview"}))},openSessionIn:(s,l)=>{if(s===i().projectId)return i().go({kind:"session",id:l});window.location.hash=Al(s,{kind:"session",id:l},!1).slice(1)},refreshSessions:async()=>{const s=i().projectId;if(!s)return;const l=await ve.sessions();i().projectId===s&&e({sessions:l})},refreshOpen:async()=>{const s=i().projectId;if(!s)return;const l=await ve.interactions("open");i().projectId===s&&e({open:l})},notify:(s,l="info")=>{jp&&clearTimeout(jp),e({toast:{text:s,tone:l}}),jp=setTimeout(()=>e({toast:null}),l==="error"?6e3:3e3)}}});function ut(e,i,r=null){const s=ye(c=>i.map(_=>c.ticks[_]).join(",")),[l,f]=P.useState(null),[p,a]=P.useState(null),[h,d]=P.useState(0);P.useEffect(()=>{let c=!1;return e().then(_=>{c||(f(_),a(null))},_=>!c&&a(_.message)),()=>{c=!0}},[s,h,JSON.stringify(r)]);const m=P.useCallback(()=>d(c=>c+1),[]);return{data:l,error:p,reload:m}}async function rt(e,i){try{const r=await e();return i&&ye.getState().notify(i),r}catch(r){ye.getState().notify(r.message,"error");return}}function Zs(){const e=ye(l=>l.go),[i,r]=P.useState(!1);return{starting:i,start:async(l,f)=>{if(i)return;r(!0);const p=Math.max(80,Math.floor((window.innerWidth-340)/7.8)),a=Math.max(24,Math.floor((window.innerHeight-220)/17)),h=await rt(()=>ve.startPurpose(l,f,{cols:p,rows:a}));r(!1),h&&(await ye.getState().refreshSessions(),e({kind:"session",id:h.sessionId}))}}}const fy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,py=MS,K4=(e,i)=>r=>{var s;if((i==null?void 0:i.variants)==null)return py(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:f}=i,p=Object.keys(l).map(d=>{const m=r==null?void 0:r[d],c=f==null?void 0:f[d];if(m===null)return null;const _=fy(m)||fy(c);return l[d][_]}),a=r&&Object.entries(r).reduce((d,m)=>{let[c,_]=m;return _===void 0||(d[c]=_),d},{}),h=i==null||(s=i.compoundVariants)===null||s===void 0?void 0:s.reduce((d,m)=>{let{class:c,className:_,...x}=m;return Object.entries(x).every(E=>{let[w,g]=E;return Array.isArray(g)?g.includes({...f,...a}[w]):{...f,...a}[w]===g})?[...d,c,_]:d},[]);return py(e,p,h,r==null?void 0:r.class,r==null?void 0:r.className)},Q4=K4("inline-flex items-center justify-center gap-1.5 font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0",{variants:{variant:{foreground:"bg-foreground text-background hover:bg-foreground/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground",ghost:"text-muted-foreground hover:bg-muted hover:text-foreground",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",success:"bg-success text-success-foreground hover:bg-success/90"},size:{sm:"text-xs px-3 py-1.5 rounded",md:"text-sm px-4 py-2 rounded-md",lg:"text-base px-5 py-2.5 rounded-md",icon:"p-1.5 rounded-md"}},defaultVariants:{variant:"muted",size:"sm"}}),_e=P.forwardRef(({className:e,variant:i,size:r,...s},l)=>v.jsx("button",{ref:l,className:xe(Q4({variant:i,size:r}),e),...s}));_e.displayName="Button";var Z4=Object.defineProperty,xa=(e,i)=>Z4(e,"name",{value:i,configurable:!0}),HS=!!(typeof window<"u"&&window.document&&window.document.createElement);function tt(e,i,{checkForDefaultPrevented:r=!0}={}){return xa(function(l){if(e==null||e(l),r===!1||!l||!l.defaultPrevented)return i==null?void 0:i(l)},"handleEvent")}xa(tt,"composeEventHandlers");function J4(e){var i;if(!HS)throw new Error("Cannot access window outside of the DOM");return((i=e==null?void 0:e.ownerDocument)==null?void 0:i.defaultView)??window}xa(J4,"getOwnerWindow");function _m(e){if(!HS)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}xa(_m,"getOwnerDocument");function FS(e,i=!1){const{activeElement:r}=_m(e);if(!(r!=null&&r.nodeName))return null;if(US(r)&&r.contentDocument)return FS(r.contentDocument.body,i);if(i){const s=r.getAttribute("aria-activedescendant");if(s){const l=_m(r).getElementById(s);if(l)return l}}return r}xa(FS,"getActiveElement");function US(e){return e.tagName==="IFRAME"}xa(US,"isFrame");var eT=Object.defineProperty,fg=(e,i)=>eT(e,"name",{value:i,configurable:!0});function xm(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}fg(xm,"setRef");function $S(...e){return i=>{let r=!1;const s=e.map(l=>{const f=xm(l,i);return!r&&typeof f=="function"&&(r=!0),f});if(r)return()=>{for(let l=0;l<s.length;l++){const f=s[l];typeof f=="function"?f():xm(e[l],null)}}}}fg($S,"composeRefs");function ht(...e){return P.useCallback($S(...e),e)}fg(ht,"useComposedRefs");var tT=Object.defineProperty,di=(e,i)=>tT(e,"name",{value:i,configurable:!0});function nT(e,i){const r=P.createContext(i);r.displayName=e+"Context";const s=di(f=>{const{children:p,...a}=f,h=P.useMemo(()=>a,Object.values(a));return v.jsx(r.Provider,{value:h,children:p})},"Provider");s.displayName=e+"Provider";function l(f,p={}){const{optional:a=!1}=p,h=P.useContext(r);if(h)return h;if(i!==void 0)return i;if(!a)throw new Error(`\`${f}\` must be used within \`${e}\``)}return di(l,"useContext"),[s,l]}di(nT,"createContext");function br(e,i=[]){let r=[];function s(f,p){const a=P.createContext(p);a.displayName=f+"Context";const h=r.length;r=[...r,p];const d=di(c=>{var b;const{scope:_,children:x,...E}=c,w=((b=_==null?void 0:_[e])==null?void 0:b[h])||a,g=P.useMemo(()=>E,Object.values(E));return v.jsx(w.Provider,{value:g,children:x})},"Provider");d.displayName=f+"Provider";function m(c,_,x={}){var b;const{optional:E=!1}=x,w=((b=_==null?void 0:_[e])==null?void 0:b[h])||a,g=P.useContext(w);if(g)return g;if(p!==void 0)return p;if(!E)throw new Error(`\`${c}\` must be used within \`${f}\``)}return di(m,"useContext"),[d,m]}di(s,"createContext");const l=di(()=>{const f=r.map(p=>P.createContext(p));return di(function(a){const h=(a==null?void 0:a[e])||f;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])},"useScope")},"createScope");return l.scopeName=e,[s,qS(l,...i)]}di(br,"createContextScope");function qS(...e){const i=e[0];if(e.length===1)return i;const r=di(()=>{const s=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return di(function(f){const p=s.reduce((a,{useScope:h,scopeName:d})=>{const c=h(f)[`__scope${d}`];return{...a,...c}},{});return P.useMemo(()=>({[`__scope${i.scopeName}`]:p}),[p])},"useComposedScopes")},"createScope");return r.scopeName=i.scopeName,r}di(qS,"composeContextScopes");var $t=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},iT=Object.defineProperty,rT=(e,i)=>iT(e,"name",{value:i,configurable:!0}),sT=fa[" useId ".trim().toString()]||(()=>{}),oT=0;function Fi(e){const[i,r]=P.useState(sT());return $t(()=>{e||r(s=>s??String(oT++))},[e]),e||(i?`radix-${i}`:"")}rT(Fi,"useId");var aT=Object.defineProperty,lT=(e,i)=>aT(e,"name",{value:i,configurable:!0}),my=fa[" useEffectEvent ".trim().toString()],gy=fa[" useInsertionEffect ".trim().toString()];function VS(e){if(typeof my=="function")return my(e);const i=P.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof gy=="function"?gy(()=>{i.current=e}):$t(()=>{i.current=e}),P.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}lT(VS,"useEffectEvent");var cT=Object.defineProperty,Yl=(e,i)=>cT(e,"name",{value:i,configurable:!0}),uT=fa[" useInsertionEffect ".trim().toString()]||$t;function Gs({prop:e,defaultProp:i,onChange:r=Yl(()=>{},"onChange"),caller:s}){const[l,f,p]=WS({defaultProp:i,onChange:r}),a=e!==void 0,h=a?e:l,d=P.useCallback(m=>{var c;if(a){const _=GS(m)?m(e):m;_!==e&&((c=p.current)==null||c.call(p,_))}else f(m)},[a,e,f,p]);return[h,d]}Yl(Gs,"useControllableState");function WS({defaultProp:e,onChange:i}){const[r,s]=P.useState(e),l=P.useRef(r),f=P.useRef(i);return uT(()=>{f.current=i},[i]),P.useEffect(()=>{var p;l.current!==r&&((p=f.current)==null||p.call(f,r),l.current=r)},[r,l]),[r,s,f]}Yl(WS,"useUncontrolledState");function GS(e){return typeof e=="function"}Yl(GS,"isFunction");var vy=Symbol("RADIX:SYNC_STATE");function hT(e,i,r,s){const{prop:l,defaultProp:f,onChange:p,caller:a}=i,h=l!==void 0,d=VS(p),m=[{...r,state:f}];s&&m.push(s);const[c,_]=P.useReducer((g,b)=>{if(b.type===vy)return{...g,state:b.state};const S=e(g,b);return h&&!Object.is(S.state,g.state)&&d(S.state),S},...m),x=c.state,E=P.useRef(x);P.useEffect(()=>{E.current!==x&&(E.current=x,h||d(x))},[x,E,h]);const w=P.useMemo(()=>l!==void 0?{...c,state:l}:c,[c,l]);return P.useEffect(()=>{h&&!Object.is(l,c.state)&&_({type:vy,state:l})},[l,c.state,h]),[w,_]}Yl(hT,"useControllableStateReducer");var Xl=fS(),dT=Object.defineProperty,Zn=(e,i)=>dT(e,"name",{value:i,configurable:!0});function gr(e){const i=P.forwardRef((r,s)=>{let{children:l,...f}=r,p=null,a=!1;const h=[];l=ew(l),P.Children.forEach(l,_=>{var x;if(ZS(_)){a=!0;const E=_;let w="child"in E.props?E.props.child:E.props.children;for(;pg(w)&&typeof ih=="function";)w=ih(w._payload);p=fT(E,w),h.push((x=p==null?void 0:p.props)==null?void 0:x.children)}else h.push(_)}),p?p=P.cloneElement(p,void 0,h):!a&&P.Children.count(l)===1&&P.isValidElement(l)&&(p=l);const d=p?QS(p):void 0,m=ht(s,d);if(!p){if(l||l===0)throw new Error(a?gT(e):mT(e));return l}const c=KS(f,p.props??{});return p.type!==P.Fragment&&(c.ref=s?m:d),P.cloneElement(p,c)});return i.displayName=`${e}.Slot`,i}Zn(gr,"createSlot");var YS=Symbol.for("radix.slottable");function XS(e){const i=Zn(r=>"child"in r?r.children(r.child):r.children,"Slottable");return i.displayName=`${e}.Slottable`,i.__radixId=YS,i}Zn(XS,"createSlottable");var fT=Zn((e,i)=>"child"in e.props?P.isValidElement(i)?P.cloneElement(i,void 0,e.props.children(i.props.children)):null:P.isValidElement(i)?i:null,"getSlottableElementFromSlottable");function KS(e,i){const r={...i};for(const s in i){const l=e[s],f=i[s];/^on[A-Z]/.test(s)?l&&f?r[s]=(...a)=>{const h=f(...a);return l(...a),h}:l&&(r[s]=l):s==="style"?r[s]={...l,...f}:s==="className"?r[s]=[l,f].filter(Boolean).join(" "):s==="aria-describedby"&&(r[s]=tw(f,l))}return{...e,...r}}Zn(KS,"mergeProps");function QS(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Zn(QS,"getElementRef");function ZS(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YS}Zn(ZS,"isSlottable");var pT=Symbol.for("react.lazy");function pg(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pT&&"_payload"in e&&JS(e._payload)}Zn(pg,"isLazyComponent");function JS(e){return typeof e=="object"&&e!==null&&"then"in e}Zn(JS,"isPromiseLike");function ew(e){let i=e;for(;pg(i)&&typeof ih=="function";)i=ih(i._payload);return i}Zn(ew,"useUnwrappedLazy");function tw(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Zn(tw,"concatAriaDescribedby");var mT=Zn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),gT=Zn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ih=fa[" use ".trim().toString()],vT=Object.defineProperty,_T=(e,i)=>vT(e,"name",{value:i,configurable:!0}),xT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wt=xT.reduce((e,i)=>{const r=gr(`Primitive.${i}`),s=P.forwardRef((l,f)=>{const{asChild:p,...a}=l,h=p?r:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(h,{...a,ref:f})});return s.displayName=`Primitive.${i}`,{...e,[i]:s}},{});function nw(e,i){e&&Xl.flushSync(()=>e.dispatchEvent(i))}_T(nw,"dispatchDiscreteCustomEvent");var yT=Object.defineProperty,bT=(e,i)=>yT(e,"name",{value:i,configurable:!0}),_y=fa[" useInsertionEffect ".trim().toString()];function Ui(e){const i=P.useRef(e);return typeof _y=="function"?_y(()=>{i.current=e}):$t(()=>{i.current=e}),P.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}bT(Ui,"useCallbackRef");var ST=Object.defineProperty,tn=(e,i)=>ST(e,"name",{value:i,configurable:!0}),ym="dismissableLayer.update",wT="dismissableLayer.pointerDownOutside",CT="dismissableLayer.focusOutside",xy,iw=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Sh=P.forwardRef(tn(function(i,r){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:a,onInteractOutside:h,onDismiss:d,...m}=i,c=P.useContext(iw),[_,x]=P.useState(null),E=(_==null?void 0:_.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=P.useState({}),g=ht(r,x),b=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=S?b.indexOf(S):-1,T=_?b.indexOf(_):-1,L=c.layersWithOutsidePointerEventsDisabled.size>0,R=T>=y,D=P.useRef(!1),A=sw(B=>{p==null||p(B),h==null||h(B),B.defaultPrevented||d==null||d()},{ownerDocument:E,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:P.useCallback(B=>{if(!(B instanceof Node))return!1;const H=[...c.branches].some(U=>U.contains(B));return R&&!H},[c.branches,R])}),j=ow(B=>{if(l&&D.current)return;const H=B.target;[...c.branches].some(W=>W.contains(H))||(a==null||a(B),h==null||h(B),B.defaultPrevented||d==null||d())},E),M=_?T===b.length-1:!1,I=Ui(B=>{B.key==="Escape"&&(f==null||f(B),!B.defaultPrevented&&d&&(B.preventDefault(),d()))});return P.useEffect(()=>{if(M)return E.addEventListener("keydown",I,{capture:!0}),()=>E.removeEventListener("keydown",I,{capture:!0})},[E,M,I]),P.useEffect(()=>{if(_)return s&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(xy=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(_)),c.layers.add(_),bm(),()=>{s&&(c.layersWithOutsidePointerEventsDisabled.delete(_),c.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=xy))}},[_,E,s,c]),P.useEffect(()=>()=>{_&&(c.layers.delete(_),c.layersWithOutsidePointerEventsDisabled.delete(_),bm())},[_,c]),P.useEffect(()=>{const B=tn(()=>w({}),"handleUpdate");return document.addEventListener(ym,B),()=>document.removeEventListener(ym,B)},[]),v.jsx(wt.div,{...m,ref:g,style:{pointerEvents:L?R?"auto":"none":void 0,...i.style},onFocusCapture:tt(i.onFocusCapture,j.onFocusCapture),onBlurCapture:tt(i.onBlurCapture,j.onBlurCapture),onPointerDownCapture:tt(i.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function rw(){const e=P.useContext(iw),[i,r]=P.useState(null);return P.useEffect(()=>{if(i)return e.dismissableSurfaces.add(i),()=>{e.dismissableSurfaces.delete(i)}},[i,e.dismissableSurfaces]),r}tn(rw,"useDismissableLayerSurface");var ET=tn(()=>!0,"IS_TRUE");function sw(e,i){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:f,shouldHandlePointerDownOutside:p=ET}=i,a=Ui(e),h=P.useRef(!1),d=P.useRef(!1),m=P.useRef(new Map),c=P.useRef(()=>{});return P.useEffect(()=>{function _(){d.current=!1,l.current=!1,m.current.clear()}tn(_,"resetOutsideInteraction");function x(){return Array.from(m.current.values()).some(Boolean)}tn(x,"isOutsideInteractionIntercepted");function E(y){if(!d.current)return;const T=y.target;T instanceof Node&&[...f].some(R=>R.contains(T))||m.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{d.current&&c.current()},0)}tn(E,"handleInteractionCapture");function w(y){d.current&&m.current.set(y.type,!1)}tn(w,"handleInteractionBubble");const g=tn(y=>{if(y.target&&!h.current){let T=function(){r.removeEventListener("click",c.current);const R=x();_(),R||mg(wT,a,L,{discrete:!0})};if(tn(T,"handleAndDispatchPointerDownOutsideEvent"),!p(y.target)){r.removeEventListener("click",c.current),_(),h.current=!1;return}const L={originalEvent:y};d.current=!0,l.current=s&&y.button===0,m.current.clear(),!s||y.button!==0?T():(r.removeEventListener("click",c.current),c.current=T,r.addEventListener("click",c.current,{once:!0}))}else r.removeEventListener("click",c.current),_();h.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of b)r.addEventListener(y,E,!0),r.addEventListener(y,w);const S=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(S),r.removeEventListener("pointerdown",g),r.removeEventListener("click",c.current);for(const y of b)r.removeEventListener(y,E,!0),r.removeEventListener(y,w)}},[r,a,s,l,f,p]),{onPointerDownCapture:tn(()=>h.current=!0,"onPointerDownCapture")}}tn(sw,"usePointerDownOutside");function ow(e,i=globalThis==null?void 0:globalThis.document){const r=Ui(e),s=P.useRef(!1);return P.useEffect(()=>{const l=tn(f=>{f.target&&!s.current&&mg(CT,r,{originalEvent:f},{discrete:!1})},"handleFocus");return i.addEventListener("focusin",l),()=>i.removeEventListener("focusin",l)},[i,r]),{onFocusCapture:tn(()=>s.current=!0,"onFocusCapture"),onBlurCapture:tn(()=>s.current=!1,"onBlurCapture")}}tn(ow,"useFocusOutside");function bm(){const e=new CustomEvent(ym);document.dispatchEvent(e)}tn(bm,"dispatchUpdate");function mg(e,i,r,{discrete:s}){const l=r.originalEvent.target,f=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});i&&l.addEventListener(e,i,{once:!0}),s?nw(l,f):l.dispatchEvent(f)}tn(mg,"handleAndDispatchCustomEvent");var kT=Object.defineProperty,Ft=(e,i)=>kT(e,"name",{value:i,configurable:!0}),Op="focusScope.autoFocusOnMount",Np="focusScope.autoFocusOnUnmount",yy={bubbles:!1,cancelable:!0},gg=P.forwardRef(Ft(function(i,r){const{loop:s=!1,trapped:l=!1,branches:f,onMountAutoFocus:p,onUnmountAutoFocus:a,...h}=i,[d,m]=P.useState(null),c=Ui(p),_=Ui(a),x=P.useRef(null),E=ht(r,m),w=P.useRef(f);P.useEffect(()=>{w.current=f});const g=P.useCallback(y=>{var T;return y?d!=null&&d.contains(y)?!0:!!((T=w.current)!=null&&T.some(L=>L.contains(y))):!1},[d]),b=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(l){let y=function(D){if(b.paused||!d)return;const A=D.target;g(A)?x.current=A:cr(x.current,{select:!0})},T=function(D){if(b.paused||!d)return;const A=D.relatedTarget;A!==null&&(g(A)||cr(x.current,{select:!0}))},L=function(D){if(document.activeElement===document.body)for(const j of D)j.removedNodes.length>0&&cr(d)};Ft(y,"handleFocusIn"),Ft(T,"handleFocusOut"),Ft(L,"handleMutations"),document.addEventListener("focusin",y),document.addEventListener("focusout",T);const R=new MutationObserver(L);return d&&R.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",T),R.disconnect()}}},[l,d,b.paused,g]),P.useEffect(()=>{if(d){by.add(b);const y=document.activeElement;if(!d.contains(y)){const L=new CustomEvent(Op,yy);d.addEventListener(Op,c),d.dispatchEvent(L),L.defaultPrevented||(lw(fw(yg(d)),{select:!0}),document.activeElement===y&&cr(d))}return()=>{d.removeEventListener(Op,c);const L=d.ownerDocument,R=CustomEvent;setTimeout(()=>{const D=new R(Np,yy);d.addEventListener(Np,_),d.dispatchEvent(D),D.defaultPrevented||cr(y??L.body,{select:!0}),d.removeEventListener(Np,_),by.remove(b)},0)}}},[d,c,_,b]);const S=P.useCallback(y=>{if(!s&&!l||b.paused)return;const T=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,L=document.activeElement;if(T&&L){const R=y.currentTarget,[D,A]=cw(R);D&&A?!y.shiftKey&&L===A?(y.preventDefault(),s&&cr(D,{select:!0})):y.shiftKey&&L===D&&(y.preventDefault(),s&&cr(A,{select:!0})):L===R&&y.preventDefault()}},[s,l,b.paused]);return v.jsx(wt.div,{tabIndex:-1,...h,ref:E,onKeyDown:S})},"FocusScope")),aw=P.createContext(null);function vg({registry:e,children:i}){return e?v.jsx(aw.Provider,{value:e,children:i}):i}Ft(vg,"FocusScopeBranchProvider");function _g(){const[e,i]=P.useState([]),r=P.useMemo(()=>({add:Ft(s=>i(l=>l.includes(s)?l:[...l,s]),"add"),remove:Ft(s=>i(l=>l.filter(f=>f!==s)),"remove")}),[]);return{nodes:e,registry:r}}Ft(_g,"useFocusScopeBranchRegistry");function xg(e){const i=P.useContext(aw);P.useEffect(()=>{if(!(!e||!i))return i.add(e),()=>i.remove(e)},[e,i])}Ft(xg,"useFocusScopeBranch");function lw(e,{select:i=!1}={}){const r=document.activeElement;for(const s of e)if(cr(s,{select:i}),document.activeElement!==r)return}Ft(lw,"focusFirst");function cw(e){const i=yg(e),r=Sm(i,e),s=Sm(i.reverse(),e);return[r,s]}Ft(cw,"getTabbableEdges");function yg(e){const i=[],s=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ft(l=>{const f=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||f?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)i.push(s.currentNode);return i}Ft(yg,"getTabbableCandidates");function Sm(e,i){const r=typeof i.checkVisibility=="function"&&i.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(r?!s.checkVisibility({checkVisibilityCSS:!0}):uw(s,{upTo:i})))return s}Ft(Sm,"findVisible");function uw(e,{upTo:i}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(i!==void 0&&e===i)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ft(uw,"isHidden");function hw(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ft(hw,"isSelectableInput");function cr(e,{select:i=!1}={}){if(e&&e.focus){const s=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==s&&hw(e)&&i&&e.select()}}Ft(cr,"focus");var by=dw();function dw(){let e=[];return{add(i){const r=e[0];i!==r&&(r==null||r.pause()),e=wm(e,i),e.unshift(i)},remove(i){var r;e=wm(e,i),(r=e[0])==null||r.resume()}}}Ft(dw,"createFocusScopesStack");function wm(e,i){const r=[...e],s=r.indexOf(i);return s!==-1&&r.splice(s,1),r}Ft(wm,"arrayRemove");function fw(e){return e.filter(i=>i.tagName!=="A")}Ft(fw,"removeLinks");var TT=Object.defineProperty,RT=(e,i)=>TT(e,"name",{value:i,configurable:!0}),wh=P.forwardRef(RT(function(i,r){var h;const{container:s,...l}=i,[f,p]=P.useState(!1);$t(()=>p(!0),[]);const a=s||f&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return a?Xl.createPortal(v.jsx(wt.div,{...l,ref:r}),a):null},"Portal")),AT=Object.defineProperty,vr=(e,i)=>AT(e,"name",{value:i,configurable:!0});function pw(e,i){return P.useReducer((r,s)=>i[r][s]??r,e)}vr(pw,"useStateMachine");var Sr=vr(e=>{const{present:i,children:r}=e,s=mw(i),l=typeof r=="function"?r({present:s.isPresent}):P.Children.only(r),f=gw(s.ref,vw(l));return typeof r=="function"||s.isPresent?P.cloneElement(l,{ref:f}):null},"Presence");function mw(e){const[i,r]=P.useState(),s=P.useRef(null),l=P.useRef(e),f=P.useRef("none"),p=P.useRef(void 0),a=e?"mounted":"unmounted",[h,d]=pw(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{h==="mounted"?(f.current=p.current??ea(s.current),p.current=void 0):f.current="none"},[h]),$t(()=>{const m=s.current,c=l.current;if(c!==e){const x=f.current,E=ea(m);e?(p.current=E,d("MOUNT")):E==="none"||(m==null?void 0:m.display)==="none"?d("UNMOUNT"):d(c&&x!==E?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,d]),$t(()=>{if(i){let m;const c=i.ownerDocument.defaultView??window,_=vr(E=>{const g=ea(s.current).includes(CSS.escape(E.animationName));if(E.target===i&&g&&(d("ANIMATION_END"),!l.current)){const b=i.style.animationFillMode;i.style.animationFillMode="forwards",m=c.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=b)})}},"handleAnimationEnd"),x=vr(E=>{E.target===i&&(f.current=ea(s.current))},"handleAnimationStart");return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",_),i.addEventListener("animationend",_),()=>{c.clearTimeout(m),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",_),i.removeEventListener("animationend",_)}}else d("ANIMATION_END")},[i,d]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:P.useCallback(m=>{if(m){const c=getComputedStyle(m);s.current=c,p.current=ea(c)}else s.current=null;r(m)},[])}}vr(mw,"usePresence");function Cm(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}vr(Cm,"setRef");function gw(...e){const i=P.useRef(e);return i.current=e,P.useCallback(r=>{const s=i.current;let l=!1;const f=s.map(p=>{const a=Cm(p,r);return!l&&typeof a=="function"&&(l=!0),a});if(l)return()=>{for(let p=0;p<f.length;p++){const a=f[p];typeof a=="function"?a():Cm(s[p],null)}}},[])}vr(gw,"useStableComposedRefs");function ea(e){return(e==null?void 0:e.animationName)||"none"}vr(ea,"getAnimationName");function vw(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}vr(vw,"getElementRef");var LT=Object.defineProperty,bg=(e,i)=>LT(e,"name",{value:i,configurable:!0}),Mu=0,Bi=null;function DT(e){return Kl(),e.children}bg(DT,"FocusGuards");function Kl(){P.useEffect(()=>{Bi||(Bi={start:Em(),end:Em()});const{start:e,end:i}=Bi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==i&&document.body.insertAdjacentElement("beforeend",i),Mu++,()=>{Mu===1&&(Bi==null||Bi.start.remove(),Bi==null||Bi.end.remove(),Bi=null),Mu=Math.max(0,Mu-1)}},[])}bg(Kl,"useFocusGuards");function Em(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}bg(Em,"createFocusGuard");var Ii=function(){return Ii=Object.assign||function(i){for(var r,s=1,l=arguments.length;s<l;s++){r=arguments[s];for(var f in r)Object.prototype.hasOwnProperty.call(r,f)&&(i[f]=r[f])}return i},Ii.apply(this,arguments)};function _w(e,i){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(e);l<s.length;l++)i.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(r[s[l]]=e[s[l]]);return r}function MT(e,i,r){if(r||arguments.length===2)for(var s=0,l=i.length,f;s<l;s++)(f||!(s in i))&&(f||(f=Array.prototype.slice.call(i,0,s)),f[s]=i[s]);return e.concat(f||Array.prototype.slice.call(i))}var Gu="right-scroll-bar-position",Yu="width-before-scroll-bar",jT="with-scroll-bars-hidden",OT="--removed-body-scroll-bar-size";function Bp(e,i){return typeof e=="function"?e(i):e&&(e.current=i),e}function NT(e,i){var r=P.useState(function(){return{value:e,callback:i,facade:{get current(){return r.value},set current(s){var l=r.value;l!==s&&(r.value=s,r.callback(s,l))}}}})[0];return r.callback=i,r.facade}var BT=typeof window<"u"?P.useLayoutEffect:P.useEffect,Sy=new WeakMap;function PT(e,i){var r=NT(null,function(s){return e.forEach(function(l){return Bp(l,s)})});return BT(function(){var s=Sy.get(r);if(s){var l=new Set(s),f=new Set(e),p=r.current;l.forEach(function(a){f.has(a)||Bp(a,null)}),f.forEach(function(a){l.has(a)||Bp(a,p)})}Sy.set(r,e)},[e]),r}function IT(e){return e}function zT(e,i){i===void 0&&(i=IT);var r=[],s=!1,l={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(f){var p=i(f,s);return r.push(p),function(){r=r.filter(function(a){return a!==p})}},assignSyncMedium:function(f){for(s=!0;r.length;){var p=r;r=[],p.forEach(f)}r={push:function(a){return f(a)},filter:function(){return r}}},assignMedium:function(f){s=!0;var p=[];if(r.length){var a=r;r=[],a.forEach(f),p=r}var h=function(){var m=p;p=[],m.forEach(f)},d=function(){return Promise.resolve().then(h)};d(),r={push:function(m){p.push(m),d()},filter:function(m){return p=p.filter(m),r}}}};return l}function HT(e){e===void 0&&(e={});var i=zT(null);return i.options=Ii({async:!0,ssr:!1},e),i}var xw=function(e){var i=e.sideCar,r=_w(e,["sideCar"]);if(!i)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=i.read();if(!s)throw new Error("Sidecar medium not found");return P.createElement(s,Ii({},r))};xw.isSideCarExport=!0;function FT(e,i){return e.useMedium(i),xw}var yw=HT(),Pp=function(){},Ch=P.forwardRef(function(e,i){var r=P.useRef(null),s=P.useState({onScrollCapture:Pp,onWheelCapture:Pp,onTouchMoveCapture:Pp}),l=s[0],f=s[1],p=e.forwardProps,a=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,c=e.shards,_=e.sideCar,x=e.noRelative,E=e.noIsolation,w=e.inert,g=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,y=e.gapMode,T=_w(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=_,R=PT([r,i]),D=Ii(Ii({},T),l);return P.createElement(P.Fragment,null,m&&P.createElement(L,{sideCar:yw,removeScrollBar:d,shards:c,noRelative:x,noIsolation:E,inert:w,setCallbacks:f,allowPinchZoom:!!g,lockRef:r,gapMode:y}),p?P.cloneElement(P.Children.only(a),Ii(Ii({},D),{ref:R})):P.createElement(S,Ii({},D,{className:h,ref:R}),a))});Ch.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ch.classNames={fullWidth:Yu,zeroRight:Gu};var UT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $T(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var i=UT();return i&&e.setAttribute("nonce",i),e}function qT(e,i){e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i))}function VT(e){var i=document.head||document.getElementsByTagName("head")[0];i.appendChild(e)}var WT=function(){var e=0,i=null;return{add:function(r){e==0&&(i=$T())&&(qT(i,r),VT(i)),e++},remove:function(){e--,!e&&i&&(i.parentNode&&i.parentNode.removeChild(i),i=null)}}},GT=function(){var e=WT();return function(i,r){P.useEffect(function(){return e.add(i),function(){e.remove()}},[i&&r])}},bw=function(){var e=GT(),i=function(r){var s=r.styles,l=r.dynamic;return e(s,l),null};return i},YT={left:0,top:0,right:0,gap:0},Ip=function(e){return parseInt(e||"",10)||0},XT=function(e){var i=window.getComputedStyle(document.body),r=i[e==="padding"?"paddingLeft":"marginLeft"],s=i[e==="padding"?"paddingTop":"marginTop"],l=i[e==="padding"?"paddingRight":"marginRight"];return[Ip(r),Ip(s),Ip(l)]},KT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return YT;var i=XT(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,s-r+i[2]-i[0])}},QT=bw(),sa="data-scroll-locked",ZT=function(e,i,r,s){var l=e.left,f=e.top,p=e.right,a=e.gap;return r===void 0&&(r="margin"),`
466
466
  .`.concat(jT,` {
467
467
  overflow: hidden `).concat(s,`;
468
468
  padding-right: `).concat(a,"px ").concat(s,`;
@@ -499,16 +499,16 @@ Error generating stack: `+u.message+`
499
499
  body[`).concat(sa,`] {
500
500
  `).concat(OT,": ").concat(a,`px;
501
501
  }
502
- `)},wy=function(){var e=parseInt(document.body.getAttribute(sa)||"0",10);return isFinite(e)?e:0},JT=function(){P.useEffect(function(){return document.body.setAttribute(sa,(wy()+1).toString()),function(){var e=wy()-1;e<=0?document.body.removeAttribute(sa):document.body.setAttribute(sa,e.toString())}},[])},eR=function(e){var i=e.noRelative,r=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;JT();var f=P.useMemo(function(){return KT(l)},[l]);return P.createElement(QT,{styles:ZT(f,!i,l,r?"":"!important")})},km=!1;if(typeof window<"u")try{var ju=Object.defineProperty({},"passive",{get:function(){return km=!0,!0}});window.addEventListener("test",ju,ju),window.removeEventListener("test",ju,ju)}catch{km=!1}var Yo=km?{passive:!1}:!1,tR=function(e){return e.tagName==="TEXTAREA"},Sw=function(e,i){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[i]!=="hidden"&&!(r.overflowY===r.overflowX&&!tR(e)&&r[i]==="visible")},nR=function(e){return Sw(e,"overflowY")},iR=function(e){return Sw(e,"overflowX")},Cy=function(e,i){var r=i.ownerDocument,s=i;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=ww(e,s);if(l){var f=Cw(e,s),p=f[1],a=f[2];if(p>a)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},rR=function(e){var i=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[i,r,s]},sR=function(e){var i=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[i,r,s]},ww=function(e,i){return e==="v"?nR(i):iR(i)},Cw=function(e,i){return e==="v"?rR(i):sR(i)},oR=function(e,i){return e==="h"&&i==="rtl"?-1:1},aR=function(e,i,r,s,l){var f=oR(e,window.getComputedStyle(i).direction),p=f*s,a=r.target,h=i.contains(a),d=!1,m=p>0,c=0,_=0;do{if(!a)break;var x=Cw(e,a),E=x[0],w=x[1],g=x[2],b=w-g-f*E;(E||b)&&ww(e,a)&&(c+=b,_+=E);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!h&&a!==document.body||h&&(i.contains(a)||i===a));return(m&&Math.abs(c)<1||!m&&Math.abs(_)<1)&&(d=!0),d},Ou=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ey=function(e){return[e.deltaX,e.deltaY]},ky=function(e){return e&&"current"in e?e.current:e},lR=function(e,i){return e[0]===i[0]&&e[1]===i[1]},cR=function(e){return`
502
+ `)},wy=function(){var e=parseInt(document.body.getAttribute(sa)||"0",10);return isFinite(e)?e:0},JT=function(){P.useEffect(function(){return document.body.setAttribute(sa,(wy()+1).toString()),function(){var e=wy()-1;e<=0?document.body.removeAttribute(sa):document.body.setAttribute(sa,e.toString())}},[])},eR=function(e){var i=e.noRelative,r=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;JT();var f=P.useMemo(function(){return KT(l)},[l]);return P.createElement(QT,{styles:ZT(f,!i,l,r?"":"!important")})},km=!1;if(typeof window<"u")try{var ju=Object.defineProperty({},"passive",{get:function(){return km=!0,!0}});window.addEventListener("test",ju,ju),window.removeEventListener("test",ju,ju)}catch{km=!1}var Xo=km?{passive:!1}:!1,tR=function(e){return e.tagName==="TEXTAREA"},Sw=function(e,i){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[i]!=="hidden"&&!(r.overflowY===r.overflowX&&!tR(e)&&r[i]==="visible")},nR=function(e){return Sw(e,"overflowY")},iR=function(e){return Sw(e,"overflowX")},Cy=function(e,i){var r=i.ownerDocument,s=i;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=ww(e,s);if(l){var f=Cw(e,s),p=f[1],a=f[2];if(p>a)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},rR=function(e){var i=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[i,r,s]},sR=function(e){var i=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[i,r,s]},ww=function(e,i){return e==="v"?nR(i):iR(i)},Cw=function(e,i){return e==="v"?rR(i):sR(i)},oR=function(e,i){return e==="h"&&i==="rtl"?-1:1},aR=function(e,i,r,s,l){var f=oR(e,window.getComputedStyle(i).direction),p=f*s,a=r.target,h=i.contains(a),d=!1,m=p>0,c=0,_=0;do{if(!a)break;var x=Cw(e,a),E=x[0],w=x[1],g=x[2],b=w-g-f*E;(E||b)&&ww(e,a)&&(c+=b,_+=E);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!h&&a!==document.body||h&&(i.contains(a)||i===a));return(m&&Math.abs(c)<1||!m&&Math.abs(_)<1)&&(d=!0),d},Ou=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ey=function(e){return[e.deltaX,e.deltaY]},ky=function(e){return e&&"current"in e?e.current:e},lR=function(e,i){return e[0]===i[0]&&e[1]===i[1]},cR=function(e){return`
503
503
  .block-interactivity-`.concat(e,` {pointer-events: none;}
504
504
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
505
- `)},uR=0,Xo=[];function hR(e){var i=P.useRef([]),r=P.useRef([0,0]),s=P.useRef(),l=P.useState(uR++)[0],f=P.useState(bw)[0],p=P.useRef(e);P.useEffect(function(){p.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=MT([e.lockRef.current],(e.shards||[]).map(ky),!0).filter(Boolean);return w.forEach(function(g){return g.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(w,g){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!p.current.allowPinchZoom;var b=Ou(w),S=r.current,y="deltaX"in w?w.deltaX:S[0]-b[0],T="deltaY"in w?w.deltaY:S[1]-b[1],L,R=w.target,D=Math.abs(y)>Math.abs(T)?"h":"v";if("touches"in w&&D==="h"&&R.type==="range")return!1;var A=window.getSelection(),j=A&&A.anchorNode,M=j?j===R||j.contains(R):!1;if(M)return!1;var I=Cy(D,R);if(!I)return!0;if(I?L=D:(L=D==="v"?"h":"v",I=Cy(D,R)),!I)return!1;if(!s.current&&"changedTouches"in w&&(y||T)&&(s.current=L),!L)return!0;var B=s.current||L;return aR(B,g,w,B==="h"?y:T)},[]),h=P.useCallback(function(w){var g=w;if(!(!Xo.length||Xo[Xo.length-1]!==f)){var b="deltaY"in g?Ey(g):Ou(g),S=i.current.filter(function(L){return L.name===g.type&&(L.target===g.target||g.target===L.shadowParent)&&lR(L.delta,b)})[0];if(S&&S.should){g.cancelable&&g.preventDefault();return}if(!S){var y=(p.current.shards||[]).map(ky).filter(Boolean).filter(function(L){return L.contains(g.target)}),T=y.length>0?a(g,y[0]):!p.current.noIsolation;T&&g.cancelable&&g.preventDefault()}}},[]),d=P.useCallback(function(w,g,b,S){var y={name:w,delta:g,target:b,should:S,shadowParent:dR(b)};i.current.push(y),setTimeout(function(){i.current=i.current.filter(function(T){return T!==y})},1)},[]),m=P.useCallback(function(w){r.current=Ou(w),s.current=void 0},[]),c=P.useCallback(function(w){d(w.type,Ey(w),w.target,a(w,e.lockRef.current))},[]),_=P.useCallback(function(w){d(w.type,Ou(w),w.target,a(w,e.lockRef.current))},[]);P.useEffect(function(){return Xo.push(f),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:_}),document.addEventListener("wheel",h,Yo),document.addEventListener("touchmove",h,Yo),document.addEventListener("touchstart",m,Yo),function(){Xo=Xo.filter(function(w){return w!==f}),document.removeEventListener("wheel",h,Yo),document.removeEventListener("touchmove",h,Yo),document.removeEventListener("touchstart",m,Yo)}},[]);var x=e.removeScrollBar,E=e.inert;return P.createElement(P.Fragment,null,E?P.createElement(f,{styles:cR(l)}):null,x?P.createElement(eR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dR(e){for(var i=null;e!==null;)e instanceof ShadowRoot&&(i=e.host,e=e.host),e=e.parentNode;return i}const fR=FT(yw,hR);var Eh=P.forwardRef(function(e,i){return P.createElement(Ch,Ii({},e,{ref:i,sideCar:fR}))});Eh.classNames=Ch.classNames;var pR=function(e){if(typeof document>"u")return null;var i=Array.isArray(e)?e[0]:e;return i.ownerDocument.body},Ko=new WeakMap,Nu=new WeakMap,Bu={},zp=0,Ew=function(e){return e&&(e.host||Ew(e.parentNode))},mR=function(e,i){return i.map(function(r){if(e.contains(r))return r;var s=Ew(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},gR=function(e,i,r,s){var l=mR(i,Array.isArray(e)?e:[e]);Bu[r]||(Bu[r]=new WeakMap);var f=Bu[r],p=[],a=new Set,h=new Set(l),d=function(c){!c||a.has(c)||(a.add(c),d(c.parentNode))};l.forEach(d);var m=function(c){!c||h.has(c)||Array.prototype.forEach.call(c.children,function(_){if(a.has(_))m(_);else try{var x=_.getAttribute(s),E=x!==null&&x!=="false",w=(Ko.get(_)||0)+1,g=(f.get(_)||0)+1;Ko.set(_,w),f.set(_,g),p.push(_),w===1&&E&&Nu.set(_,!0),g===1&&_.setAttribute(r,"true"),E||_.setAttribute(s,"true")}catch(b){console.error("aria-hidden: cannot operate on ",_,b)}})};return m(i),a.clear(),zp++,function(){p.forEach(function(c){var _=Ko.get(c)-1,x=f.get(c)-1;Ko.set(c,_),f.set(c,x),_||(Nu.has(c)||c.removeAttribute(s),Nu.delete(c)),x||c.removeAttribute(r)}),zp--,zp||(Ko=new WeakMap,Ko=new WeakMap,Nu=new WeakMap,Bu={})}},Sg=function(e,i,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=pR(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),gR(s,l,r,"aria-hidden")):function(){return null}},vR=Object.defineProperty,Pn=(e,i)=>vR(e,"name",{value:i,configurable:!0}),wg="Dialog",[kw,iB]=br(wg),[_R,Ci]=kw(wg),Tw=Pn(e=>{const{__scopeDialog:i,children:r,open:s,defaultOpen:l,onOpenChange:f,modal:p=!0}=e,a=P.useRef(null),h=P.useRef(null),{nodes:d,registry:m}=_g(),[c,_]=Ws({prop:s,defaultProp:l??!1,onChange:f,caller:wg}),[x,E]=P.useState(0),[w,g]=P.useState(0);return v.jsx(_R,{scope:i,triggerRef:a,contentRef:h,contentId:Fi(),titleId:Fi(),descriptionId:Fi(),titlePresent:x>0,descriptionPresent:w>0,setTitleCount:E,setDescriptionCount:g,open:c,onOpenChange:_,onOpenToggle:P.useCallback(()=>_(b=>!b),[_]),modal:p,branchNodes:d,branchRegistry:m,children:r})},"Dialog"),xR="DialogTrigger",yR=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci(xR,s),p=ht(r,f.triggerRef);return v.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":kh(f.open),...l,ref:p,onClick:tt(i.onClick,f.onOpenToggle)})},"DialogTrigger")),Rw="DialogPortal",[bR,Aw]=kw(Rw,{forceMount:void 0}),Lw=Pn(e=>{const{__scopeDialog:i,forceMount:r,children:s,container:l}=e,f=Ci(Rw,i);return v.jsx(bR,{scope:i,forceMount:r,children:P.Children.map(s,p=>v.jsx(Sr,{present:r||f.open,children:v.jsx(wh,{asChild:!0,container:l,children:p})}))})},"DialogPortal"),Tm="DialogOverlay",Dw=P.forwardRef(Pn(function(i,r){const s=Aw(Tm,i.__scopeDialog),{forceMount:l=s.forceMount,...f}=i,p=Ci(Tm,i.__scopeDialog);return p.modal?v.jsx(Sr,{present:l||p.open,children:v.jsx(wR,{...f,ref:r})}):null},"DialogOverlay")),SR=gr("DialogOverlay.RemoveScroll"),wR=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci(Tm,s),p=rw(),a=ht(r,p);return v.jsx(Eh,{as:SR,allowPinchZoom:!0,shards:P.useMemo(()=>[f.contentRef,...f.branchNodes.map(h=>({current:h}))],[f.contentRef,f.branchNodes]),children:v.jsx(wt.div,{"data-state":kh(f.open),...l,ref:a,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),Ol="DialogContent",Mw=P.forwardRef(Pn(function(i,r){const s=Aw(Ol,i.__scopeDialog),{forceMount:l=s.forceMount,...f}=i,p=Ci(Ol,i.__scopeDialog);return v.jsx(Sr,{present:l||p.open,children:p.modal?v.jsx(CR,{...f,ref:r}):v.jsx(ER,{...f,ref:r})})},"DialogContent")),CR=P.forwardRef(Pn(function(i,r){const s=Ci(Ol,i.__scopeDialog),l=P.useRef(null),f=ht(r,s.contentRef,l);return P.useEffect(()=>{const p=l.current;if(p)return Sg(p)},[]),v.jsx(jw,{...i,ref:f,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:tt(i.onCloseAutoFocus,p=>{var a;p.preventDefault(),(a=s.triggerRef.current)==null||a.focus()}),onPointerDownOutside:tt(i.onPointerDownOutside,p=>{const a=p.detail.originalEvent,h=a.button===0&&a.ctrlKey===!0;(a.button===2||h)&&p.preventDefault()}),onFocusOutside:tt(i.onFocusOutside,p=>p.preventDefault())})},"DialogContentModal")),ER=P.forwardRef(Pn(function(i,r){const s=Ci(Ol,i.__scopeDialog),l=P.useRef(!1),f=P.useRef(!1);return v.jsx(jw,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var a,h;(a=i.onCloseAutoFocus)==null||a.call(i,p),p.defaultPrevented||(l.current||(h=s.triggerRef.current)==null||h.focus(),p.preventDefault()),l.current=!1,f.current=!1},onInteractOutside:p=>{var d,m;(d=i.onInteractOutside)==null||d.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const a=p.target;((m=s.triggerRef.current)==null?void 0:m.contains(a))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&f.current&&p.preventDefault()}})},"DialogContentNonModal")),jw=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,trapFocus:l,onOpenAutoFocus:f,onCloseAutoFocus:p,"aria-describedby":a,children:h,...d}=i,m=Ci(Ol,s);return Kl(),v.jsx(vg,{registry:m.branchRegistry,children:v.jsx(gg,{asChild:!0,loop:!0,trapped:l,branches:m.branchNodes,onMountAutoFocus:f,onUnmountAutoFocus:p,children:v.jsx(Sh,{role:"dialog",id:m.contentId,"aria-labelledby":m.titlePresent?m.titleId:void 0,"aria-describedby":m.descriptionPresent?Pw(a,m.descriptionId):a,"data-state":kh(m.open),...d,ref:r,deferPointerDownOutside:!0,onDismiss:()=>m.onOpenChange(!1),children:h})})})},"DialogContentImpl")),Ow=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci("DialogTitle",s),{setTitleCount:p}=f;return $t(()=>(p(a=>a+1),()=>p(a=>a-1)),[p]),v.jsx(wt.h2,{id:f.titleId,...l,ref:r})},"DialogTitle")),Nw=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci("DialogDescription",s),{setDescriptionCount:p}=f;return $t(()=>(p(a=>a+1),()=>p(a=>a-1)),[p]),v.jsx(wt.p,{id:f.descriptionId,...l,ref:r})},"DialogDescription")),kR="DialogClose",Bw=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci(kR,s);return v.jsx(wt.button,{type:"button",...l,ref:r,onClick:tt(i.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function Pw(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Pn(Pw,"concatAriaDescribedby");function kh(e){return e?"open":"closed"}Pn(kh,"getState");function Iw({open:e,onOpenChange:i,title:r,description:s,children:l,footer:f,headerAction:p,maxWidth:a="max-w-md",height:h,disableOutsideClose:d}){return v.jsx(Tw,{open:e,onOpenChange:i,children:v.jsxs(Lw,{children:[v.jsx(Dw,{className:"fixed inset-0 z-50 bg-foreground/40 animate-in fade-in-0"}),v.jsxs(Mw,{className:`fixed left-1/2 top-1/2 z-50 flex w-[calc(100%-1.5rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl bg-card shadow-xl focus:outline-none animate-in fade-in-0 zoom-in-95 sm:w-[calc(100%-2rem)] ${a} max-h-[calc(100dvh-1.5rem)] sm:max-h-[calc(100dvh-2rem)] ${h??""}`,onInteractOutside:d?m=>m.preventDefault():void 0,children:[v.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-3 px-4 py-4 sm:px-5",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx(Ow,{className:"text-sm font-semibold text-foreground",children:r}),s&&v.jsx(Nw,{className:"mt-0.5 truncate text-xs text-muted-foreground",title:s,children:s})]}),v.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[p,v.jsx(Bw,{asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Close",children:v.jsx(En,{size:15})})})]})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-4 pt-1 sm:px-5",children:l}),f&&v.jsx("div",{className:"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border px-4 pb-4 pt-3 sm:px-5",children:f})]})]})})}const zw=P.createContext(null);function Ty({children:e}){const[i,r]=P.useState(null),[s,l]=P.useState(!1),f=P.useRef(null),p=P.useCallback(d=>{var m;return(m=f.current)==null||m.call(f,!1),r(d),new Promise(c=>{f.current=c})},[]),a=d=>{var m;(m=f.current)==null||m.call(f,d),f.current=null,r(null),l(!1)},h=async()=>{if(!(i!=null&&i.run))return a(!0);l(!0);try{await i.run(),a(!0)}catch(d){ye.getState().notify(d.message,"error"),l(!1)}};return v.jsxs(zw.Provider,{value:p,children:[e,i&&v.jsx(Iw,{open:!0,onOpenChange:d=>!d&&!s&&a(!1),title:i.title,description:i.description,maxWidth:i.maxWidth??"max-w-md",disableOutsideClose:s,footer:v.jsxs(v.Fragment,{children:[v.jsx(_e,{disabled:s,onClick:()=>a(!1),children:"Cancel"}),v.jsx(_e,{variant:i.tone??"primary",disabled:s,onClick:()=>void h(),autoFocus:!0,children:s?"Working...":i.confirmLabel??"Confirm"})]}),children:i.body})]})}function pn(){const e=P.useContext(zw);if(!e)throw new Error("useConfirm needs a ConfirmProvider above it.");return e}function Nl({text:e,className:i}){const[r,s]=P.useState(!1),l=async f=>{f.stopPropagation();try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return v.jsx("button",{onClick:l,title:`Copy: ${e}`,className:xe("shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",i),children:r?v.jsx($l,{size:11,className:"text-severity-suggestion"}):v.jsx(xh,{size:11})})}function nn({icon:e,title:i,hint:r,variant:s="card",className:l}){return s==="inline"?v.jsx("div",{className:xe("px-2 py-3 text-xs text-muted-foreground",l),children:i}):v.jsxs("div",{className:xe("card flex flex-col items-center gap-1.5 p-8 text-center",l),children:[e&&v.jsx(e,{size:20,className:"text-muted-foreground/60"}),v.jsx("div",{className:"text-sm text-muted-foreground",children:i}),r&&v.jsx("div",{className:"max-w-sm text-xs text-muted-foreground/70",children:r})]})}const TR=["top","right","bottom","left"],cs=Math.min,fr=Math.max,rh=Math.round,Pu=Math.floor,pr=e=>({x:e,y:e}),RR={left:"right",right:"left",bottom:"top",top:"bottom"};function Hw(e,i,r){return fr(e,cs(i,r))}function _r(e,i){return typeof e=="function"?e(i):e}function us(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Cg(e){return e==="x"?"y":"x"}function Eg(e){return e==="y"?"height":"width"}function zi(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function kg(e){return Cg(zi(e))}function AR(e,i,r){r===void 0&&(r=!1);const s=ya(e),l=kg(e),f=Eg(l);let p=l==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return i.reference[f]>i.floating[f]&&(p=sh(p)),[p,sh(p)]}function LR(e){const i=sh(e);return[Rm(e),i,Rm(i)]}function Rm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ry=["left","right"],Ay=["right","left"],DR=["top","bottom"],MR=["bottom","top"];function jR(e,i,r){switch(e){case"top":case"bottom":return r?i?Ay:Ry:i?Ry:Ay;case"left":case"right":return i?DR:MR;default:return[]}}function OR(e,i,r,s){const l=ya(e);let f=jR(us(e),r==="start",s);return l&&(f=f.map(p=>p+"-"+l),i&&(f=f.concat(f.map(Rm)))),f}function sh(e){const i=us(e);return RR[i]+e.slice(i.length)}function NR(e){var i,r,s,l;return{top:(i=e.top)!=null?i:0,right:(r=e.right)!=null?r:0,bottom:(s=e.bottom)!=null?s:0,left:(l=e.left)!=null?l:0}}function Fw(e){return typeof e!="number"?NR(e):{top:e,right:e,bottom:e,left:e}}function oh(e){const{x:i,y:r,width:s,height:l}=e;return{width:s,height:l,top:r,left:i,right:i+s,bottom:r+l,x:i,y:r}}function Ly(e,i,r){let{reference:s,floating:l}=e;const f=zi(i),p=kg(i),a=Eg(p),h=us(i),d=f==="y",m=s.x+s.width/2-l.width/2,c=s.y+s.height/2-l.height/2,_=s[a]/2-l[a]/2;let x;switch(h){case"top":x={x:m,y:s.y-l.height};break;case"bottom":x={x:m,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:c};break;case"left":x={x:s.x-l.width,y:c};break;default:x={x:s.x,y:s.y}}const E=ya(i);return E&&(x[p]+=_*(E==="end"?1:-1)*(r&&d?-1:1)),x}async function BR(e,i){var r;i===void 0&&(i={});const{x:s,y:l,platform:f,rects:p,elements:a,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:c="floating",altBoundary:_=!1,padding:x=0}=_r(i,e),E=Fw(x),g=a[_?c==="floating"?"reference":"floating":c],b=oh(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(g)))==null||r?g:g.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:h})),S=c==="floating"?{x:s,y:l,width:p.floating.width,height:p.floating.height}:p.reference,y=await(f.getOffsetParent==null?void 0:f.getOffsetParent(a.floating)),T=await(f.isElement==null?void 0:f.isElement(y))&&await(f.getScale==null?void 0:f.getScale(y))||{x:1,y:1},L=oh(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:y,strategy:h}):S);return{top:(b.top-L.top+E.top)/T.y,bottom:(L.bottom-b.bottom+E.bottom)/T.y,left:(b.left-L.left+E.left)/T.x,right:(L.right-b.right+E.right)/T.x}}const PR=50,IR=async(e,i,r)=>{const{placement:s="bottom",strategy:l="absolute",middleware:f=[],platform:p}=r,a=p.detectOverflow?p:{...p,detectOverflow:BR},h=await(p.isRTL==null?void 0:p.isRTL(i));let d=await p.getElementRects({reference:e,floating:i,strategy:l}),{x:m,y:c}=Ly(d,s,h),_=s,x=0;const E={};for(let w=0;w<f.length;w++){const g=f[w];if(!g)continue;const{name:b,fn:S}=g,{x:y,y:T,data:L,reset:R}=await S({x:m,y:c,initialPlacement:s,placement:_,strategy:l,middlewareData:E,rects:d,platform:a,elements:{reference:e,floating:i}});m=y??m,c=T??c,E[b]={...E[b],...L},R&&x<PR&&(x++,typeof R=="object"&&(R.placement&&(_=R.placement),R.rects&&(d=R.rects===!0?await p.getElementRects({reference:e,floating:i,strategy:l}):R.rects),{x:m,y:c}=Ly(d,_,h)),w=-1)}return{x:m,y:c,placement:_,strategy:l,middlewareData:E}},zR=e=>({name:"arrow",options:e,async fn(i){const{x:r,y:s,placement:l,rects:f,platform:p,elements:a,middlewareData:h}=i,{element:d,padding:m=0}=_r(e,i)||{};if(d==null)return{};const c=Fw(m),_={x:r,y:s},x=kg(l),E=Eg(x),w=await p.getDimensions(d),g=x==="y",b=g?"top":"left",S=g?"bottom":"right",y=g?"clientHeight":"clientWidth",T=f.reference[E]+f.reference[x]-_[x]-f.floating[E],L=_[x]-f.reference[x],R=await(p.getOffsetParent==null?void 0:p.getOffsetParent(d));let D=R?R[y]:0;(!D||!await(p.isElement==null?void 0:p.isElement(R)))&&(D=a.floating[y]||f.floating[E]);const A=T/2-L/2,j=D/2-w[E]/2-1,M=cs(c[b],j),I=cs(c[S],j),B=D-w[E]-I,H=D/2-w[E]/2+A,U=Hw(M,H,B),W=!h.arrow&&ya(l)!=null&&H!==U&&f.reference[E]/2-(H<M?M:I)-w[E]/2<0,Y=W?H<M?H-M:H-B:0;return{[x]:_[x]+Y,data:{[x]:U,centerOffset:H-U-Y,...W&&{alignmentOffset:Y}},reset:W}}}),HR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var r,s;const{placement:l,middlewareData:f,rects:p,initialPlacement:a,platform:h,elements:d}=i,{mainAxis:m=!0,crossAxis:c=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...g}=_r(e,i);if((r=f.arrow)!=null&&r.alignmentOffset)return{};const b=us(l),S=zi(a),y=us(a)===a,T=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=_||(y||!w?[sh(a)]:LR(a)),R=E!=="none";!_&&R&&L.push(...OR(a,w,E,T));const D=[a,...L],A=await h.detectOverflow(i,g),j=[];let M=((s=f.flip)==null?void 0:s.overflows)||[];if(m&&j.push(A[b]),c){const U=AR(l,p,T);j.push(A[U[0]],A[U[1]])}if(M=[...M,{placement:l,overflows:j}],!j.every(U=>U<=0)){var I,B;const U=(((I=f.flip)==null?void 0:I.index)||0)+1,W=D[U];if(W&&(!(c==="alignment"?S!==zi(W):!1)||M.every(K=>zi(K.placement)===S?K.overflows[0]>0:!0)))return{data:{index:U,overflows:M},reset:{placement:W}};let Y=(B=M.filter(Q=>Q.overflows[0]<=0).sort((Q,K)=>Q.overflows[1]-K.overflows[1])[0])==null?void 0:B.placement;if(!Y)switch(x){case"bestFit":{var H;const Q=(H=M.filter(K=>{if(R){const z=zi(K.placement);return z===S||z==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(z=>z>0).reduce((z,O)=>z+O,0)]).sort((K,z)=>K[1]-z[1])[0])==null?void 0:H[0];Q&&(Y=Q);break}case"initialPlacement":Y=a;break}if(l!==Y)return{reset:{placement:Y}}}return{}}}};function Dy(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function My(e){return TR.some(i=>e[i]>=0)}const FR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:r,platform:s}=i,{strategy:l="referenceHidden",...f}=_r(e,i);switch(l){case"referenceHidden":{const p=await s.detectOverflow(i,{...f,elementContext:"reference"}),a=Dy(p,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:My(a)}}}case"escaped":{const p=await s.detectOverflow(i,{...f,altBoundary:!0}),a=Dy(p,r.floating);return{data:{escapedOffsets:a,escaped:My(a)}}}default:return{}}}}},Uw=new Set(["left","top"]);async function UR(e,i){const{placement:r,platform:s,elements:l}=e,f=await(s.isRTL==null?void 0:s.isRTL(l.floating)),p=us(r),a=ya(r),h=zi(r)==="y",d=Uw.has(p)?-1:1,m=f&&h?-1:1,c=_r(i,e);let{mainAxis:_,crossAxis:x,alignmentAxis:E}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof E=="number"&&(x=a==="end"?E*-1:E),h?{x:x*m,y:_*d}:{x:_*d,y:x*m}}const $R=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var r,s;const{x:l,y:f,placement:p,middlewareData:a}=i,h=await UR(i,e);return p===((r=a.offset)==null?void 0:r.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:l+h.x,y:f+h.y,data:{...h,placement:p}}}}},qR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:r,y:s,placement:l,platform:f}=i,{mainAxis:p=!0,crossAxis:a=!1,limiter:h={fn:S=>{let{x:y,y:T}=S;return{x:y,y:T}}},...d}=_r(e,i),m={x:r,y:s},c=await f.detectOverflow(i,d),_=zi(l),x=Cg(_);let E=m[x],w=m[_];const g=(S,y)=>Hw(y+c[S==="y"?"top":"left"],y,y-c[S==="y"?"bottom":"right"]);p&&(E=g(x,E)),a&&(w=g(_,w));const b=h.fn({...i,[x]:E,[_]:w});return{...b,data:{x:b.x-r,y:b.y-s,enabled:{[x]:p,[_]:a}}}}}},VR=function(e){return e===void 0&&(e={}),{options:e,fn(i){var r,s;const{x:l,y:f,placement:p,rects:a,middlewareData:h}=i,{offset:d=0,mainAxis:m=!0,crossAxis:c=!0}=_r(e,i),_={x:l,y:f},x=zi(p),E=Cg(x);let w=_[E],g=_[x];const b=_r(d,i),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(r=b.mainAxis)!=null?r:0,crossAxis:(s=b.crossAxis)!=null?s:0};if(m){const L=E==="y"?"height":"width",R=a.reference[E]-a.floating[L]+S.mainAxis,D=a.reference[E]+a.reference[L]-S.mainAxis;w<R?w=R:w>D&&(w=D)}if(c){var y,T;const L=E==="y"?"width":"height",R=Uw.has(us(p)),D=a.reference[x]-a.floating[L]+(R&&((y=h.offset)==null?void 0:y[x])||0)+(R?0:S.crossAxis),A=a.reference[x]+a.reference[L]+(R?0:((T=h.offset)==null?void 0:T[x])||0)-(R?S.crossAxis:0);g<D?g=D:g>A&&(g=A)}return{[E]:w,[x]:g}}}},WR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:r,rects:s,platform:l,elements:f}=i,{apply:p=()=>{},...a}=_r(e,i),h=await l.detectOverflow(i,a),d=us(r),m=ya(r),c=zi(r)==="y",{width:_,height:x}=s.floating;let E,w;d==="top"||d==="bottom"?(E=d,w=m===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(w=d,E=m==="end"?"top":"bottom");const g=x-h.top-h.bottom,b=_-h.left-h.right,S=cs(x-h[E],g),y=cs(_-h[w],b),T=i.middlewareData.shift,L=!T;let R=S,D=y;T!=null&&T.enabled.x&&(D=b),T!=null&&T.enabled.y&&(R=g),L&&!m&&(c?D=_-2*fr(h.left,h.right):R=x-2*fr(h.top,h.bottom)),await p({...i,availableWidth:D,availableHeight:R});const A=await l.getDimensions(f.floating);return _!==A.width||x!==A.height?{reset:{rects:!0}}:{}}}};function Th(){return typeof window<"u"}function ba(e){return $w(e)?(e.nodeName||"").toLowerCase():"#document"}function Nn(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function wr(e){var i;return(i=($w(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function $w(e){return Th()?e instanceof Node||e instanceof Nn(e).Node:!1}function $i(e){return Th()?e instanceof Element||e instanceof Nn(e).Element:!1}function fs(e){return Th()?e instanceof HTMLElement||e instanceof Nn(e).HTMLElement:!1}function jy(e){return!Th()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nn(e).ShadowRoot}function Rh(e){const{overflow:i,overflowX:r,overflowY:s,display:l}=qi(e);return/auto|scroll|overlay|hidden|clip/.test(i+s+r)&&l!=="inline"&&l!=="contents"}function GR(e){return/^(table|td|th)$/.test(ba(e))}function Ah(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const YR=/transform|translate|scale|rotate|perspective|filter/,XR=/paint|layout|strict|content/,zs=e=>!!e&&e!=="none";let Hp;function Tg(e){const i=$i(e)?qi(e):e;return zs(i.transform)||zs(i.translate)||zs(i.scale)||zs(i.rotate)||zs(i.perspective)||!Rg()&&(zs(i.backdropFilter)||zs(i.filter))||YR.test(i.willChange||"")||XR.test(i.contain||"")}function KR(e){let i=Gs(e);for(;fs(i)&&!Bl(i);){if(Tg(i))return i;if(Ah(i))return null;i=Gs(i)}return null}function Rg(){return Hp==null&&(Hp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hp}function Bl(e){return/^(html|body|#document)$/.test(ba(e))}function qi(e){return Nn(e).getComputedStyle(e)}function Lh(e){return $i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gs(e){if(ba(e)==="html")return e;const i=e.assignedSlot||e.parentNode||jy(e)&&e.host||wr(e);return jy(i)?i.host:i}function qw(e){const i=Gs(e);return Bl(i)?(e.ownerDocument||e).body:fs(i)&&Rh(i)?i:qw(i)}function Pl(e,i,r){var s;i===void 0&&(i=[]),r===void 0&&(r=!0);const l=qw(e),f=l===((s=e.ownerDocument)==null?void 0:s.body),p=Nn(l);if(f){const a=Am(p);return i.concat(p,p.visualViewport||[],Rh(l)?l:[],a&&r?Pl(a):[])}else return i.concat(l,Pl(l,[],r))}function Am(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vw(e){const i=qi(e);let r=parseFloat(i.width)||0,s=parseFloat(i.height)||0;const l=fs(e),f=l?e.offsetWidth:r,p=l?e.offsetHeight:s,a=rh(r)!==f||rh(s)!==p;return a&&(r=f,s=p),{width:r,height:s,$:a}}function Ag(e){return $i(e)?e:e.contextElement}function oa(e){const i=Ag(e);if(!fs(i))return pr(1);const r=i.getBoundingClientRect(),{width:s,height:l,$:f}=Vw(i);let p=(f?rh(r.width):r.width)/s,a=(f?rh(r.height):r.height)/l;return(!p||!Number.isFinite(p))&&(p=1),(!a||!Number.isFinite(a))&&(a=1),{x:p,y:a}}const QR=pr(0);function Ww(e){const i=Nn(e);return!Rg()||!i.visualViewport?QR:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function ZR(e,i,r){return i===void 0&&(i=!1),!!r&&i&&r===Nn(e)}function Ys(e,i,r,s){i===void 0&&(i=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),f=Ag(e);let p=pr(1);i&&(s?$i(s)&&(p=oa(s)):p=oa(e));const a=ZR(f,r,s)?Ww(f):pr(0);let h=(l.left+a.x)/p.x,d=(l.top+a.y)/p.y,m=l.width/p.x,c=l.height/p.y;if(f&&s){const _=Nn(f),x=$i(s)?Nn(s):s;let E=_,w=Am(E);for(;w&&x!==E;){const g=oa(w),b=w.getBoundingClientRect(),S=qi(w),y=b.left+(w.clientLeft+parseFloat(S.paddingLeft))*g.x,T=b.top+(w.clientTop+parseFloat(S.paddingTop))*g.y;h*=g.x,d*=g.y,m*=g.x,c*=g.y,h+=y,d+=T,E=Nn(w),w=Am(E)}}return oh({width:m,height:c,x:h,y:d})}function Dh(e,i){const r=Lh(e).scrollLeft;return i?i.left+r:Ys(wr(e)).left+r}function Gw(e,i){const r=e.getBoundingClientRect(),s=r.left+i.scrollLeft-Dh(e,r),l=r.top+i.scrollTop;return{x:s,y:l}}function JR(e){let{elements:i,rect:r,offsetParent:s,strategy:l}=e;const f=l==="fixed",p=wr(s),a=i?Ah(i.floating):!1;if(s===p||a&&f)return r;let h={scrollLeft:0,scrollTop:0},d=pr(1);const m=pr(0),c=fs(s);if((c||!f)&&((ba(s)!=="body"||Rh(p))&&(h=Lh(s)),c)){const x=Ys(s);d=oa(s),m.x=x.x+s.clientLeft,m.y=x.y+s.clientTop}const _=p&&!c&&!f?Gw(p,h):pr(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-h.scrollLeft*d.x+m.x+_.x,y:r.y*d.y-h.scrollTop*d.y+m.y+_.y}}function eA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tA(e){const i=Lh(e),r=e.ownerDocument.body,s=fr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=fr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let f=-i.scrollLeft+Dh(e);const p=-i.scrollTop;return qi(r).direction==="rtl"&&(f+=fr(e.clientWidth,r.clientWidth)-s),{width:s,height:l,x:f,y:p}}const nA=25;function iA(e,i,r){r===void 0&&(r="viewport");const s=r==="layoutViewport",l=Nn(e),f=wr(e),p=l.visualViewport;let a=f.clientWidth,h=f.clientHeight,d=0,m=0;if(p){const _=!Rg()||i==="fixed";s?_||(d=-p.offsetLeft,m=-p.offsetTop):(a=p.width,h=p.height,_&&(d=p.offsetLeft,m=p.offsetTop))}if(Dh(f)<=0){const _=f.ownerDocument,x=_.body,E=getComputedStyle(x),w=_.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,g=Math.abs(f.clientWidth-x.clientWidth-w),b=getComputedStyle(f).scrollbarGutter==="stable both-edges"?g/2:g;b<=nA&&(a-=b)}return{width:a,height:h,x:d,y:m}}function rA(e,i){const r=Ys(e,!0,i==="fixed"),s=r.top+e.clientTop,l=r.left+e.clientLeft,f=oa(e),p=e.clientWidth*f.x,a=e.clientHeight*f.y,h=l*f.x,d=s*f.y;return{width:p,height:a,x:h,y:d}}function Oy(e,i,r){let s;if(i==="viewport"||i==="layoutViewport")s=iA(e,r,i);else if(i==="document")s=tA(wr(e));else if($i(i))s=rA(i,r);else{const l=Ww(e);s={x:i.x-l.x,y:i.y-l.y,width:i.width,height:i.height}}return oh(s)}function sA(e,i){const r=i.get(e);if(r)return r;let s=Pl(e,[],!1).filter(a=>$i(a)&&ba(a)!=="body"),l=null;const f=qi(e).position==="fixed";let p=f?Gs(e):e;for(;$i(p)&&!Bl(p);){const a=qi(p),h=Tg(p),d=l?l.position:f?"fixed":"";!h&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(c=>c!==p):l=a,p=Gs(p)}return i.set(e,s),s}function oA(e){let{element:i,boundary:r,rootBoundary:s,strategy:l}=e;const p=[...r==="clippingAncestors"?Ah(i)?[]:sA(i,this._c):[].concat(r),s],a=Oy(i,p[0],l);let h=a.top,d=a.right,m=a.bottom,c=a.left;for(let _=1;_<p.length;_++){const x=Oy(i,p[_],l);h=fr(x.top,h),d=cs(x.right,d),m=cs(x.bottom,m),c=fr(x.left,c)}return{width:d-c,height:m-h,x:c,y:h}}function aA(e){const{width:i,height:r}=Vw(e);return{width:i,height:r}}function lA(e,i,r){const s=fs(i),l=wr(i),f=r==="fixed",p=Ys(e,!0,f,i);let a={scrollLeft:0,scrollTop:0};const h=pr(0);if((s||!f)&&((ba(i)!=="body"||Rh(l))&&(a=Lh(i)),s)){const _=Ys(i,!0,f,i);h.x=_.x+i.clientLeft,h.y=_.y+i.clientTop}!s&&l&&(h.x=Dh(l));const d=l&&!s&&!f?Gw(l,a):pr(0),m=p.left+a.scrollLeft-h.x-d.x,c=p.top+a.scrollTop-h.y-d.y;return{x:m,y:c,width:p.width,height:p.height}}function Fp(e){return qi(e).position==="static"}function Ny(e,i){if(!fs(e)||qi(e).position==="fixed")return null;if(i)return i(e);let r=e.offsetParent;return wr(e)===r&&(r=r.ownerDocument.body),r}function Yw(e,i){const r=Nn(e);if(Ah(e))return r;if(!fs(e)){let l=Gs(e);for(;l&&!Bl(l);){if($i(l)&&!Fp(l))return l;l=Gs(l)}return r}let s=Ny(e,i);for(;s&&GR(s)&&Fp(s);)s=Ny(s,i);return s&&Bl(s)&&Fp(s)&&!Tg(s)?r:s||KR(e)||r}const cA=async function(e){const i=this.getOffsetParent||Yw,r=this.getDimensions,s=await r(e.floating);return{reference:lA(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function uA(e){return qi(e).direction==="rtl"}const hA={convertOffsetParentRelativeRectToViewportRelativeRect:JR,getDocumentElement:wr,getClippingRect:oA,getOffsetParent:Yw,getElementRects:cA,getClientRects:eA,getDimensions:aA,getScale:oa,isElement:$i,isRTL:uA};function Xw(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function dA(e,i,r){let s=null,l;const f=wr(e);function p(){var m;clearTimeout(l),(m=s)==null||m.disconnect(),s=null}function a(m,c){m===void 0&&(m=!1),c===void 0&&(c=1),p();const _=e.getBoundingClientRect(),{left:x,top:E,width:w,height:g}=_;if(m||i(),!w||!g)return;const b=Pu(E),S=Pu(f.clientWidth-(x+w)),y=Pu(f.clientHeight-(E+g)),T=Pu(x),R={rootMargin:-b+"px "+-S+"px "+-y+"px "+-T+"px",threshold:fr(0,cs(1,c))||1};let D=!0;function A(j){const M=j[0].intersectionRatio;if(!Xw(_,e.getBoundingClientRect()))return a();if(M!==c){if(!D)return a();M?a(!1,M):l=setTimeout(()=>{a(!1,1e-7)},1e3)}D=!1}try{s=new IntersectionObserver(A,{...R,root:f.ownerDocument})}catch{s=new IntersectionObserver(A,R)}s.observe(e)}const h=Nn(e),d=()=>a(r);return h.addEventListener("resize",d),a(!0),()=>{h.removeEventListener("resize",d),p()}}function fA(e,i,r,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:f=!0,elementResize:p=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,d=Ag(e),m=l||f?[...d?Pl(d):[],...i?Pl(i):[]]:[];m.forEach(b=>{l&&b.addEventListener("scroll",r),f&&b.addEventListener("resize",r)});const c=d&&a?dA(d,r,f):null;let _=-1,x=null;p&&(x=new ResizeObserver(b=>{let[S]=b;S&&S.target===d&&x&&i&&(x.unobserve(i),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(i)})),r()}),d&&!h&&x.observe(d),i&&x.observe(i));let E,w=h?Ys(e):null;h&&g();function g(){const b=Ys(e);w&&!Xw(w,b)&&r(),w=b,E=requestAnimationFrame(g)}return r(),()=>{var b;m.forEach(S=>{l&&S.removeEventListener("scroll",r),f&&S.removeEventListener("resize",r)}),c==null||c(),(b=x)==null||b.disconnect(),x=null,h&&cancelAnimationFrame(E)}}const pA=$R,mA=qR,gA=HR,vA=WR,_A=FR,By=zR,xA=VR,yA=(e,i,r)=>{const s=new Map,l=r??{},f={...hA,...l.platform,_c:s};return IR(e,i,{...l,platform:f})};var bA=typeof document<"u",SA=function(){},Xu=bA?P.useLayoutEffect:SA;function ah(e,i){if(e===i)return!0;if(typeof e!=typeof i)return!1;if(typeof e=="function"&&e.toString()===i.toString())return!0;let r,s,l;if(e&&i&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==i.length)return!1;for(s=r;s--!==0;)if(!ah(e[s],i[s]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(i).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(i,l[s]))return!1;for(s=r;s--!==0;){const f=l[s];if(!(f==="_owner"&&e.$$typeof)&&!ah(e[f],i[f]))return!1}return!0}return e!==e&&i!==i}function Kw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Py(e,i){const r=Kw(e);return Math.round(i*r)/r}function Up(e){const i=P.useRef(e);return Xu(()=>{i.current=e}),i}function wA(e){e===void 0&&(e={});const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l,elements:{reference:f,floating:p}={},transform:a=!0,whileElementsMounted:h,open:d}=e,[m,c]=P.useState({x:0,y:0,strategy:r,placement:i,middlewareData:{},isPositioned:!1}),[_,x]=P.useState(s);ah(_,s)||x(s);const[E,w]=P.useState(null),[g,b]=P.useState(null),S=P.useCallback(K=>{K!==R.current&&(R.current=K,w(K))},[]),y=P.useCallback(K=>{K!==D.current&&(D.current=K,b(K))},[]),T=f||E,L=p||g,R=P.useRef(null),D=P.useRef(null),A=P.useRef(m),j=h!=null,M=Up(h),I=Up(l),B=Up(d),H=P.useCallback(()=>{if(!R.current||!D.current)return;const K={placement:i,strategy:r,middleware:_};I.current&&(K.platform=I.current),yA(R.current,D.current,K).then(z=>{const O={...z,isPositioned:B.current!==!1};U.current&&!ah(A.current,O)&&(A.current=O,Xl.flushSync(()=>{c(O)}))})},[_,i,r,I,B]);Xu(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(K=>({...K,isPositioned:!1})))},[d]);const U=P.useRef(!1);Xu(()=>(U.current=!0,()=>{U.current=!1}),[]),Xu(()=>{if(T&&(R.current=T),L&&(D.current=L),T&&L){if(M.current)return M.current(T,L,H);H()}},[T,L,H,M,j]);const W=P.useMemo(()=>({reference:R,floating:D,setReference:S,setFloating:y}),[S,y]),Y=P.useMemo(()=>({reference:T,floating:L}),[T,L]),Q=P.useMemo(()=>{const K={position:r,left:0,top:0};if(!Y.floating)return K;const z=Py(Y.floating,m.x),O=Py(Y.floating,m.y);return a?{...K,transform:"translate("+z+"px, "+O+"px)",...Kw(Y.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:O}},[r,a,Y.floating,m.x,m.y]);return P.useMemo(()=>({...m,update:H,refs:W,elements:Y,floatingStyles:Q}),[m,H,W,Y,Q])}const CA=e=>{function i(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:l}=typeof e=="function"?e(r):e;return s&&i(s)?s.current!=null?By({element:s.current,padding:l}).fn(r):{}:s?By({element:s,padding:l}).fn(r):{}}}},EA=(e,i)=>{const r=pA(e);return{name:r.name,fn:r.fn,options:[e,i]}},kA=(e,i)=>{const r=mA(e);return{name:r.name,fn:r.fn,options:[e,i]}},TA=(e,i)=>({fn:xA(e).fn,options:[e,i]}),RA=(e,i)=>{const r=gA(e);return{name:r.name,fn:r.fn,options:[e,i]}},AA=(e,i)=>{const r=vA(e);return{name:r.name,fn:r.fn,options:[e,i]}},LA=(e,i)=>{const r=_A(e);return{name:r.name,fn:r.fn,options:[e,i]}},DA=(e,i)=>{const r=CA(e);return{name:r.name,fn:r.fn,options:[e,i]}};var MA=Object.defineProperty,jA=(e,i)=>MA(e,"name",{value:i,configurable:!0}),OA=P.forwardRef(jA(function(i,r){const{children:s,width:l=10,height:f=5,...p}=i;return v.jsx(wt.svg,{...p,ref:r,width:l,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:i.asChild?s:v.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),NA=Object.defineProperty,BA=(e,i)=>NA(e,"name",{value:i,configurable:!0});function Lg(e){const[i,r]=P.useState(void 0);return $t(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let s=0;const l=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const p=f[0];window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{let a,h;if("borderBoxSize"in p){const d=p.borderBoxSize,m=Array.isArray(d)?d[0]:d;a=m.inlineSize,h=m.blockSize}else a=e.offsetWidth,h=e.offsetHeight;r({width:a,height:h})})});return l.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(s),l.unobserve(e)}}else r(void 0)},[e]),i}BA(Lg,"useSize");var PA=Object.defineProperty,mr=(e,i)=>PA(e,"name",{value:i,configurable:!0}),Iy={Partial:"partial"},zy={Optimized:"optimized",Always:"always"},Qw="Popper",[Zw,Sa]=br(Qw),[IA,Jw]=Zw(Qw),Dg=mr(e=>{const{__scopePopper:i,children:r}=e,[s,l]=P.useState(null),[f,p]=P.useState(void 0);return v.jsx(IA,{scope:i,anchor:s,onAnchorChange:l,placementState:f,setPlacementState:p,children:r})},"Popper"),zA="PopperAnchor",Mg=P.forwardRef(mr(function(i,r){const{__scopePopper:s,virtualRef:l,...f}=i,p=Jw(zA,s),a=P.useRef(null),h=p.onAnchorChange,d=P.useCallback(w=>{a.current=w,w&&h(w)},[h]),m=ht(r,d),c=P.useRef(null);P.useEffect(()=>{if(!l)return;const w=c.current;c.current=l.current,w!==c.current&&h(c.current)});const _=p.placementState&&Mh(p.placementState),x=_==null?void 0:_[0],E=_==null?void 0:_[1];return l?null:v.jsx(wt.div,{"data-radix-popper-side":x,"data-radix-popper-align":E,...f,ref:m})},"PopperAnchor")),eC="PopperContent",[HA,FA]=Zw(eC),jg=P.forwardRef(mr(function(i,r){var oe,ee,ue,he,we,Se,Re;const{__scopePopper:s,side:l="bottom",sideOffset:f=0,align:p="center",alignOffset:a=0,arrowPadding:h=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:c=0,sticky:_=Iy.Partial,hideWhenDetached:x=!1,updatePositionStrategy:E=zy.Optimized,onPlaced:w,...g}=i,b=Jw(eC,s),[S,y]=P.useState(null),T=ht(r,y),[L,R]=P.useState(null),D=Lg(L),A=(D==null?void 0:D.width)??0,j=(D==null?void 0:D.height)??0,M=l+(p!=="center"?"-"+p:""),I=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},B=Array.isArray(m)?m:[m],H=B.length>0,U={padding:I,boundary:B.filter(tC),altBoundary:H},{refs:W,floatingStyles:Y,placement:Q,isPositioned:K,middlewareData:z}=wA({strategy:"fixed",placement:M,whileElementsMounted:mr((...qe)=>fA(...qe,{animationFrame:E===zy.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[EA({mainAxis:f+j,alignmentAxis:a}),d&&kA({mainAxis:!0,crossAxis:!1,..._===Iy.Partial?{limiter:TA()}:{},...U}),d&&RA({...U}),AA({...U,apply:mr(({elements:qe,rects:ke,availableWidth:ze,availableHeight:Mt})=>{const{width:$e,height:Be}=ke.reference,Ie=qe.floating.style;Ie.setProperty("--radix-popper-available-width",`${ze}px`),Ie.setProperty("--radix-popper-available-height",`${Mt}px`),Ie.setProperty("--radix-popper-anchor-width",`${$e}px`),Ie.setProperty("--radix-popper-anchor-height",`${Be}px`)},"apply")}),L&&DA({element:L,padding:h}),VA({arrowWidth:A,arrowHeight:j}),x&&LA(H?{strategy:"referenceHidden",...U}:{strategy:"referenceHidden",padding:U.padding,altBoundary:U.altBoundary})]}),O=b.setPlacementState;$t(()=>(O(Q),()=>{O(void 0)}),[Q,O]);const[G,Z]=Mh(Q),F=Ui(w);$t(()=>{K&&(F==null||F())},[K,F]);const V=(oe=z.arrow)==null?void 0:oe.x,ne=(ee=z.arrow)==null?void 0:ee.y,le=((ue=z.arrow)==null?void 0:ue.centerOffset)!==0,[X,$]=P.useState();return $t(()=>{S&&$(window.getComputedStyle(S).zIndex)},[S]),v.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:K?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(he=z.transformOrigin)==null?void 0:he.x,(we=z.transformOrigin)==null?void 0:we.y].join(" "),...((Se=z.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:i.dir,children:v.jsx(HA,{scope:s,placedSide:G,placedAlign:Z,onArrowChange:R,arrowX:V,arrowY:ne,shouldHideArrow:le,children:v.jsx(wt.div,{"data-side":G,"data-align":Z,...g,ref:T,style:{...g.style,animation:K?(Re=g.style)==null?void 0:Re.animation:"none"}})})})},"PopperContent")),UA="PopperArrow",$A={top:"bottom",right:"left",bottom:"top",left:"right"},qA=P.forwardRef(mr(function(i,r){const{__scopePopper:s,...l}=i,f=FA(UA,s),p=$A[f.placedSide];return v.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[p]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:v.jsx(OA,{...l,ref:r,style:{...l.style,display:"block"}})})},"PopperArrow"));function tC(e){return e!==null}mr(tC,"isNotNull");var VA=mr(e=>({name:"transformOrigin",options:e,fn(i){var g,b,S;const{placement:r,rects:s,middlewareData:l}=i,p=((g=l.arrow)==null?void 0:g.centerOffset)!==0,a=p?0:e.arrowWidth,h=p?0:e.arrowHeight,[d,m]=Mh(r),c={start:"0%",center:"50%",end:"100%"}[m],_=(((b=l.arrow)==null?void 0:b.x)??0)+a/2,x=(((S=l.arrow)==null?void 0:S.y)??0)+h/2;let E="",w="";return d==="bottom"?(E=p?c:`${_}px`,w=`${-h}px`):d==="top"?(E=p?c:`${_}px`,w=`${s.floating.height+h}px`):d==="right"?(E=`${-h}px`,w=p?c:`${x}px`):d==="left"&&(E=`${s.floating.width+h}px`,w=p?c:`${x}px`),{data:{x:E,y:w}}}}),"transformOrigin");function Mh(e){const[i,r="center"]=e.split("-");return[i,r]}mr(Mh,"getSideAndAlignFromPlacement");var WA=Object.defineProperty,Cr=(e,i)=>WA(e,"name",{value:i,configurable:!0}),Og="Popover",[nC,rB]=br(Og,[Sa]),Ng=Sa(),[GA,wa]=nC(Og),YA=Cr(e=>{const{__scopePopover:i,children:r,open:s,defaultOpen:l,onOpenChange:f,modal:p=!1}=e,a=Ng(i),h=P.useRef(null),[d,m]=P.useState(!1),[c,_]=P.useState(0),[x,E]=P.useState(0),[w,g]=Ws({prop:s,defaultProp:l??!1,onChange:f,caller:Og});return v.jsx(Dg,{...a,children:v.jsx(GA,{scope:i,contentId:Fi(),titleId:Fi(),descriptionId:Fi(),titlePresent:c>0,descriptionPresent:x>0,setTitleCount:_,setDescriptionCount:E,triggerRef:h,open:w,onOpenChange:g,onOpenToggle:P.useCallback(()=>g(b=>!b),[g]),hasCustomAnchor:d,onCustomAnchorAdd:P.useCallback(()=>m(!0),[]),onCustomAnchorRemove:P.useCallback(()=>m(!1),[]),modal:p,children:r})})},"Popover"),XA="PopoverTrigger",KA=P.forwardRef(Cr(function(i,r){const{__scopePopover:s,...l}=i,f=wa(XA,s),p=Ng(s),a=ht(r,f.triggerRef),h=v.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":Bg(f.open),...l,ref:a,onClick:tt(i.onClick,f.onOpenToggle)});return f.hasCustomAnchor?h:v.jsx(Mg,{asChild:!0,...p,children:h})},"PopoverTrigger")),iC="PopoverPortal",[QA,ZA]=nC(iC,{forceMount:void 0}),JA=Cr(e=>{const{__scopePopover:i,forceMount:r,children:s,container:l}=e,f=wa(iC,i);return v.jsx(QA,{scope:i,forceMount:r,children:v.jsx(Sr,{present:r||f.open,children:v.jsx(wh,{asChild:!0,container:l,children:s})})})},"PopoverPortal"),Il="PopoverContent",e6=P.forwardRef(Cr(function(i,r){const s=ZA(Il,i.__scopePopover),{forceMount:l=s.forceMount,...f}=i,p=wa(Il,i.__scopePopover);return v.jsx(Sr,{present:l||p.open,children:p.modal?v.jsx(n6,{...f,ref:r}):v.jsx(i6,{...f,ref:r})})},"PopoverContent")),t6=gr("PopoverContent.RemoveScroll"),n6=P.forwardRef(Cr(function(i,r){const s=wa(Il,i.__scopePopover),l=P.useRef(null),f=ht(r,l),p=P.useRef(!1),{nodes:a,registry:h}=_g();return P.useEffect(()=>{const d=l.current;if(d)return Sg(d)},[]),v.jsx(Eh,{as:t6,allowPinchZoom:!0,shards:P.useMemo(()=>[l,...a.map(d=>({current:d}))],[l,a]),children:v.jsx(rC,{...i,ref:f,branchNodes:a,branchRegistry:h,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tt(i.onCloseAutoFocus,d=>{var m;d.preventDefault(),p.current||(m=s.triggerRef.current)==null||m.focus()}),onPointerDownOutside:tt(i.onPointerDownOutside,d=>{const m=d.detail.originalEvent,c=m.button===0&&m.ctrlKey===!0,_=m.button===2||c;p.current=_},{checkForDefaultPrevented:!1}),onFocusOutside:tt(i.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),i6=P.forwardRef(Cr(function(i,r){const s=wa(Il,i.__scopePopover),l=P.useRef(!1),f=P.useRef(!1);return v.jsx(rC,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var a,h;(a=i.onCloseAutoFocus)==null||a.call(i,p),p.defaultPrevented||(l.current||(h=s.triggerRef.current)==null||h.focus(),p.preventDefault()),l.current=!1,f.current=!1},onInteractOutside:p=>{var d,m;(d=i.onInteractOutside)==null||d.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const a=p.target;((m=s.triggerRef.current)==null?void 0:m.contains(a))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&f.current&&p.preventDefault()}})},"PopoverContentNonModal")),rC=P.forwardRef(Cr(function(i,r){const{__scopePopover:s,trapFocus:l,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:a,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:c,"aria-describedby":_,branchNodes:x,branchRegistry:E,...w}=i,g=wa(Il,s),b=Ng(s),[S,y]=P.useState(null),T=ht(r,y);return xg(S),Kl(),v.jsx(vg,{registry:E,children:v.jsx(gg,{asChild:!0,loop:!0,trapped:l,branches:x,onMountAutoFocus:f,onUnmountAutoFocus:p,children:v.jsx(Sh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:v.jsx(jg,{"data-state":Bg(g.open),role:"dialog",id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?sC(_,g.descriptionId):_,...b,...w,ref:T,style:{...w.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function Bg(e){return e?"open":"closed"}Cr(Bg,"getState");function sC(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Cr(sC,"concatAriaDescribedby");function Pg({trigger:e,children:i,side:r="bottom",align:s="start",className:l,open:f,onOpenChange:p}){return v.jsxs(YA,{open:f,onOpenChange:p,children:[v.jsx(KA,{asChild:!0,children:e}),v.jsx(JA,{children:v.jsx(e6,{side:r,align:s,sideOffset:6,collisionPadding:8,className:xe("z-50 rounded-lg border bg-card p-3 shadow-lg focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",l),children:i})})]})}const r6={on:"bg-foreground text-background",off:"bg-muted text-muted-foreground",critical:"bg-severity-critical text-primary-foreground",warning:"bg-severity-warning text-background",suggestion:"bg-severity-suggestion text-background",success:"bg-success text-success-foreground"};function nt({tone:e="on",icon:i,children:r,className:s,title:l}){return v.jsxs("span",{title:l,className:xe("inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",r6[e],s),children:[i&&v.jsx(i,{className:"h-2.5 w-2.5"}),r]})}const Hy="clauder-hub:automation-tab";function s6(){var h,d,m,c;const e=ut(()=>ve.jobs(),["jobs"]),i=ut(()=>ve.runs(),["runs"]),{starting:r,start:s}=Qs(),[l,f]=P.useState(()=>{try{return localStorage.getItem(Hy)==="queue"?"queue":"jobs"}catch{return"jobs"}}),p=_=>{f(_);try{localStorage.setItem(Hy,_)}catch{}},a=(i.data??[]).filter(_=>_.status==="queued"||_.status==="running").length;return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),v.jsx("h1",{className:"text-base font-semibold",children:"Automation"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Cron and webhook runs, one session at a time, while the hub runs.",children:"Cron and webhook runs, one session at a time, while the hub runs."})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.jsxs(_e,{disabled:r,onClick:()=>void s("queue-run"),title:"Opens a Claude session to queue a run",children:[v.jsx(ua,{size:12})," Queue a run"]}),v.jsxs(_e,{variant:"primary",disabled:r,onClick:()=>void s("create-job"),title:"Opens a Claude session to create a job",children:[v.jsx(Qn,{size:12})," New job"]})]})]}),v.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b",children:[["jobs","Jobs",((h=e.data)==null?void 0:h.length)??0,"Every job of this project"],["queue","Queue",((d=i.data)==null?void 0:d.length)??0,a?`${a} waiting or running now`:"Nothing waiting or running now"]].map(([_,x,E,w])=>v.jsxs("button",{onClick:()=>p(_),title:w,className:xe("flex shrink-0 items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",l===_?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:[x,v.jsx("span",{className:xe("grid h-4 min-w-[1rem] place-items-center rounded-full px-1 text-[10px] font-semibold leading-none tabular-nums",_==="queue"&&a>0?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:E})]},_))}),l==="jobs"?(m=e.data)!=null&&m.length?v.jsx("div",{className:"divide-y rounded-md border",children:e.data.map(_=>v.jsx(o6,{job:_,onEdit:()=>void s("edit-job",_.id)},_.id))}):v.jsx(nn,{variant:"inline",title:"No jobs yet. A cron job runs a prompt on a schedule; a manual / webhook job runs when you press Run, type /job in a channel, or something calls its URL."}):(c=i.data)!=null&&c.length?v.jsx(c6,{runs:i.data}):v.jsx(nn,{variant:"inline",title:"Nothing has run yet."})]})})}function o6({job:e,onEdit:i}){const r=pn(),l=`curl -X POST "${`${location.origin}${Hi()}/trigger/${e.id}`}" -H "x-clauder-token: ${e.token}" -H "content-type: application/json" -d "{\\"issue\\":\\"ABC-123\\"}"`;return v.jsxs("div",{className:"px-3 py-2.5",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[e.kind==="cron"?v.jsx(_h,{size:14,className:"shrink-0 text-muted-foreground"}):v.jsx(LS,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate text-xs font-medium",children:e.name}),!e.enabled&&v.jsx(nt,{tone:"off",children:"disabled"}),v.jsx(nt,{tone:"off",title:e.kind==="cron"?"Runs on its schedule while the hub runs, and whenever it is run by hand":"No schedule: runs when you press Run, type /job in a channel, or something calls its URL",children:e.kind==="cron"?"cron":"manual / webhook"}),v.jsx(nt,{tone:"off",children:e.category||"no category"}),v.jsx(a6,{job:e,curl:l}),v.jsxs("span",{className:"ml-auto flex gap-1",children:[v.jsx(_e,{variant:"ghost",size:"icon",title:"Run now",onClick:()=>void r({title:`Run '${e.name}' now?`,description:"Joins the queue as an unattended session.",body:v.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-[11px]",children:e.prompt}),confirmLabel:"Queue it",run:async()=>{await ve.runJob(e.id),ye.getState().notify("Queued.")}}),children:v.jsx(ua,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:i,children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void r({title:`Delete the job '${e.name}'?`,description:"Its schedule or webhook stops. Past runs stay.",confirmLabel:"Delete",tone:"destructive",run:()=>ve.deleteJob(e.id)}),children:v.jsx(yr,{size:13})})]})]}),v.jsx("div",{className:"mt-1 line-clamp-2 break-words pl-6 text-[11px] text-muted-foreground",children:e.prompt}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-3 pl-6 text-[11px] text-muted-foreground",children:[e.kind==="cron"?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-mono",children:e.schedule}),v.jsxs("span",{children:["next: ",e.nextRunAt?Vs(e.nextRunAt):"-"]})]}):v.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[v.jsxs("span",{className:"break-all font-mono",children:["POST ",Hi(),"/trigger/",e.id]}),v.jsx(Nl,{text:l}),v.jsx("span",{children:"copy curl"}),v.jsx(_e,{variant:"ghost",size:"icon",title:"New token",onClick:()=>void r({title:"Issue a new token?",description:"Callers using the old token stop working.",confirmLabel:"Issue new token",tone:"destructive",run:()=>ve.rotateJobToken(e.id)}),children:v.jsx(yh,{size:11})})]}),v.jsxs("span",{children:["last run: ",e.lastRunAt?va(e.lastRunAt):"never"]})]})]})}function a6({job:e,curl:i}){const r=`curl -X POST "http://127.0.0.1:${location.port||80}${Hi()}/jobs/${e.id}/run" -H "content-type: application/json" -d "{}"`;return v.jsxs(Pg,{align:"start",className:"w-[30rem] max-w-[calc(100vw-1rem)] space-y-2.5 text-[11px]",trigger:v.jsxs("button",{className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Every way to start this job",children:[v.jsx(xS,{size:11})," How to run"]}),children:[v.jsxs("div",{className:"text-xs font-semibold",children:["How to run ‘",e.name,"’"]}),e.kind==="cron"?v.jsxs(Qo,{title:"On its schedule",children:[v.jsx("span",{className:"font-mono",children:e.schedule}),", next ",e.nextRunAt?Vs(e.nextRunAt):"-",", while the hub runs",e.enabled?"":" (disabled now)","."]}):v.jsx(Qo,{title:"No schedule",children:"It runs only when started one of the ways below."}),v.jsxs(Qo,{title:"From this page",children:["Press ",v.jsx(ua,{size:11,className:"inline"})," Run. It asks first, then joins the project’s queue (one run at a time). In the queue below, ",v.jsx(bh,{size:10,className:"inline"})," stops a running run and ",v.jsx(TS,{size:10,className:"inline"})," resumes a stopped one where it left off."]}),v.jsxs(Qo,{title:"From a channel",children:[v.jsxs("span",{className:"font-mono",children:["/job ",e.name]})," on Telegram (",v.jsx("span",{className:"font-mono",children:"!job"})," on Slack), or ",v.jsx("span",{className:"font-mono",children:"/jobs"})," and pick it. It asks before it queues. ",v.jsx("span",{className:"font-mono",children:"/stop"})," stops it, ",v.jsx("span",{className:"font-mono",children:"/resume"})," carries it on."]}),e.kind==="webhook"&&v.jsxs(Qo,{title:"From another tool (webhook)",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",Hi(),"/trigger/",e.id]}),v.jsx(Nl,{text:i})]}),"With the header ",v.jsx("span",{className:"font-mono",children:"x-clauder-token"})," (the job’s token, in the copied curl; renew it with ",v.jsx(yh,{size:10,className:"inline"})," on the row). The JSON body reaches the prompt as ",v.jsx("span",{className:"font-mono",children:"{{payload}}"})," or ",v.jsx("span",{className:"font-mono",children:"{{payload.field}}"}),"."]}),v.jsxs(Qo,{title:"From an app on this machine",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",Hi(),"/jobs/",e.id,"/run"]}),v.jsx(Nl,{text:r})]}),"No token: the hub only listens on 127.0.0.1. An optional ",v.jsx("span",{className:"font-mono",children:'{"payload": {...}}'})," body fills the prompt as above."]})]})}function Qo({title:e,children:i}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-foreground",children:e}),v.jsx("div",{className:"text-muted-foreground",children:i})]})}const l6={queued:"off",running:"warning",done:"success",exited:"off",cancelled:"off"};function c6({runs:e}){const i=ye(l=>l.go),r=pn(),s=l=>l.jobName??l.prompt.slice(0,60);return v.jsx("div",{className:"divide-y rounded-md border",children:e.map(l=>v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs",children:[v.jsx(nt,{tone:l6[l.status],children:l.status}),l.resume&&v.jsx(nt,{tone:"off",title:"Queued again to carry on its own session",children:"resumed"}),v.jsx("span",{className:"hidden w-16 shrink-0 text-[11px] text-muted-foreground sm:block",children:l.source}),v.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l.jobName&&v.jsxs("span",{className:"font-medium",children:[l.jobName,": "]}),v.jsx("span",{className:"text-muted-foreground",children:l.prompt})]}),v.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:va(l.createdAt)}),l.sessionId&&v.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>i({kind:"session",id:l.sessionId}),children:"Open"}),l.status==="running"&&l.sessionId&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Stop",onClick:()=>void r({title:`Stop '${s(l)}'?`,description:"Its terminal closes and the queue moves on. The conversation is kept: Resume carries on from where it stopped.",confirmLabel:"Stop",tone:"destructive",run:()=>ve.stopRun(l.id)}),children:v.jsx(bh,{size:13})}),l.status==="exited"&&l.sessionId&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Resume",onClick:()=>void r({title:`Resume '${s(l)}'?`,description:"Joins the back of the queue as an unattended run and carries on its own conversation from where it stopped.",confirmLabel:"Queue it",run:async()=>{const{position:f}=await ve.resumeRun(l.id);ye.getState().notify(`Queued, number ${f} in line.`)}}),children:v.jsx(TS,{size:13})}),l.status==="queued"&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Cancel",onClick:()=>void rt(()=>ve.cancelRun(l.id)),children:v.jsx(En,{size:13})})]},l.id))})}function ss({label:e,value:i,hint:r}){return v.jsxs("div",{className:"card px-3 py-2.5",title:r,children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:e}),v.jsx("div",{className:"mt-0.5 text-lg font-semibold tabular-nums",children:i})]})}function oC({tokens:e}){return v.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[v.jsx(ss,{label:"Input",value:On(e.input),hint:`${e.input.toLocaleString()} uncached input tokens`}),v.jsx(ss,{label:"Output",value:On(e.output),hint:`${e.output.toLocaleString()} output tokens`}),v.jsx(ss,{label:"Cache read",value:On(e.cacheRead),hint:`${e.cacheRead.toLocaleString()} tokens read from the prompt cache`}),v.jsx(ss,{label:"Cache write",value:On(e.cacheCreation),hint:`${e.cacheCreation.toLocaleString()} tokens written to the prompt cache`})]})}function as({rows:e,empty:i="Nothing yet.",limit:r=12,format:s=On}){const[l,f]=P.useState(!1);if(!e.length)return v.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:i});const p=[...e].sort((d,m)=>m.value-d.value),a=l?p:p.slice(0,r),h=Math.max(...p.map(d=>d.value),1);return v.jsxs("div",{className:"space-y-1.5",children:[a.map(d=>v.jsxs("div",{className:"group",title:`${d.label}: ${d.value.toLocaleString()}${d.note?` (${d.note})`:""}`,children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[v.jsxs("span",{className:"min-w-0 truncate font-mono text-[11px]",children:[d.label,d.sublabel&&v.jsx("span",{className:"ml-1.5 font-sans text-muted-foreground",children:d.sublabel})]}),v.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[s(d.value),d.note&&v.jsx("span",{className:"ml-1 text-severity-critical",children:d.note})]})]}),v.jsx("div",{className:"mt-0.5 h-1.5 rounded-full bg-foreground/10",children:v.jsx("div",{className:"h-1.5 rounded-full bg-series transition-all group-hover:opacity-80",style:{width:`${Math.max(2,d.value/h*100)}%`}})})]},d.key)),p.length>r&&v.jsx("button",{className:"text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>f(!l),children:l?"Show fewer":`Show all ${p.length}`})]})}function u6({days:e,valueOf:i,label:r}){const[s,l]=P.useState(null),f=Object.entries(e).sort(([d],[m])=>d.localeCompare(m)).slice(-30);if(!f.length)return v.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:"No sessions yet."});const p=Math.max(...f.map(([,d])=>i(d)),1),a=s??f[f.length-1][0],h=i(e[a]);return v.jsxs("div",{children:[v.jsxs("div",{className:"mb-2 flex items-baseline gap-2 text-xs",children:[v.jsx("span",{className:"font-medium tabular-nums",children:On(h)}),v.jsxs("span",{className:"text-muted-foreground",children:[r," on ",a]})]}),v.jsx("div",{className:"flex h-28 items-end gap-[2px]",onMouseLeave:()=>l(null),children:f.map(([d,m])=>{const c=i(m);return v.jsx("div",{className:"flex h-full max-w-8 flex-1 cursor-default items-end",onMouseEnter:()=>l(d),children:v.jsx("div",{className:xe("w-full rounded-t bg-series transition-opacity",s&&s!==d&&"opacity-50"),style:{height:`${Math.max(2,c/p*100)}%`}})},d)})}),v.jsxs("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground",children:[v.jsx("span",{children:f[0][0]}),v.jsx("span",{children:f[f.length-1][0]})]})]})}function Dt({title:e,description:i,children:r,action:s,className:l}){return v.jsxs("section",{className:xe("card p-4",l),children:[v.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),i&&v.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:i})]}),s]}),r]})}const h6=[{name:"feature",description:"New behaviour",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"Documentation",description:"path or link to the docs written or updated",required:!0},{name:"Test evidence",description:"how it was tested and the result",required:!0}]},{name:"bugfix",description:"A defect fixed",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"RCA",description:"root cause analysis, a few sentences or a file path",required:!0},{name:"Test evidence",description:"the failing case now passing",required:!0}]}];function d6(){var s;const e=ut(()=>ve.categories(),[]),{starting:i,start:r}=Qs();return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Settings"}),v.jsx("h1",{className:"text-base font-semibold",children:"Task categories"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What counts as done for each kind of task.",children:"What counts as done for each kind of task."})]}),v.jsxs(_e,{variant:"primary",className:"shrink-0",disabled:i,onClick:()=>void r("create-category"),title:"Opens a Claude session to define a category",children:[v.jsx(Qn,{size:12})," New category"]})]}),(s=e.data)==null?void 0:s.map(l=>v.jsx(f6,{category:l,onEdit:()=>void r("edit-category",l.id),onDeleted:e.reload},l.id)),e.data&&!e.data.length&&v.jsx(nn,{title:"No categories yet.",hint:"Without any, a triggered session reports a summary and evidence of its own choosing. Start from the examples, or describe your own to Claude."}),e.data&&!e.data.length&&v.jsx("div",{className:"flex justify-center",children:v.jsx(_e,{onClick:()=>void Promise.all(h6.map(l=>ve.saveCategory(l))).then(e.reload),children:"Add the feature and bugfix examples"})})]})})}function f6({category:e,onEdit:i,onDeleted:r}){const s=pn();return v.jsx(Dt,{title:e.name,description:e.description||void 0,action:v.jsxs("div",{className:"flex gap-1",children:[v.jsx(_e,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:i,children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void s({title:`Delete the category '${e.name}'?`,description:"Sessions using it can no longer close against it.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deleteCategory(e.id),r()}}),children:v.jsx(yr,{size:13})})]}),children:e.deliverables.length?v.jsx("div",{className:"divide-y rounded-md border",children:e.deliverables.map(l=>v.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"text-xs font-medium",children:l.name}),l.description&&v.jsx("div",{className:"break-words text-[11px] text-muted-foreground",children:l.description})]}),v.jsx(nt,{tone:l.required?"on":"off",children:l.required?"required":"optional"})]},l.name))}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No fixed deliverables."})})}const p6={permission:"Permission requests",question:"Questions",turn:"End of each turn",mcp:"MCP suggestions",done:"Task done"},Lm="clauder:highlight-notifications";let Dm=!1;function m6(){Dm=!0,ye.getState().go({kind:"page",page:"channels"}),window.dispatchEvent(new Event(Lm))}function aC({on:e,label:i,onToggle:r,className:s}){return v.jsx("button",{role:"switch","aria-checked":e,"aria-label":i,title:i,onClick:r,className:xe("relative h-5 w-9 shrink-0 rounded-full transition-colors",e?"bg-primary":"bg-foreground/20",s),children:v.jsx("span",{className:xe("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",e?"left-[18px]":"left-0.5")})})}function lC({global:e=!1}){var E,w,g,b,S;const i=ut(()=>ve.channels(),["channels"]),{starting:r,start:s}=Qs(),l=pn(),f=((E=i.data)==null?void 0:E.kinds)??[],p=((w=i.data)==null?void 0:w.paused)??!1,a=new Set(((g=i.data)==null?void 0:g.notifyKinds)??[]),h=(b=i.data)==null?void 0:b.channels.find(y=>y.kind==="device"),d=(((S=i.data)==null?void 0:S.channels)??[]).filter(y=>y.kind!=="device"),m=P.useRef(null),[c,_]=P.useState(!1);P.useEffect(()=>{const y=()=>{!Dm||!m.current||(Dm=!1,m.current.scrollIntoView({block:"center",behavior:"smooth"}),_(!0),window.setTimeout(()=>_(!1),2200))};return y(),window.addEventListener(Lm,y),()=>window.removeEventListener(Lm,y)},[i.data!==null]);const x=y=>void rt(()=>ve.setNotifyKinds(a.has(y)?[...a].filter(T=>T!==y):[...a,y]));return v.jsx("div",{className:e?"":"h-full overflow-y-auto",children:v.jsxs("div",{className:xe("space-y-4",!e&&"p-5"),children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e?"Every project":"Settings"}),v.jsx("h1",{className:"text-base font-semibold",children:e?"Global channels":"Channels"}),e?v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"One bot for every project: their questions arrive here, named after the project, and /projects, /use pick one.",children:"One bot for every project: their questions arrive here, named after the project."}):v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Where sessions reach you. A reply goes back into the session.",children:"Where sessions reach you. A reply goes back into the session."})]}),v.jsxs(_e,{variant:"primary",className:"shrink-0",disabled:r,onClick:()=>void s("create-channel"),title:"Opens a Claude session to connect a channel",children:[v.jsx(Qn,{size:12})," Add channel"]})]}),i.data&&v.jsx(Dt,{title:"Notifications",description:p?"Paused: no channel hears of anything; questions still wait in the inbox.":"For every channel below, this computer included.",action:v.jsxs("div",{ref:m,className:xe("flex items-center gap-2 rounded-full py-0.5 pl-2.5 pr-0.5 transition-shadow",c&&"ring-2 ring-primary ring-offset-2 ring-offset-background animate-pulse"),children:[v.jsx("span",{className:xe("text-[11px] font-medium",p?"text-severity-warning":"text-muted-foreground"),children:p?"Paused on every channel":"On for every channel"}),v.jsx(aC,{on:!p,label:p?"Turn notifications back on":"Pause notifications on every channel",onToggle:()=>void rt(()=>ve.setNotificationsPaused(!p))})]}),children:v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.jsx("span",{className:"mr-1 text-[11px] text-muted-foreground",children:"Notify for"}),(i.data.interactionKinds??[]).map(y=>v.jsx("button",{disabled:p,onClick:()=>x(y),className:xe("rounded-full border px-2.5 py-0.5 text-[11px] transition-colors disabled:cursor-not-allowed disabled:opacity-40",a.has(y)?"border-primary bg-primary/15 text-foreground":"text-muted-foreground hover:bg-muted"),children:p6[y]??y},y))]})}),v.jsx(Dt,{title:"Channels",description:"Send /help to the Telegram bot, or !help in the Slack channel, for the commands: new session, run, sessions, summary, stop, queue.",children:i.data&&(!e||d.length)?v.jsxs("div",{className:"divide-y rounded-md border",children:[!e&&v.jsx(g6,{channel:h}),d.map(y=>{var T;return v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[v.jsx(Wl,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:y.name}),v.jsx(nt,{tone:"off",children:((T=f.find(L=>L.kind===y.kind))==null?void 0:T.label)??y.kind}),v.jsx(nt,{tone:y.status.ok?"success":y.enabled?"warning":"off",children:y.status.ok?"connected":y.enabled?"not connected":"off"})]}),v.jsx("div",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:y.status.detail}),y.kind==="http"&&v.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground",children:[v.jsxs("span",{className:"truncate font-mono",children:["POST ",`${location.origin}${Hi()}/channels/${y.id}/reply`]}),v.jsx(Nl,{text:`${location.origin}${Hi()}/channels/${y.id}/reply`})]})]}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Send a test message",onClick:()=>void rt(()=>ve.testChannel(y.id),"Test message sent."),children:v.jsx(ES,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:()=>void s("edit-channel",y.id),children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void l({title:`Remove '${y.name}'?`,description:"Sessions stop reaching you there.",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteChannel(y.id)}),children:v.jsx(yr,{size:13})})]},y.id)})]}):i.data&&v.jsx(nn,{variant:"inline",title:"No channels yet. Without one, questions wait in the dashboard's inbox and the terminal."})})]})})}function g6({channel:e}){const i=!!(e!=null&&e.enabled),r=()=>rt(()=>ve.saveChannel({id:e==null?void 0:e.id,kind:"device",name:"This computer",config:{},enabled:!i,kinds:e==null?void 0:e.kinds}));return v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[v.jsx(V3,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:"This computer"}),v.jsx(nt,{tone:"off",children:"System notifications"}),v.jsx(nt,{tone:i&&(e!=null&&e.status.ok)?"success":i?"warning":"off",children:i?e!=null&&e.status.ok?"on":"not working":"off"})]}),v.jsx("div",{className:xe("mt-0.5 truncate text-[11px]",i&&e&&!e.status.ok?"text-severity-critical":"text-muted-foreground"),children:i&&e&&!e.status.ok?e.status.detail:"From the hub itself; they arrive even with the browser closed."})]}),i&&e&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Send a test notification",onClick:()=>void rt(()=>ve.testChannel(e.id),"Test notification sent."),children:v.jsx(ES,{size:13})}),v.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:i?"On":"Off"}),v.jsx(aC,{on:i,label:i?"Stop notifying on this computer":"Notify on this computer",onToggle:()=>void r()})]})}function Er({group:e,title:i,description:r,action:s}){return v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),v.jsx("h1",{className:"text-base font-semibold",children:i}),r&&v.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",title:r,children:r})]}),s&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:s})]})}function Ig({onClick:e}){return v.jsxs(_e,{variant:"ghost",className:"-ml-2 mb-3 md:hidden",onClick:e,children:[v.jsx(T3,{size:13})," Back"]})}function Hs({label:e,hint:i,children:r}){return v.jsxs("label",{className:"block space-y-1",children:[v.jsx("div",{className:"text-xs font-medium",children:e}),r,i&&v.jsx("div",{className:"text-[11px] text-muted-foreground",children:i})]})}const pi=P.forwardRef(({className:e,size:i="sm",...r},s)=>v.jsx("input",{ref:s,className:xe("w-full rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));pi.displayName="Input";var v6=Object.defineProperty,_6=(e,i)=>v6(e,"name",{value:i,configurable:!0});function Mm(e,[i,r]){return Math.min(r,Math.max(i,e))}_6(Mm,"clamp");var x6=Object.defineProperty,Yt=(e,i)=>x6(e,"name",{value:i,configurable:!0});function cC(e){const i=e+"CollectionProvider",[r,s]=br(i),[l,f]=r(i,{collectionRef:{current:null},itemMap:new Map}),p=Yt(w=>{const{scope:g,children:b}=w,S=P.useRef(null),y=P.useRef(new Map).current;return v.jsx(l,{scope:g,itemMap:y,collectionRef:S,children:b})},"CollectionProvider");p.displayName=i;const a=e+"CollectionSlot",h=gr(a),d=P.forwardRef((w,g)=>{const{scope:b,children:S}=w,y=f(a,b),T=ht(g,y.collectionRef);return v.jsx(h,{ref:T,children:S})});d.displayName=a;const m=e+"CollectionItemSlot",c="data-radix-collection-item",_=gr(m),x=P.forwardRef((w,g)=>{const{scope:b,children:S,...y}=w,T=P.useRef(null),L=ht(g,T),R=f(m,b);return P.useEffect(()=>(R.itemMap.set(T,{ref:T,...y}),()=>void R.itemMap.delete(T))),v.jsx(_,{[c]:"",ref:L,children:S})});x.displayName=m;function E(w){const g=f(e+"CollectionConsumer",w);return P.useCallback(()=>{const S=g.collectionRef.current;if(!S)return[];const y=Array.from(S.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((R,D)=>y.indexOf(R.ref.current)-y.indexOf(D.ref.current))},[g.collectionRef,g.itemMap])}return Yt(E,"useCollection"),[{Provider:p,Slot:d,ItemSlot:x},E,s]}Yt(cC,"createCollection");var Fy=new WeakMap,Nt,Kn,Iu=(Kn=class extends Map{constructor(r){super(r);Yx(this,Nt);Ep(this,Nt,[...super.keys()]),Fy.set(this,!0)}set(r,s){return Fy.get(this)&&!this.has(r)&&un(this,Nt).push(r),super.set(r,s),this}insert(r,s,l){const f=this.has(s),p=f?this.size:this.size+1,a=zg(r),h=a>=0?Math.min(a,p-1):Math.max(p+a,0);if(f?un(this,Nt).indexOf(s)===h:h===this.size)return this.set(s,l),this;const d=un(this,Nt).filter(c=>c!==s);d.splice(h,0,s);const m=d.map(c=>[c,c===s?l:this.get(c)]);this.clear();for(const[c,_]of m)this.set(c,_);return this}with(r,s,l){const f=new Kn(this);return f.insert(r,s,l),f}before(r){const s=un(this,Nt).indexOf(r)-1;if(!(s<0))return this.entryAt(s)}setBefore(r,s,l){const f=un(this,Nt).indexOf(r);if(f===-1)return this;const p=un(this,Nt).indexOf(s),a=p!==-1&&p<f?f-1:f;return this.insert(a,s,l)}after(r){let s=un(this,Nt).indexOf(r);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(r,s,l){const f=un(this,Nt).indexOf(r);if(f===-1)return this;const p=un(this,Nt).indexOf(s),a=p!==-1&&p<=f?f:f+1;return this.insert(a,s,l)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ep(this,Nt,[]),super.clear()}delete(r){const s=super.delete(r);return s&&un(this,Nt).splice(un(this,Nt).indexOf(r),1),s}deleteAt(r){const s=this.keyAt(r);return s!==void 0?this.delete(s):!1}at(r){const s=Ku(un(this,Nt),r);if(s!==void 0)return this.get(s)}entryAt(r){const s=Ku(un(this,Nt),r);if(s!==void 0)return[s,this.get(s)]}indexOf(r){return un(this,Nt).indexOf(r)}keyAt(r){return Ku(un(this,Nt),r)}from(r,s){const l=this.indexOf(r);if(l===-1)return;let f=l+s;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.at(f)}keyFrom(r,s){const l=this.indexOf(r);if(l===-1)return;let f=l+s;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.keyAt(f)}find(r,s){let l=0;for(const f of this){if(Reflect.apply(r,s,[f,l,this]))return f;l++}}findIndex(r,s){let l=0;for(const f of this){if(Reflect.apply(r,s,[f,l,this]))return l;l++}return-1}filter(r,s){const l=[];let f=0;for(const p of this)Reflect.apply(r,s,[p,f,this])&&l.push(p),f++;return new Kn(l)}map(r,s){const l=[];let f=0;for(const p of this)l.push([p[0],Reflect.apply(r,s,[p,f,this])]),f++;return new Kn(l)}reduce(...r){const[s,l]=r,f=r.length>1;if(!f&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=0,a=l;for(const h of this)p===0&&!f?a=h:a=Reflect.apply(s,this,[a,h,p,this]),p++;return a}reduceRight(...r){const[s,l]=r,f=r.length>1;if(!f&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=l;for(let a=this.size-1;a>=0;a--){const h=this.entryAt(a);a===this.size-1&&!f?p=h:p=Reflect.apply(s,this,[p,h,a,this])}return p}sort(r){if(typeof r!="function")throw new TypeError("OrderedDict.sort requires a compare function");const s=[...this.entries()].sort(r);this.clear();for(const[l,f]of s)this.set(l,f);return this}toSorted(r){if(typeof r!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const s=[...this.entries()].sort(r);return new Kn(s)}toReversed(){const r=new Kn;for(let s=this.size-1;s>=0;s--){const l=this.keyAt(s),f=this.get(l);r.set(l,f)}return r}toSpliced(...r){const s=[...this.entries()];return s.splice(...r),new Kn(s)}slice(r,s){const l=new Kn;for(const f of un(this,Nt).slice(r,s))l.set(f,this.get(f));return l}every(r,s){let l=0;for(const f of this){if(!Reflect.apply(r,s,[f,l,this]))return!1;l++}return!0}some(r,s){let l=0;for(const f of this){if(Reflect.apply(r,s,[f,l,this]))return!0;l++}return!1}},Nt=new WeakMap,Yt(Kn,"OrderedDict"),Kn);function Ku(e,i){if("at"in Array.prototype)return Array.prototype.at.call(e,i);const r=uC(e,i);return r===-1?void 0:e[r]}Yt(Ku,"at");function uC(e,i){const r=e.length,s=zg(i),l=s>=0?s:r+s;return l<0||l>=r?-1:l}Yt(uC,"toSafeIndex");function zg(e){return e!==e||e===0?0:Math.trunc(e)}Yt(zg,"toSafeInteger");function y6(e){const i=e+"CollectionProvider",[r,s]=br(i),[l,f]=r(i);l.displayName=e+"CollectionStableContextProvider";const[p,a]=r(i);p.displayName=e+"CollectionStatefulContextProvider";const h=Yt(({state:R,...D})=>R?v.jsx(m,{...D,state:R}):v.jsx(d,{...D}),"CollectionProvider");h.displayName=i;const d=Yt(R=>{const D=S();return v.jsx(m,{...R,state:D})},"CollectionInit");d.displayName=e+"CollectionInit";const m=Yt(R=>{const{scope:D,children:A,state:j}=R,M=P.useRef(null),[I,B]=P.useState(null),H=ht(M,B),[U,W]=j,Y=P.useRef(new Iu),Q=P.useCallback(()=>{const K=Y.current;return fC(K)||K.sort(Qu),K},[]);return P.useEffect(()=>{if(!I)return;const K=pC(()=>{W(z=>{const O=z.toSorted(Qu);return O.some(([Z],F)=>z.keyAt(F)!==Z)?O:z})});return K.observe(I,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[I,W]),v.jsx(l,{scope:D,collectionElementRef:H,collectionElementRefObject:M,getCollection:Q,setCollection:W,registryRef:Y,children:v.jsx(p,{scope:D,collectionElement:I,collection:U,children:A})})},"CollectionProviderImpl");m.displayName=e+"CollectionProviderImpl";const c=e+"CollectionSlot",_=gr(c),x=P.forwardRef((R,D)=>{const{scope:A,children:j}=R,M=f(c,A),I=ht(D,M.collectionElementRef);return v.jsx(_,{ref:I,children:j})});x.displayName=c;const E=e+"CollectionItemSlot",w="data-radix-collection-item",g=gr(E),b=P.forwardRef((R,D)=>{const{scope:A,children:j,...M}=R,I=P.useRef(null),B=f(E,A),{setCollection:H,registryRef:U}=B,W=P.useRef(M);hC(W.current,M)||(W.current=M);const Y=W.current,Q=P.useCallback(O=>{const G=U.current;O?G.set(O,{...W.current,element:O}):I.current&&G.delete(I.current)},[U]),K=ht(D,Q,I);$t(()=>{const O=I.current,G=U.current;O&&G.has(O)&&G.set(O,{...Y,element:O})},[Y,U]);const z=P.useRef(null);return P.useEffect(()=>{const O=I.current,G=z.current;((G==null?void 0:G.element)??null)===O&&(!O||(G==null?void 0:G.itemData)===Y)||(z.current=O?{element:O,itemData:Y}:null,H(Z=>{const F=new Iu(Z);return G&&G.element!==O&&F.delete(G.element),O&&F.set(O,{...Y,element:O}),F.sort(Qu)}))}),P.useEffect(()=>()=>{const O=z.current;z.current=null,O&&H(G=>{if(!G.has(O.element))return G;const Z=new Iu(G);return Z.delete(O.element),Z})},[H]),v.jsx(g,{[w]:"",ref:K,children:j})});b.displayName=E;function S(){return P.useState(new Iu)}Yt(S,"useInitCollection");function y(R){const{collection:D}=a(e+"CollectionConsumer",R);return D}Yt(y,"useCollection");function T(R){const{getCollection:D}=f(e+"CollectionConsumer",R);return D}return Yt(T,"useGetCollection"),[{Provider:h,Slot:x,ItemSlot:b},{createCollectionScope:s,useCollection:y,useGetCollection:T,useInitCollection:S}]}Yt(y6,"createCollection");function hC(e,i){if(e===i)return!0;if(typeof e!="object"||typeof i!="object"||e==null||i==null)return!1;const r=Object.keys(e),s=Object.keys(i);if(r.length!==s.length)return!1;for(const l of r)if(!Object.prototype.hasOwnProperty.call(i,l)||e[l]!==i[l])return!1;return!0}Yt(hC,"shallowEqual");function dC(e,i){return!!(i.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Yt(dC,"isElementPreceding");function fC(e){let i;for(const r of e.keys()){if(i){const s=i.compareDocumentPosition(r);if(!(s&Node.DOCUMENT_POSITION_DISCONNECTED)&&s&Node.DOCUMENT_POSITION_PRECEDING)return!1}i=r}return!0}Yt(fC,"isInDocumentOrder");function Qu(e,i){return!e[1].element||!i[1].element?0:dC(e[1].element,i[1].element)?-1:1}Yt(Qu,"sortByDocumentPosition");function pC(e){return new MutationObserver(r=>{for(const s of r)if(s.type==="childList"){e();return}})}Yt(pC,"getChildListObserver");var b6=Object.defineProperty,S6=(e,i)=>b6(e,"name",{value:i,configurable:!0}),w6={LTR:"ltr"},C6=P.createContext(void 0);function mC(e){const i=P.useContext(C6);return e||i||w6.LTR}S6(mC,"useDirection");var E6=Object.defineProperty,k6=(e,i)=>E6(e,"name",{value:i,configurable:!0}),gC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),T6=P.forwardRef(k6(function(i,r){return v.jsx(wt.span,{...i,ref:r,style:{...gC,...i.style}})},"VisuallyHidden")),R6=Object.defineProperty,mt=(e,i)=>R6(e,"name",{value:i,configurable:!0}),Uy={ItemAligned:"item-aligned",Popper:"popper"},A6={RTL:"rtl"},L6=[" ","Enter","ArrowUp","ArrowDown"],D6=[" ","Enter"],ha="Select",[jh,Hg,M6]=cC(ha),[Zs,sB]=br(ha,[M6,Sa]),Fg=Sa(),[j6,ps]=Zs(ha),[O6,N6]=Zs(ha);function vC(e){const{__scopeSelect:i,children:r,open:s,defaultOpen:l,onOpenChange:f,value:p,defaultValue:a,onValueChange:h,dir:d,name:m,autoComplete:c,disabled:_,required:x,form:E,internal_do_not_use_render:w}=e,g=Fg(i),[b,S]=P.useState(null),[y,T]=P.useState(null),[L,R]=P.useState(!1),D=mC(d),[A,j]=Ws({prop:s,defaultProp:l??!1,onChange:f,caller:ha}),[M,I]=Ws({prop:p,defaultProp:a,onChange:h,caller:ha}),B=P.useRef(null),H=P.useRef(!1),[U,W]=P.useState(null),Y=mt(le=>{W({value:le,hasConsumerStoppedPropagation:H.current}),I(le)},"handleUserSelect"),Q=P.useRef(M);P.useEffect(()=>{const le=E?b==null?void 0:b.ownerDocument.getElementById(E):b==null?void 0:b.form;if(le instanceof HTMLFormElement){const X=mt(()=>I(Q.current),"reset");return le.addEventListener("reset",X),()=>le.removeEventListener("reset",X)}},[E,b,I]);const K=b?!!E||!!b.closest("form"):!0,[z,O]=P.useState(new Set),G=Fi(),Z=Array.from(z).map(le=>le.props.value).join(";"),F=P.useCallback(le=>{O(X=>new Set(X).add(le))},[]),V=P.useCallback(le=>{O(X=>{const $=new Set(X);return $.delete(le),$})},[]),ne={required:x,trigger:b,onTriggerChange:S,valueNode:y,onValueNodeChange:T,valueNodeHasChildren:L,onValueNodeHasChildrenChange:R,contentId:G,value:M,onValueChange:I,hasConsumerStoppedPropagationRef:H,userSelection:U,onUserSelect:Y,open:A,onOpenChange:j,dir:D,triggerPointerDownPosRef:B,disabled:_,name:m,autoComplete:c,form:E,nativeOptions:z,nativeSelectKey:Z,isFormControl:K};return v.jsx(Dg,{...g,children:v.jsx(j6,{scope:i,...ne,children:v.jsx(jh.Provider,{scope:i,children:v.jsx(O6,{scope:i,onNativeOptionAdd:F,onNativeOptionRemove:V,children:yC(w)?w(ne):r})})})})}mt(vC,"SelectProvider");var B6=mt(e=>{const{__scopeSelect:i,children:r,...s}=e;return v.jsx(vC,{__scopeSelect:i,...s,internal_do_not_use_render:({isFormControl:l})=>v.jsxs(v.Fragment,{children:[r,l?v.jsx(aL,{__scopeSelect:i}):null]})})},"Select"),P6="SelectTrigger",I6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,disabled:l=!1,...f}=i,p=Fg(s),a=ps(P6,s),h=a.disabled||l,d=ht(r,a.onTriggerChange),m=Hg(s),c=P.useRef("touch"),[_,x,E]=Ug(g=>{const b=m().filter(T=>!T.disabled),S=b.find(T=>T.value===a.value),y=$g(b,g,S);y!==void 0&&a.onUserSelect(y.value)}),w=mt(g=>{h||(a.onOpenChange(!0),E()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})},"handleOpen");return v.jsx(Mg,{asChild:!0,...p,children:v.jsx(wt.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Ql(a.value)?"":void 0,...f,ref:d,onClick:tt(f.onClick,g=>{g.currentTarget.focus(),c.current!=="mouse"&&w(g)}),onPointerDown:tt(f.onPointerDown,g=>{c.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(w(g),g.preventDefault())}),onKeyDown:tt(f.onKeyDown,g=>{const b=_.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&(a.hasConsumerStoppedPropagationRef.current=g.isPropagationStopped(),x(g.key)),!(b&&g.key===" ")&&L6.includes(g.key)&&(w(),g.preventDefault())})})})},"SelectTrigger")),z6="SelectValue",H6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:f,children:p,placeholder:a="",...h}=i,d=ps(z6,s),{onValueNodeHasChildrenChange:m}=d,c=p!==void 0,_=ht(r,d.onValueNodeChange);$t(()=>{m(c)},[m,c]);const x=Ql(d.value);return v.jsx(wt.span,{...h,asChild:x?!1:h.asChild,ref:_,style:{pointerEvents:"none"},children:v.jsx(P.Fragment,{children:x?a:p},x?"placeholder":"value")})},"SelectValue")),F6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,...f}=i;return v.jsx(wt.span,{"aria-hidden":!0,...f,ref:r,children:l||"▼"})},"SelectIcon")),U6="SelectPortal",[$6,q6]=Zs(U6,{forceMount:void 0}),V6=mt(e=>{const{__scopeSelect:i,forceMount:r,...s}=e;return v.jsx($6,{scope:e.__scopeSelect,forceMount:r,children:v.jsx(wh,{asChild:!0,...s})})},"SelectPortal"),Xs="SelectContent",W6=P.forwardRef(mt(function(i,r){const s=q6(Xs,i.__scopeSelect),{forceMount:l=s.forceMount,...f}=i,p=ps(Xs,i.__scopeSelect),[a,h]=P.useState();return $t(()=>{h(new DocumentFragment)},[]),v.jsx(Sr,{present:l||p.open,children:({present:d})=>d?v.jsx(X6,{...f,ref:r}):v.jsx(G6,{...f,fragment:a})})},"SelectContent")),G6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,fragment:f}=i;return f?Xl.createPortal(v.jsx(_C,{scope:s,children:v.jsx(jh.Slot,{scope:s,children:v.jsx("div",{ref:r,children:l})})}),f):null},"SelectContentFragment")),bi=10,[_C,Oh]=Zs(Xs),Y6=gr("SelectContent.RemoveScroll"),X6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s}=i,{position:l=Uy.ItemAligned,onCloseAutoFocus:f,onEscapeKeyDown:p,onPointerDownOutside:a,side:h,sideOffset:d,align:m,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:E,sticky:w,hideWhenDetached:g,avoidCollisions:b,...S}=i,y=ps(Xs,s),[T,L]=P.useState(null),[R,D]=P.useState(null),A=ht(r,L),[j,M]=P.useState(null),[I,B]=P.useState(null),H=Hg(s),[U,W]=P.useState(!1),Y=P.useRef(!1),Q=P.useRef(!1),K=P.useRef(!1);P.useEffect(()=>{if(T)return Sg(T)},[T]),Kl();const z=P.useCallback(ee=>{const[ue,...he]=H().map(Re=>Re.ref.current),[we]=he.slice(-1),Se=document.activeElement;for(const Re of ee)if(Re===Se||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ue&&R&&(R.scrollTop=0),Re===we&&R&&(R.scrollTop=R.scrollHeight),Re==null||Re.focus(),document.activeElement!==Se))return},[H,R]),O=P.useCallback(()=>z([j,T]),[z,j,T]);P.useEffect(()=>{U&&O()},[U,O]);const{onOpenChange:G,triggerPointerDownPosRef:Z}=y;P.useEffect(()=>{if(T){let ee={x:0,y:0};const ue=mt(we=>{var Se,Re;ee={x:Math.abs(Math.round(we.pageX)-(((Se=Z.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(we.pageY)-(((Re=Z.current)==null?void 0:Re.y)??0))}},"handlePointerMove"),he=mt(we=>{ee.x<=10&&ee.y<=10?we.preventDefault():we.composedPath().includes(T)||G(!1),document.removeEventListener("pointermove",ue),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",he,{capture:!0})}}},[T,G,Z]),P.useEffect(()=>{const ee=mt(()=>G(!1),"close");return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[G]);const[F,V]=Ug(ee=>{const ue=H().filter(Se=>!Se.disabled),he=ue.find(Se=>Se.ref.current===document.activeElement),we=$g(ue,ee,he);we&&setTimeout(()=>{var Se;return(Se=we.ref.current)==null?void 0:Se.focus()})}),ne=P.useCallback((ee,ue,he)=>{const we=!Q.current;we&&(Q.current=!0);const Se=!Y.current&&!he;y.value!==void 0&&y.value===ue||Se?(M(ee),Se&&(Y.current=!0)):we&&M(ee)},[y.value]),le=P.useCallback(()=>T==null?void 0:T.focus(),[T]),X=P.useCallback((ee,ue,he)=>{if(!ee)return;const we=!K.current;we&&(K.current=!0);const Se=!Y.current&&!he;(y.value!==void 0&&y.value===ue||Se||we)&&B(ee)},[y.value]),$=l===Uy.Popper?$y:K6,oe=$===$y?{side:h,sideOffset:d,align:m,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:E,sticky:w,hideWhenDetached:g,avoidCollisions:b}:{};return v.jsx(_C,{scope:s,content:T,viewport:R,onViewportChange:D,itemRefCallback:ne,selectedItem:j,onItemLeave:le,itemTextRefCallback:X,focusSelectedItem:O,selectedItemText:I,position:l,isPositioned:U,searchRef:F,children:v.jsx(Eh,{as:Y6,allowPinchZoom:!0,children:v.jsx(gg,{asChild:!0,trapped:y.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:tt(f,ee=>{var ue;(ue=y.trigger)==null||ue.focus({preventScroll:!0}),ee.preventDefault()}),children:v.jsx(Sh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:a,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:v.jsx($,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:ee=>ee.preventDefault(),...S,...oe,onPlaced:()=>W(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:tt(S.onKeyDown,ee=>{const ue=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ue&&ee.key.length===1&&V(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let we=H().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const Se=ee.target,Re=we.indexOf(Se);we=we.slice(Re+1)}setTimeout(()=>z(we)),ee.preventDefault()}})})})})})})},"SelectContentImpl")),K6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,onPlaced:l,...f}=i,p=ps(Xs,s),a=Oh(Xs,s),[h,d]=P.useState(null),[m,c]=P.useState(null),_=ht(r,c),x=Hg(s),E=P.useRef(!1),w=P.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:S,focusSelectedItem:y}=a,T=P.useCallback(()=>{if(p.trigger&&p.valueNode&&h&&m&&g&&b&&S){const A=p.trigger.getBoundingClientRect(),j=m.getBoundingClientRect(),M=p.valueNode.getBoundingClientRect(),I=S.getBoundingClientRect();if(p.dir!==A6.RTL){const he=I.left-j.left,we=M.left-he,Se=A.left-we,Re=A.width+Se,qe=Math.max(Re,j.width),ke=window.innerWidth-bi,ze=Mm(we,[bi,Math.max(bi,ke-qe)]);h.style.minWidth=Re+"px",h.style.left=ze+"px"}else{const he=j.right-I.right,we=window.innerWidth-M.right-he,Se=window.innerWidth-A.right-we,Re=A.width+Se,qe=Math.max(Re,j.width),ke=window.innerWidth-bi,ze=Mm(we,[bi,Math.max(bi,ke-qe)]);h.style.minWidth=Re+"px",h.style.right=ze+"px"}const B=x(),H=window.innerHeight-bi*2,U=g.scrollHeight,W=window.getComputedStyle(m),Y=parseInt(W.borderTopWidth,10),Q=parseInt(W.paddingTop,10),K=parseInt(W.borderBottomWidth,10),z=parseInt(W.paddingBottom,10),O=Y+Q+U+z+K,G=Math.min(b.offsetHeight*5,O),Z=window.getComputedStyle(g),F=parseInt(Z.paddingTop,10),V=parseInt(Z.paddingBottom,10),ne=A.top+A.height/2-bi,le=H-ne,X=b.offsetHeight/2,$=b.offsetTop+X,oe=Y+Q+$,ee=O-oe;if(oe<=ne){const he=B.length>0&&b===B[B.length-1].ref.current;h.style.bottom="0px";const we=m.clientHeight-g.offsetTop-g.offsetHeight,Se=Math.max(le,X+(he?V:0)+we+K),Re=oe+Se;h.style.height=Re+"px"}else{const he=B.length>0&&b===B[0].ref.current;h.style.top="0px";const Se=Math.max(ne,Y+g.offsetTop+(he?F:0)+X)+ee;h.style.height=Se+"px",g.scrollTop=oe-ne+g.offsetTop}h.style.margin=`${bi}px 0`,h.style.minHeight=G+"px",h.style.maxHeight=H+"px",l==null||l(),requestAnimationFrame(()=>E.current=!0)}},[x,p.trigger,p.valueNode,h,m,g,b,S,p.dir,l]);$t(()=>T(),[T]);const[L,R]=P.useState();$t(()=>{m&&R(window.getComputedStyle(m).zIndex)},[m]);const D=P.useCallback(A=>{A&&w.current===!0&&(T(),y==null||y(),w.current=!1)},[T,y]);return v.jsx(Q6,{scope:s,contentWrapper:h,shouldExpandOnScrollRef:E,onScrollButtonChange:D,children:v.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:v.jsx(wt.div,{...f,ref:_,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),$y=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,align:l="start",collisionPadding:f=bi,...p}=i,a=Fg(s);return v.jsx(jg,{...a,...p,ref:r,align:l,collisionPadding:f,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[Q6,Z6]=Zs(Xs,{}),qy="SelectViewport",J6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,nonce:l,...f}=i,p=Oh(qy,s),a=Z6(qy,s),h=ht(r,p.onViewportChange),d=P.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),v.jsx(jh.Slot,{scope:s,children:v.jsx(wt.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:tt(f.onScroll,m=>{const c=m.currentTarget,{contentWrapper:_,shouldExpandOnScrollRef:x}=a;if(x!=null&&x.current&&_){const E=Math.abs(d.current-c.scrollTop);if(E>0){const w=window.innerHeight-bi*2,g=parseFloat(_.style.minHeight),b=parseFloat(_.style.height),S=Math.max(g,b);if(S<w){const y=S+E,T=Math.min(w,y),L=y-T;_.style.height=T+"px",_.style.bottom==="0px"&&(c.scrollTop=L>0?L:0,_.style.justifyContent="flex-end")}}}d.current=c.scrollTop})})})]})},"SelectViewport")),eL="SelectGroup",[oB,aB]=Zs(eL),jm="SelectItem",[tL,xC]=Zs(jm),nL=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,value:l,disabled:f=!1,textValue:p,...a}=i,h=ps(jm,s),d=Oh(jm,s),m=h.value===l,[c,_]=P.useState(p??""),[x,E]=P.useState(!1),w=Ui(T=>{var L;return(L=d.itemRefCallback)==null?void 0:L.call(d,T,l,f)}),g=ht(r,w),b=Fi(),S=P.useRef("touch");function y(T){h.hasConsumerStoppedPropagationRef.current=T.isPropagationStopped(),h.onUserSelect(l),h.onOpenChange(!1)}return mt(y,"handleSelect"),v.jsx(tL,{scope:s,value:l,disabled:f,textId:b,isSelected:m,onItemTextChange:P.useCallback(T=>{_(L=>L||((T==null?void 0:T.textContent)??"").trim())},[]),children:v.jsx(jh.ItemSlot,{scope:s,value:l,disabled:f,textValue:c,children:v.jsx(wt.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...a,ref:g,onFocus:tt(a.onFocus,()=>E(!0)),onBlur:tt(a.onBlur,()=>E(!1)),onClick:tt(a.onClick,T=>{f||S.current!=="mouse"&&y(T)}),onPointerUp:tt(a.onPointerUp,T=>{f||S.current==="mouse"&&y(T)}),onPointerDown:tt(a.onPointerDown,T=>{S.current=T.pointerType}),onPointerMove:tt(a.onPointerMove,T=>{var L;S.current=T.pointerType,f?(L=d.onItemLeave)==null||L.call(d):S.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:tt(a.onPointerLeave,T=>{var L;T.currentTarget===document.activeElement&&((L=d.onItemLeave)==null||L.call(d))}),onKeyDown:tt(a.onKeyDown,T=>{var R;f||T.target!==T.currentTarget||((R=d.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(D6.includes(T.key)&&y(T),T.key===" "&&T.preventDefault())})})})})},"SelectItem")),zu="SelectItemText",iL=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:f,...p}=i,a=ps(zu,s),h=Oh(zu,s),d=xC(zu,s),m=N6(zu,s),[c,_]=P.useState(null),x=Ui(y=>{var T;return(T=h.itemTextRefCallback)==null?void 0:T.call(h,y,d.value,d.disabled)}),E=ht(r,_,d.onItemTextChange,x),w=c==null?void 0:c.textContent,g=P.useMemo(()=>v.jsx("option",{value:d.value,disabled:d.disabled,children:w},d.value),[d.disabled,d.value,w]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=m;return $t(()=>(b(g),()=>S(g)),[b,S,g]),v.jsxs(v.Fragment,{children:[v.jsx(wt.span,{id:d.textId,...p,ref:E}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Ql(a.value)?Xl.createPortal(p.children,a.valueNode):null]})},"SelectItemText")),rL="SelectItemIndicator",sL=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,...l}=i;return xC(rL,s).isSelected?v.jsx(wt.span,{"aria-hidden":!0,...l,ref:r}):null},"SelectItemIndicator")),oL="SelectBubbleInput",aL=P.forwardRef(mt(function({__scopeSelect:i,...r},s){const l=ps(oL,i),{value:f,onValueChange:p,required:a,disabled:h,name:d,autoComplete:m,form:c,userSelection:_}=l,{nativeOptions:x,nativeSelectKey:E}=l,w=P.useRef(null),g=ht(s,w),b=f??"",S=P.useRef(b),y=P.useRef(_),T=P.useRef(!1),L=Array.from(x).some(R=>(R.props.value??"")==="");return P.useEffect(()=>{const R=w.current;if(!R)return;const D=window.HTMLSelectElement.prototype,j=Object.getOwnPropertyDescriptor(D,"value").set,M=_!==null&&_!==y.current;y.current=_;const I=S.current!==b;S.current=b;const B=M&&I;if(M&&!I&&_.value!==b&&!_.hasConsumerStoppedPropagation&&j){T.current=!0;try{j.call(R,_.value),R.dispatchEvent(new Event("change",{bubbles:!0}))}finally{T.current=!1,j.call(R,b)}return}const H=B&&!_.hasConsumerStoppedPropagation;if(I&&j){const U=new Event("change",{bubbles:H});j.call(R,b),R.dispatchEvent(U)}},[b,_]),v.jsxs(wt.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:d,autoComplete:m,disabled:h,form:c,onChange:R=>{T.current||p(R.target.value)},...r,style:{...gC,...r.style},ref:g,defaultValue:b,children:[Ql(f)&&!L?v.jsx("option",{value:""}):null,Array.from(x)]},E)},"SelectBubbleInput"));function yC(e){return typeof e=="function"}mt(yC,"isFunction");function Ql(e){return e===""||e===void 0}mt(Ql,"shouldShowPlaceholder");function Ug(e){const i=Ui(e),r=P.useRef(""),s=P.useRef(0),l=P.useCallback(p=>{const a=r.current+p;i(a);function h(d){r.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>h(""),1e3))}mt(h,"updateSearch"),h(a)},[i]),f=P.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,l,f]}mt(Ug,"useTypeaheadSearch");function $g(e,i,r){const l=i.length>1&&Array.from(i).every(d=>d===i[0])?i[0]:i,f=r?e.indexOf(r):-1;let p=bC(e,Math.max(f,0));l.length===1&&(p=p.filter(d=>d!==r));const h=p.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==r?h:void 0}mt($g,"findNextItem");function bC(e,i){return e.map((r,s)=>e[(i+s)%e.length])}mt(bC,"wrapArray");const SC="__empty__",wC=e=>e===""?SC:e,lL=e=>e===SC?"":e;function ia({value:e,onValueChange:i,placeholder:r,size:s="sm",disabled:l,className:f,children:p}){return v.jsxs(B6,{value:wC(e),onValueChange:a=>i(lL(a)),disabled:l,children:[v.jsxs(I6,{className:xe("flex w-full select-none items-center justify-between rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","data-[placeholder]:text-muted-foreground/60",s==="sm"?"gap-1 px-2 py-1.5 text-xs":"gap-2 px-3 py-2 text-sm",f),children:[v.jsx(H6,{placeholder:r}),v.jsx(F6,{asChild:!0,children:v.jsx(ql,{className:xe("shrink-0 text-muted-foreground",s==="sm"?"h-3 w-3":"h-4 w-4")})})]}),v.jsx(V6,{children:v.jsx(W6,{position:"popper",sideOffset:4,className:xe("z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden","rounded-lg border bg-card shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:v.jsx(J6,{className:"p-1",children:p})})})]})}const Cn=P.forwardRef(({value:e,children:i,className:r},s)=>v.jsxs(nL,{ref:s,value:wC(e),className:xe("relative flex w-full cursor-pointer select-none items-center rounded","px-2 py-1.5 pr-7 text-xs outline-none","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),children:[v.jsx(iL,{children:i}),v.jsx(sL,{className:"absolute right-2 flex items-center justify-center",children:v.jsx($l,{className:"h-3 w-3 text-foreground"})})]}));Cn.displayName="SelectItem";const qg=P.forwardRef(({className:e,size:i="sm",...r},s)=>v.jsx("textarea",{ref:s,className:xe("w-full resize-y rounded border bg-transparent font-serif leading-relaxed","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));qg.displayName="Textarea";const Vy={manual:"Manual: ask before edits and commands",default:"Default (older name of Manual)",acceptEdits:"Accept edits: ask only for commands",plan:"Plan: read and plan, change nothing",auto:"Auto: a classifier decides what to ask",dontAsk:"Don't ask: deny what is not allowed",bypassPermissions:"Bypass: never ask"},cL=["default","fable","opus","sonnet","haiku","opus[1m]","sonnet[1m]","claude-fable-5-1","claude-opus-5-5","claude-sonnet-5-5","claude-haiku-5-5"],Hu="";function uL(){var _,x;const e=ut(()=>ve.claudeSettings(),[]),[i,r]=P.useState(null),[s,l]=P.useState(""),[f,p]=P.useState(""),[a,h]=P.useState("");P.useEffect(()=>{if(!e.data)return;const E=e.data.settings;r(E),l(E.model),p(E.fallbackModel),h(E.addDirs.join(`
506
- `))},[e.data]);const d=async E=>{const w=await rt(()=>ve.saveClaudeSettings(E),"Saved. New sessions use it.");w&&r(w)},m=((_=e.data)==null?void 0:_.permissionModes)??[],c=((x=e.data)==null?void 0:x.efforts)??[];return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Settings",title:"Claude settings",description:"How the hub starts claude. Applies to sessions started from now on; empty keeps your own Claude Code setting."}),i&&v.jsxs(v.Fragment,{children:[v.jsx(Dt,{title:"Permissions",description:"Which mode a session starts in.",children:v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Hs,{label:"Sessions you open",hint:"New session, resumes and hub tasks.",children:v.jsxs(ia,{value:i.permissionMode,onValueChange:E=>void d({permissionMode:E}),children:[v.jsx(Cn,{value:Hu,children:"Your Claude Code setting"}),m.map(E=>v.jsx(Cn,{value:E,children:Vy[E]??E},E))]})}),v.jsx(Hs,{label:"Unattended runs",hint:"Cron, webhook and queued runs. Their questions go to the channels.",children:v.jsxs(ia,{value:i.runPermissionMode,onValueChange:E=>void d({runPermissionMode:E}),children:[v.jsx(Cn,{value:Hu,children:"Your Claude Code setting"}),m.map(E=>v.jsx(Cn,{value:E,children:Vy[E]??E},E))]})})]})}),v.jsxs(Dt,{title:"Model",description:"An alias or a full model id.",children:[v.jsx("datalist",{id:"claude-models",children:cL.map(E=>v.jsx("option",{value:E},E))}),v.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[v.jsx(Hs,{label:"Model",children:v.jsx(pi,{list:"claude-models",value:s,placeholder:"Your Claude Code setting",onChange:E=>l(E.target.value),onBlur:()=>s!==i.model&&void d({model:s.trim()})})}),v.jsx(Hs,{label:"Fallback model",hint:"Used when the model is overloaded.",children:v.jsx(pi,{list:"claude-models",value:f,placeholder:"None",onChange:E=>p(E.target.value),onBlur:()=>f!==i.fallbackModel&&void d({fallbackModel:f.trim()})})}),v.jsx(Hs,{label:"Effort",children:v.jsxs(ia,{value:i.effort,onValueChange:E=>void d({effort:E}),children:[v.jsx(Cn,{value:Hu,children:"Your Claude Code setting"}),c.map(E=>v.jsx(Cn,{value:E,children:E},E))]})})]})]}),v.jsx(Dt,{title:"Access",description:"What else a session can reach.",children:v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Hs,{label:"Extra directories",hint:"One path per line, passed as --add-dir.",children:v.jsx(qg,{rows:3,className:"font-mono",value:a,placeholder:"C:\\Source code\\shared-lib",onChange:E=>h(E.target.value),onBlur:()=>a!==i.addDirs.join(`
505
+ `)},uR=0,Ko=[];function hR(e){var i=P.useRef([]),r=P.useRef([0,0]),s=P.useRef(),l=P.useState(uR++)[0],f=P.useState(bw)[0],p=P.useRef(e);P.useEffect(function(){p.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=MT([e.lockRef.current],(e.shards||[]).map(ky),!0).filter(Boolean);return w.forEach(function(g){return g.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(w,g){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!p.current.allowPinchZoom;var b=Ou(w),S=r.current,y="deltaX"in w?w.deltaX:S[0]-b[0],T="deltaY"in w?w.deltaY:S[1]-b[1],L,R=w.target,D=Math.abs(y)>Math.abs(T)?"h":"v";if("touches"in w&&D==="h"&&R.type==="range")return!1;var A=window.getSelection(),j=A&&A.anchorNode,M=j?j===R||j.contains(R):!1;if(M)return!1;var I=Cy(D,R);if(!I)return!0;if(I?L=D:(L=D==="v"?"h":"v",I=Cy(D,R)),!I)return!1;if(!s.current&&"changedTouches"in w&&(y||T)&&(s.current=L),!L)return!0;var B=s.current||L;return aR(B,g,w,B==="h"?y:T)},[]),h=P.useCallback(function(w){var g=w;if(!(!Ko.length||Ko[Ko.length-1]!==f)){var b="deltaY"in g?Ey(g):Ou(g),S=i.current.filter(function(L){return L.name===g.type&&(L.target===g.target||g.target===L.shadowParent)&&lR(L.delta,b)})[0];if(S&&S.should){g.cancelable&&g.preventDefault();return}if(!S){var y=(p.current.shards||[]).map(ky).filter(Boolean).filter(function(L){return L.contains(g.target)}),T=y.length>0?a(g,y[0]):!p.current.noIsolation;T&&g.cancelable&&g.preventDefault()}}},[]),d=P.useCallback(function(w,g,b,S){var y={name:w,delta:g,target:b,should:S,shadowParent:dR(b)};i.current.push(y),setTimeout(function(){i.current=i.current.filter(function(T){return T!==y})},1)},[]),m=P.useCallback(function(w){r.current=Ou(w),s.current=void 0},[]),c=P.useCallback(function(w){d(w.type,Ey(w),w.target,a(w,e.lockRef.current))},[]),_=P.useCallback(function(w){d(w.type,Ou(w),w.target,a(w,e.lockRef.current))},[]);P.useEffect(function(){return Ko.push(f),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:_}),document.addEventListener("wheel",h,Xo),document.addEventListener("touchmove",h,Xo),document.addEventListener("touchstart",m,Xo),function(){Ko=Ko.filter(function(w){return w!==f}),document.removeEventListener("wheel",h,Xo),document.removeEventListener("touchmove",h,Xo),document.removeEventListener("touchstart",m,Xo)}},[]);var x=e.removeScrollBar,E=e.inert;return P.createElement(P.Fragment,null,E?P.createElement(f,{styles:cR(l)}):null,x?P.createElement(eR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dR(e){for(var i=null;e!==null;)e instanceof ShadowRoot&&(i=e.host,e=e.host),e=e.parentNode;return i}const fR=FT(yw,hR);var Eh=P.forwardRef(function(e,i){return P.createElement(Ch,Ii({},e,{ref:i,sideCar:fR}))});Eh.classNames=Ch.classNames;var pR=function(e){if(typeof document>"u")return null;var i=Array.isArray(e)?e[0]:e;return i.ownerDocument.body},Qo=new WeakMap,Nu=new WeakMap,Bu={},zp=0,Ew=function(e){return e&&(e.host||Ew(e.parentNode))},mR=function(e,i){return i.map(function(r){if(e.contains(r))return r;var s=Ew(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},gR=function(e,i,r,s){var l=mR(i,Array.isArray(e)?e:[e]);Bu[r]||(Bu[r]=new WeakMap);var f=Bu[r],p=[],a=new Set,h=new Set(l),d=function(c){!c||a.has(c)||(a.add(c),d(c.parentNode))};l.forEach(d);var m=function(c){!c||h.has(c)||Array.prototype.forEach.call(c.children,function(_){if(a.has(_))m(_);else try{var x=_.getAttribute(s),E=x!==null&&x!=="false",w=(Qo.get(_)||0)+1,g=(f.get(_)||0)+1;Qo.set(_,w),f.set(_,g),p.push(_),w===1&&E&&Nu.set(_,!0),g===1&&_.setAttribute(r,"true"),E||_.setAttribute(s,"true")}catch(b){console.error("aria-hidden: cannot operate on ",_,b)}})};return m(i),a.clear(),zp++,function(){p.forEach(function(c){var _=Qo.get(c)-1,x=f.get(c)-1;Qo.set(c,_),f.set(c,x),_||(Nu.has(c)||c.removeAttribute(s),Nu.delete(c)),x||c.removeAttribute(r)}),zp--,zp||(Qo=new WeakMap,Qo=new WeakMap,Nu=new WeakMap,Bu={})}},Sg=function(e,i,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=pR(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),gR(s,l,r,"aria-hidden")):function(){return null}},vR=Object.defineProperty,Pn=(e,i)=>vR(e,"name",{value:i,configurable:!0}),wg="Dialog",[kw,iB]=br(wg),[_R,Ci]=kw(wg),Tw=Pn(e=>{const{__scopeDialog:i,children:r,open:s,defaultOpen:l,onOpenChange:f,modal:p=!0}=e,a=P.useRef(null),h=P.useRef(null),{nodes:d,registry:m}=_g(),[c,_]=Gs({prop:s,defaultProp:l??!1,onChange:f,caller:wg}),[x,E]=P.useState(0),[w,g]=P.useState(0);return v.jsx(_R,{scope:i,triggerRef:a,contentRef:h,contentId:Fi(),titleId:Fi(),descriptionId:Fi(),titlePresent:x>0,descriptionPresent:w>0,setTitleCount:E,setDescriptionCount:g,open:c,onOpenChange:_,onOpenToggle:P.useCallback(()=>_(b=>!b),[_]),modal:p,branchNodes:d,branchRegistry:m,children:r})},"Dialog"),xR="DialogTrigger",yR=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci(xR,s),p=ht(r,f.triggerRef);return v.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":kh(f.open),...l,ref:p,onClick:tt(i.onClick,f.onOpenToggle)})},"DialogTrigger")),Rw="DialogPortal",[bR,Aw]=kw(Rw,{forceMount:void 0}),Lw=Pn(e=>{const{__scopeDialog:i,forceMount:r,children:s,container:l}=e,f=Ci(Rw,i);return v.jsx(bR,{scope:i,forceMount:r,children:P.Children.map(s,p=>v.jsx(Sr,{present:r||f.open,children:v.jsx(wh,{asChild:!0,container:l,children:p})}))})},"DialogPortal"),Tm="DialogOverlay",Dw=P.forwardRef(Pn(function(i,r){const s=Aw(Tm,i.__scopeDialog),{forceMount:l=s.forceMount,...f}=i,p=Ci(Tm,i.__scopeDialog);return p.modal?v.jsx(Sr,{present:l||p.open,children:v.jsx(wR,{...f,ref:r})}):null},"DialogOverlay")),SR=gr("DialogOverlay.RemoveScroll"),wR=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci(Tm,s),p=rw(),a=ht(r,p);return v.jsx(Eh,{as:SR,allowPinchZoom:!0,shards:P.useMemo(()=>[f.contentRef,...f.branchNodes.map(h=>({current:h}))],[f.contentRef,f.branchNodes]),children:v.jsx(wt.div,{"data-state":kh(f.open),...l,ref:a,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),Ol="DialogContent",Mw=P.forwardRef(Pn(function(i,r){const s=Aw(Ol,i.__scopeDialog),{forceMount:l=s.forceMount,...f}=i,p=Ci(Ol,i.__scopeDialog);return v.jsx(Sr,{present:l||p.open,children:p.modal?v.jsx(CR,{...f,ref:r}):v.jsx(ER,{...f,ref:r})})},"DialogContent")),CR=P.forwardRef(Pn(function(i,r){const s=Ci(Ol,i.__scopeDialog),l=P.useRef(null),f=ht(r,s.contentRef,l);return P.useEffect(()=>{const p=l.current;if(p)return Sg(p)},[]),v.jsx(jw,{...i,ref:f,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:tt(i.onCloseAutoFocus,p=>{var a;p.preventDefault(),(a=s.triggerRef.current)==null||a.focus()}),onPointerDownOutside:tt(i.onPointerDownOutside,p=>{const a=p.detail.originalEvent,h=a.button===0&&a.ctrlKey===!0;(a.button===2||h)&&p.preventDefault()}),onFocusOutside:tt(i.onFocusOutside,p=>p.preventDefault())})},"DialogContentModal")),ER=P.forwardRef(Pn(function(i,r){const s=Ci(Ol,i.__scopeDialog),l=P.useRef(!1),f=P.useRef(!1);return v.jsx(jw,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var a,h;(a=i.onCloseAutoFocus)==null||a.call(i,p),p.defaultPrevented||(l.current||(h=s.triggerRef.current)==null||h.focus(),p.preventDefault()),l.current=!1,f.current=!1},onInteractOutside:p=>{var d,m;(d=i.onInteractOutside)==null||d.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const a=p.target;((m=s.triggerRef.current)==null?void 0:m.contains(a))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&f.current&&p.preventDefault()}})},"DialogContentNonModal")),jw=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,trapFocus:l,onOpenAutoFocus:f,onCloseAutoFocus:p,"aria-describedby":a,children:h,...d}=i,m=Ci(Ol,s);return Kl(),v.jsx(vg,{registry:m.branchRegistry,children:v.jsx(gg,{asChild:!0,loop:!0,trapped:l,branches:m.branchNodes,onMountAutoFocus:f,onUnmountAutoFocus:p,children:v.jsx(Sh,{role:"dialog",id:m.contentId,"aria-labelledby":m.titlePresent?m.titleId:void 0,"aria-describedby":m.descriptionPresent?Pw(a,m.descriptionId):a,"data-state":kh(m.open),...d,ref:r,deferPointerDownOutside:!0,onDismiss:()=>m.onOpenChange(!1),children:h})})})},"DialogContentImpl")),Ow=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci("DialogTitle",s),{setTitleCount:p}=f;return $t(()=>(p(a=>a+1),()=>p(a=>a-1)),[p]),v.jsx(wt.h2,{id:f.titleId,...l,ref:r})},"DialogTitle")),Nw=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci("DialogDescription",s),{setDescriptionCount:p}=f;return $t(()=>(p(a=>a+1),()=>p(a=>a-1)),[p]),v.jsx(wt.p,{id:f.descriptionId,...l,ref:r})},"DialogDescription")),kR="DialogClose",Bw=P.forwardRef(Pn(function(i,r){const{__scopeDialog:s,...l}=i,f=Ci(kR,s);return v.jsx(wt.button,{type:"button",...l,ref:r,onClick:tt(i.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function Pw(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Pn(Pw,"concatAriaDescribedby");function kh(e){return e?"open":"closed"}Pn(kh,"getState");function Iw({open:e,onOpenChange:i,title:r,description:s,children:l,footer:f,headerAction:p,maxWidth:a="max-w-md",height:h,disableOutsideClose:d}){return v.jsx(Tw,{open:e,onOpenChange:i,children:v.jsxs(Lw,{children:[v.jsx(Dw,{className:"fixed inset-0 z-50 bg-foreground/40 animate-in fade-in-0"}),v.jsxs(Mw,{className:`fixed left-1/2 top-1/2 z-50 flex w-[calc(100%-1.5rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl bg-card shadow-xl focus:outline-none animate-in fade-in-0 zoom-in-95 sm:w-[calc(100%-2rem)] ${a} max-h-[calc(100dvh-1.5rem)] sm:max-h-[calc(100dvh-2rem)] ${h??""}`,onInteractOutside:d?m=>m.preventDefault():void 0,children:[v.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-3 px-4 py-4 sm:px-5",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx(Ow,{className:"text-sm font-semibold text-foreground",children:r}),s&&v.jsx(Nw,{className:"mt-0.5 truncate text-xs text-muted-foreground",title:s,children:s})]}),v.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[p,v.jsx(Bw,{asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Close",children:v.jsx(vn,{size:15})})})]})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-4 pt-1 sm:px-5",children:l}),f&&v.jsx("div",{className:"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border px-4 pb-4 pt-3 sm:px-5",children:f})]})]})})}const zw=P.createContext(null);function Ty({children:e}){const[i,r]=P.useState(null),[s,l]=P.useState(!1),f=P.useRef(null),p=P.useCallback(d=>{var m;return(m=f.current)==null||m.call(f,!1),r(d),new Promise(c=>{f.current=c})},[]),a=d=>{var m;(m=f.current)==null||m.call(f,d),f.current=null,r(null),l(!1)},h=async()=>{if(!(i!=null&&i.run))return a(!0);l(!0);try{await i.run(),a(!0)}catch(d){ye.getState().notify(d.message,"error"),l(!1)}};return v.jsxs(zw.Provider,{value:p,children:[e,i&&v.jsx(Iw,{open:!0,onOpenChange:d=>!d&&!s&&a(!1),title:i.title,description:i.description,maxWidth:i.maxWidth??"max-w-md",disableOutsideClose:s,footer:v.jsxs(v.Fragment,{children:[v.jsx(_e,{disabled:s,onClick:()=>a(!1),children:"Cancel"}),v.jsx(_e,{variant:i.tone??"primary",disabled:s,onClick:()=>void h(),autoFocus:!0,children:s?"Working...":i.confirmLabel??"Confirm"})]}),children:i.body})]})}function pn(){const e=P.useContext(zw);if(!e)throw new Error("useConfirm needs a ConfirmProvider above it.");return e}function Nl({text:e,className:i}){const[r,s]=P.useState(!1),l=async f=>{f.stopPropagation();try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return v.jsx("button",{onClick:l,title:`Copy: ${e}`,className:xe("shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",i),children:r?v.jsx($l,{size:11,className:"text-severity-suggestion"}):v.jsx(xh,{size:11})})}function nn({icon:e,title:i,hint:r,variant:s="card",className:l}){return s==="inline"?v.jsx("div",{className:xe("px-2 py-3 text-xs text-muted-foreground",l),children:i}):v.jsxs("div",{className:xe("card flex flex-col items-center gap-1.5 p-8 text-center",l),children:[e&&v.jsx(e,{size:20,className:"text-muted-foreground/60"}),v.jsx("div",{className:"text-sm text-muted-foreground",children:i}),r&&v.jsx("div",{className:"max-w-sm text-xs text-muted-foreground/70",children:r})]})}const TR=["top","right","bottom","left"],cs=Math.min,fr=Math.max,rh=Math.round,Pu=Math.floor,pr=e=>({x:e,y:e}),RR={left:"right",right:"left",bottom:"top",top:"bottom"};function Hw(e,i,r){return fr(e,cs(i,r))}function _r(e,i){return typeof e=="function"?e(i):e}function us(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Cg(e){return e==="x"?"y":"x"}function Eg(e){return e==="y"?"height":"width"}function zi(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function kg(e){return Cg(zi(e))}function AR(e,i,r){r===void 0&&(r=!1);const s=ya(e),l=kg(e),f=Eg(l);let p=l==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return i.reference[f]>i.floating[f]&&(p=sh(p)),[p,sh(p)]}function LR(e){const i=sh(e);return[Rm(e),i,Rm(i)]}function Rm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ry=["left","right"],Ay=["right","left"],DR=["top","bottom"],MR=["bottom","top"];function jR(e,i,r){switch(e){case"top":case"bottom":return r?i?Ay:Ry:i?Ry:Ay;case"left":case"right":return i?DR:MR;default:return[]}}function OR(e,i,r,s){const l=ya(e);let f=jR(us(e),r==="start",s);return l&&(f=f.map(p=>p+"-"+l),i&&(f=f.concat(f.map(Rm)))),f}function sh(e){const i=us(e);return RR[i]+e.slice(i.length)}function NR(e){var i,r,s,l;return{top:(i=e.top)!=null?i:0,right:(r=e.right)!=null?r:0,bottom:(s=e.bottom)!=null?s:0,left:(l=e.left)!=null?l:0}}function Fw(e){return typeof e!="number"?NR(e):{top:e,right:e,bottom:e,left:e}}function oh(e){const{x:i,y:r,width:s,height:l}=e;return{width:s,height:l,top:r,left:i,right:i+s,bottom:r+l,x:i,y:r}}function Ly(e,i,r){let{reference:s,floating:l}=e;const f=zi(i),p=kg(i),a=Eg(p),h=us(i),d=f==="y",m=s.x+s.width/2-l.width/2,c=s.y+s.height/2-l.height/2,_=s[a]/2-l[a]/2;let x;switch(h){case"top":x={x:m,y:s.y-l.height};break;case"bottom":x={x:m,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:c};break;case"left":x={x:s.x-l.width,y:c};break;default:x={x:s.x,y:s.y}}const E=ya(i);return E&&(x[p]+=_*(E==="end"?1:-1)*(r&&d?-1:1)),x}async function BR(e,i){var r;i===void 0&&(i={});const{x:s,y:l,platform:f,rects:p,elements:a,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:c="floating",altBoundary:_=!1,padding:x=0}=_r(i,e),E=Fw(x),g=a[_?c==="floating"?"reference":"floating":c],b=oh(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(g)))==null||r?g:g.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:h})),S=c==="floating"?{x:s,y:l,width:p.floating.width,height:p.floating.height}:p.reference,y=await(f.getOffsetParent==null?void 0:f.getOffsetParent(a.floating)),T=await(f.isElement==null?void 0:f.isElement(y))&&await(f.getScale==null?void 0:f.getScale(y))||{x:1,y:1},L=oh(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:y,strategy:h}):S);return{top:(b.top-L.top+E.top)/T.y,bottom:(L.bottom-b.bottom+E.bottom)/T.y,left:(b.left-L.left+E.left)/T.x,right:(L.right-b.right+E.right)/T.x}}const PR=50,IR=async(e,i,r)=>{const{placement:s="bottom",strategy:l="absolute",middleware:f=[],platform:p}=r,a=p.detectOverflow?p:{...p,detectOverflow:BR},h=await(p.isRTL==null?void 0:p.isRTL(i));let d=await p.getElementRects({reference:e,floating:i,strategy:l}),{x:m,y:c}=Ly(d,s,h),_=s,x=0;const E={};for(let w=0;w<f.length;w++){const g=f[w];if(!g)continue;const{name:b,fn:S}=g,{x:y,y:T,data:L,reset:R}=await S({x:m,y:c,initialPlacement:s,placement:_,strategy:l,middlewareData:E,rects:d,platform:a,elements:{reference:e,floating:i}});m=y??m,c=T??c,E[b]={...E[b],...L},R&&x<PR&&(x++,typeof R=="object"&&(R.placement&&(_=R.placement),R.rects&&(d=R.rects===!0?await p.getElementRects({reference:e,floating:i,strategy:l}):R.rects),{x:m,y:c}=Ly(d,_,h)),w=-1)}return{x:m,y:c,placement:_,strategy:l,middlewareData:E}},zR=e=>({name:"arrow",options:e,async fn(i){const{x:r,y:s,placement:l,rects:f,platform:p,elements:a,middlewareData:h}=i,{element:d,padding:m=0}=_r(e,i)||{};if(d==null)return{};const c=Fw(m),_={x:r,y:s},x=kg(l),E=Eg(x),w=await p.getDimensions(d),g=x==="y",b=g?"top":"left",S=g?"bottom":"right",y=g?"clientHeight":"clientWidth",T=f.reference[E]+f.reference[x]-_[x]-f.floating[E],L=_[x]-f.reference[x],R=await(p.getOffsetParent==null?void 0:p.getOffsetParent(d));let D=R?R[y]:0;(!D||!await(p.isElement==null?void 0:p.isElement(R)))&&(D=a.floating[y]||f.floating[E]);const A=T/2-L/2,j=D/2-w[E]/2-1,M=cs(c[b],j),I=cs(c[S],j),B=D-w[E]-I,H=D/2-w[E]/2+A,U=Hw(M,H,B),W=!h.arrow&&ya(l)!=null&&H!==U&&f.reference[E]/2-(H<M?M:I)-w[E]/2<0,Y=W?H<M?H-M:H-B:0;return{[x]:_[x]+Y,data:{[x]:U,centerOffset:H-U-Y,...W&&{alignmentOffset:Y}},reset:W}}}),HR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var r,s;const{placement:l,middlewareData:f,rects:p,initialPlacement:a,platform:h,elements:d}=i,{mainAxis:m=!0,crossAxis:c=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...g}=_r(e,i);if((r=f.arrow)!=null&&r.alignmentOffset)return{};const b=us(l),S=zi(a),y=us(a)===a,T=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=_||(y||!w?[sh(a)]:LR(a)),R=E!=="none";!_&&R&&L.push(...OR(a,w,E,T));const D=[a,...L],A=await h.detectOverflow(i,g),j=[];let M=((s=f.flip)==null?void 0:s.overflows)||[];if(m&&j.push(A[b]),c){const U=AR(l,p,T);j.push(A[U[0]],A[U[1]])}if(M=[...M,{placement:l,overflows:j}],!j.every(U=>U<=0)){var I,B;const U=(((I=f.flip)==null?void 0:I.index)||0)+1,W=D[U];if(W&&(!(c==="alignment"?S!==zi(W):!1)||M.every(K=>zi(K.placement)===S?K.overflows[0]>0:!0)))return{data:{index:U,overflows:M},reset:{placement:W}};let Y=(B=M.filter(Q=>Q.overflows[0]<=0).sort((Q,K)=>Q.overflows[1]-K.overflows[1])[0])==null?void 0:B.placement;if(!Y)switch(x){case"bestFit":{var H;const Q=(H=M.filter(K=>{if(R){const z=zi(K.placement);return z===S||z==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(z=>z>0).reduce((z,O)=>z+O,0)]).sort((K,z)=>K[1]-z[1])[0])==null?void 0:H[0];Q&&(Y=Q);break}case"initialPlacement":Y=a;break}if(l!==Y)return{reset:{placement:Y}}}return{}}}};function Dy(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function My(e){return TR.some(i=>e[i]>=0)}const FR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:r,platform:s}=i,{strategy:l="referenceHidden",...f}=_r(e,i);switch(l){case"referenceHidden":{const p=await s.detectOverflow(i,{...f,elementContext:"reference"}),a=Dy(p,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:My(a)}}}case"escaped":{const p=await s.detectOverflow(i,{...f,altBoundary:!0}),a=Dy(p,r.floating);return{data:{escapedOffsets:a,escaped:My(a)}}}default:return{}}}}},Uw=new Set(["left","top"]);async function UR(e,i){const{placement:r,platform:s,elements:l}=e,f=await(s.isRTL==null?void 0:s.isRTL(l.floating)),p=us(r),a=ya(r),h=zi(r)==="y",d=Uw.has(p)?-1:1,m=f&&h?-1:1,c=_r(i,e);let{mainAxis:_,crossAxis:x,alignmentAxis:E}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof E=="number"&&(x=a==="end"?E*-1:E),h?{x:x*m,y:_*d}:{x:_*d,y:x*m}}const $R=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var r,s;const{x:l,y:f,placement:p,middlewareData:a}=i,h=await UR(i,e);return p===((r=a.offset)==null?void 0:r.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:l+h.x,y:f+h.y,data:{...h,placement:p}}}}},qR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:r,y:s,placement:l,platform:f}=i,{mainAxis:p=!0,crossAxis:a=!1,limiter:h={fn:S=>{let{x:y,y:T}=S;return{x:y,y:T}}},...d}=_r(e,i),m={x:r,y:s},c=await f.detectOverflow(i,d),_=zi(l),x=Cg(_);let E=m[x],w=m[_];const g=(S,y)=>Hw(y+c[S==="y"?"top":"left"],y,y-c[S==="y"?"bottom":"right"]);p&&(E=g(x,E)),a&&(w=g(_,w));const b=h.fn({...i,[x]:E,[_]:w});return{...b,data:{x:b.x-r,y:b.y-s,enabled:{[x]:p,[_]:a}}}}}},VR=function(e){return e===void 0&&(e={}),{options:e,fn(i){var r,s;const{x:l,y:f,placement:p,rects:a,middlewareData:h}=i,{offset:d=0,mainAxis:m=!0,crossAxis:c=!0}=_r(e,i),_={x:l,y:f},x=zi(p),E=Cg(x);let w=_[E],g=_[x];const b=_r(d,i),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(r=b.mainAxis)!=null?r:0,crossAxis:(s=b.crossAxis)!=null?s:0};if(m){const L=E==="y"?"height":"width",R=a.reference[E]-a.floating[L]+S.mainAxis,D=a.reference[E]+a.reference[L]-S.mainAxis;w<R?w=R:w>D&&(w=D)}if(c){var y,T;const L=E==="y"?"width":"height",R=Uw.has(us(p)),D=a.reference[x]-a.floating[L]+(R&&((y=h.offset)==null?void 0:y[x])||0)+(R?0:S.crossAxis),A=a.reference[x]+a.reference[L]+(R?0:((T=h.offset)==null?void 0:T[x])||0)-(R?S.crossAxis:0);g<D?g=D:g>A&&(g=A)}return{[E]:w,[x]:g}}}},WR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:r,rects:s,platform:l,elements:f}=i,{apply:p=()=>{},...a}=_r(e,i),h=await l.detectOverflow(i,a),d=us(r),m=ya(r),c=zi(r)==="y",{width:_,height:x}=s.floating;let E,w;d==="top"||d==="bottom"?(E=d,w=m===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(w=d,E=m==="end"?"top":"bottom");const g=x-h.top-h.bottom,b=_-h.left-h.right,S=cs(x-h[E],g),y=cs(_-h[w],b),T=i.middlewareData.shift,L=!T;let R=S,D=y;T!=null&&T.enabled.x&&(D=b),T!=null&&T.enabled.y&&(R=g),L&&!m&&(c?D=_-2*fr(h.left,h.right):R=x-2*fr(h.top,h.bottom)),await p({...i,availableWidth:D,availableHeight:R});const A=await l.getDimensions(f.floating);return _!==A.width||x!==A.height?{reset:{rects:!0}}:{}}}};function Th(){return typeof window<"u"}function ba(e){return $w(e)?(e.nodeName||"").toLowerCase():"#document"}function Nn(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function wr(e){var i;return(i=($w(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function $w(e){return Th()?e instanceof Node||e instanceof Nn(e).Node:!1}function $i(e){return Th()?e instanceof Element||e instanceof Nn(e).Element:!1}function fs(e){return Th()?e instanceof HTMLElement||e instanceof Nn(e).HTMLElement:!1}function jy(e){return!Th()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nn(e).ShadowRoot}function Rh(e){const{overflow:i,overflowX:r,overflowY:s,display:l}=qi(e);return/auto|scroll|overlay|hidden|clip/.test(i+s+r)&&l!=="inline"&&l!=="contents"}function GR(e){return/^(table|td|th)$/.test(ba(e))}function Ah(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const YR=/transform|translate|scale|rotate|perspective|filter/,XR=/paint|layout|strict|content/,zs=e=>!!e&&e!=="none";let Hp;function Tg(e){const i=$i(e)?qi(e):e;return zs(i.transform)||zs(i.translate)||zs(i.scale)||zs(i.rotate)||zs(i.perspective)||!Rg()&&(zs(i.backdropFilter)||zs(i.filter))||YR.test(i.willChange||"")||XR.test(i.contain||"")}function KR(e){let i=Ys(e);for(;fs(i)&&!Bl(i);){if(Tg(i))return i;if(Ah(i))return null;i=Ys(i)}return null}function Rg(){return Hp==null&&(Hp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hp}function Bl(e){return/^(html|body|#document)$/.test(ba(e))}function qi(e){return Nn(e).getComputedStyle(e)}function Lh(e){return $i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ys(e){if(ba(e)==="html")return e;const i=e.assignedSlot||e.parentNode||jy(e)&&e.host||wr(e);return jy(i)?i.host:i}function qw(e){const i=Ys(e);return Bl(i)?(e.ownerDocument||e).body:fs(i)&&Rh(i)?i:qw(i)}function Pl(e,i,r){var s;i===void 0&&(i=[]),r===void 0&&(r=!0);const l=qw(e),f=l===((s=e.ownerDocument)==null?void 0:s.body),p=Nn(l);if(f){const a=Am(p);return i.concat(p,p.visualViewport||[],Rh(l)?l:[],a&&r?Pl(a):[])}else return i.concat(l,Pl(l,[],r))}function Am(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vw(e){const i=qi(e);let r=parseFloat(i.width)||0,s=parseFloat(i.height)||0;const l=fs(e),f=l?e.offsetWidth:r,p=l?e.offsetHeight:s,a=rh(r)!==f||rh(s)!==p;return a&&(r=f,s=p),{width:r,height:s,$:a}}function Ag(e){return $i(e)?e:e.contextElement}function oa(e){const i=Ag(e);if(!fs(i))return pr(1);const r=i.getBoundingClientRect(),{width:s,height:l,$:f}=Vw(i);let p=(f?rh(r.width):r.width)/s,a=(f?rh(r.height):r.height)/l;return(!p||!Number.isFinite(p))&&(p=1),(!a||!Number.isFinite(a))&&(a=1),{x:p,y:a}}const QR=pr(0);function Ww(e){const i=Nn(e);return!Rg()||!i.visualViewport?QR:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function ZR(e,i,r){return i===void 0&&(i=!1),!!r&&i&&r===Nn(e)}function Xs(e,i,r,s){i===void 0&&(i=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),f=Ag(e);let p=pr(1);i&&(s?$i(s)&&(p=oa(s)):p=oa(e));const a=ZR(f,r,s)?Ww(f):pr(0);let h=(l.left+a.x)/p.x,d=(l.top+a.y)/p.y,m=l.width/p.x,c=l.height/p.y;if(f&&s){const _=Nn(f),x=$i(s)?Nn(s):s;let E=_,w=Am(E);for(;w&&x!==E;){const g=oa(w),b=w.getBoundingClientRect(),S=qi(w),y=b.left+(w.clientLeft+parseFloat(S.paddingLeft))*g.x,T=b.top+(w.clientTop+parseFloat(S.paddingTop))*g.y;h*=g.x,d*=g.y,m*=g.x,c*=g.y,h+=y,d+=T,E=Nn(w),w=Am(E)}}return oh({width:m,height:c,x:h,y:d})}function Dh(e,i){const r=Lh(e).scrollLeft;return i?i.left+r:Xs(wr(e)).left+r}function Gw(e,i){const r=e.getBoundingClientRect(),s=r.left+i.scrollLeft-Dh(e,r),l=r.top+i.scrollTop;return{x:s,y:l}}function JR(e){let{elements:i,rect:r,offsetParent:s,strategy:l}=e;const f=l==="fixed",p=wr(s),a=i?Ah(i.floating):!1;if(s===p||a&&f)return r;let h={scrollLeft:0,scrollTop:0},d=pr(1);const m=pr(0),c=fs(s);if((c||!f)&&((ba(s)!=="body"||Rh(p))&&(h=Lh(s)),c)){const x=Xs(s);d=oa(s),m.x=x.x+s.clientLeft,m.y=x.y+s.clientTop}const _=p&&!c&&!f?Gw(p,h):pr(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-h.scrollLeft*d.x+m.x+_.x,y:r.y*d.y-h.scrollTop*d.y+m.y+_.y}}function eA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tA(e){const i=Lh(e),r=e.ownerDocument.body,s=fr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=fr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let f=-i.scrollLeft+Dh(e);const p=-i.scrollTop;return qi(r).direction==="rtl"&&(f+=fr(e.clientWidth,r.clientWidth)-s),{width:s,height:l,x:f,y:p}}const nA=25;function iA(e,i,r){r===void 0&&(r="viewport");const s=r==="layoutViewport",l=Nn(e),f=wr(e),p=l.visualViewport;let a=f.clientWidth,h=f.clientHeight,d=0,m=0;if(p){const _=!Rg()||i==="fixed";s?_||(d=-p.offsetLeft,m=-p.offsetTop):(a=p.width,h=p.height,_&&(d=p.offsetLeft,m=p.offsetTop))}if(Dh(f)<=0){const _=f.ownerDocument,x=_.body,E=getComputedStyle(x),w=_.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,g=Math.abs(f.clientWidth-x.clientWidth-w),b=getComputedStyle(f).scrollbarGutter==="stable both-edges"?g/2:g;b<=nA&&(a-=b)}return{width:a,height:h,x:d,y:m}}function rA(e,i){const r=Xs(e,!0,i==="fixed"),s=r.top+e.clientTop,l=r.left+e.clientLeft,f=oa(e),p=e.clientWidth*f.x,a=e.clientHeight*f.y,h=l*f.x,d=s*f.y;return{width:p,height:a,x:h,y:d}}function Oy(e,i,r){let s;if(i==="viewport"||i==="layoutViewport")s=iA(e,r,i);else if(i==="document")s=tA(wr(e));else if($i(i))s=rA(i,r);else{const l=Ww(e);s={x:i.x-l.x,y:i.y-l.y,width:i.width,height:i.height}}return oh(s)}function sA(e,i){const r=i.get(e);if(r)return r;let s=Pl(e,[],!1).filter(a=>$i(a)&&ba(a)!=="body"),l=null;const f=qi(e).position==="fixed";let p=f?Ys(e):e;for(;$i(p)&&!Bl(p);){const a=qi(p),h=Tg(p),d=l?l.position:f?"fixed":"";!h&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(c=>c!==p):l=a,p=Ys(p)}return i.set(e,s),s}function oA(e){let{element:i,boundary:r,rootBoundary:s,strategy:l}=e;const p=[...r==="clippingAncestors"?Ah(i)?[]:sA(i,this._c):[].concat(r),s],a=Oy(i,p[0],l);let h=a.top,d=a.right,m=a.bottom,c=a.left;for(let _=1;_<p.length;_++){const x=Oy(i,p[_],l);h=fr(x.top,h),d=cs(x.right,d),m=cs(x.bottom,m),c=fr(x.left,c)}return{width:d-c,height:m-h,x:c,y:h}}function aA(e){const{width:i,height:r}=Vw(e);return{width:i,height:r}}function lA(e,i,r){const s=fs(i),l=wr(i),f=r==="fixed",p=Xs(e,!0,f,i);let a={scrollLeft:0,scrollTop:0};const h=pr(0);if((s||!f)&&((ba(i)!=="body"||Rh(l))&&(a=Lh(i)),s)){const _=Xs(i,!0,f,i);h.x=_.x+i.clientLeft,h.y=_.y+i.clientTop}!s&&l&&(h.x=Dh(l));const d=l&&!s&&!f?Gw(l,a):pr(0),m=p.left+a.scrollLeft-h.x-d.x,c=p.top+a.scrollTop-h.y-d.y;return{x:m,y:c,width:p.width,height:p.height}}function Fp(e){return qi(e).position==="static"}function Ny(e,i){if(!fs(e)||qi(e).position==="fixed")return null;if(i)return i(e);let r=e.offsetParent;return wr(e)===r&&(r=r.ownerDocument.body),r}function Yw(e,i){const r=Nn(e);if(Ah(e))return r;if(!fs(e)){let l=Ys(e);for(;l&&!Bl(l);){if($i(l)&&!Fp(l))return l;l=Ys(l)}return r}let s=Ny(e,i);for(;s&&GR(s)&&Fp(s);)s=Ny(s,i);return s&&Bl(s)&&Fp(s)&&!Tg(s)?r:s||KR(e)||r}const cA=async function(e){const i=this.getOffsetParent||Yw,r=this.getDimensions,s=await r(e.floating);return{reference:lA(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function uA(e){return qi(e).direction==="rtl"}const hA={convertOffsetParentRelativeRectToViewportRelativeRect:JR,getDocumentElement:wr,getClippingRect:oA,getOffsetParent:Yw,getElementRects:cA,getClientRects:eA,getDimensions:aA,getScale:oa,isElement:$i,isRTL:uA};function Xw(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function dA(e,i,r){let s=null,l;const f=wr(e);function p(){var m;clearTimeout(l),(m=s)==null||m.disconnect(),s=null}function a(m,c){m===void 0&&(m=!1),c===void 0&&(c=1),p();const _=e.getBoundingClientRect(),{left:x,top:E,width:w,height:g}=_;if(m||i(),!w||!g)return;const b=Pu(E),S=Pu(f.clientWidth-(x+w)),y=Pu(f.clientHeight-(E+g)),T=Pu(x),R={rootMargin:-b+"px "+-S+"px "+-y+"px "+-T+"px",threshold:fr(0,cs(1,c))||1};let D=!0;function A(j){const M=j[0].intersectionRatio;if(!Xw(_,e.getBoundingClientRect()))return a();if(M!==c){if(!D)return a();M?a(!1,M):l=setTimeout(()=>{a(!1,1e-7)},1e3)}D=!1}try{s=new IntersectionObserver(A,{...R,root:f.ownerDocument})}catch{s=new IntersectionObserver(A,R)}s.observe(e)}const h=Nn(e),d=()=>a(r);return h.addEventListener("resize",d),a(!0),()=>{h.removeEventListener("resize",d),p()}}function fA(e,i,r,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:f=!0,elementResize:p=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,d=Ag(e),m=l||f?[...d?Pl(d):[],...i?Pl(i):[]]:[];m.forEach(b=>{l&&b.addEventListener("scroll",r),f&&b.addEventListener("resize",r)});const c=d&&a?dA(d,r,f):null;let _=-1,x=null;p&&(x=new ResizeObserver(b=>{let[S]=b;S&&S.target===d&&x&&i&&(x.unobserve(i),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(i)})),r()}),d&&!h&&x.observe(d),i&&x.observe(i));let E,w=h?Xs(e):null;h&&g();function g(){const b=Xs(e);w&&!Xw(w,b)&&r(),w=b,E=requestAnimationFrame(g)}return r(),()=>{var b;m.forEach(S=>{l&&S.removeEventListener("scroll",r),f&&S.removeEventListener("resize",r)}),c==null||c(),(b=x)==null||b.disconnect(),x=null,h&&cancelAnimationFrame(E)}}const pA=$R,mA=qR,gA=HR,vA=WR,_A=FR,By=zR,xA=VR,yA=(e,i,r)=>{const s=new Map,l=r??{},f={...hA,...l.platform,_c:s};return IR(e,i,{...l,platform:f})};var bA=typeof document<"u",SA=function(){},Xu=bA?P.useLayoutEffect:SA;function ah(e,i){if(e===i)return!0;if(typeof e!=typeof i)return!1;if(typeof e=="function"&&e.toString()===i.toString())return!0;let r,s,l;if(e&&i&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==i.length)return!1;for(s=r;s--!==0;)if(!ah(e[s],i[s]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(i).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(i,l[s]))return!1;for(s=r;s--!==0;){const f=l[s];if(!(f==="_owner"&&e.$$typeof)&&!ah(e[f],i[f]))return!1}return!0}return e!==e&&i!==i}function Kw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Py(e,i){const r=Kw(e);return Math.round(i*r)/r}function Up(e){const i=P.useRef(e);return Xu(()=>{i.current=e}),i}function wA(e){e===void 0&&(e={});const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l,elements:{reference:f,floating:p}={},transform:a=!0,whileElementsMounted:h,open:d}=e,[m,c]=P.useState({x:0,y:0,strategy:r,placement:i,middlewareData:{},isPositioned:!1}),[_,x]=P.useState(s);ah(_,s)||x(s);const[E,w]=P.useState(null),[g,b]=P.useState(null),S=P.useCallback(K=>{K!==R.current&&(R.current=K,w(K))},[]),y=P.useCallback(K=>{K!==D.current&&(D.current=K,b(K))},[]),T=f||E,L=p||g,R=P.useRef(null),D=P.useRef(null),A=P.useRef(m),j=h!=null,M=Up(h),I=Up(l),B=Up(d),H=P.useCallback(()=>{if(!R.current||!D.current)return;const K={placement:i,strategy:r,middleware:_};I.current&&(K.platform=I.current),yA(R.current,D.current,K).then(z=>{const O={...z,isPositioned:B.current!==!1};U.current&&!ah(A.current,O)&&(A.current=O,Xl.flushSync(()=>{c(O)}))})},[_,i,r,I,B]);Xu(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(K=>({...K,isPositioned:!1})))},[d]);const U=P.useRef(!1);Xu(()=>(U.current=!0,()=>{U.current=!1}),[]),Xu(()=>{if(T&&(R.current=T),L&&(D.current=L),T&&L){if(M.current)return M.current(T,L,H);H()}},[T,L,H,M,j]);const W=P.useMemo(()=>({reference:R,floating:D,setReference:S,setFloating:y}),[S,y]),Y=P.useMemo(()=>({reference:T,floating:L}),[T,L]),Q=P.useMemo(()=>{const K={position:r,left:0,top:0};if(!Y.floating)return K;const z=Py(Y.floating,m.x),O=Py(Y.floating,m.y);return a?{...K,transform:"translate("+z+"px, "+O+"px)",...Kw(Y.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:O}},[r,a,Y.floating,m.x,m.y]);return P.useMemo(()=>({...m,update:H,refs:W,elements:Y,floatingStyles:Q}),[m,H,W,Y,Q])}const CA=e=>{function i(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:l}=typeof e=="function"?e(r):e;return s&&i(s)?s.current!=null?By({element:s.current,padding:l}).fn(r):{}:s?By({element:s,padding:l}).fn(r):{}}}},EA=(e,i)=>{const r=pA(e);return{name:r.name,fn:r.fn,options:[e,i]}},kA=(e,i)=>{const r=mA(e);return{name:r.name,fn:r.fn,options:[e,i]}},TA=(e,i)=>({fn:xA(e).fn,options:[e,i]}),RA=(e,i)=>{const r=gA(e);return{name:r.name,fn:r.fn,options:[e,i]}},AA=(e,i)=>{const r=vA(e);return{name:r.name,fn:r.fn,options:[e,i]}},LA=(e,i)=>{const r=_A(e);return{name:r.name,fn:r.fn,options:[e,i]}},DA=(e,i)=>{const r=CA(e);return{name:r.name,fn:r.fn,options:[e,i]}};var MA=Object.defineProperty,jA=(e,i)=>MA(e,"name",{value:i,configurable:!0}),OA=P.forwardRef(jA(function(i,r){const{children:s,width:l=10,height:f=5,...p}=i;return v.jsx(wt.svg,{...p,ref:r,width:l,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:i.asChild?s:v.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),NA=Object.defineProperty,BA=(e,i)=>NA(e,"name",{value:i,configurable:!0});function Lg(e){const[i,r]=P.useState(void 0);return $t(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let s=0;const l=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const p=f[0];window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{let a,h;if("borderBoxSize"in p){const d=p.borderBoxSize,m=Array.isArray(d)?d[0]:d;a=m.inlineSize,h=m.blockSize}else a=e.offsetWidth,h=e.offsetHeight;r({width:a,height:h})})});return l.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(s),l.unobserve(e)}}else r(void 0)},[e]),i}BA(Lg,"useSize");var PA=Object.defineProperty,mr=(e,i)=>PA(e,"name",{value:i,configurable:!0}),Iy={Partial:"partial"},zy={Optimized:"optimized",Always:"always"},Qw="Popper",[Zw,Sa]=br(Qw),[IA,Jw]=Zw(Qw),Dg=mr(e=>{const{__scopePopper:i,children:r}=e,[s,l]=P.useState(null),[f,p]=P.useState(void 0);return v.jsx(IA,{scope:i,anchor:s,onAnchorChange:l,placementState:f,setPlacementState:p,children:r})},"Popper"),zA="PopperAnchor",Mg=P.forwardRef(mr(function(i,r){const{__scopePopper:s,virtualRef:l,...f}=i,p=Jw(zA,s),a=P.useRef(null),h=p.onAnchorChange,d=P.useCallback(w=>{a.current=w,w&&h(w)},[h]),m=ht(r,d),c=P.useRef(null);P.useEffect(()=>{if(!l)return;const w=c.current;c.current=l.current,w!==c.current&&h(c.current)});const _=p.placementState&&Mh(p.placementState),x=_==null?void 0:_[0],E=_==null?void 0:_[1];return l?null:v.jsx(wt.div,{"data-radix-popper-side":x,"data-radix-popper-align":E,...f,ref:m})},"PopperAnchor")),eC="PopperContent",[HA,FA]=Zw(eC),jg=P.forwardRef(mr(function(i,r){var oe,ee,ue,he,we,Se,Re;const{__scopePopper:s,side:l="bottom",sideOffset:f=0,align:p="center",alignOffset:a=0,arrowPadding:h=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:c=0,sticky:_=Iy.Partial,hideWhenDetached:x=!1,updatePositionStrategy:E=zy.Optimized,onPlaced:w,...g}=i,b=Jw(eC,s),[S,y]=P.useState(null),T=ht(r,y),[L,R]=P.useState(null),D=Lg(L),A=(D==null?void 0:D.width)??0,j=(D==null?void 0:D.height)??0,M=l+(p!=="center"?"-"+p:""),I=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},B=Array.isArray(m)?m:[m],H=B.length>0,U={padding:I,boundary:B.filter(tC),altBoundary:H},{refs:W,floatingStyles:Y,placement:Q,isPositioned:K,middlewareData:z}=wA({strategy:"fixed",placement:M,whileElementsMounted:mr((...qe)=>fA(...qe,{animationFrame:E===zy.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[EA({mainAxis:f+j,alignmentAxis:a}),d&&kA({mainAxis:!0,crossAxis:!1,..._===Iy.Partial?{limiter:TA()}:{},...U}),d&&RA({...U}),AA({...U,apply:mr(({elements:qe,rects:ke,availableWidth:ze,availableHeight:Mt})=>{const{width:$e,height:Be}=ke.reference,Ie=qe.floating.style;Ie.setProperty("--radix-popper-available-width",`${ze}px`),Ie.setProperty("--radix-popper-available-height",`${Mt}px`),Ie.setProperty("--radix-popper-anchor-width",`${$e}px`),Ie.setProperty("--radix-popper-anchor-height",`${Be}px`)},"apply")}),L&&DA({element:L,padding:h}),VA({arrowWidth:A,arrowHeight:j}),x&&LA(H?{strategy:"referenceHidden",...U}:{strategy:"referenceHidden",padding:U.padding,altBoundary:U.altBoundary})]}),O=b.setPlacementState;$t(()=>(O(Q),()=>{O(void 0)}),[Q,O]);const[G,Z]=Mh(Q),F=Ui(w);$t(()=>{K&&(F==null||F())},[K,F]);const V=(oe=z.arrow)==null?void 0:oe.x,ne=(ee=z.arrow)==null?void 0:ee.y,le=((ue=z.arrow)==null?void 0:ue.centerOffset)!==0,[X,$]=P.useState();return $t(()=>{S&&$(window.getComputedStyle(S).zIndex)},[S]),v.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:K?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(he=z.transformOrigin)==null?void 0:he.x,(we=z.transformOrigin)==null?void 0:we.y].join(" "),...((Se=z.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:i.dir,children:v.jsx(HA,{scope:s,placedSide:G,placedAlign:Z,onArrowChange:R,arrowX:V,arrowY:ne,shouldHideArrow:le,children:v.jsx(wt.div,{"data-side":G,"data-align":Z,...g,ref:T,style:{...g.style,animation:K?(Re=g.style)==null?void 0:Re.animation:"none"}})})})},"PopperContent")),UA="PopperArrow",$A={top:"bottom",right:"left",bottom:"top",left:"right"},qA=P.forwardRef(mr(function(i,r){const{__scopePopper:s,...l}=i,f=FA(UA,s),p=$A[f.placedSide];return v.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[p]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:v.jsx(OA,{...l,ref:r,style:{...l.style,display:"block"}})})},"PopperArrow"));function tC(e){return e!==null}mr(tC,"isNotNull");var VA=mr(e=>({name:"transformOrigin",options:e,fn(i){var g,b,S;const{placement:r,rects:s,middlewareData:l}=i,p=((g=l.arrow)==null?void 0:g.centerOffset)!==0,a=p?0:e.arrowWidth,h=p?0:e.arrowHeight,[d,m]=Mh(r),c={start:"0%",center:"50%",end:"100%"}[m],_=(((b=l.arrow)==null?void 0:b.x)??0)+a/2,x=(((S=l.arrow)==null?void 0:S.y)??0)+h/2;let E="",w="";return d==="bottom"?(E=p?c:`${_}px`,w=`${-h}px`):d==="top"?(E=p?c:`${_}px`,w=`${s.floating.height+h}px`):d==="right"?(E=`${-h}px`,w=p?c:`${x}px`):d==="left"&&(E=`${s.floating.width+h}px`,w=p?c:`${x}px`),{data:{x:E,y:w}}}}),"transformOrigin");function Mh(e){const[i,r="center"]=e.split("-");return[i,r]}mr(Mh,"getSideAndAlignFromPlacement");var WA=Object.defineProperty,Cr=(e,i)=>WA(e,"name",{value:i,configurable:!0}),Og="Popover",[nC,rB]=br(Og,[Sa]),Ng=Sa(),[GA,wa]=nC(Og),YA=Cr(e=>{const{__scopePopover:i,children:r,open:s,defaultOpen:l,onOpenChange:f,modal:p=!1}=e,a=Ng(i),h=P.useRef(null),[d,m]=P.useState(!1),[c,_]=P.useState(0),[x,E]=P.useState(0),[w,g]=Gs({prop:s,defaultProp:l??!1,onChange:f,caller:Og});return v.jsx(Dg,{...a,children:v.jsx(GA,{scope:i,contentId:Fi(),titleId:Fi(),descriptionId:Fi(),titlePresent:c>0,descriptionPresent:x>0,setTitleCount:_,setDescriptionCount:E,triggerRef:h,open:w,onOpenChange:g,onOpenToggle:P.useCallback(()=>g(b=>!b),[g]),hasCustomAnchor:d,onCustomAnchorAdd:P.useCallback(()=>m(!0),[]),onCustomAnchorRemove:P.useCallback(()=>m(!1),[]),modal:p,children:r})})},"Popover"),XA="PopoverTrigger",KA=P.forwardRef(Cr(function(i,r){const{__scopePopover:s,...l}=i,f=wa(XA,s),p=Ng(s),a=ht(r,f.triggerRef),h=v.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":Bg(f.open),...l,ref:a,onClick:tt(i.onClick,f.onOpenToggle)});return f.hasCustomAnchor?h:v.jsx(Mg,{asChild:!0,...p,children:h})},"PopoverTrigger")),iC="PopoverPortal",[QA,ZA]=nC(iC,{forceMount:void 0}),JA=Cr(e=>{const{__scopePopover:i,forceMount:r,children:s,container:l}=e,f=wa(iC,i);return v.jsx(QA,{scope:i,forceMount:r,children:v.jsx(Sr,{present:r||f.open,children:v.jsx(wh,{asChild:!0,container:l,children:s})})})},"PopoverPortal"),Il="PopoverContent",e6=P.forwardRef(Cr(function(i,r){const s=ZA(Il,i.__scopePopover),{forceMount:l=s.forceMount,...f}=i,p=wa(Il,i.__scopePopover);return v.jsx(Sr,{present:l||p.open,children:p.modal?v.jsx(n6,{...f,ref:r}):v.jsx(i6,{...f,ref:r})})},"PopoverContent")),t6=gr("PopoverContent.RemoveScroll"),n6=P.forwardRef(Cr(function(i,r){const s=wa(Il,i.__scopePopover),l=P.useRef(null),f=ht(r,l),p=P.useRef(!1),{nodes:a,registry:h}=_g();return P.useEffect(()=>{const d=l.current;if(d)return Sg(d)},[]),v.jsx(Eh,{as:t6,allowPinchZoom:!0,shards:P.useMemo(()=>[l,...a.map(d=>({current:d}))],[l,a]),children:v.jsx(rC,{...i,ref:f,branchNodes:a,branchRegistry:h,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tt(i.onCloseAutoFocus,d=>{var m;d.preventDefault(),p.current||(m=s.triggerRef.current)==null||m.focus()}),onPointerDownOutside:tt(i.onPointerDownOutside,d=>{const m=d.detail.originalEvent,c=m.button===0&&m.ctrlKey===!0,_=m.button===2||c;p.current=_},{checkForDefaultPrevented:!1}),onFocusOutside:tt(i.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),i6=P.forwardRef(Cr(function(i,r){const s=wa(Il,i.__scopePopover),l=P.useRef(!1),f=P.useRef(!1);return v.jsx(rC,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var a,h;(a=i.onCloseAutoFocus)==null||a.call(i,p),p.defaultPrevented||(l.current||(h=s.triggerRef.current)==null||h.focus(),p.preventDefault()),l.current=!1,f.current=!1},onInteractOutside:p=>{var d,m;(d=i.onInteractOutside)==null||d.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const a=p.target;((m=s.triggerRef.current)==null?void 0:m.contains(a))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&f.current&&p.preventDefault()}})},"PopoverContentNonModal")),rC=P.forwardRef(Cr(function(i,r){const{__scopePopover:s,trapFocus:l,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:a,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:c,"aria-describedby":_,branchNodes:x,branchRegistry:E,...w}=i,g=wa(Il,s),b=Ng(s),[S,y]=P.useState(null),T=ht(r,y);return xg(S),Kl(),v.jsx(vg,{registry:E,children:v.jsx(gg,{asChild:!0,loop:!0,trapped:l,branches:x,onMountAutoFocus:f,onUnmountAutoFocus:p,children:v.jsx(Sh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:v.jsx(jg,{"data-state":Bg(g.open),role:"dialog",id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?sC(_,g.descriptionId):_,...b,...w,ref:T,style:{...w.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function Bg(e){return e?"open":"closed"}Cr(Bg,"getState");function sC(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Cr(sC,"concatAriaDescribedby");function Pg({trigger:e,children:i,side:r="bottom",align:s="start",className:l,open:f,onOpenChange:p}){return v.jsxs(YA,{open:f,onOpenChange:p,children:[v.jsx(KA,{asChild:!0,children:e}),v.jsx(JA,{children:v.jsx(e6,{side:r,align:s,sideOffset:6,collisionPadding:8,className:xe("z-50 rounded-lg border bg-card p-3 shadow-lg focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",l),children:i})})]})}const r6={on:"bg-foreground text-background",off:"bg-muted text-muted-foreground",critical:"bg-severity-critical text-primary-foreground",warning:"bg-severity-warning text-background",suggestion:"bg-severity-suggestion text-background",success:"bg-success text-success-foreground"};function nt({tone:e="on",icon:i,children:r,className:s,title:l}){return v.jsxs("span",{title:l,className:xe("inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",r6[e],s),children:[i&&v.jsx(i,{className:"h-2.5 w-2.5"}),r]})}const Hy="clauder-hub:automation-tab";function s6(){var h,d,m,c;const e=ut(()=>ve.jobs(),["jobs"]),i=ut(()=>ve.runs(),["runs"]),{starting:r,start:s}=Zs(),[l,f]=P.useState(()=>{try{return localStorage.getItem(Hy)==="queue"?"queue":"jobs"}catch{return"jobs"}}),p=_=>{f(_);try{localStorage.setItem(Hy,_)}catch{}},a=(i.data??[]).filter(_=>_.status==="queued"||_.status==="running").length;return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),v.jsx("h1",{className:"text-base font-semibold",children:"Automation"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Cron and webhook runs, one session at a time, while the hub runs.",children:"Cron and webhook runs, one session at a time, while the hub runs."})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.jsxs(_e,{disabled:r,onClick:()=>void s("queue-run"),title:"Opens a Claude session to queue a run",children:[v.jsx(ua,{size:12})," Queue a run"]}),v.jsxs(_e,{variant:"primary",disabled:r,onClick:()=>void s("create-job"),title:"Opens a Claude session to create a job",children:[v.jsx(Qn,{size:12})," New job"]})]})]}),v.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b",children:[["jobs","Jobs",((h=e.data)==null?void 0:h.length)??0,"Every job of this project"],["queue","Queue",((d=i.data)==null?void 0:d.length)??0,a?`${a} waiting or running now`:"Nothing waiting or running now"]].map(([_,x,E,w])=>v.jsxs("button",{onClick:()=>p(_),title:w,className:xe("flex shrink-0 items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",l===_?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:[x,v.jsx("span",{className:xe("grid h-4 min-w-[1rem] place-items-center rounded-full px-1 text-[10px] font-semibold leading-none tabular-nums",_==="queue"&&a>0?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:E})]},_))}),l==="jobs"?(m=e.data)!=null&&m.length?v.jsx("div",{className:"divide-y rounded-md border",children:e.data.map(_=>v.jsx(o6,{job:_,onEdit:()=>void s("edit-job",_.id)},_.id))}):v.jsx(nn,{variant:"inline",title:"No jobs yet. A cron job runs a prompt on a schedule; a manual / webhook job runs when you press Run, type /job in a channel, or something calls its URL."}):(c=i.data)!=null&&c.length?v.jsx(c6,{runs:i.data}):v.jsx(nn,{variant:"inline",title:"Nothing has run yet."})]})})}function o6({job:e,onEdit:i}){const r=pn(),l=`curl -X POST "${`${location.origin}${Hi()}/trigger/${e.id}`}" -H "x-clauder-token: ${e.token}" -H "content-type: application/json" -d "{\\"issue\\":\\"ABC-123\\"}"`;return v.jsxs("div",{className:"px-3 py-2.5",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[e.kind==="cron"?v.jsx(_h,{size:14,className:"shrink-0 text-muted-foreground"}):v.jsx(LS,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate text-xs font-medium",children:e.name}),!e.enabled&&v.jsx(nt,{tone:"off",children:"disabled"}),v.jsx(nt,{tone:"off",title:e.kind==="cron"?"Runs on its schedule while the hub runs, and whenever it is run by hand":"No schedule: runs when you press Run, type /job in a channel, or something calls its URL",children:e.kind==="cron"?"cron":"manual / webhook"}),v.jsx(nt,{tone:"off",children:e.category||"no category"}),v.jsx(a6,{job:e,curl:l}),v.jsxs("span",{className:"ml-auto flex gap-1",children:[v.jsx(_e,{variant:"ghost",size:"icon",title:"Run now",onClick:()=>void r({title:`Run '${e.name}' now?`,description:"Joins the queue as an unattended session.",body:v.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-[11px]",children:e.prompt}),confirmLabel:"Queue it",run:async()=>{await ve.runJob(e.id),ye.getState().notify("Queued.")}}),children:v.jsx(ua,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:i,children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void r({title:`Delete the job '${e.name}'?`,description:"Its schedule or webhook stops. Past runs stay.",confirmLabel:"Delete",tone:"destructive",run:()=>ve.deleteJob(e.id)}),children:v.jsx(yr,{size:13})})]})]}),v.jsx("div",{className:"mt-1 line-clamp-2 break-words pl-6 text-[11px] text-muted-foreground",children:e.prompt}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-3 pl-6 text-[11px] text-muted-foreground",children:[e.kind==="cron"?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-mono",children:e.schedule}),v.jsxs("span",{children:["next: ",e.nextRunAt?Ws(e.nextRunAt):"-"]})]}):v.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[v.jsxs("span",{className:"break-all font-mono",children:["POST ",Hi(),"/trigger/",e.id]}),v.jsx(Nl,{text:l}),v.jsx("span",{children:"copy curl"}),v.jsx(_e,{variant:"ghost",size:"icon",title:"New token",onClick:()=>void r({title:"Issue a new token?",description:"Callers using the old token stop working.",confirmLabel:"Issue new token",tone:"destructive",run:()=>ve.rotateJobToken(e.id)}),children:v.jsx(yh,{size:11})})]}),v.jsxs("span",{children:["last run: ",e.lastRunAt?va(e.lastRunAt):"never"]})]})]})}function a6({job:e,curl:i}){const r=`curl -X POST "http://127.0.0.1:${location.port||80}${Hi()}/jobs/${e.id}/run" -H "content-type: application/json" -d "{}"`;return v.jsxs(Pg,{align:"start",className:"w-[30rem] max-w-[calc(100vw-1rem)] space-y-2.5 text-[11px]",trigger:v.jsxs("button",{className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Every way to start this job",children:[v.jsx(xS,{size:11})," How to run"]}),children:[v.jsxs("div",{className:"text-xs font-semibold",children:["How to run ‘",e.name,"’"]}),e.kind==="cron"?v.jsxs(Zo,{title:"On its schedule",children:[v.jsx("span",{className:"font-mono",children:e.schedule}),", next ",e.nextRunAt?Ws(e.nextRunAt):"-",", while the hub runs",e.enabled?"":" (disabled now)","."]}):v.jsx(Zo,{title:"No schedule",children:"It runs only when started one of the ways below."}),v.jsxs(Zo,{title:"From this page",children:["Press ",v.jsx(ua,{size:11,className:"inline"})," Run. It asks first, then joins the project’s queue (one run at a time). In the queue below, ",v.jsx(bh,{size:10,className:"inline"})," stops a running run and ",v.jsx(TS,{size:10,className:"inline"})," resumes a stopped one where it left off."]}),v.jsxs(Zo,{title:"From a channel",children:[v.jsxs("span",{className:"font-mono",children:["/job ",e.name]})," on Telegram (",v.jsx("span",{className:"font-mono",children:"!job"})," on Slack), or ",v.jsx("span",{className:"font-mono",children:"/jobs"})," and pick it. It asks before it queues. ",v.jsx("span",{className:"font-mono",children:"/stop"})," stops it, ",v.jsx("span",{className:"font-mono",children:"/resume"})," carries it on."]}),e.kind==="webhook"&&v.jsxs(Zo,{title:"From another tool (webhook)",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",Hi(),"/trigger/",e.id]}),v.jsx(Nl,{text:i})]}),"With the header ",v.jsx("span",{className:"font-mono",children:"x-clauder-token"})," (the job’s token, in the copied curl; renew it with ",v.jsx(yh,{size:10,className:"inline"})," on the row). The JSON body reaches the prompt as ",v.jsx("span",{className:"font-mono",children:"{{payload}}"})," or ",v.jsx("span",{className:"font-mono",children:"{{payload.field}}"}),"."]}),v.jsxs(Zo,{title:"From an app on this machine",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",Hi(),"/jobs/",e.id,"/run"]}),v.jsx(Nl,{text:r})]}),"No token: the hub only listens on 127.0.0.1. An optional ",v.jsx("span",{className:"font-mono",children:'{"payload": {...}}'})," body fills the prompt as above."]})]})}function Zo({title:e,children:i}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-foreground",children:e}),v.jsx("div",{className:"text-muted-foreground",children:i})]})}const l6={queued:"off",running:"warning",done:"success",exited:"off",cancelled:"off"};function c6({runs:e}){const i=ye(l=>l.go),r=pn(),s=l=>l.jobName??l.prompt.slice(0,60);return v.jsx("div",{className:"divide-y rounded-md border",children:e.map(l=>v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs",children:[v.jsx(nt,{tone:l6[l.status],children:l.status}),l.resume&&v.jsx(nt,{tone:"off",title:"Queued again to carry on its own session",children:"resumed"}),v.jsx("span",{className:"hidden w-16 shrink-0 text-[11px] text-muted-foreground sm:block",children:l.source}),v.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l.jobName&&v.jsxs("span",{className:"font-medium",children:[l.jobName,": "]}),v.jsx("span",{className:"text-muted-foreground",children:l.prompt})]}),v.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:va(l.createdAt)}),l.sessionId&&v.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>i({kind:"session",id:l.sessionId}),children:"Open"}),l.status==="running"&&l.sessionId&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Stop",onClick:()=>void r({title:`Stop '${s(l)}'?`,description:"Its terminal closes and the queue moves on. The conversation is kept: Resume carries on from where it stopped.",confirmLabel:"Stop",tone:"destructive",run:()=>ve.stopRun(l.id)}),children:v.jsx(bh,{size:13})}),l.status==="exited"&&l.sessionId&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Resume",onClick:()=>void r({title:`Resume '${s(l)}'?`,description:"Joins the back of the queue as an unattended run and carries on its own conversation from where it stopped.",confirmLabel:"Queue it",run:async()=>{const{position:f}=await ve.resumeRun(l.id);ye.getState().notify(`Queued, number ${f} in line.`)}}),children:v.jsx(TS,{size:13})}),l.status==="queued"&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Cancel",onClick:()=>void rt(()=>ve.cancelRun(l.id)),children:v.jsx(vn,{size:13})})]},l.id))})}function ss({label:e,value:i,hint:r}){return v.jsxs("div",{className:"card px-3 py-2.5",title:r,children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:e}),v.jsx("div",{className:"mt-0.5 text-lg font-semibold tabular-nums",children:i})]})}function oC({tokens:e}){return v.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[v.jsx(ss,{label:"Input",value:On(e.input),hint:`${e.input.toLocaleString()} uncached input tokens`}),v.jsx(ss,{label:"Output",value:On(e.output),hint:`${e.output.toLocaleString()} output tokens`}),v.jsx(ss,{label:"Cache read",value:On(e.cacheRead),hint:`${e.cacheRead.toLocaleString()} tokens read from the prompt cache`}),v.jsx(ss,{label:"Cache write",value:On(e.cacheCreation),hint:`${e.cacheCreation.toLocaleString()} tokens written to the prompt cache`})]})}function as({rows:e,empty:i="Nothing yet.",limit:r=12,format:s=On}){const[l,f]=P.useState(!1);if(!e.length)return v.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:i});const p=[...e].sort((d,m)=>m.value-d.value),a=l?p:p.slice(0,r),h=Math.max(...p.map(d=>d.value),1);return v.jsxs("div",{className:"space-y-1.5",children:[a.map(d=>v.jsxs("div",{className:"group",title:`${d.label}: ${d.value.toLocaleString()}${d.note?` (${d.note})`:""}`,children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[v.jsxs("span",{className:"min-w-0 truncate font-mono text-[11px]",children:[d.label,d.sublabel&&v.jsx("span",{className:"ml-1.5 font-sans text-muted-foreground",children:d.sublabel})]}),v.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[s(d.value),d.note&&v.jsx("span",{className:"ml-1 text-severity-critical",children:d.note})]})]}),v.jsx("div",{className:"mt-0.5 h-1.5 rounded-full bg-foreground/10",children:v.jsx("div",{className:"h-1.5 rounded-full bg-series transition-all group-hover:opacity-80",style:{width:`${Math.max(2,d.value/h*100)}%`}})})]},d.key)),p.length>r&&v.jsx("button",{className:"text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>f(!l),children:l?"Show fewer":`Show all ${p.length}`})]})}function u6({days:e,valueOf:i,label:r}){const[s,l]=P.useState(null),f=Object.entries(e).sort(([d],[m])=>d.localeCompare(m)).slice(-30);if(!f.length)return v.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:"No sessions yet."});const p=Math.max(...f.map(([,d])=>i(d)),1),a=s??f[f.length-1][0],h=i(e[a]);return v.jsxs("div",{children:[v.jsxs("div",{className:"mb-2 flex items-baseline gap-2 text-xs",children:[v.jsx("span",{className:"font-medium tabular-nums",children:On(h)}),v.jsxs("span",{className:"text-muted-foreground",children:[r," on ",a]})]}),v.jsx("div",{className:"flex h-28 items-end gap-[2px]",onMouseLeave:()=>l(null),children:f.map(([d,m])=>{const c=i(m);return v.jsx("div",{className:"flex h-full max-w-8 flex-1 cursor-default items-end",onMouseEnter:()=>l(d),children:v.jsx("div",{className:xe("w-full rounded-t bg-series transition-opacity",s&&s!==d&&"opacity-50"),style:{height:`${Math.max(2,c/p*100)}%`}})},d)})}),v.jsxs("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground",children:[v.jsx("span",{children:f[0][0]}),v.jsx("span",{children:f[f.length-1][0]})]})]})}function Dt({title:e,description:i,children:r,action:s,className:l}){return v.jsxs("section",{className:xe("card p-4",l),children:[v.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),i&&v.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:i})]}),s]}),r]})}const h6=[{name:"feature",description:"New behaviour",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"Documentation",description:"path or link to the docs written or updated",required:!0},{name:"Test evidence",description:"how it was tested and the result",required:!0}]},{name:"bugfix",description:"A defect fixed",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"RCA",description:"root cause analysis, a few sentences or a file path",required:!0},{name:"Test evidence",description:"the failing case now passing",required:!0}]}];function d6(){var s;const e=ut(()=>ve.categories(),[]),{starting:i,start:r}=Zs();return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Settings"}),v.jsx("h1",{className:"text-base font-semibold",children:"Task categories"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What counts as done for each kind of task.",children:"What counts as done for each kind of task."})]}),v.jsxs(_e,{variant:"primary",className:"shrink-0",disabled:i,onClick:()=>void r("create-category"),title:"Opens a Claude session to define a category",children:[v.jsx(Qn,{size:12})," New category"]})]}),(s=e.data)==null?void 0:s.map(l=>v.jsx(f6,{category:l,onEdit:()=>void r("edit-category",l.id),onDeleted:e.reload},l.id)),e.data&&!e.data.length&&v.jsx(nn,{title:"No categories yet.",hint:"Without any, a triggered session reports a summary and evidence of its own choosing. Start from the examples, or describe your own to Claude."}),e.data&&!e.data.length&&v.jsx("div",{className:"flex justify-center",children:v.jsx(_e,{onClick:()=>void Promise.all(h6.map(l=>ve.saveCategory(l))).then(e.reload),children:"Add the feature and bugfix examples"})})]})})}function f6({category:e,onEdit:i,onDeleted:r}){const s=pn();return v.jsx(Dt,{title:e.name,description:e.description||void 0,action:v.jsxs("div",{className:"flex gap-1",children:[v.jsx(_e,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:i,children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void s({title:`Delete the category '${e.name}'?`,description:"Sessions using it can no longer close against it.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deleteCategory(e.id),r()}}),children:v.jsx(yr,{size:13})})]}),children:e.deliverables.length?v.jsx("div",{className:"divide-y rounded-md border",children:e.deliverables.map(l=>v.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"text-xs font-medium",children:l.name}),l.description&&v.jsx("div",{className:"break-words text-[11px] text-muted-foreground",children:l.description})]}),v.jsx(nt,{tone:l.required?"on":"off",children:l.required?"required":"optional"})]},l.name))}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No fixed deliverables."})})}const p6={permission:"Permission requests",question:"Questions",turn:"End of each turn",mcp:"MCP suggestions",done:"Task done"},Lm="clauder:highlight-notifications";let Dm=!1;function m6(){Dm=!0,ye.getState().go({kind:"page",page:"channels"}),window.dispatchEvent(new Event(Lm))}function aC({on:e,label:i,onToggle:r,className:s}){return v.jsx("button",{role:"switch","aria-checked":e,"aria-label":i,title:i,onClick:r,className:xe("relative h-5 w-9 shrink-0 rounded-full transition-colors",e?"bg-primary":"bg-foreground/20",s),children:v.jsx("span",{className:xe("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",e?"left-[18px]":"left-0.5")})})}function lC({global:e=!1}){var E,w,g,b,S;const i=ut(()=>ve.channels(),["channels"]),{starting:r,start:s}=Zs(),l=pn(),f=((E=i.data)==null?void 0:E.kinds)??[],p=((w=i.data)==null?void 0:w.paused)??!1,a=new Set(((g=i.data)==null?void 0:g.notifyKinds)??[]),h=(b=i.data)==null?void 0:b.channels.find(y=>y.kind==="device"),d=(((S=i.data)==null?void 0:S.channels)??[]).filter(y=>y.kind!=="device"),m=P.useRef(null),[c,_]=P.useState(!1);P.useEffect(()=>{const y=()=>{!Dm||!m.current||(Dm=!1,m.current.scrollIntoView({block:"center",behavior:"smooth"}),_(!0),window.setTimeout(()=>_(!1),2200))};return y(),window.addEventListener(Lm,y),()=>window.removeEventListener(Lm,y)},[i.data!==null]);const x=y=>void rt(()=>ve.setNotifyKinds(a.has(y)?[...a].filter(T=>T!==y):[...a,y]));return v.jsx("div",{className:e?"":"h-full overflow-y-auto",children:v.jsxs("div",{className:xe("space-y-4",!e&&"p-5"),children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e?"Every project":"Settings"}),v.jsx("h1",{className:"text-base font-semibold",children:e?"Global channels":"Channels"}),e?v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"One bot for every project: their questions arrive here, named after the project, and /projects, /use pick one.",children:"One bot for every project: their questions arrive here, named after the project."}):v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Where sessions reach you. A reply goes back into the session.",children:"Where sessions reach you. A reply goes back into the session."})]}),v.jsxs(_e,{variant:"primary",className:"shrink-0",disabled:r,onClick:()=>void s("create-channel"),title:"Opens a Claude session to connect a channel",children:[v.jsx(Qn,{size:12})," Add channel"]})]}),i.data&&v.jsx(Dt,{title:"Notifications",description:p?"Paused: no channel hears of anything; questions still wait in the inbox.":"For every channel below, this computer included.",action:v.jsxs("div",{ref:m,className:xe("flex items-center gap-2 rounded-full py-0.5 pl-2.5 pr-0.5 transition-shadow",c&&"ring-2 ring-primary ring-offset-2 ring-offset-background animate-pulse"),children:[v.jsx("span",{className:xe("text-[11px] font-medium",p?"text-severity-warning":"text-muted-foreground"),children:p?"Paused on every channel":"On for every channel"}),v.jsx(aC,{on:!p,label:p?"Turn notifications back on":"Pause notifications on every channel",onToggle:()=>void rt(()=>ve.setNotificationsPaused(!p))})]}),children:v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.jsx("span",{className:"mr-1 text-[11px] text-muted-foreground",children:"Notify for"}),(i.data.interactionKinds??[]).map(y=>v.jsx("button",{disabled:p,onClick:()=>x(y),className:xe("rounded-full border px-2.5 py-0.5 text-[11px] transition-colors disabled:cursor-not-allowed disabled:opacity-40",a.has(y)?"border-primary bg-primary/15 text-foreground":"text-muted-foreground hover:bg-muted"),children:p6[y]??y},y))]})}),v.jsx(Dt,{title:"Channels",description:"Send /help to the Telegram bot, or !help in the Slack channel, for the commands: new session, run, sessions, summary, stop, queue.",children:i.data&&(!e||d.length)?v.jsxs("div",{className:"divide-y rounded-md border",children:[!e&&v.jsx(g6,{channel:h}),d.map(y=>{var T;return v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[v.jsx(Wl,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:y.name}),v.jsx(nt,{tone:"off",children:((T=f.find(L=>L.kind===y.kind))==null?void 0:T.label)??y.kind}),v.jsx(nt,{tone:y.status.ok?"success":y.enabled?"warning":"off",children:y.status.ok?"connected":y.enabled?"not connected":"off"})]}),v.jsx("div",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:y.status.detail}),y.kind==="http"&&v.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground",children:[v.jsxs("span",{className:"truncate font-mono",children:["POST ",`${location.origin}${Hi()}/channels/${y.id}/reply`]}),v.jsx(Nl,{text:`${location.origin}${Hi()}/channels/${y.id}/reply`})]})]}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Send a test message",onClick:()=>void rt(()=>ve.testChannel(y.id),"Test message sent."),children:v.jsx(ES,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Edit with Claude",onClick:()=>void s("edit-channel",y.id),children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void l({title:`Remove '${y.name}'?`,description:"Sessions stop reaching you there.",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteChannel(y.id)}),children:v.jsx(yr,{size:13})})]},y.id)})]}):i.data&&v.jsx(nn,{variant:"inline",title:"No channels yet. Without one, questions wait in the dashboard's inbox and the terminal."})})]})})}function g6({channel:e}){const i=!!(e!=null&&e.enabled),r=()=>rt(()=>ve.saveChannel({id:e==null?void 0:e.id,kind:"device",name:"This computer",config:{},enabled:!i,kinds:e==null?void 0:e.kinds}));return v.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[v.jsx(V3,{size:14,className:"shrink-0 text-muted-foreground"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:"This computer"}),v.jsx(nt,{tone:"off",children:"System notifications"}),v.jsx(nt,{tone:i&&(e!=null&&e.status.ok)?"success":i?"warning":"off",children:i?e!=null&&e.status.ok?"on":"not working":"off"})]}),v.jsx("div",{className:xe("mt-0.5 truncate text-[11px]",i&&e&&!e.status.ok?"text-severity-critical":"text-muted-foreground"),children:i&&e&&!e.status.ok?e.status.detail:"From the hub itself; they arrive even with the browser closed."})]}),i&&e&&v.jsx(_e,{variant:"ghost",size:"icon",title:"Send a test notification",onClick:()=>void rt(()=>ve.testChannel(e.id),"Test notification sent."),children:v.jsx(ES,{size:13})}),v.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:i?"On":"Off"}),v.jsx(aC,{on:i,label:i?"Stop notifying on this computer":"Notify on this computer",onToggle:()=>void r()})]})}function Er({group:e,title:i,description:r,action:s}){return v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),v.jsx("h1",{className:"text-base font-semibold",children:i}),r&&v.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",title:r,children:r})]}),s&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:s})]})}function Ig({onClick:e}){return v.jsxs(_e,{variant:"ghost",className:"-ml-2 mb-3 md:hidden",onClick:e,children:[v.jsx(T3,{size:13})," Back"]})}function Hs({label:e,hint:i,children:r}){return v.jsxs("label",{className:"block space-y-1",children:[v.jsx("div",{className:"text-xs font-medium",children:e}),r,i&&v.jsx("div",{className:"text-[11px] text-muted-foreground",children:i})]})}const pi=P.forwardRef(({className:e,size:i="sm",...r},s)=>v.jsx("input",{ref:s,className:xe("w-full rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));pi.displayName="Input";var v6=Object.defineProperty,_6=(e,i)=>v6(e,"name",{value:i,configurable:!0});function Mm(e,[i,r]){return Math.min(r,Math.max(i,e))}_6(Mm,"clamp");var x6=Object.defineProperty,Yt=(e,i)=>x6(e,"name",{value:i,configurable:!0});function cC(e){const i=e+"CollectionProvider",[r,s]=br(i),[l,f]=r(i,{collectionRef:{current:null},itemMap:new Map}),p=Yt(w=>{const{scope:g,children:b}=w,S=P.useRef(null),y=P.useRef(new Map).current;return v.jsx(l,{scope:g,itemMap:y,collectionRef:S,children:b})},"CollectionProvider");p.displayName=i;const a=e+"CollectionSlot",h=gr(a),d=P.forwardRef((w,g)=>{const{scope:b,children:S}=w,y=f(a,b),T=ht(g,y.collectionRef);return v.jsx(h,{ref:T,children:S})});d.displayName=a;const m=e+"CollectionItemSlot",c="data-radix-collection-item",_=gr(m),x=P.forwardRef((w,g)=>{const{scope:b,children:S,...y}=w,T=P.useRef(null),L=ht(g,T),R=f(m,b);return P.useEffect(()=>(R.itemMap.set(T,{ref:T,...y}),()=>void R.itemMap.delete(T))),v.jsx(_,{[c]:"",ref:L,children:S})});x.displayName=m;function E(w){const g=f(e+"CollectionConsumer",w);return P.useCallback(()=>{const S=g.collectionRef.current;if(!S)return[];const y=Array.from(S.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((R,D)=>y.indexOf(R.ref.current)-y.indexOf(D.ref.current))},[g.collectionRef,g.itemMap])}return Yt(E,"useCollection"),[{Provider:p,Slot:d,ItemSlot:x},E,s]}Yt(cC,"createCollection");var Fy=new WeakMap,Nt,Kn,Iu=(Kn=class extends Map{constructor(r){super(r);Yx(this,Nt);Ep(this,Nt,[...super.keys()]),Fy.set(this,!0)}set(r,s){return Fy.get(this)&&!this.has(r)&&un(this,Nt).push(r),super.set(r,s),this}insert(r,s,l){const f=this.has(s),p=f?this.size:this.size+1,a=zg(r),h=a>=0?Math.min(a,p-1):Math.max(p+a,0);if(f?un(this,Nt).indexOf(s)===h:h===this.size)return this.set(s,l),this;const d=un(this,Nt).filter(c=>c!==s);d.splice(h,0,s);const m=d.map(c=>[c,c===s?l:this.get(c)]);this.clear();for(const[c,_]of m)this.set(c,_);return this}with(r,s,l){const f=new Kn(this);return f.insert(r,s,l),f}before(r){const s=un(this,Nt).indexOf(r)-1;if(!(s<0))return this.entryAt(s)}setBefore(r,s,l){const f=un(this,Nt).indexOf(r);if(f===-1)return this;const p=un(this,Nt).indexOf(s),a=p!==-1&&p<f?f-1:f;return this.insert(a,s,l)}after(r){let s=un(this,Nt).indexOf(r);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(r,s,l){const f=un(this,Nt).indexOf(r);if(f===-1)return this;const p=un(this,Nt).indexOf(s),a=p!==-1&&p<=f?f:f+1;return this.insert(a,s,l)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ep(this,Nt,[]),super.clear()}delete(r){const s=super.delete(r);return s&&un(this,Nt).splice(un(this,Nt).indexOf(r),1),s}deleteAt(r){const s=this.keyAt(r);return s!==void 0?this.delete(s):!1}at(r){const s=Ku(un(this,Nt),r);if(s!==void 0)return this.get(s)}entryAt(r){const s=Ku(un(this,Nt),r);if(s!==void 0)return[s,this.get(s)]}indexOf(r){return un(this,Nt).indexOf(r)}keyAt(r){return Ku(un(this,Nt),r)}from(r,s){const l=this.indexOf(r);if(l===-1)return;let f=l+s;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.at(f)}keyFrom(r,s){const l=this.indexOf(r);if(l===-1)return;let f=l+s;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.keyAt(f)}find(r,s){let l=0;for(const f of this){if(Reflect.apply(r,s,[f,l,this]))return f;l++}}findIndex(r,s){let l=0;for(const f of this){if(Reflect.apply(r,s,[f,l,this]))return l;l++}return-1}filter(r,s){const l=[];let f=0;for(const p of this)Reflect.apply(r,s,[p,f,this])&&l.push(p),f++;return new Kn(l)}map(r,s){const l=[];let f=0;for(const p of this)l.push([p[0],Reflect.apply(r,s,[p,f,this])]),f++;return new Kn(l)}reduce(...r){const[s,l]=r,f=r.length>1;if(!f&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=0,a=l;for(const h of this)p===0&&!f?a=h:a=Reflect.apply(s,this,[a,h,p,this]),p++;return a}reduceRight(...r){const[s,l]=r,f=r.length>1;if(!f&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=l;for(let a=this.size-1;a>=0;a--){const h=this.entryAt(a);a===this.size-1&&!f?p=h:p=Reflect.apply(s,this,[p,h,a,this])}return p}sort(r){if(typeof r!="function")throw new TypeError("OrderedDict.sort requires a compare function");const s=[...this.entries()].sort(r);this.clear();for(const[l,f]of s)this.set(l,f);return this}toSorted(r){if(typeof r!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const s=[...this.entries()].sort(r);return new Kn(s)}toReversed(){const r=new Kn;for(let s=this.size-1;s>=0;s--){const l=this.keyAt(s),f=this.get(l);r.set(l,f)}return r}toSpliced(...r){const s=[...this.entries()];return s.splice(...r),new Kn(s)}slice(r,s){const l=new Kn;for(const f of un(this,Nt).slice(r,s))l.set(f,this.get(f));return l}every(r,s){let l=0;for(const f of this){if(!Reflect.apply(r,s,[f,l,this]))return!1;l++}return!0}some(r,s){let l=0;for(const f of this){if(Reflect.apply(r,s,[f,l,this]))return!0;l++}return!1}},Nt=new WeakMap,Yt(Kn,"OrderedDict"),Kn);function Ku(e,i){if("at"in Array.prototype)return Array.prototype.at.call(e,i);const r=uC(e,i);return r===-1?void 0:e[r]}Yt(Ku,"at");function uC(e,i){const r=e.length,s=zg(i),l=s>=0?s:r+s;return l<0||l>=r?-1:l}Yt(uC,"toSafeIndex");function zg(e){return e!==e||e===0?0:Math.trunc(e)}Yt(zg,"toSafeInteger");function y6(e){const i=e+"CollectionProvider",[r,s]=br(i),[l,f]=r(i);l.displayName=e+"CollectionStableContextProvider";const[p,a]=r(i);p.displayName=e+"CollectionStatefulContextProvider";const h=Yt(({state:R,...D})=>R?v.jsx(m,{...D,state:R}):v.jsx(d,{...D}),"CollectionProvider");h.displayName=i;const d=Yt(R=>{const D=S();return v.jsx(m,{...R,state:D})},"CollectionInit");d.displayName=e+"CollectionInit";const m=Yt(R=>{const{scope:D,children:A,state:j}=R,M=P.useRef(null),[I,B]=P.useState(null),H=ht(M,B),[U,W]=j,Y=P.useRef(new Iu),Q=P.useCallback(()=>{const K=Y.current;return fC(K)||K.sort(Qu),K},[]);return P.useEffect(()=>{if(!I)return;const K=pC(()=>{W(z=>{const O=z.toSorted(Qu);return O.some(([Z],F)=>z.keyAt(F)!==Z)?O:z})});return K.observe(I,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[I,W]),v.jsx(l,{scope:D,collectionElementRef:H,collectionElementRefObject:M,getCollection:Q,setCollection:W,registryRef:Y,children:v.jsx(p,{scope:D,collectionElement:I,collection:U,children:A})})},"CollectionProviderImpl");m.displayName=e+"CollectionProviderImpl";const c=e+"CollectionSlot",_=gr(c),x=P.forwardRef((R,D)=>{const{scope:A,children:j}=R,M=f(c,A),I=ht(D,M.collectionElementRef);return v.jsx(_,{ref:I,children:j})});x.displayName=c;const E=e+"CollectionItemSlot",w="data-radix-collection-item",g=gr(E),b=P.forwardRef((R,D)=>{const{scope:A,children:j,...M}=R,I=P.useRef(null),B=f(E,A),{setCollection:H,registryRef:U}=B,W=P.useRef(M);hC(W.current,M)||(W.current=M);const Y=W.current,Q=P.useCallback(O=>{const G=U.current;O?G.set(O,{...W.current,element:O}):I.current&&G.delete(I.current)},[U]),K=ht(D,Q,I);$t(()=>{const O=I.current,G=U.current;O&&G.has(O)&&G.set(O,{...Y,element:O})},[Y,U]);const z=P.useRef(null);return P.useEffect(()=>{const O=I.current,G=z.current;((G==null?void 0:G.element)??null)===O&&(!O||(G==null?void 0:G.itemData)===Y)||(z.current=O?{element:O,itemData:Y}:null,H(Z=>{const F=new Iu(Z);return G&&G.element!==O&&F.delete(G.element),O&&F.set(O,{...Y,element:O}),F.sort(Qu)}))}),P.useEffect(()=>()=>{const O=z.current;z.current=null,O&&H(G=>{if(!G.has(O.element))return G;const Z=new Iu(G);return Z.delete(O.element),Z})},[H]),v.jsx(g,{[w]:"",ref:K,children:j})});b.displayName=E;function S(){return P.useState(new Iu)}Yt(S,"useInitCollection");function y(R){const{collection:D}=a(e+"CollectionConsumer",R);return D}Yt(y,"useCollection");function T(R){const{getCollection:D}=f(e+"CollectionConsumer",R);return D}return Yt(T,"useGetCollection"),[{Provider:h,Slot:x,ItemSlot:b},{createCollectionScope:s,useCollection:y,useGetCollection:T,useInitCollection:S}]}Yt(y6,"createCollection");function hC(e,i){if(e===i)return!0;if(typeof e!="object"||typeof i!="object"||e==null||i==null)return!1;const r=Object.keys(e),s=Object.keys(i);if(r.length!==s.length)return!1;for(const l of r)if(!Object.prototype.hasOwnProperty.call(i,l)||e[l]!==i[l])return!1;return!0}Yt(hC,"shallowEqual");function dC(e,i){return!!(i.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Yt(dC,"isElementPreceding");function fC(e){let i;for(const r of e.keys()){if(i){const s=i.compareDocumentPosition(r);if(!(s&Node.DOCUMENT_POSITION_DISCONNECTED)&&s&Node.DOCUMENT_POSITION_PRECEDING)return!1}i=r}return!0}Yt(fC,"isInDocumentOrder");function Qu(e,i){return!e[1].element||!i[1].element?0:dC(e[1].element,i[1].element)?-1:1}Yt(Qu,"sortByDocumentPosition");function pC(e){return new MutationObserver(r=>{for(const s of r)if(s.type==="childList"){e();return}})}Yt(pC,"getChildListObserver");var b6=Object.defineProperty,S6=(e,i)=>b6(e,"name",{value:i,configurable:!0}),w6={LTR:"ltr"},C6=P.createContext(void 0);function mC(e){const i=P.useContext(C6);return e||i||w6.LTR}S6(mC,"useDirection");var E6=Object.defineProperty,k6=(e,i)=>E6(e,"name",{value:i,configurable:!0}),gC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),T6=P.forwardRef(k6(function(i,r){return v.jsx(wt.span,{...i,ref:r,style:{...gC,...i.style}})},"VisuallyHidden")),R6=Object.defineProperty,mt=(e,i)=>R6(e,"name",{value:i,configurable:!0}),Uy={ItemAligned:"item-aligned",Popper:"popper"},A6={RTL:"rtl"},L6=[" ","Enter","ArrowUp","ArrowDown"],D6=[" ","Enter"],ha="Select",[jh,Hg,M6]=cC(ha),[Js,sB]=br(ha,[M6,Sa]),Fg=Sa(),[j6,ps]=Js(ha),[O6,N6]=Js(ha);function vC(e){const{__scopeSelect:i,children:r,open:s,defaultOpen:l,onOpenChange:f,value:p,defaultValue:a,onValueChange:h,dir:d,name:m,autoComplete:c,disabled:_,required:x,form:E,internal_do_not_use_render:w}=e,g=Fg(i),[b,S]=P.useState(null),[y,T]=P.useState(null),[L,R]=P.useState(!1),D=mC(d),[A,j]=Gs({prop:s,defaultProp:l??!1,onChange:f,caller:ha}),[M,I]=Gs({prop:p,defaultProp:a,onChange:h,caller:ha}),B=P.useRef(null),H=P.useRef(!1),[U,W]=P.useState(null),Y=mt(le=>{W({value:le,hasConsumerStoppedPropagation:H.current}),I(le)},"handleUserSelect"),Q=P.useRef(M);P.useEffect(()=>{const le=E?b==null?void 0:b.ownerDocument.getElementById(E):b==null?void 0:b.form;if(le instanceof HTMLFormElement){const X=mt(()=>I(Q.current),"reset");return le.addEventListener("reset",X),()=>le.removeEventListener("reset",X)}},[E,b,I]);const K=b?!!E||!!b.closest("form"):!0,[z,O]=P.useState(new Set),G=Fi(),Z=Array.from(z).map(le=>le.props.value).join(";"),F=P.useCallback(le=>{O(X=>new Set(X).add(le))},[]),V=P.useCallback(le=>{O(X=>{const $=new Set(X);return $.delete(le),$})},[]),ne={required:x,trigger:b,onTriggerChange:S,valueNode:y,onValueNodeChange:T,valueNodeHasChildren:L,onValueNodeHasChildrenChange:R,contentId:G,value:M,onValueChange:I,hasConsumerStoppedPropagationRef:H,userSelection:U,onUserSelect:Y,open:A,onOpenChange:j,dir:D,triggerPointerDownPosRef:B,disabled:_,name:m,autoComplete:c,form:E,nativeOptions:z,nativeSelectKey:Z,isFormControl:K};return v.jsx(Dg,{...g,children:v.jsx(j6,{scope:i,...ne,children:v.jsx(jh.Provider,{scope:i,children:v.jsx(O6,{scope:i,onNativeOptionAdd:F,onNativeOptionRemove:V,children:yC(w)?w(ne):r})})})})}mt(vC,"SelectProvider");var B6=mt(e=>{const{__scopeSelect:i,children:r,...s}=e;return v.jsx(vC,{__scopeSelect:i,...s,internal_do_not_use_render:({isFormControl:l})=>v.jsxs(v.Fragment,{children:[r,l?v.jsx(aL,{__scopeSelect:i}):null]})})},"Select"),P6="SelectTrigger",I6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,disabled:l=!1,...f}=i,p=Fg(s),a=ps(P6,s),h=a.disabled||l,d=ht(r,a.onTriggerChange),m=Hg(s),c=P.useRef("touch"),[_,x,E]=Ug(g=>{const b=m().filter(T=>!T.disabled),S=b.find(T=>T.value===a.value),y=$g(b,g,S);y!==void 0&&a.onUserSelect(y.value)}),w=mt(g=>{h||(a.onOpenChange(!0),E()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})},"handleOpen");return v.jsx(Mg,{asChild:!0,...p,children:v.jsx(wt.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Ql(a.value)?"":void 0,...f,ref:d,onClick:tt(f.onClick,g=>{g.currentTarget.focus(),c.current!=="mouse"&&w(g)}),onPointerDown:tt(f.onPointerDown,g=>{c.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(w(g),g.preventDefault())}),onKeyDown:tt(f.onKeyDown,g=>{const b=_.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&(a.hasConsumerStoppedPropagationRef.current=g.isPropagationStopped(),x(g.key)),!(b&&g.key===" ")&&L6.includes(g.key)&&(w(),g.preventDefault())})})})},"SelectTrigger")),z6="SelectValue",H6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:f,children:p,placeholder:a="",...h}=i,d=ps(z6,s),{onValueNodeHasChildrenChange:m}=d,c=p!==void 0,_=ht(r,d.onValueNodeChange);$t(()=>{m(c)},[m,c]);const x=Ql(d.value);return v.jsx(wt.span,{...h,asChild:x?!1:h.asChild,ref:_,style:{pointerEvents:"none"},children:v.jsx(P.Fragment,{children:x?a:p},x?"placeholder":"value")})},"SelectValue")),F6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,...f}=i;return v.jsx(wt.span,{"aria-hidden":!0,...f,ref:r,children:l||"▼"})},"SelectIcon")),U6="SelectPortal",[$6,q6]=Js(U6,{forceMount:void 0}),V6=mt(e=>{const{__scopeSelect:i,forceMount:r,...s}=e;return v.jsx($6,{scope:e.__scopeSelect,forceMount:r,children:v.jsx(wh,{asChild:!0,...s})})},"SelectPortal"),Ks="SelectContent",W6=P.forwardRef(mt(function(i,r){const s=q6(Ks,i.__scopeSelect),{forceMount:l=s.forceMount,...f}=i,p=ps(Ks,i.__scopeSelect),[a,h]=P.useState();return $t(()=>{h(new DocumentFragment)},[]),v.jsx(Sr,{present:l||p.open,children:({present:d})=>d?v.jsx(X6,{...f,ref:r}):v.jsx(G6,{...f,fragment:a})})},"SelectContent")),G6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,fragment:f}=i;return f?Xl.createPortal(v.jsx(_C,{scope:s,children:v.jsx(jh.Slot,{scope:s,children:v.jsx("div",{ref:r,children:l})})}),f):null},"SelectContentFragment")),bi=10,[_C,Oh]=Js(Ks),Y6=gr("SelectContent.RemoveScroll"),X6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s}=i,{position:l=Uy.ItemAligned,onCloseAutoFocus:f,onEscapeKeyDown:p,onPointerDownOutside:a,side:h,sideOffset:d,align:m,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:E,sticky:w,hideWhenDetached:g,avoidCollisions:b,...S}=i,y=ps(Ks,s),[T,L]=P.useState(null),[R,D]=P.useState(null),A=ht(r,L),[j,M]=P.useState(null),[I,B]=P.useState(null),H=Hg(s),[U,W]=P.useState(!1),Y=P.useRef(!1),Q=P.useRef(!1),K=P.useRef(!1);P.useEffect(()=>{if(T)return Sg(T)},[T]),Kl();const z=P.useCallback(ee=>{const[ue,...he]=H().map(Re=>Re.ref.current),[we]=he.slice(-1),Se=document.activeElement;for(const Re of ee)if(Re===Se||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ue&&R&&(R.scrollTop=0),Re===we&&R&&(R.scrollTop=R.scrollHeight),Re==null||Re.focus(),document.activeElement!==Se))return},[H,R]),O=P.useCallback(()=>z([j,T]),[z,j,T]);P.useEffect(()=>{U&&O()},[U,O]);const{onOpenChange:G,triggerPointerDownPosRef:Z}=y;P.useEffect(()=>{if(T){let ee={x:0,y:0};const ue=mt(we=>{var Se,Re;ee={x:Math.abs(Math.round(we.pageX)-(((Se=Z.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(we.pageY)-(((Re=Z.current)==null?void 0:Re.y)??0))}},"handlePointerMove"),he=mt(we=>{ee.x<=10&&ee.y<=10?we.preventDefault():we.composedPath().includes(T)||G(!1),document.removeEventListener("pointermove",ue),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",he,{capture:!0})}}},[T,G,Z]),P.useEffect(()=>{const ee=mt(()=>G(!1),"close");return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[G]);const[F,V]=Ug(ee=>{const ue=H().filter(Se=>!Se.disabled),he=ue.find(Se=>Se.ref.current===document.activeElement),we=$g(ue,ee,he);we&&setTimeout(()=>{var Se;return(Se=we.ref.current)==null?void 0:Se.focus()})}),ne=P.useCallback((ee,ue,he)=>{const we=!Q.current;we&&(Q.current=!0);const Se=!Y.current&&!he;y.value!==void 0&&y.value===ue||Se?(M(ee),Se&&(Y.current=!0)):we&&M(ee)},[y.value]),le=P.useCallback(()=>T==null?void 0:T.focus(),[T]),X=P.useCallback((ee,ue,he)=>{if(!ee)return;const we=!K.current;we&&(K.current=!0);const Se=!Y.current&&!he;(y.value!==void 0&&y.value===ue||Se||we)&&B(ee)},[y.value]),$=l===Uy.Popper?$y:K6,oe=$===$y?{side:h,sideOffset:d,align:m,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:E,sticky:w,hideWhenDetached:g,avoidCollisions:b}:{};return v.jsx(_C,{scope:s,content:T,viewport:R,onViewportChange:D,itemRefCallback:ne,selectedItem:j,onItemLeave:le,itemTextRefCallback:X,focusSelectedItem:O,selectedItemText:I,position:l,isPositioned:U,searchRef:F,children:v.jsx(Eh,{as:Y6,allowPinchZoom:!0,children:v.jsx(gg,{asChild:!0,trapped:y.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:tt(f,ee=>{var ue;(ue=y.trigger)==null||ue.focus({preventScroll:!0}),ee.preventDefault()}),children:v.jsx(Sh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:a,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:v.jsx($,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:ee=>ee.preventDefault(),...S,...oe,onPlaced:()=>W(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:tt(S.onKeyDown,ee=>{const ue=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ue&&ee.key.length===1&&V(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let we=H().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const Se=ee.target,Re=we.indexOf(Se);we=we.slice(Re+1)}setTimeout(()=>z(we)),ee.preventDefault()}})})})})})})},"SelectContentImpl")),K6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,onPlaced:l,...f}=i,p=ps(Ks,s),a=Oh(Ks,s),[h,d]=P.useState(null),[m,c]=P.useState(null),_=ht(r,c),x=Hg(s),E=P.useRef(!1),w=P.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:S,focusSelectedItem:y}=a,T=P.useCallback(()=>{if(p.trigger&&p.valueNode&&h&&m&&g&&b&&S){const A=p.trigger.getBoundingClientRect(),j=m.getBoundingClientRect(),M=p.valueNode.getBoundingClientRect(),I=S.getBoundingClientRect();if(p.dir!==A6.RTL){const he=I.left-j.left,we=M.left-he,Se=A.left-we,Re=A.width+Se,qe=Math.max(Re,j.width),ke=window.innerWidth-bi,ze=Mm(we,[bi,Math.max(bi,ke-qe)]);h.style.minWidth=Re+"px",h.style.left=ze+"px"}else{const he=j.right-I.right,we=window.innerWidth-M.right-he,Se=window.innerWidth-A.right-we,Re=A.width+Se,qe=Math.max(Re,j.width),ke=window.innerWidth-bi,ze=Mm(we,[bi,Math.max(bi,ke-qe)]);h.style.minWidth=Re+"px",h.style.right=ze+"px"}const B=x(),H=window.innerHeight-bi*2,U=g.scrollHeight,W=window.getComputedStyle(m),Y=parseInt(W.borderTopWidth,10),Q=parseInt(W.paddingTop,10),K=parseInt(W.borderBottomWidth,10),z=parseInt(W.paddingBottom,10),O=Y+Q+U+z+K,G=Math.min(b.offsetHeight*5,O),Z=window.getComputedStyle(g),F=parseInt(Z.paddingTop,10),V=parseInt(Z.paddingBottom,10),ne=A.top+A.height/2-bi,le=H-ne,X=b.offsetHeight/2,$=b.offsetTop+X,oe=Y+Q+$,ee=O-oe;if(oe<=ne){const he=B.length>0&&b===B[B.length-1].ref.current;h.style.bottom="0px";const we=m.clientHeight-g.offsetTop-g.offsetHeight,Se=Math.max(le,X+(he?V:0)+we+K),Re=oe+Se;h.style.height=Re+"px"}else{const he=B.length>0&&b===B[0].ref.current;h.style.top="0px";const Se=Math.max(ne,Y+g.offsetTop+(he?F:0)+X)+ee;h.style.height=Se+"px",g.scrollTop=oe-ne+g.offsetTop}h.style.margin=`${bi}px 0`,h.style.minHeight=G+"px",h.style.maxHeight=H+"px",l==null||l(),requestAnimationFrame(()=>E.current=!0)}},[x,p.trigger,p.valueNode,h,m,g,b,S,p.dir,l]);$t(()=>T(),[T]);const[L,R]=P.useState();$t(()=>{m&&R(window.getComputedStyle(m).zIndex)},[m]);const D=P.useCallback(A=>{A&&w.current===!0&&(T(),y==null||y(),w.current=!1)},[T,y]);return v.jsx(Q6,{scope:s,contentWrapper:h,shouldExpandOnScrollRef:E,onScrollButtonChange:D,children:v.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:v.jsx(wt.div,{...f,ref:_,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),$y=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,align:l="start",collisionPadding:f=bi,...p}=i,a=Fg(s);return v.jsx(jg,{...a,...p,ref:r,align:l,collisionPadding:f,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[Q6,Z6]=Js(Ks,{}),qy="SelectViewport",J6=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,nonce:l,...f}=i,p=Oh(qy,s),a=Z6(qy,s),h=ht(r,p.onViewportChange),d=P.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),v.jsx(jh.Slot,{scope:s,children:v.jsx(wt.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:tt(f.onScroll,m=>{const c=m.currentTarget,{contentWrapper:_,shouldExpandOnScrollRef:x}=a;if(x!=null&&x.current&&_){const E=Math.abs(d.current-c.scrollTop);if(E>0){const w=window.innerHeight-bi*2,g=parseFloat(_.style.minHeight),b=parseFloat(_.style.height),S=Math.max(g,b);if(S<w){const y=S+E,T=Math.min(w,y),L=y-T;_.style.height=T+"px",_.style.bottom==="0px"&&(c.scrollTop=L>0?L:0,_.style.justifyContent="flex-end")}}}d.current=c.scrollTop})})})]})},"SelectViewport")),eL="SelectGroup",[oB,aB]=Js(eL),jm="SelectItem",[tL,xC]=Js(jm),nL=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,value:l,disabled:f=!1,textValue:p,...a}=i,h=ps(jm,s),d=Oh(jm,s),m=h.value===l,[c,_]=P.useState(p??""),[x,E]=P.useState(!1),w=Ui(T=>{var L;return(L=d.itemRefCallback)==null?void 0:L.call(d,T,l,f)}),g=ht(r,w),b=Fi(),S=P.useRef("touch");function y(T){h.hasConsumerStoppedPropagationRef.current=T.isPropagationStopped(),h.onUserSelect(l),h.onOpenChange(!1)}return mt(y,"handleSelect"),v.jsx(tL,{scope:s,value:l,disabled:f,textId:b,isSelected:m,onItemTextChange:P.useCallback(T=>{_(L=>L||((T==null?void 0:T.textContent)??"").trim())},[]),children:v.jsx(jh.ItemSlot,{scope:s,value:l,disabled:f,textValue:c,children:v.jsx(wt.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...a,ref:g,onFocus:tt(a.onFocus,()=>E(!0)),onBlur:tt(a.onBlur,()=>E(!1)),onClick:tt(a.onClick,T=>{f||S.current!=="mouse"&&y(T)}),onPointerUp:tt(a.onPointerUp,T=>{f||S.current==="mouse"&&y(T)}),onPointerDown:tt(a.onPointerDown,T=>{S.current=T.pointerType}),onPointerMove:tt(a.onPointerMove,T=>{var L;S.current=T.pointerType,f?(L=d.onItemLeave)==null||L.call(d):S.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:tt(a.onPointerLeave,T=>{var L;T.currentTarget===document.activeElement&&((L=d.onItemLeave)==null||L.call(d))}),onKeyDown:tt(a.onKeyDown,T=>{var R;f||T.target!==T.currentTarget||((R=d.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(D6.includes(T.key)&&y(T),T.key===" "&&T.preventDefault())})})})})},"SelectItem")),zu="SelectItemText",iL=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:f,...p}=i,a=ps(zu,s),h=Oh(zu,s),d=xC(zu,s),m=N6(zu,s),[c,_]=P.useState(null),x=Ui(y=>{var T;return(T=h.itemTextRefCallback)==null?void 0:T.call(h,y,d.value,d.disabled)}),E=ht(r,_,d.onItemTextChange,x),w=c==null?void 0:c.textContent,g=P.useMemo(()=>v.jsx("option",{value:d.value,disabled:d.disabled,children:w},d.value),[d.disabled,d.value,w]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=m;return $t(()=>(b(g),()=>S(g)),[b,S,g]),v.jsxs(v.Fragment,{children:[v.jsx(wt.span,{id:d.textId,...p,ref:E}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Ql(a.value)?Xl.createPortal(p.children,a.valueNode):null]})},"SelectItemText")),rL="SelectItemIndicator",sL=P.forwardRef(mt(function(i,r){const{__scopeSelect:s,...l}=i;return xC(rL,s).isSelected?v.jsx(wt.span,{"aria-hidden":!0,...l,ref:r}):null},"SelectItemIndicator")),oL="SelectBubbleInput",aL=P.forwardRef(mt(function({__scopeSelect:i,...r},s){const l=ps(oL,i),{value:f,onValueChange:p,required:a,disabled:h,name:d,autoComplete:m,form:c,userSelection:_}=l,{nativeOptions:x,nativeSelectKey:E}=l,w=P.useRef(null),g=ht(s,w),b=f??"",S=P.useRef(b),y=P.useRef(_),T=P.useRef(!1),L=Array.from(x).some(R=>(R.props.value??"")==="");return P.useEffect(()=>{const R=w.current;if(!R)return;const D=window.HTMLSelectElement.prototype,j=Object.getOwnPropertyDescriptor(D,"value").set,M=_!==null&&_!==y.current;y.current=_;const I=S.current!==b;S.current=b;const B=M&&I;if(M&&!I&&_.value!==b&&!_.hasConsumerStoppedPropagation&&j){T.current=!0;try{j.call(R,_.value),R.dispatchEvent(new Event("change",{bubbles:!0}))}finally{T.current=!1,j.call(R,b)}return}const H=B&&!_.hasConsumerStoppedPropagation;if(I&&j){const U=new Event("change",{bubbles:H});j.call(R,b),R.dispatchEvent(U)}},[b,_]),v.jsxs(wt.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:d,autoComplete:m,disabled:h,form:c,onChange:R=>{T.current||p(R.target.value)},...r,style:{...gC,...r.style},ref:g,defaultValue:b,children:[Ql(f)&&!L?v.jsx("option",{value:""}):null,Array.from(x)]},E)},"SelectBubbleInput"));function yC(e){return typeof e=="function"}mt(yC,"isFunction");function Ql(e){return e===""||e===void 0}mt(Ql,"shouldShowPlaceholder");function Ug(e){const i=Ui(e),r=P.useRef(""),s=P.useRef(0),l=P.useCallback(p=>{const a=r.current+p;i(a);function h(d){r.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>h(""),1e3))}mt(h,"updateSearch"),h(a)},[i]),f=P.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,l,f]}mt(Ug,"useTypeaheadSearch");function $g(e,i,r){const l=i.length>1&&Array.from(i).every(d=>d===i[0])?i[0]:i,f=r?e.indexOf(r):-1;let p=bC(e,Math.max(f,0));l.length===1&&(p=p.filter(d=>d!==r));const h=p.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==r?h:void 0}mt($g,"findNextItem");function bC(e,i){return e.map((r,s)=>e[(i+s)%e.length])}mt(bC,"wrapArray");const SC="__empty__",wC=e=>e===""?SC:e,lL=e=>e===SC?"":e;function ia({value:e,onValueChange:i,placeholder:r,size:s="sm",disabled:l,className:f,children:p}){return v.jsxs(B6,{value:wC(e),onValueChange:a=>i(lL(a)),disabled:l,children:[v.jsxs(I6,{className:xe("flex w-full select-none items-center justify-between rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","data-[placeholder]:text-muted-foreground/60",s==="sm"?"gap-1 px-2 py-1.5 text-xs":"gap-2 px-3 py-2 text-sm",f),children:[v.jsx(H6,{placeholder:r}),v.jsx(F6,{asChild:!0,children:v.jsx(ql,{className:xe("shrink-0 text-muted-foreground",s==="sm"?"h-3 w-3":"h-4 w-4")})})]}),v.jsx(V6,{children:v.jsx(W6,{position:"popper",sideOffset:4,className:xe("z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden","rounded-lg border bg-card shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:v.jsx(J6,{className:"p-1",children:p})})})]})}const En=P.forwardRef(({value:e,children:i,className:r},s)=>v.jsxs(nL,{ref:s,value:wC(e),className:xe("relative flex w-full cursor-pointer select-none items-center rounded","px-2 py-1.5 pr-7 text-xs outline-none","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),children:[v.jsx(iL,{children:i}),v.jsx(sL,{className:"absolute right-2 flex items-center justify-center",children:v.jsx($l,{className:"h-3 w-3 text-foreground"})})]}));En.displayName="SelectItem";const qg=P.forwardRef(({className:e,size:i="sm",...r},s)=>v.jsx("textarea",{ref:s,className:xe("w-full resize-y rounded border bg-transparent font-serif leading-relaxed","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));qg.displayName="Textarea";const Vy={manual:"Manual: ask before edits and commands",default:"Default (older name of Manual)",acceptEdits:"Accept edits: ask only for commands",plan:"Plan: read and plan, change nothing",auto:"Auto: a classifier decides what to ask",dontAsk:"Don't ask: deny what is not allowed",bypassPermissions:"Bypass: never ask"},cL=["default","fable","opus","sonnet","haiku","opus[1m]","sonnet[1m]","claude-fable-5-1","claude-opus-5-5","claude-sonnet-5-5","claude-haiku-5-5"],Hu="";function uL(){var _,x;const e=ut(()=>ve.claudeSettings(),[]),[i,r]=P.useState(null),[s,l]=P.useState(""),[f,p]=P.useState(""),[a,h]=P.useState("");P.useEffect(()=>{if(!e.data)return;const E=e.data.settings;r(E),l(E.model),p(E.fallbackModel),h(E.addDirs.join(`
506
+ `))},[e.data]);const d=async E=>{const w=await rt(()=>ve.saveClaudeSettings(E),"Saved. New sessions use it.");w&&r(w)},m=((_=e.data)==null?void 0:_.permissionModes)??[],c=((x=e.data)==null?void 0:x.efforts)??[];return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Settings",title:"Claude settings",description:"How the hub starts claude. Applies to sessions started from now on; empty keeps your own Claude Code setting."}),i&&v.jsxs(v.Fragment,{children:[v.jsx(Dt,{title:"Permissions",description:"Which mode a session starts in.",children:v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Hs,{label:"Sessions you open",hint:"New session, resumes and hub tasks.",children:v.jsxs(ia,{value:i.permissionMode,onValueChange:E=>void d({permissionMode:E}),children:[v.jsx(En,{value:Hu,children:"Your Claude Code setting"}),m.map(E=>v.jsx(En,{value:E,children:Vy[E]??E},E))]})}),v.jsx(Hs,{label:"Unattended runs",hint:"Cron, webhook and queued runs. Their questions go to the channels.",children:v.jsxs(ia,{value:i.runPermissionMode,onValueChange:E=>void d({runPermissionMode:E}),children:[v.jsx(En,{value:Hu,children:"Your Claude Code setting"}),m.map(E=>v.jsx(En,{value:E,children:Vy[E]??E},E))]})})]})}),v.jsxs(Dt,{title:"Model",description:"An alias or a full model id.",children:[v.jsx("datalist",{id:"claude-models",children:cL.map(E=>v.jsx("option",{value:E},E))}),v.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[v.jsx(Hs,{label:"Model",children:v.jsx(pi,{list:"claude-models",value:s,placeholder:"Your Claude Code setting",onChange:E=>l(E.target.value),onBlur:()=>s!==i.model&&void d({model:s.trim()})})}),v.jsx(Hs,{label:"Fallback model",hint:"Used when the model is overloaded.",children:v.jsx(pi,{list:"claude-models",value:f,placeholder:"None",onChange:E=>p(E.target.value),onBlur:()=>f!==i.fallbackModel&&void d({fallbackModel:f.trim()})})}),v.jsx(Hs,{label:"Effort",children:v.jsxs(ia,{value:i.effort,onValueChange:E=>void d({effort:E}),children:[v.jsx(En,{value:Hu,children:"Your Claude Code setting"}),c.map(E=>v.jsx(En,{value:E,children:E},E))]})})]})]}),v.jsx(Dt,{title:"Access",description:"What else a session can reach.",children:v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Hs,{label:"Extra directories",hint:"One path per line, passed as --add-dir.",children:v.jsx(qg,{rows:3,className:"font-mono",value:a,placeholder:"C:\\Source code\\shared-lib",onChange:E=>h(E.target.value),onBlur:()=>a!==i.addDirs.join(`
507
507
  `)&&void d({addDirs:a.split(`
508
- `)})})}),v.jsx(Hs,{label:"Claude in Chrome",children:v.jsxs(ia,{value:i.chrome,onValueChange:E=>void d({chrome:E}),children:[v.jsx(Cn,{value:Hu,children:"Your Claude Code setting"}),v.jsx(Cn,{value:"on",children:"On"}),v.jsx(Cn,{value:"off",children:"Off"})]})})]})})]})]})})}class CC extends Error{constructor(i,r){super(i),this.status=r}}async function ea(e,i){const r=await fetch(`${Hi()}/files${e}`,{...i,headers:{"Content-Type":"application/json"}}),s=await r.json().catch(()=>({}));if(!r.ok)throw new CC(s.error??r.statusText,r.status);return s}const ns=(e,i,r)=>ea(i,{method:e,body:JSON.stringify(r)}),Xt={list:(e,i)=>ea(`/list?path=${encodeURIComponent(e)}${i?"&ignored=1":""}`),read:e=>ea(`/read?path=${encodeURIComponent(e)}`),blame:e=>ea(`/blame?path=${encodeURIComponent(e)}`),commit:e=>ea(`/commit?sha=${encodeURIComponent(e)}`),stat:e=>ea(`/stat?path=${encodeURIComponent(e)}`),write:(e,i,r)=>ns("PUT","/write",{path:e,content:i,expectedMtimeMs:r}),create:e=>ns("POST","/create",{path:e}),mkdir:e=>ns("POST","/mkdir",{path:e}),rename:(e,i)=>ns("POST","/rename",{from:e,to:i}),remove:e=>ns("POST","/delete",{path:e}),reveal:e=>ns("POST","/reveal",{path:e}),copyToClipboard:e=>ns("POST","/clipboard",{path:e}),copy:(e,i)=>ns("POST","/copy",{from:e,folder:i})},hL=e=>/\.(md|markdown|mdx)$/i.test(e),dL=e=>/\.(html?|xhtml)$/i.test(e);function Wy(e){var r;const i=((r=e.split(".").pop())==null?void 0:r.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif","svg"].includes(i)?"image":["mp3","wav","ogg","oga","m4a","aac","flac","opus","weba"].includes(i)?"audio":["mp4","webm","ogv","mov","m4v","mkv"].includes(i)?"video":null}const Om=e=>`${Hi()}/files/raw/${e.split("/").map(encodeURIComponent).join("/")}`,fL="modulepreload",pL=function(e){return"/"+e},Gy={},mL=function(i,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),h=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));l=p(r.map(d=>{if(d=pL(d),d in Gy)return;Gy[d]=!0;const m=d.endsWith(".css"),c=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${c}`))return;const _=document.createElement("link");if(_.rel=m?"stylesheet":fL,m||(_.as="script"),_.crossOrigin="",_.href=d,h&&_.setAttribute("nonce",h),document.head.appendChild(_),m)return new Promise((x,E)=>{_.addEventListener("load",x),_.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(p){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=p,window.dispatchEvent(a),!a.defaultPrevented)throw p}return l.then(p=>{for(const a of p||[])a.status==="rejected"&&f(a.reason);return i().catch(f)})},gL=P.lazy(()=>mL(()=>import("./MonacoEditor-DbrZH7RQ.js").then(e=>e.b),__vite__mapDeps([0,1])));function EC(e){return v.jsx(P.Suspense,{fallback:v.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading editor..."}),children:v.jsx(gL,{...e})})}function vL(e,i){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const _L=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yL={};function Yy(e,i){return(yL.jsx?xL:_L).test(e)}const bL=/[ \t\n\f\r]/g;function SL(e){return typeof e=="object"?e.type==="text"?Xy(e.value):!1:Xy(e)}function Xy(e){return e.replace(bL,"")===""}class Zl{constructor(i,r,s){this.normal=r,this.property=i,s&&(this.space=s)}}Zl.prototype.normal={};Zl.prototype.property={};Zl.prototype.space=void 0;function kC(e,i){const r={},s={};for(const l of e)Object.assign(r,l.property),Object.assign(s,l.normal);return new Zl(r,s,i)}function Nm(e){return e.toLowerCase()}class In{constructor(i,r){this.attribute=r,this.property=i}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let wL=0;const Ue=Js(),Ht=Js(),Bm=Js(),be=Js(),xt=Js(),qs=Js(),Xn=Js();function Js(){return 2**++wL}const Pm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Ht,commaOrSpaceSeparated:Xn,commaSeparated:qs,number:be,overloadedBoolean:Bm,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),$p=Object.keys(Pm);class Vg extends In{constructor(i,r,s,l){let f=-1;if(super(i,r),Ky(this,"space",l),typeof s=="number")for(;++f<$p.length;){const p=$p[f];Ky(this,$p[f],(s&Pm[p])===Pm[p])}}}Vg.prototype.defined=!0;function Ky(e,i,r){r&&(e[i]=r)}function Ca(e){const i={},r={};for(const[s,l]of Object.entries(e.properties)){const f=new Vg(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(f.mustUseProperty=!0),i[s]=f,r[Nm(s)]=s,r[Nm(f.attribute)]=s}return new Zl(i,r,e.space)}const TC=Ca({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:xt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:be,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:xt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Ht,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function RC(e,i){return i in e?e[i]:i}function AC(e,i){return RC(e,i.toLowerCase())}const CL=Ca({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qs,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alpha:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:xt,autoFocus:Ue,autoPlay:Ue,blocking:xt,capture:null,charSet:null,checked:Ue,cite:null,className:xt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:Ht,controls:Ue,controlsList:xt,coords:be|qs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Bm,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:xt,height:be,hidden:Bm,high:be,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ue,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:be,pattern:null,ping:xt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:xt,required:Ue,reversed:Ue,rows:be,rowSpan:be,sandbox:xt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootCustomElementRegistry:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shadowRootSerializable:Ue,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Ht,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ue,disablePictureInPicture:Ue,disableRemotePlayback:Ue,exportParts:qs,part:xt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:AC}),EL=Ca({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:xt,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:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,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:qs,g2:qs,glyphName:qs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,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:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,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:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:RC}),LC=Ca({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),DC=Ca({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:AC}),MC=Ca({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),kL={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"},TL=/[A-Z]/g,Qy=/-[a-z]/g,RL=/^data[-\w.:]+$/i;function AL(e,i){const r=Nm(i);let s=i,l=In;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&RL.test(i)){if(i.charAt(4)==="-"){const f=i.slice(5).replace(Qy,DL);s="data"+f.charAt(0).toUpperCase()+f.slice(1)}else{const f=i.slice(4);if(!Qy.test(f)){let p=f.replace(TL,LL);p.charAt(0)!=="-"&&(p="-"+p),i="data"+p}}l=Vg}return new l(s,i)}function LL(e){return"-"+e.toLowerCase()}function DL(e){return e.charAt(1).toUpperCase()}const ML=kC([TC,CL,LC,DC,MC],"html"),Wg=kC([TC,EL,LC,DC,MC],"svg");function jL(e){return e.join(" ").trim()}var Zo={},qp,Zy;function OL(){if(Zy)return qp;Zy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,f=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p=/^[;\s]*/,a=/^\s+|\s+$/g,h=`
509
- `,d="/",m="*",c="",_="comment",x="declaration";function E(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var S=1,y=1;function T(U){var W=U.match(i);W&&(S+=W.length);var Y=U.lastIndexOf(h);y=~Y?U.length-Y:y+U.length}function L(){var U={line:S,column:y};return function(W){return W.position=new R(U),j(),W}}function R(U){this.start=U,this.end={line:S,column:y},this.source=b.source}R.prototype.content=g;function D(U){var W=new Error(b.source+":"+S+":"+y+": "+U);if(W.reason=U,W.filename=b.source,W.line=S,W.column=y,W.source=g,!b.silent)throw W}function A(U){var W=U.exec(g);if(W){var Y=W[0];return T(Y),g=g.slice(Y.length),W}}function j(){A(r)}function M(U){var W;for(U=U||[];W=I();)W!==!1&&U.push(W);return U}function I(){var U=L();if(!(d!=g.charAt(0)||m!=g.charAt(1))){for(var W=2;c!=g.charAt(W)&&(m!=g.charAt(W)||d!=g.charAt(W+1));)++W;if(W+=2,c===g.charAt(W-1))return D("End of comment missing");var Y=g.slice(2,W-2);return y+=2,T(Y),g=g.slice(W),y+=2,U({type:_,comment:Y})}}function B(){var U=L(),W=A(s);if(W){if(I(),!A(l))return D("property missing ':'");var Y=A(f),Q=U({type:x,property:w(W[0].replace(e,c)),value:Y?w(Y[0].replace(e,c)):c});return A(p),Q}}function H(){var U=[];M(U);for(var W;W=B();)W!==!1&&(U.push(W),M(U));return U}return j(),H()}function w(g){return g?g.replace(a,c):c}return qp=E,qp}var Jy;function NL(){if(Jy)return Zo;Jy=1;var e=Zo&&Zo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=r;const i=e(OL());function r(s,l){let f=null;if(!s||typeof s!="string")return f;const p=(0,i.default)(s),a=typeof l=="function";return p.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;a?l(d,m,h):m&&(f=f||{},f[d]=m)}),f}return Zo}var wl={},eb;function BL(){if(eb)return wl;eb=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,f=function(d){return!d||r.test(d)||e.test(d)},p=function(d,m){return m.toUpperCase()},a=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),f(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(l,a):d=d.replace(s,a),d.replace(i,p))};return wl.camelCase=h,wl}var Cl,tb;function PL(){if(tb)return Cl;tb=1;var e=Cl&&Cl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},i=e(NL()),r=BL();function s(l,f){var p={};return!l||typeof l!="string"||(0,i.default)(l,function(a,h){a&&h&&(p[(0,r.camelCase)(a,f)]=h)}),p}return s.default=s,Cl=s,Cl}var IL=PL();const zL=ng(IL),jC=OC("end"),Gg=OC("start");function OC(e){return i;function i(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function HL(e){const i=Gg(e),r=jC(e);if(i&&r)return{start:i,end:r}}function Ll(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nb(e.position):"start"in e||"end"in e?nb(e):"line"in e||"column"in e?Im(e):""}function Im(e){return ib(e&&e.line)+":"+ib(e&&e.column)}function nb(e){return Im(e&&e.start)+"-"+Im(e&&e.end)}function ib(e){return e&&typeof e=="number"?e:1}class vn extends Error{constructor(i,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let l="",f={},p=!1;if(r&&("line"in r&&"column"in r?f={place:r}:"start"in r&&"end"in r?f={place:r}:"type"in r?f={ancestors:[r],place:r.position}:f={...r}),typeof i=="string"?l=i:!f.cause&&i&&(p=!0,l=i.message,f.cause=i),!f.ruleId&&!f.source&&typeof s=="string"){const h=s.indexOf(":");h===-1?f.ruleId=s:(f.source=s.slice(0,h),f.ruleId=s.slice(h+1))}if(!f.place&&f.ancestors&&f.ancestors){const h=f.ancestors[f.ancestors.length-1];h&&(f.place=h.position)}const a=f.place&&"start"in f.place?f.place.start:f.place;this.ancestors=f.ancestors||void 0,this.cause=f.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=a?a.line:void 0,this.name=Ll(f.place)||"1:1",this.place=f.place||void 0,this.reason=this.message,this.ruleId=f.ruleId||void 0,this.source=f.source||void 0,this.stack=p&&f.cause&&typeof f.cause.stack=="string"?f.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const Yg={}.hasOwnProperty,FL=new Map,UL=/[A-Z]/g,$L=new Set(["table","tbody","thead","tfoot","tr"]),qL=new Set(["td","th"]),NC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VL(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let s;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=JL(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=ZL(r,i.jsx,i.jsxs)}const l={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:s,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?Wg:ML,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},f=BC(l,e,void 0);return f&&typeof f!="string"?f:l.create(e,l.Fragment,{children:f||void 0},void 0)}function BC(e,i,r){if(i.type==="element")return WL(e,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return GL(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return XL(e,i,r);if(i.type==="mdxjsEsm")return YL(e,i);if(i.type==="root")return KL(e,i,r);if(i.type==="text")return QL(e,i)}function WL(e,i,r){const s=e.schema;let l=s;i.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=Wg,e.schema=l),e.ancestors.push(i);const f=IC(e,i.tagName,!1),p=eD(e,i);let a=Kg(e,i);return $L.has(i.tagName)&&(a=a.filter(function(h){return typeof h=="string"?!SL(h):!0})),PC(e,p,f,i),Xg(p,a),e.ancestors.pop(),e.schema=s,e.create(i,f,p,r)}function GL(e,i){if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}zl(e,i.position)}function YL(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);zl(e,i.position)}function XL(e,i,r){const s=e.schema;let l=s;i.name==="svg"&&s.space==="html"&&(l=Wg,e.schema=l),e.ancestors.push(i);const f=i.name===null?e.Fragment:IC(e,i.name,!0),p=tD(e,i),a=Kg(e,i);return PC(e,p,f,i),Xg(p,a),e.ancestors.pop(),e.schema=s,e.create(i,f,p,r)}function KL(e,i,r){const s={};return Xg(s,Kg(e,i)),e.create(i,e.Fragment,s,r)}function QL(e,i){return i.value}function PC(e,i,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(i.node=s)}function Xg(e,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(e.children=r)}}function ZL(e,i,r){return s;function s(l,f,p,a){const d=Array.isArray(p.children)?r:i;return a?d(f,p,a):d(f,p)}}function JL(e,i){return r;function r(s,l,f,p){const a=Array.isArray(f.children),h=Gg(s);return i(l,f,p,a,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function eD(e,i){const r={};let s,l;for(l in i.properties)if(l!=="children"&&Yg.call(i.properties,l)){const f=nD(e,l,i.properties[l]);if(f){const[p,a]=f;e.tableCellAlignToStyle&&p==="align"&&typeof a=="string"&&qL.has(i.tagName)?s=a:r[p]=a}}if(s){const f=r.style||(r.style={});f[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function tD(e,i){const r={};for(const s of i.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const f=s.data.estree.body[0];f.type;const p=f.expression;p.type;const a=p.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else zl(e,i.position);else{const l=s.name;let f;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const a=s.value.data.estree.body[0];a.type,f=e.evaluater.evaluateExpression(a.expression)}else zl(e,i.position);else f=s.value===null?!0:s.value;r[l]=f}return r}function Kg(e,i){const r=[];let s=-1;const l=e.passKeys?new Map:FL;for(;++s<i.children.length;){const f=i.children[s];let p;if(e.passKeys){const h=f.type==="element"?f.tagName:f.type==="mdxJsxFlowElement"||f.type==="mdxJsxTextElement"?f.name:void 0;if(h){const d=l.get(h)||0;p=h+"-"+d,l.set(h,d+1)}}const a=BC(e,f,p);a!==void 0&&r.push(a)}return r}function nD(e,i,r){const s=AL(e.schema,i);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?vL(r):jL(r)),s.property==="style"){let l=typeof r=="object"?r:iD(e,String(r));return e.stylePropertyNameCase==="css"&&(l=rD(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?kL[s.property]||s.property:s.attribute,r]}}function iD(e,i){try{return zL(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,l=new vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=NC+"#cannot-parse-style-attribute",l}}function IC(e,i,r){let s;if(!r)s={type:"Literal",value:i};else if(i.includes(".")){const l=i.split(".");let f=-1,p;for(;++f<l.length;){const a=Yy(l[f])?{type:"Identifier",name:l[f]}:{type:"Literal",value:l[f]};p=p?{type:"MemberExpression",object:p,property:a,computed:!!(f&&a.type==="Literal"),optional:!1}:a}s=p}else s=Yy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(s.type==="Literal"){const l=s.value;return Yg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);zl(e)}function zl(e,i){const r=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=NC+"#cannot-handle-mdx-estrees-without-createevaluater",r}function rD(e){const i={};let r;for(r in e)Yg.call(e,r)&&(i[sD(r)]=e[r]);return i}function sD(e){let i=e.replace(UL,oD);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function oD(e){return"-"+e.toLowerCase()}const Vp={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"]},aD={};function Qg(e,i){const r=aD,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return zC(e,s,l)}function zC(e,i,r){if(lD(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rb(e.children,i,r)}return Array.isArray(e)?rb(e,i,r):""}function rb(e,i,r){const s=[];let l=-1;for(;++l<e.length;)s[l]=zC(e[l],i,r);return s.join("")}function lD(e){return!!(e&&typeof e=="object")}const sb=document.createElement("i");function Zg(e){const i="&"+e+";";sb.innerHTML=i;const r=sb.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===i?!1:r}function Si(e,i,r,s){const l=e.length;let f=0,p;if(i<0?i=-i>l?0:l+i:i=i>l?l:i,r=r>0?r:0,s.length<1e4)p=Array.from(s),p.unshift(i,r),e.splice(...p);else for(r&&e.splice(i,r);f<s.length;)p=s.slice(f,f+1e4),p.unshift(i,0),e.splice(...p),f+=1e4,i+=1e4}function hi(e,i){return e.length>0?(Si(e,e.length,0,i),e):i}const ob={}.hasOwnProperty;function HC(e){const i={};let r=-1;for(;++r<e.length;)cD(i,e[r]);return i}function cD(e,i){let r;for(r in i){const l=(ob.call(e,r)?e[r]:void 0)||(e[r]={}),f=i[r];let p;if(f)for(p in f){ob.call(l,p)||(l[p]=[]);const a=f[p];uD(l[p],Array.isArray(a)?a:a?[a]:[])}}}function uD(e,i){let r=-1;const s=[];for(;++r<i.length;)(i[r].add==="after"?e:s).push(i[r]);Si(e,0,0,s)}function FC(e,i){const r=Number.parseInt(e,i);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function wi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=ms(/[A-Za-z]/),fn=ms(/[\dA-Za-z]/),hD=ms(/[#-'*+\--9=?A-Z^-~]/);function lh(e){return e!==null&&(e<32||e===127)}const zm=ms(/\d/),dD=ms(/[\dA-Fa-f]/),UC=ms(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Nh=ms(new RegExp("\\p{P}|\\p{S}","u")),Ks=ms(/\s/);function ms(e){return i;function i(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ea(e){const i=[];let r=-1,s=0,l=0;for(;++r<e.length;){const f=e.charCodeAt(r);let p="";if(f===37&&fn(e.charCodeAt(r+1))&&fn(e.charCodeAt(r+2)))l=2;else if(f<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(f))||(p=String.fromCharCode(f));else if(f>55295&&f<57344){const a=e.charCodeAt(r+1);f<56320&&a>56319&&a<57344?(p=String.fromCharCode(f,a),l=1):p="�"}else p=String.fromCharCode(f);p&&(i.push(e.slice(s,r),encodeURIComponent(p)),s=r+l+1,p=""),l&&(r+=l,l=0)}return i.join("")+e.slice(s)}function at(e,i,r,s){const l=s?s-1:1/0;let f=0;return p;function p(h){return Ke(h)?(e.enter(r),a(h)):i(h)}function a(h){return Ke(h)&&f++<l?(e.consume(h),a):(e.exit(r),i(h))}}function $C(e,i,r,s,l,f){let p=0;return a;function a(m){return Ke(m)?(e.enter(s),h(m)):d(m)}function h(m){return Ke(m)&&p<f?(e.consume(m),p++,h):(e.exit(s),d(m))}function d(m){return p>=l?i(m):r(m)}}const fD={tokenize:pD};function pD(e){const i=e.attempt(this.parser.constructs.contentInitial,s,l);let r;return i;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,i,"linePrefix")}function l(a){return e.enter("paragraph"),f(a)}function f(a){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,p(a)}function p(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ne(a)?(e.consume(a),e.exit("chunkText"),f):(e.consume(a),p)}}let ch=class{constructor(){this.index=new Map,this.map=[]}add(i,r,s){ab(this,i,r,s,!1)}addBefore(i,r,s){ab(this,i,r,s,!0)}consume(i){if(this.map.sort(function(f,p){return f[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const f of l)i.push(f);l=s.pop()}this.map.length=0,this.index.clear()}};function ab(e,i,r,s,l){if(r===0&&s.length===0)return;const f=e.index.get(i);if(f){f[1]+=r,l?(s.push(...f[2]),f[2]=s):f[2].push(...s);return}const p=[i,r,s];e.map.push(p),e.index.set(i,p)}const mD={tokenize:gD},lb={tokenize:vD};function gD(e){const i=this,r=[];let s=0,l,f,p;return a;function a(y){if(s<r.length){const T=r[s];return i.containerState=T[1],e.attempt(T[0].continuation,h,d)(y)}return d(y)}function h(y){if(s++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,l&&S();const T=i.events.length;let L=T,R;for(;L--;)if(i.events[L][0]==="exit"&&i.events[L][1].type==="chunkFlow"){R=i.events[L][1].end;break}b(s);let D=T;for(;D<i.events.length;)i.events[D][1].end={...R},D++;const A=new ch;return A.add(L+1,0,i.events.slice(T)),A.add(T,D-T,[]),A.consume(i.events),d(y)}return a(y)}function d(y){if(s===r.length){if(!l)return _(y);if(l.currentConstruct&&l.currentConstruct.concrete)return E(y);i.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(lb,m,c)(y)}function m(y){return l&&S(),b(s),_(y)}function c(y){return i.parser.lazy[i.now().line]=s!==r.length,p=i.now().offset,E(y)}function _(y){return i.containerState={},e.attempt(lb,x,E)(y)}function x(y){return s++,r.push([i.currentConstruct,i.containerState]),_(y)}function E(y){if(y===null){l&&S(),b(0),e.consume(y);return}return l=l||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:f}),w(y)}function w(y){if(y===null){g(e.exit("chunkFlow"),!0),b(0),e.consume(y);return}return Ne(y)?(e.consume(y),g(e.exit("chunkFlow")),s=0,i.interrupt=void 0,a):(e.consume(y),w)}function g(y,T){const L=i.sliceStream(y);if(T&&L.push(null),y.previous=f,f&&(f.next=y),f=y,l.defineSkip(y.start),l.write(L),i.parser.lazy[y.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<p&&(!l.events[R][1].end||l.events[R][1].end.offset>p))return;const D=i.events.length;let A=D,j,M;for(;A--;)if(i.events[A][0]==="exit"&&i.events[A][1].type==="chunkFlow"){if(j){M=i.events[A][1].end;break}j=!0}for(b(s),R=D;R<i.events.length;)i.events[R][1].end={...M},R++;const I=new ch;I.add(A+1,0,i.events.slice(D)),I.add(D,R-D,[]),I.consume(i.events)}}function b(y){let T=r.length;for(;T-- >y;){const L=r[T];i.containerState=L[1],L[0].exit.call(i,e)}r.length=y}function S(){l.write([null]),f=void 0,l=void 0,i.containerState._closeFlow=void 0}}function vD(e,i,r){return at(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hs(e){if(e===null||yt(e)||Ks(e))return 1;if(Nh(e))return 2}function Bh(e,i,r){const s=[];let l=-1;for(;++l<e.length;){const f=e[l].resolveAll;f&&!s.includes(f)&&(i=f(i,r),s.push(f))}return i}const Hm={name:"attention",resolveAll:_D,tokenize:xD};function _D(e,i){let r=-1,s;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){let l=r;for(;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&i.sliceSerialize(e[l][1]).charCodeAt(0)===i.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;const f=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1,p={...e[l][1].end},a={...e[r][1].start};cb(p,-f),cb(a,f);const h={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[l][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:a},m={type:f>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},c={type:f>1?"strong":"emphasis",start:{...h.start},end:{...d.end}};e[l][1].end={...h.start},e[r][1].start={...d.end},s=[],e[l][1].end.offset-e[l][1].start.offset&&(s=hi(s,[["enter",e[l][1],i],["exit",e[l][1],i]])),s=hi(s,[["enter",c,i],["enter",h,i],["exit",h,i],["enter",m,i]]),s=hi(s,Bh(i.parser.constructs.insideSpan.null,e.slice(l+1,r),i)),s=hi(s,[["exit",m,i],["enter",d,i],["exit",d,i],["exit",c,i]]);let _=0;e[r][1].end.offset-e[r][1].start.offset&&(_=2,s=hi(s,[["enter",e[r][1],i],["exit",e[r][1],i]])),Si(e,l-1,r-l+3,s),r=l+s.length-_-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function xD(e,i){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,l=hs(s);let f;return p;function p(h){return f=h,e.enter("attentionSequence"),a(h)}function a(h){if(h===f)return e.consume(h),a;const d=e.exit("attentionSequence"),m=hs(h),c=!m||m===2&&l||r.includes(h)&&h!==42&&h!==95,_=!l||l===2&&m||r.includes(s)&&s!==42&&s!==95;return d._open=!!(f===42?c:c&&(l||!_)),d._close=!!(f===42?_:_&&(m||!c)),i(h)}}function cb(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const yD={name:"autolink",tokenize:bD};function bD(e,i,r){let s=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),f}function f(x){return dn(x)?(e.consume(x),p):x===64?r(x):d(x)}function p(x){return x===43||x===45||x===46||fn(x)?(s=1,a(x)):d(x)}function a(x){return x===58?(e.consume(x),s=0,h):(x===43||x===45||x===46||fn(x))&&s++<32?(e.consume(x),a):(s=0,d(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):x===null||x===32||x===60||lh(x)?r(x):(e.consume(x),h)}function d(x){return x===64?(e.consume(x),m):hD(x)?(e.consume(x),d):r(x)}function m(x){return fn(x)?c(x):r(x)}function c(x){return x===46?(e.consume(x),s=0,m):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):_(x)}function _(x){if((x===45||fn(x))&&s++<63){const E=x===45?_:c;return e.consume(x),E}return r(x)}}const Jl={partial:!0,tokenize:SD};function SD(e,i,r){return s;function s(f){return Ke(f)?at(e,l,"linePrefix")(f):l(f)}function l(f){return f===null||Ne(f)?i(f):r(f)}}const qC={continuation:{tokenize:CD},exit:ED,name:"blockQuote",tokenize:wD};function wD(e,i,r){const s=this;return l;function l(p){if(p===62){const a=s.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(p),e.exit("blockQuoteMarker"),f}return r(p)}function f(p){return Ke(p)?(e.enter("blockQuotePrefixWhitespace"),e.consume(p),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(p))}}function CD(e,i,r){const s=this;return l;function l(p){return Ke(p)?at(e,f,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p):f(p)}function f(p){return e.attempt(qC,i,r)(p)}}function ED(e){e.exit("blockQuote")}const VC={name:"characterEscape",tokenize:kD};function kD(e,i,r){return s;function s(f){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(f),e.exit("escapeMarker"),l}function l(f){return UC(f)?(e.enter("characterEscapeValue"),e.consume(f),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(f)}}const WC={name:"characterReference",tokenize:TD};function TD(e,i,r){const s=this;let l=0,f,p;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),h}function h(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),f=31,p=fn,m(c))}function d(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),f=6,p=dD,m):(e.enter("characterReferenceValue"),f=7,p=zm,m(c))}function m(c){if(c===59&&l){const _=e.exit("characterReferenceValue");return p===fn&&!Zg(s.sliceSerialize(_))?r(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return p(c)&&l++<f?(e.consume(c),m):r(c)}}const Fm={partial:!0,tokenize:RD};function RD(e,i,r){const s=this;return l;function l(p){return p===null?r(p):(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f)}function f(p){return s.parser.lazy[s.now().line]?r(p):i(p)}}const ub={concrete:!0,name:"codeFenced",tokenize:AD};function AD(e,i,r){const s=this,l={partial:!0,tokenize:L};let f=0,p=0,a;return h;function h(R){return d(R)}function d(R){const D=s.events[s.events.length-1];return f=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===a?(p++,e.consume(R),m):p<3?r(R):(e.exit("codeFencedFenceSequence"),Ke(R)?at(e,c,"whitespace")(R):c(R))}function c(R){return R===null||Ne(R)?(e.exit("codeFencedFence"),s.interrupt?i(R):e.check(Fm,w,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(R))}function _(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(R)):Ke(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,x,"whitespace")(R)):R===96&&R===a?r(R):(e.consume(R),_)}function x(R){return R===null||Ne(R)?c(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(R))}function E(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(R)):R===96&&R===a?r(R):(e.consume(R),E)}function w(R){return e.attempt(l,T,g)(R)}function g(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),b}function b(R){return f>0&&Ke(R)?at(e,S,"linePrefix",f+1)(R):S(R)}function S(R){return R===null||Ne(R)?e.check(Fm,w,T)(R):(e.enter("codeFlowValue"),y(R))}function y(R){return R===null||Ne(R)?(e.exit("codeFlowValue"),S(R)):(e.consume(R),y)}function T(R){return e.exit("codeFenced"),i(R)}function L(R,D,A){let j=0;return M;function M(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),I}function I(W){return R.enter("codeFencedFence"),Ke(W)?at(R,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):B(W)}function B(W){return W===a?(R.enter("codeFencedFenceSequence"),H(W)):A(W)}function H(W){return W===a?(j++,R.consume(W),H):j>=p?(R.exit("codeFencedFenceSequence"),Ke(W)?at(R,U,"whitespace")(W):U(W)):A(W)}function U(W){return W===null||Ne(W)?(R.exit("codeFencedFence"),D(W)):A(W)}}}const Wp={name:"codeIndented",tokenize:DD},LD={partial:!0,tokenize:MD};function DD(e,i,r){return s;function s(a){return e.enter("codeIndented"),$C(e,l,r,"linePrefix",4,4)(a)}function l(a){return a===null?p(a):Ne(a)?e.attempt(LD,l,p)(a):(e.enter("codeFlowValue"),f(a))}function f(a){return a===null||Ne(a)?(e.exit("codeFlowValue"),l(a)):(e.consume(a),f)}function p(a){return e.exit("codeIndented"),i(a)}}function MD(e,i,r){const s=this;return l;function l(p){return s.parser.lazy[s.now().line]?r(p):Ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):$C(e,i,f,"linePrefix",4,4)(p)}function f(p){return Ne(p)?l(p):r(p)}}const jD={name:"codeText",previous:ND,resolve:OD,tokenize:BD};function OD(e){let i=e.length-4,r=3,s,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(s=r;++s<i;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(s=r-1,i++;++s<=i;)l===void 0?s!==i&&e[s][1].type!=="lineEnding"&&(l=s):(s===i||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),i-=s-l-2,s=l+2),l=void 0);return e}function ND(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BD(e,i,r){let s=0,l,f;return p;function p(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),s++,a):(e.exit("codeTextSequence"),h(c))}function h(c){return c===null?r(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),h):c===96?(f=e.enter("codeTextSequence"),l=0,m(c)):Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(c))}function d(c){return c===null||c===32||c===96||Ne(c)?(e.exit("codeTextData"),h(c)):(e.consume(c),d)}function m(c){return c===96?(e.consume(c),l++,m):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),i(c)):(f.type="codeTextData",d(c))}}class PD{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(i,s):i>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(i,r,s){const l=r||0;this.setCursor(Math.trunc(i));const f=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&El(this.left,s),f.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),El(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),El(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);El(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);El(this.left,r.reverse())}}}function El(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function GC(e){const i={};let r=-1,s,l,f,p,a,h,d;const m=new PD(e);for(;++r<m.length;){for(;r in i;)r=i[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,f=0,f<h.length&&h[f][1].type==="lineEndingBlank"&&(f+=2),f<h.length&&h[f][1].type==="content"))for(;++f<h.length&&h[f][1].type!=="content";)h[f][1].type==="chunkText"&&(h[f][1]._isInFirstContentOfListItem=!0,f++);if(s[0]==="enter")s[1].contentType&&(Object.assign(i,ID(m,r)),r=i[r],d=!0);else if(s[1]._container){for(f=r,l=void 0;f--;)if(p=m.get(f),p[1].type==="lineEnding"||p[1].type==="lineEndingBlank")p[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),p[1].type="lineEnding",l=f);else if(!(p[1].type==="linePrefix"||p[1].type==="listItemIndent"))break;l&&(s[1].end={...m.get(l)[1].start},a=m.slice(l,r),a.unshift(s),m.splice(l,r-l+1,a))}}return Si(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function ID(e,i){const r=e.get(i)[1],s=e.get(i)[2];let l=i-1;const f=[];let p=r._tokenizer;p||(p=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(p._contentTypeTextTrailing=!0));const a=p.events,h=[],d={};let m,c,_=-1,x=r,E=0,w=0;const g=[w];for(;x;){for(;e.get(++l)[1]!==x;);f.push(l),x._tokenizer||(m=s.sliceStream(x),x.next||m.push(null),c&&p.defineSkip(x.start),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=!0),p.write(m),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=void 0)),c=x,x=x.next}for(x=r;++_<a.length;)a[_][0]==="exit"&&a[_-1][0]==="enter"&&a[_][1].type===a[_-1][1].type&&a[_][1].start.line!==a[_][1].end.line&&(w=_+1,g.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(p.events=[],x?(x._tokenizer=void 0,x.previous=void 0):g.pop(),_=g.length;_--;){const b=a.slice(g[_],g[_+1]),S=f.pop();h.push([S,S+b.length-1]),e.splice(S,2,b)}for(h.reverse(),_=-1;++_<h.length;)d[E+h[_][0]]=E+h[_][1],E+=h[_][1]-h[_][0]-1;return d}const zD={resolve:FD,tokenize:UD},HD={partial:!0,tokenize:$D};function FD(e){return GC(e),e}function UD(e,i){let r;return s;function s(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(a)}function l(a){return a===null?f(a):Ne(a)?e.check(HD,p,f)(a):(e.consume(a),l)}function f(a){return e.exit("chunkContent"),e.exit("content"),i(a)}function p(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function $D(e,i,r){const s=this;return l;function l(p){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),at(e,f,"linePrefix")}function f(p){if(p===null||Ne(p))return r(p);const a=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?i(p):e.interrupt(s.parser.constructs.flow,r,i)(p)}}function YC(e,i,r,s,l,f,p,a,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return c;function c(b){return b===60?(e.enter(s),e.enter(l),e.enter(f),e.consume(b),e.exit(f),_):b===null||b===32||b===41||lh(b)?r(b):(e.enter(s),e.enter(p),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(b))}function _(b){return b===62?(e.enter(f),e.consume(b),e.exit(f),e.exit(l),e.exit(s),i):(e.enter(a),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===62?(e.exit("chunkString"),e.exit(a),_(b)):b===null||b===60||Ne(b)?r(b):(e.consume(b),b===92?E:x)}function E(b){return b===60||b===62||b===92?(e.consume(b),x):x(b)}function w(b){return!m&&(b===null||b===41||yt(b))?(e.exit("chunkString"),e.exit(a),e.exit(p),e.exit(s),i(b)):m<d&&b===40?(e.consume(b),m++,w):b===41?(e.consume(b),m--,w):b===null||b===32||b===40||lh(b)?r(b):(e.consume(b),b===92?g:w)}function g(b){return b===40||b===41||b===92?(e.consume(b),w):w(b)}}function XC(e,i,r,s,l,f){const p=this;let a=0,h;return d;function d(x){return e.enter(s),e.enter(l),e.consume(x),e.exit(l),e.enter(f),m}function m(x){return a>999||x===null||x===91||x===93&&!h||x===94&&!a&&"_hiddenFootnoteSupport"in p.parser.constructs?r(x):x===93?(e.exit(f),e.enter(l),e.consume(x),e.exit(l),e.exit(s),i):Ne(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===null||x===91||x===93||Ne(x)||a++>999?(e.exit("chunkString"),m(x)):(e.consume(x),h||(h=!Ke(x)),x===92?_:c)}function _(x){return x===91||x===92||x===93?(e.consume(x),a++,c):c(x)}}function KC(e,i,r,s,l,f){let p;return a;function a(_){return _===34||_===39||_===40?(e.enter(s),e.enter(l),e.consume(_),e.exit(l),p=_===40?41:_,h):r(_)}function h(_){return _===p?(e.enter(l),e.consume(_),e.exit(l),e.exit(s),i):(e.enter(f),d(_))}function d(_){return _===p?(e.exit(f),h(p)):_===null?r(_):Ne(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),at(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===p||_===null||Ne(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?c:m)}function c(_){return _===p||_===92?(e.consume(_),m):m(_)}}function Dl(e,i){let r;return s;function s(l){return Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,s):Ke(l)?at(e,s,r?"linePrefix":"lineSuffix")(l):i(l)}}const qD={name:"definition",tokenize:WD},VD={partial:!0,tokenize:GD};function WD(e,i,r){const s=this;let l;return f;function f(x){return e.enter("definition"),p(x)}function p(x){return XC.call(s,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function a(x){return l=wi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):r(x)}function h(x){return yt(x)?Dl(e,d)(x):d(x)}function d(x){return YC(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(VD,c,c)(x)}function c(x){return Ke(x)?at(e,_,"whitespace")(x):_(x)}function _(x){return x===null||Ne(x)?(e.exit("definition"),s.parser.defined.push(l),i(x)):r(x)}}function GD(e,i,r){return s;function s(a){return yt(a)?Dl(e,l)(a):r(a)}function l(a){return KC(e,f,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function f(a){return Ke(a)?at(e,p,"whitespace")(a):p(a)}function p(a){return a===null||Ne(a)?i(a):r(a)}}const YD={name:"hardBreakEscape",tokenize:XD};function XD(e,i,r){return s;function s(f){return e.enter("hardBreakEscape"),e.consume(f),l}function l(f){return Ne(f)?(e.exit("hardBreakEscape"),i(f)):r(f)}}const KD={name:"headingAtx",resolve:QD,tokenize:ZD};function QD(e,i){let r=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s){const l={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},f={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"};Si(e,s,r-s+1,[["enter",l,i],["enter",f,i],["exit",f,i],["exit",l,i]])}return e}function ZD(e,i,r){let s=0;return l;function l(m){return e.enter("atxHeading"),f(m)}function f(m){return e.enter("atxHeadingSequence"),p(m)}function p(m){return m===35&&s++<6?(e.consume(m),p):m===null||yt(m)?(e.exit("atxHeadingSequence"),a(m)):r(m)}function a(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Ne(m)?(e.exit("atxHeading"),i(m)):Ke(m)?at(e,a,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),a(m))}function d(m){return m===null||m===35||yt(m)?(e.exit("atxHeadingText"),a(m)):(e.consume(m),d)}}const QC=["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"],Um=["pre","script","style","textarea"],JD={concrete:!0,name:"htmlFlow",resolveTo:tM,tokenize:nM},eM={partial:!0,tokenize:iM};function tM(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function nM(e,i,r){const s=this;let l,f,p,a,h;return d;function d(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),c}function c(F){return F===33?(e.consume(F),_):F===47?(e.consume(F),f=!0,w):F===63?(e.consume(F),l=3,s.interrupt?i:O):dn(F)?(e.consume(F),p=String.fromCharCode(F),g):r(F)}function _(F){return F===45?(e.consume(F),l=2,x):F===91?(e.consume(F),l=5,a=0,E):dn(F)?(e.consume(F),l=4,s.interrupt?i:O):r(F)}function x(F){return F===45?(e.consume(F),s.interrupt?i:O):r(F)}function E(F){const V="CDATA[";return F===V.charCodeAt(a++)?(e.consume(F),a===V.length?s.interrupt?i:B:E):r(F)}function w(F){return dn(F)?(e.consume(F),p=String.fromCharCode(F),g):r(F)}function g(F){if(F===null||F===47||F===62||yt(F)){const V=F===47,ne=p.toLowerCase();return!V&&!f&&Um.includes(ne)?(l=1,s.interrupt?i(F):B(F)):QC.includes(p.toLowerCase())?(l=6,V?(e.consume(F),b):s.interrupt?i(F):B(F)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(F):f?S(F):y(F))}return F===45||fn(F)?(e.consume(F),p+=String.fromCharCode(F),g):r(F)}function b(F){return F===62?(e.consume(F),s.interrupt?i:B):r(F)}function S(F){return Ke(F)?(e.consume(F),S):M(F)}function y(F){return F===47?(e.consume(F),M):F===58||F===95||dn(F)?(e.consume(F),T):Ke(F)?(e.consume(F),y):M(F)}function T(F){return F===45||F===46||F===58||F===95||fn(F)?(e.consume(F),T):L(F)}function L(F){return F===61?(e.consume(F),R):Ke(F)?(e.consume(F),L):y(F)}function R(F){return F===null||F===60||F===61||F===62||F===96?r(F):F===34||F===39?(e.consume(F),h=F,D):Ke(F)?(e.consume(F),R):A(F)}function D(F){return F===h?(e.consume(F),h=null,j):F===null||Ne(F)?r(F):(e.consume(F),D)}function A(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||yt(F)?L(F):(e.consume(F),A)}function j(F){return F===47||F===62||Ke(F)?y(F):r(F)}function M(F){return F===62?(e.consume(F),I):r(F)}function I(F){return F===null||Ne(F)?B(F):Ke(F)?(e.consume(F),I):r(F)}function B(F){return F===45&&l===2?(e.consume(F),Y):F===60&&l===1?(e.consume(F),Q):F===62&&l===4?(e.consume(F),G):F===63&&l===3?(e.consume(F),O):F===93&&l===5?(e.consume(F),z):Ne(F)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(eM,Z,H)(F)):F===null||Ne(F)?(e.exit("htmlFlowData"),H(F)):(e.consume(F),B)}function H(F){return e.check(Fm,U,Z)(F)}function U(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),W}function W(F){return F===null||Ne(F)?H(F):(e.enter("htmlFlowData"),B(F))}function Y(F){return F===45?(e.consume(F),O):B(F)}function Q(F){return F===47?(e.consume(F),p="",K):B(F)}function K(F){if(F===62){const V=p.toLowerCase();return Um.includes(V)?(e.consume(F),G):B(F)}return dn(F)&&p.length<8?(e.consume(F),p+=String.fromCharCode(F),K):B(F)}function z(F){return F===93?(e.consume(F),O):B(F)}function O(F){return F===62?(e.consume(F),G):F===45&&l===2?(e.consume(F),O):B(F)}function G(F){return F===null||Ne(F)?(e.exit("htmlFlowData"),Z(F)):(e.consume(F),G)}function Z(F){return e.exit("htmlFlow"),i(F)}}function iM(e,i,r){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Jl,i,r)}}const rM={name:"htmlText",tokenize:sM};function sM(e,i,r){const s=this;let l,f,p;return a;function a(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),L):O===63?(e.consume(O),y):dn(O)?(e.consume(O),A):r(O)}function d(O){return O===45?(e.consume(O),m):O===91?(e.consume(O),f=0,E):dn(O)?(e.consume(O),S):r(O)}function m(O){return O===45?(e.consume(O),x):r(O)}function c(O){return O===null?r(O):O===45?(e.consume(O),_):Ne(O)?(p=c,Q(O)):(e.consume(O),c)}function _(O){return O===45?(e.consume(O),x):c(O)}function x(O){return O===62?Y(O):O===45?_(O):c(O)}function E(O){const G="CDATA[";return O===G.charCodeAt(f++)?(e.consume(O),f===G.length?w:E):r(O)}function w(O){return O===null?r(O):O===93?(e.consume(O),g):Ne(O)?(p=w,Q(O)):(e.consume(O),w)}function g(O){return O===93?(e.consume(O),b):w(O)}function b(O){return O===62?Y(O):O===93?(e.consume(O),b):w(O)}function S(O){return O===null||O===62?Y(O):Ne(O)?(p=S,Q(O)):(e.consume(O),S)}function y(O){return O===null?r(O):O===63?(e.consume(O),T):Ne(O)?(p=y,Q(O)):(e.consume(O),y)}function T(O){return O===62?Y(O):y(O)}function L(O){return dn(O)?(e.consume(O),R):r(O)}function R(O){return O===45||fn(O)?(e.consume(O),R):D(O)}function D(O){return Ne(O)?(p=D,Q(O)):Ke(O)?(e.consume(O),D):Y(O)}function A(O){return O===45||fn(O)?(e.consume(O),A):O===47||O===62||yt(O)?j(O):r(O)}function j(O){return O===47?(e.consume(O),Y):O===58||O===95||dn(O)?(e.consume(O),M):Ne(O)?(p=j,Q(O)):Ke(O)?(e.consume(O),j):Y(O)}function M(O){return O===45||O===46||O===58||O===95||fn(O)?(e.consume(O),M):I(O)}function I(O){return O===61?(e.consume(O),B):Ne(O)?(p=I,Q(O)):Ke(O)?(e.consume(O),I):j(O)}function B(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),l=O,H):Ne(O)?(p=B,Q(O)):Ke(O)?(e.consume(O),B):(e.consume(O),U)}function H(O){return O===l?(e.consume(O),l=void 0,W):O===null?r(O):Ne(O)?(p=H,Q(O)):(e.consume(O),H)}function U(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||yt(O)?j(O):(e.consume(O),U)}function W(O){return O===47||O===62||yt(O)?j(O):r(O)}function Y(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):r(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),K}function K(O){return Ke(O)?at(e,z,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return e.enter("htmlTextData"),p(O)}}const Jg={name:"labelEnd",resolveAll:cM,resolveTo:uM,tokenize:hM},oM={tokenize:dM},aM={tokenize:fM},lM={tokenize:pM};function cM(e){let i=-1;const r=[];for(;++i<e.length;){const s=e[i][1];if(r.push(e[i]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",i+=l}}return e.length!==r.length&&Si(e,0,e.length,r),e}function uM(e,i){let r=e.length,s=0,l,f,p;for(;r--;){const m=e[r][1];if(l){if(m.type==="link"||m.type==="labelLink"&&m._inactive)break;e[r][0]==="enter"&&m.type==="labelLink"&&(m._inactive=!0)}else if(f){if(e[r][0]==="enter"&&(m.type==="labelImage"||m.type==="labelLink")&&!m._balanced&&(l=r,m.type!=="labelLink")){s=2;break}}else m.type==="labelEnd"&&(f=r)}const a={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[f][1].end}},d={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[f-2][1].start}};return p=[["enter",a,i],["enter",h,i]],p=hi(p,e.slice(l+1,l+s+3)),p=hi(p,[["enter",d,i]]),p=hi(p,Bh(i.parser.constructs.insideSpan.null,e.slice(l+s+4,f-3),i)),p=hi(p,[["exit",d,i],e[f-2],e[f-1],["exit",h,i]]),p=hi(p,e.slice(f+1)),p=hi(p,[["exit",a,i]]),Si(e,l,e.length,p),e}function hM(e,i,r){const s=this,l=s._labelStarts;let f,p;if(l){for(;l.length>0&&l[l.length-1]._balanced;)l.pop();f=l[l.length-1]}return a;function a(_){return f?f._inactive?c(_):(p=s.parser.defined.includes(wi(s.sliceSerialize({start:f.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):r(_)}function h(_){return _===40?e.attempt(oM,m,p?m:c)(_):_===91?e.attempt(aM,m,p?d:c)(_):p?m(_):c(_)}function d(_){return e.attempt(lM,m,c)(_)}function m(_){return l.pop(),i(_)}function c(_){return f._balanced=!0,r(_)}}function dM(e,i,r){return s;function s(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),l}function l(c){return yt(c)?Dl(e,f)(c):f(c)}function f(c){return c===41?m(c):YC(e,p,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function p(c){return yt(c)?Dl(e,h)(c):m(c)}function a(c){return r(c)}function h(c){return c===34||c===39||c===40?KC(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):m(c)}function d(c){return yt(c)?Dl(e,m)(c):m(c)}function m(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),i):r(c)}}function fM(e,i,r){const s=this;return l;function l(a){return XC.call(s,e,f,p,"reference","referenceMarker","referenceString")(a)}function f(a){return s.parser.defined.includes(wi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?i(a):r(a)}function p(a){return r(a)}}function pM(e,i,r){return s;function s(f){return e.enter("reference"),e.enter("referenceMarker"),e.consume(f),e.exit("referenceMarker"),l}function l(f){return f===93?(e.enter("referenceMarker"),e.consume(f),e.exit("referenceMarker"),e.exit("reference"),i):r(f)}}const mM={name:"labelStartImage",resolveAll:Jg.resolveAll,tokenize:gM};function gM(e,i,r){const s=this;let l;return f;function f(h){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(h),e.exit("labelImageMarker"),p}function p(h){return h===91?(e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),l=e.exit("labelImage"),a):r(h)}function a(h){return h===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(h):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(h))}}const vM={name:"labelStartLink",resolveAll:Jg.resolveAll,tokenize:_M};function _M(e,i,r){const s=this;let l;return f;function f(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),l=e.exit("labelLink"),p}function p(a){return a===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(a):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(a))}}const Gp={name:"lineEnding",tokenize:xM};function xM(e,i){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),at(e,i,"linePrefix")}}const Zu={name:"thematicBreak",tokenize:yM};function yM(e,i,r){let s=0,l;return f;function f(d){return e.enter("thematicBreak"),p(d)}function p(d){return l=d,a(d)}function a(d){return d===l?(e.enter("thematicBreakSequence"),h(d)):s>=3&&(d===null||Ne(d))?(e.exit("thematicBreak"),i(d)):r(d)}function h(d){return d===l?(e.consume(d),s++,h):(e.exit("thematicBreakSequence"),Ke(d)?at(e,a,"whitespace")(d):a(d))}}const jn={continuation:{tokenize:CM},exit:kM,name:"list",tokenize:wM},bM={partial:!0,tokenize:TM},SM={partial:!0,tokenize:EM};function wM(e,i,r){const s=this,l=s.events[s.events.length-1];let f=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,p=0;return a;function a(x){const E=s.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!s.containerState.marker||x===s.containerState.marker:zm(x)){if(s.containerState.type||(s.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Zu,r,d)(x):d(x);if(!s.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return r(x)}function h(x){return zm(x)&&++p<10?(e.consume(x),h):(!s.interrupt||p<2)&&(s.containerState.marker?x===s.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),d(x)):r(x)}function d(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||x,e.check(Jl,s.interrupt?r:m,e.attempt(bM,_,c))}function m(x){return s.containerState.initialBlankLine=!0,f++,_(x)}function c(x){return Ke(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),_):r(x)}function _(x){return s.containerState.size=f+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(x)}}function CM(e,i,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Jl,l,f);function l(a){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,at(e,i,"listItemIndent",s.containerState.size+1)(a)}function f(a){return s.containerState.furtherBlankLines||!Ke(a)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,p(a)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(SM,i,p)(a))}function p(a){return s.containerState._closeFlow=!0,s.interrupt=void 0,at(e,e.attempt(jn,i,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function EM(e,i,r){const s=this;return at(e,l,"listItemIndent",s.containerState.size+1);function l(f){const p=s.events[s.events.length-1];return p&&p[1].type==="listItemIndent"&&p[2].sliceSerialize(p[1],!0).length===s.containerState.size?i(f):r(f)}}function kM(e){e.exit(this.containerState.type)}function TM(e,i,r){const s=this;return at(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(f){const p=s.events[s.events.length-1];return!Ke(f)&&p&&p[1].type==="listItemPrefixWhitespace"?i(f):r(f)}}const hb={name:"setextUnderline",resolveTo:RM,tokenize:AM};function RM(e,i){const r=new ch;let s=e.length,l,f,p;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){l=s;break}e[s][1].type==="paragraph"&&(f=s)}else e[s][1].type==="content"&&r.add(s,1,[]),!p&&e[s][1].type==="definition"&&(p=s);const a={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[f][1].type="setextHeadingText",p?(r.add(f,0,[["enter",a,i]]),r.add(p+1,0,[["exit",e[l][1],i]]),e[l][1].end={...e[p][1].end}):e[l][1]=a,r.add(e.length,0,[["exit",a,i]]),r.consume(e),e}function AM(e,i,r){const s=this;let l;return f;function f(d){let m=s.events.length,c;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){c=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||c)?(e.enter("setextHeadingLine"),l=d,p(d)):r(d)}function p(d){return e.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===l?(e.consume(d),a):(e.exit("setextHeadingLineSequence"),Ke(d)?at(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Ne(d)?(e.exit("setextHeadingLine"),i(d)):r(d)}}const LM={tokenize:DM};function DM(e){const i=this,r=e.attempt(Jl,s,e.attempt(this.parser.constructs.flowInitial,l,at(e,e.attempt(this.parser.constructs.flow,l,e.attempt(zD,l)),"linePrefix")));return r;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEndingBlank"),e.consume(f),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),i.currentConstruct=void 0,r}}const MM={resolveAll:JC()},jM=ZC("string"),OM=ZC("text");function ZC(e){return{resolveAll:JC(e==="text"?NM:void 0),tokenize:i};function i(r){const s=this,l=this.parser.constructs[e],f=r.attempt(l,p,a);return p;function p(m){return d(m)?f(m):a(m)}function a(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return d(m)?(r.exit("data"),f(m)):(r.consume(m),h)}function d(m){if(m===null)return!0;const c=l[m];let _=-1;if(c)for(;++_<c.length;){const x=c[_];if(!x.previous||x.previous.call(s,s.previous))return!0}return!1}}}function JC(e){return i;function i(r,s){let l=-1,f;for(;++l<=r.length;)f===void 0?r[l]&&r[l][1].type==="data"&&(f=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==f+2&&(r[f][1].end=r[l-1][1].end,r.splice(f+2,l-f-2),l=f+2),f=void 0);return e?e(r,s):r}}function NM(e,i){const r=new ch;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const l=e[s-1][1],f=i.sliceStream(l);let p=f.length,a=-1,h=0,d;for(;p--;){const m=f[p];if(typeof m=="string"){for(a=m.length;m.charCodeAt(a-1)===32;)h++,a--;if(a)break;a=-1}else if(m===-2)d=!0,h++;else if(m!==-1){p++;break}}if(i._contentTypeTextTrailing&&s===e.length&&(h=0),h){const m={type:s===e.length||d||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?a:l.start._bufferIndex+a,_index:l.start._index+p,line:l.end.line,column:l.end.column-h,offset:l.end.offset-h},end:{...l.end}};l.end={...m.start},l.start.offset===l.end.offset?Object.assign(l,m):r.add(s,0,[["enter",m,i],["exit",m,i]])}s++}return r.consume(e),e}const BM={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:qC},PM={91:qD},IM={[-2]:Wp,[-1]:Wp,32:Wp},zM={35:KD,42:Zu,45:[hb,Zu],60:JD,61:hb,95:Zu,96:ub,126:ub},HM={38:WC,92:VC},FM={[-5]:Gp,[-4]:Gp,[-3]:Gp,33:mM,38:WC,42:Hm,60:[yD,rM],91:vM,92:[YD,VC],93:Jg,95:Hm,96:jD},UM={null:[Hm,MM]},$M={null:[42,95]},qM={null:[]},VM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$M,contentInitial:PM,disable:qM,document:BM,flow:zM,flowInitial:IM,insideSpan:UM,string:HM,text:FM},Symbol.toStringTag,{value:"Module"}));function WM(e,i,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},f=[];let p=[],a=[];const h={attempt:D(L),check:D(R),consume:S,enter:y,exit:T,interrupt:D(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:E,parser:e,previous:null,sliceSerialize:_,sliceStream:x,write:c};let m=i.tokenize.call(d,h);return i.resolveAll&&f.push(i),d;function c(I){return p=hi(p,I),g(),p[p.length-1]!==null?[]:(A(i,0),d.events=Bh(f,d.events,d),d.events)}function _(I,B){return YM(x(I),B)}function x(I){return GM(p,I)}function E(){const{_bufferIndex:I,_index:B,line:H,column:U,offset:W}=s;return{_bufferIndex:I,_index:B,line:H,column:U,offset:W}}function w(I){l[I.line]=I.column,M()}function g(){for(;s._index<p.length;){const I=p[s._index];if(typeof I=="string"){const B=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===B&&s._bufferIndex<I.length;)b(I.charCodeAt(s._bufferIndex))}else b(I)}}function b(I){m=m(I)}function S(I){Ne(I)?(s.line++,s.column=1,s.offset+=I===-3?2:1,M()):I!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===p[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=I}function y(I,B){const H=B||{};return H.type=I,H.start=E(),d.events.push(["enter",H,d]),a.push(H),H}function T(I){const B=a.pop();return B.end=E(),d.events.push(["exit",B,d]),B}function L(I,B){A(I,B.from)}function R(I,B){B.restore()}function D(I,B){return H;function H(U,W,Y){let Q,K,z,O;return Array.isArray(U)?Z(U):"tokenize"in U?Z([U]):G(U);function G(le){return X;function X($){const oe=$!==null&&le[$],ee=$!==null&&le.null,ue=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return Z(ue)($)}}function Z(le){return Q=le,K=0,le.length===0?Y:F(le[K])}function F(le){return X;function X($){return O=j(),z=le,le.partial||(d.currentConstruct=le),le.name&&d.parser.constructs.disable.null.includes(le.name)?ne():le.tokenize.call(B?Object.assign(Object.create(d),B):d,h,V,ne)($)}}function V(le){return I(z,O),W}function ne(le){return O.restore(),++K<Q.length?F(Q[K]):Y}}}function A(I,B){I.resolveAll&&!f.includes(I)&&f.push(I),I.resolve&&Si(d.events,B,d.events.length-B,I.resolve(d.events.slice(B),d)),I.resolveTo&&(d.events=I.resolveTo(d.events,d))}function j(){const I=E(),B=d.previous,H=d.currentConstruct,U=d.events.length,W=Array.from(a);return{from:U,restore:Y};function Y(){s=I,d.previous=B,d.currentConstruct=H,d.events.length=U,a=W,M()}}function M(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function GM(e,i){const r=i.start._index,s=i.start._bufferIndex,l=i.end._index,f=i.end._bufferIndex;let p;if(r===l)p=[e[r].slice(s,f)];else{if(p=e.slice(r,l),s>-1){const a=p[0];typeof a=="string"?p[0]=a.slice(s):p.shift()}f>0&&p.push(e[l].slice(0,f))}return p}function YM(e,i){let r=-1;const s=[];let l;for(;++r<e.length;){const f=e[r];let p;if(typeof f=="string")p=f;else switch(f){case-5:{p="\r";break}case-4:{p=`
508
+ `)})})}),v.jsx(Hs,{label:"Claude in Chrome",children:v.jsxs(ia,{value:i.chrome,onValueChange:E=>void d({chrome:E}),children:[v.jsx(En,{value:Hu,children:"Your Claude Code setting"}),v.jsx(En,{value:"on",children:"On"}),v.jsx(En,{value:"off",children:"Off"})]})})]})})]})]})})}class CC extends Error{constructor(i,r){super(i),this.status=r}}async function ta(e,i){const r=await fetch(`${Hi()}/files${e}`,{...i,headers:{"Content-Type":"application/json"}}),s=await r.json().catch(()=>({}));if(!r.ok)throw new CC(s.error??r.statusText,r.status);return s}const ns=(e,i,r)=>ta(i,{method:e,body:JSON.stringify(r)}),Xt={list:(e,i)=>ta(`/list?path=${encodeURIComponent(e)}${i?"&ignored=1":""}`),read:e=>ta(`/read?path=${encodeURIComponent(e)}`),blame:e=>ta(`/blame?path=${encodeURIComponent(e)}`),commit:e=>ta(`/commit?sha=${encodeURIComponent(e)}`),stat:e=>ta(`/stat?path=${encodeURIComponent(e)}`),write:(e,i,r)=>ns("PUT","/write",{path:e,content:i,expectedMtimeMs:r}),create:e=>ns("POST","/create",{path:e}),mkdir:e=>ns("POST","/mkdir",{path:e}),rename:(e,i)=>ns("POST","/rename",{from:e,to:i}),remove:e=>ns("POST","/delete",{path:e}),reveal:e=>ns("POST","/reveal",{path:e}),copyToClipboard:e=>ns("POST","/clipboard",{path:e}),copy:(e,i)=>ns("POST","/copy",{from:e,folder:i})},hL=e=>/\.(md|markdown|mdx)$/i.test(e),dL=e=>/\.(html?|xhtml)$/i.test(e);function Wy(e){var r;const i=((r=e.split(".").pop())==null?void 0:r.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif","svg"].includes(i)?"image":["mp3","wav","ogg","oga","m4a","aac","flac","opus","weba"].includes(i)?"audio":["mp4","webm","ogv","mov","m4v","mkv"].includes(i)?"video":null}const Om=e=>`${Hi()}/files/raw/${e.split("/").map(encodeURIComponent).join("/")}`,fL="modulepreload",pL=function(e){return"/"+e},Gy={},mL=function(i,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),h=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));l=p(r.map(d=>{if(d=pL(d),d in Gy)return;Gy[d]=!0;const m=d.endsWith(".css"),c=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${c}`))return;const _=document.createElement("link");if(_.rel=m?"stylesheet":fL,m||(_.as="script"),_.crossOrigin="",_.href=d,h&&_.setAttribute("nonce",h),document.head.appendChild(_),m)return new Promise((x,E)=>{_.addEventListener("load",x),_.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(p){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=p,window.dispatchEvent(a),!a.defaultPrevented)throw p}return l.then(p=>{for(const a of p||[])a.status==="rejected"&&f(a.reason);return i().catch(f)})},gL=P.lazy(()=>mL(()=>import("./MonacoEditor-CbpiSq9q.js").then(e=>e.b),__vite__mapDeps([0,1])));function EC(e){return v.jsx(P.Suspense,{fallback:v.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading editor..."}),children:v.jsx(gL,{...e})})}function vL(e,i){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const _L=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yL={};function Yy(e,i){return(yL.jsx?xL:_L).test(e)}const bL=/[ \t\n\f\r]/g;function SL(e){return typeof e=="object"?e.type==="text"?Xy(e.value):!1:Xy(e)}function Xy(e){return e.replace(bL,"")===""}class Zl{constructor(i,r,s){this.normal=r,this.property=i,s&&(this.space=s)}}Zl.prototype.normal={};Zl.prototype.property={};Zl.prototype.space=void 0;function kC(e,i){const r={},s={};for(const l of e)Object.assign(r,l.property),Object.assign(s,l.normal);return new Zl(r,s,i)}function Nm(e){return e.toLowerCase()}class In{constructor(i,r){this.attribute=r,this.property=i}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let wL=0;const Ue=eo(),Ht=eo(),Bm=eo(),be=eo(),xt=eo(),Vs=eo(),Xn=eo();function eo(){return 2**++wL}const Pm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Ht,commaOrSpaceSeparated:Xn,commaSeparated:Vs,number:be,overloadedBoolean:Bm,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),$p=Object.keys(Pm);class Vg extends In{constructor(i,r,s,l){let f=-1;if(super(i,r),Ky(this,"space",l),typeof s=="number")for(;++f<$p.length;){const p=$p[f];Ky(this,$p[f],(s&Pm[p])===Pm[p])}}}Vg.prototype.defined=!0;function Ky(e,i,r){r&&(e[i]=r)}function Ca(e){const i={},r={};for(const[s,l]of Object.entries(e.properties)){const f=new Vg(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(f.mustUseProperty=!0),i[s]=f,r[Nm(s)]=s,r[Nm(f.attribute)]=s}return new Zl(i,r,e.space)}const TC=Ca({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:xt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:be,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:xt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Ht,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function RC(e,i){return i in e?e[i]:i}function AC(e,i){return RC(e,i.toLowerCase())}const CL=Ca({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vs,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alpha:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:xt,autoFocus:Ue,autoPlay:Ue,blocking:xt,capture:null,charSet:null,checked:Ue,cite:null,className:xt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:Ht,controls:Ue,controlsList:xt,coords:be|Vs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Bm,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:xt,height:be,hidden:Bm,high:be,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ue,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:be,pattern:null,ping:xt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:xt,required:Ue,reversed:Ue,rows:be,rowSpan:be,sandbox:xt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootCustomElementRegistry:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shadowRootSerializable:Ue,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Ht,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ue,disablePictureInPicture:Ue,disableRemotePlayback:Ue,exportParts:Vs,part:xt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:AC}),EL=Ca({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:xt,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:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,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:Vs,g2:Vs,glyphName:Vs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,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:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,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:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:RC}),LC=Ca({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),DC=Ca({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:AC}),MC=Ca({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),kL={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"},TL=/[A-Z]/g,Qy=/-[a-z]/g,RL=/^data[-\w.:]+$/i;function AL(e,i){const r=Nm(i);let s=i,l=In;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&RL.test(i)){if(i.charAt(4)==="-"){const f=i.slice(5).replace(Qy,DL);s="data"+f.charAt(0).toUpperCase()+f.slice(1)}else{const f=i.slice(4);if(!Qy.test(f)){let p=f.replace(TL,LL);p.charAt(0)!=="-"&&(p="-"+p),i="data"+p}}l=Vg}return new l(s,i)}function LL(e){return"-"+e.toLowerCase()}function DL(e){return e.charAt(1).toUpperCase()}const ML=kC([TC,CL,LC,DC,MC],"html"),Wg=kC([TC,EL,LC,DC,MC],"svg");function jL(e){return e.join(" ").trim()}var Jo={},qp,Zy;function OL(){if(Zy)return qp;Zy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,f=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p=/^[;\s]*/,a=/^\s+|\s+$/g,h=`
509
+ `,d="/",m="*",c="",_="comment",x="declaration";function E(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var S=1,y=1;function T(U){var W=U.match(i);W&&(S+=W.length);var Y=U.lastIndexOf(h);y=~Y?U.length-Y:y+U.length}function L(){var U={line:S,column:y};return function(W){return W.position=new R(U),j(),W}}function R(U){this.start=U,this.end={line:S,column:y},this.source=b.source}R.prototype.content=g;function D(U){var W=new Error(b.source+":"+S+":"+y+": "+U);if(W.reason=U,W.filename=b.source,W.line=S,W.column=y,W.source=g,!b.silent)throw W}function A(U){var W=U.exec(g);if(W){var Y=W[0];return T(Y),g=g.slice(Y.length),W}}function j(){A(r)}function M(U){var W;for(U=U||[];W=I();)W!==!1&&U.push(W);return U}function I(){var U=L();if(!(d!=g.charAt(0)||m!=g.charAt(1))){for(var W=2;c!=g.charAt(W)&&(m!=g.charAt(W)||d!=g.charAt(W+1));)++W;if(W+=2,c===g.charAt(W-1))return D("End of comment missing");var Y=g.slice(2,W-2);return y+=2,T(Y),g=g.slice(W),y+=2,U({type:_,comment:Y})}}function B(){var U=L(),W=A(s);if(W){if(I(),!A(l))return D("property missing ':'");var Y=A(f),Q=U({type:x,property:w(W[0].replace(e,c)),value:Y?w(Y[0].replace(e,c)):c});return A(p),Q}}function H(){var U=[];M(U);for(var W;W=B();)W!==!1&&(U.push(W),M(U));return U}return j(),H()}function w(g){return g?g.replace(a,c):c}return qp=E,qp}var Jy;function NL(){if(Jy)return Jo;Jy=1;var e=Jo&&Jo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=r;const i=e(OL());function r(s,l){let f=null;if(!s||typeof s!="string")return f;const p=(0,i.default)(s),a=typeof l=="function";return p.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;a?l(d,m,h):m&&(f=f||{},f[d]=m)}),f}return Jo}var wl={},eb;function BL(){if(eb)return wl;eb=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,f=function(d){return!d||r.test(d)||e.test(d)},p=function(d,m){return m.toUpperCase()},a=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),f(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(l,a):d=d.replace(s,a),d.replace(i,p))};return wl.camelCase=h,wl}var Cl,tb;function PL(){if(tb)return Cl;tb=1;var e=Cl&&Cl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},i=e(NL()),r=BL();function s(l,f){var p={};return!l||typeof l!="string"||(0,i.default)(l,function(a,h){a&&h&&(p[(0,r.camelCase)(a,f)]=h)}),p}return s.default=s,Cl=s,Cl}var IL=PL();const zL=ng(IL),jC=OC("end"),Gg=OC("start");function OC(e){return i;function i(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function HL(e){const i=Gg(e),r=jC(e);if(i&&r)return{start:i,end:r}}function Ll(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nb(e.position):"start"in e||"end"in e?nb(e):"line"in e||"column"in e?Im(e):""}function Im(e){return ib(e&&e.line)+":"+ib(e&&e.column)}function nb(e){return Im(e&&e.start)+"-"+Im(e&&e.end)}function ib(e){return e&&typeof e=="number"?e:1}class _n extends Error{constructor(i,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let l="",f={},p=!1;if(r&&("line"in r&&"column"in r?f={place:r}:"start"in r&&"end"in r?f={place:r}:"type"in r?f={ancestors:[r],place:r.position}:f={...r}),typeof i=="string"?l=i:!f.cause&&i&&(p=!0,l=i.message,f.cause=i),!f.ruleId&&!f.source&&typeof s=="string"){const h=s.indexOf(":");h===-1?f.ruleId=s:(f.source=s.slice(0,h),f.ruleId=s.slice(h+1))}if(!f.place&&f.ancestors&&f.ancestors){const h=f.ancestors[f.ancestors.length-1];h&&(f.place=h.position)}const a=f.place&&"start"in f.place?f.place.start:f.place;this.ancestors=f.ancestors||void 0,this.cause=f.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=a?a.line:void 0,this.name=Ll(f.place)||"1:1",this.place=f.place||void 0,this.reason=this.message,this.ruleId=f.ruleId||void 0,this.source=f.source||void 0,this.stack=p&&f.cause&&typeof f.cause.stack=="string"?f.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_n.prototype.file="";_n.prototype.name="";_n.prototype.reason="";_n.prototype.message="";_n.prototype.stack="";_n.prototype.column=void 0;_n.prototype.line=void 0;_n.prototype.ancestors=void 0;_n.prototype.cause=void 0;_n.prototype.fatal=void 0;_n.prototype.place=void 0;_n.prototype.ruleId=void 0;_n.prototype.source=void 0;const Yg={}.hasOwnProperty,FL=new Map,UL=/[A-Z]/g,$L=new Set(["table","tbody","thead","tfoot","tr"]),qL=new Set(["td","th"]),NC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VL(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let s;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=JL(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=ZL(r,i.jsx,i.jsxs)}const l={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:s,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?Wg:ML,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},f=BC(l,e,void 0);return f&&typeof f!="string"?f:l.create(e,l.Fragment,{children:f||void 0},void 0)}function BC(e,i,r){if(i.type==="element")return WL(e,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return GL(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return XL(e,i,r);if(i.type==="mdxjsEsm")return YL(e,i);if(i.type==="root")return KL(e,i,r);if(i.type==="text")return QL(e,i)}function WL(e,i,r){const s=e.schema;let l=s;i.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=Wg,e.schema=l),e.ancestors.push(i);const f=IC(e,i.tagName,!1),p=eD(e,i);let a=Kg(e,i);return $L.has(i.tagName)&&(a=a.filter(function(h){return typeof h=="string"?!SL(h):!0})),PC(e,p,f,i),Xg(p,a),e.ancestors.pop(),e.schema=s,e.create(i,f,p,r)}function GL(e,i){if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}zl(e,i.position)}function YL(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);zl(e,i.position)}function XL(e,i,r){const s=e.schema;let l=s;i.name==="svg"&&s.space==="html"&&(l=Wg,e.schema=l),e.ancestors.push(i);const f=i.name===null?e.Fragment:IC(e,i.name,!0),p=tD(e,i),a=Kg(e,i);return PC(e,p,f,i),Xg(p,a),e.ancestors.pop(),e.schema=s,e.create(i,f,p,r)}function KL(e,i,r){const s={};return Xg(s,Kg(e,i)),e.create(i,e.Fragment,s,r)}function QL(e,i){return i.value}function PC(e,i,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(i.node=s)}function Xg(e,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(e.children=r)}}function ZL(e,i,r){return s;function s(l,f,p,a){const d=Array.isArray(p.children)?r:i;return a?d(f,p,a):d(f,p)}}function JL(e,i){return r;function r(s,l,f,p){const a=Array.isArray(f.children),h=Gg(s);return i(l,f,p,a,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function eD(e,i){const r={};let s,l;for(l in i.properties)if(l!=="children"&&Yg.call(i.properties,l)){const f=nD(e,l,i.properties[l]);if(f){const[p,a]=f;e.tableCellAlignToStyle&&p==="align"&&typeof a=="string"&&qL.has(i.tagName)?s=a:r[p]=a}}if(s){const f=r.style||(r.style={});f[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function tD(e,i){const r={};for(const s of i.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const f=s.data.estree.body[0];f.type;const p=f.expression;p.type;const a=p.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else zl(e,i.position);else{const l=s.name;let f;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const a=s.value.data.estree.body[0];a.type,f=e.evaluater.evaluateExpression(a.expression)}else zl(e,i.position);else f=s.value===null?!0:s.value;r[l]=f}return r}function Kg(e,i){const r=[];let s=-1;const l=e.passKeys?new Map:FL;for(;++s<i.children.length;){const f=i.children[s];let p;if(e.passKeys){const h=f.type==="element"?f.tagName:f.type==="mdxJsxFlowElement"||f.type==="mdxJsxTextElement"?f.name:void 0;if(h){const d=l.get(h)||0;p=h+"-"+d,l.set(h,d+1)}}const a=BC(e,f,p);a!==void 0&&r.push(a)}return r}function nD(e,i,r){const s=AL(e.schema,i);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?vL(r):jL(r)),s.property==="style"){let l=typeof r=="object"?r:iD(e,String(r));return e.stylePropertyNameCase==="css"&&(l=rD(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?kL[s.property]||s.property:s.attribute,r]}}function iD(e,i){try{return zL(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,l=new _n("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=NC+"#cannot-parse-style-attribute",l}}function IC(e,i,r){let s;if(!r)s={type:"Literal",value:i};else if(i.includes(".")){const l=i.split(".");let f=-1,p;for(;++f<l.length;){const a=Yy(l[f])?{type:"Identifier",name:l[f]}:{type:"Literal",value:l[f]};p=p?{type:"MemberExpression",object:p,property:a,computed:!!(f&&a.type==="Literal"),optional:!1}:a}s=p}else s=Yy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(s.type==="Literal"){const l=s.value;return Yg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);zl(e)}function zl(e,i){const r=new _n("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=NC+"#cannot-handle-mdx-estrees-without-createevaluater",r}function rD(e){const i={};let r;for(r in e)Yg.call(e,r)&&(i[sD(r)]=e[r]);return i}function sD(e){let i=e.replace(UL,oD);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function oD(e){return"-"+e.toLowerCase()}const Vp={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"]},aD={};function Qg(e,i){const r=aD,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return zC(e,s,l)}function zC(e,i,r){if(lD(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rb(e.children,i,r)}return Array.isArray(e)?rb(e,i,r):""}function rb(e,i,r){const s=[];let l=-1;for(;++l<e.length;)s[l]=zC(e[l],i,r);return s.join("")}function lD(e){return!!(e&&typeof e=="object")}const sb=document.createElement("i");function Zg(e){const i="&"+e+";";sb.innerHTML=i;const r=sb.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===i?!1:r}function Si(e,i,r,s){const l=e.length;let f=0,p;if(i<0?i=-i>l?0:l+i:i=i>l?l:i,r=r>0?r:0,s.length<1e4)p=Array.from(s),p.unshift(i,r),e.splice(...p);else for(r&&e.splice(i,r);f<s.length;)p=s.slice(f,f+1e4),p.unshift(i,0),e.splice(...p),f+=1e4,i+=1e4}function hi(e,i){return e.length>0?(Si(e,e.length,0,i),e):i}const ob={}.hasOwnProperty;function HC(e){const i={};let r=-1;for(;++r<e.length;)cD(i,e[r]);return i}function cD(e,i){let r;for(r in i){const l=(ob.call(e,r)?e[r]:void 0)||(e[r]={}),f=i[r];let p;if(f)for(p in f){ob.call(l,p)||(l[p]=[]);const a=f[p];uD(l[p],Array.isArray(a)?a:a?[a]:[])}}}function uD(e,i){let r=-1;const s=[];for(;++r<i.length;)(i[r].add==="after"?e:s).push(i[r]);Si(e,0,0,s)}function FC(e,i){const r=Number.parseInt(e,i);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function wi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=ms(/[A-Za-z]/),fn=ms(/[\dA-Za-z]/),hD=ms(/[#-'*+\--9=?A-Z^-~]/);function lh(e){return e!==null&&(e<32||e===127)}const zm=ms(/\d/),dD=ms(/[\dA-Fa-f]/),UC=ms(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Nh=ms(new RegExp("\\p{P}|\\p{S}","u")),Qs=ms(/\s/);function ms(e){return i;function i(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ea(e){const i=[];let r=-1,s=0,l=0;for(;++r<e.length;){const f=e.charCodeAt(r);let p="";if(f===37&&fn(e.charCodeAt(r+1))&&fn(e.charCodeAt(r+2)))l=2;else if(f<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(f))||(p=String.fromCharCode(f));else if(f>55295&&f<57344){const a=e.charCodeAt(r+1);f<56320&&a>56319&&a<57344?(p=String.fromCharCode(f,a),l=1):p="�"}else p=String.fromCharCode(f);p&&(i.push(e.slice(s,r),encodeURIComponent(p)),s=r+l+1,p=""),l&&(r+=l,l=0)}return i.join("")+e.slice(s)}function at(e,i,r,s){const l=s?s-1:1/0;let f=0;return p;function p(h){return Ke(h)?(e.enter(r),a(h)):i(h)}function a(h){return Ke(h)&&f++<l?(e.consume(h),a):(e.exit(r),i(h))}}function $C(e,i,r,s,l,f){let p=0;return a;function a(m){return Ke(m)?(e.enter(s),h(m)):d(m)}function h(m){return Ke(m)&&p<f?(e.consume(m),p++,h):(e.exit(s),d(m))}function d(m){return p>=l?i(m):r(m)}}const fD={tokenize:pD};function pD(e){const i=e.attempt(this.parser.constructs.contentInitial,s,l);let r;return i;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,i,"linePrefix")}function l(a){return e.enter("paragraph"),f(a)}function f(a){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,p(a)}function p(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ne(a)?(e.consume(a),e.exit("chunkText"),f):(e.consume(a),p)}}let ch=class{constructor(){this.index=new Map,this.map=[]}add(i,r,s){ab(this,i,r,s,!1)}addBefore(i,r,s){ab(this,i,r,s,!0)}consume(i){if(this.map.sort(function(f,p){return f[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const f of l)i.push(f);l=s.pop()}this.map.length=0,this.index.clear()}};function ab(e,i,r,s,l){if(r===0&&s.length===0)return;const f=e.index.get(i);if(f){f[1]+=r,l?(s.push(...f[2]),f[2]=s):f[2].push(...s);return}const p=[i,r,s];e.map.push(p),e.index.set(i,p)}const mD={tokenize:gD},lb={tokenize:vD};function gD(e){const i=this,r=[];let s=0,l,f,p;return a;function a(y){if(s<r.length){const T=r[s];return i.containerState=T[1],e.attempt(T[0].continuation,h,d)(y)}return d(y)}function h(y){if(s++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,l&&S();const T=i.events.length;let L=T,R;for(;L--;)if(i.events[L][0]==="exit"&&i.events[L][1].type==="chunkFlow"){R=i.events[L][1].end;break}b(s);let D=T;for(;D<i.events.length;)i.events[D][1].end={...R},D++;const A=new ch;return A.add(L+1,0,i.events.slice(T)),A.add(T,D-T,[]),A.consume(i.events),d(y)}return a(y)}function d(y){if(s===r.length){if(!l)return _(y);if(l.currentConstruct&&l.currentConstruct.concrete)return E(y);i.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(lb,m,c)(y)}function m(y){return l&&S(),b(s),_(y)}function c(y){return i.parser.lazy[i.now().line]=s!==r.length,p=i.now().offset,E(y)}function _(y){return i.containerState={},e.attempt(lb,x,E)(y)}function x(y){return s++,r.push([i.currentConstruct,i.containerState]),_(y)}function E(y){if(y===null){l&&S(),b(0),e.consume(y);return}return l=l||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:f}),w(y)}function w(y){if(y===null){g(e.exit("chunkFlow"),!0),b(0),e.consume(y);return}return Ne(y)?(e.consume(y),g(e.exit("chunkFlow")),s=0,i.interrupt=void 0,a):(e.consume(y),w)}function g(y,T){const L=i.sliceStream(y);if(T&&L.push(null),y.previous=f,f&&(f.next=y),f=y,l.defineSkip(y.start),l.write(L),i.parser.lazy[y.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<p&&(!l.events[R][1].end||l.events[R][1].end.offset>p))return;const D=i.events.length;let A=D,j,M;for(;A--;)if(i.events[A][0]==="exit"&&i.events[A][1].type==="chunkFlow"){if(j){M=i.events[A][1].end;break}j=!0}for(b(s),R=D;R<i.events.length;)i.events[R][1].end={...M},R++;const I=new ch;I.add(A+1,0,i.events.slice(D)),I.add(D,R-D,[]),I.consume(i.events)}}function b(y){let T=r.length;for(;T-- >y;){const L=r[T];i.containerState=L[1],L[0].exit.call(i,e)}r.length=y}function S(){l.write([null]),f=void 0,l=void 0,i.containerState._closeFlow=void 0}}function vD(e,i,r){return at(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hs(e){if(e===null||yt(e)||Qs(e))return 1;if(Nh(e))return 2}function Bh(e,i,r){const s=[];let l=-1;for(;++l<e.length;){const f=e[l].resolveAll;f&&!s.includes(f)&&(i=f(i,r),s.push(f))}return i}const Hm={name:"attention",resolveAll:_D,tokenize:xD};function _D(e,i){let r=-1,s;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){let l=r;for(;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&i.sliceSerialize(e[l][1]).charCodeAt(0)===i.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;const f=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1,p={...e[l][1].end},a={...e[r][1].start};cb(p,-f),cb(a,f);const h={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[l][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:a},m={type:f>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},c={type:f>1?"strong":"emphasis",start:{...h.start},end:{...d.end}};e[l][1].end={...h.start},e[r][1].start={...d.end},s=[],e[l][1].end.offset-e[l][1].start.offset&&(s=hi(s,[["enter",e[l][1],i],["exit",e[l][1],i]])),s=hi(s,[["enter",c,i],["enter",h,i],["exit",h,i],["enter",m,i]]),s=hi(s,Bh(i.parser.constructs.insideSpan.null,e.slice(l+1,r),i)),s=hi(s,[["exit",m,i],["enter",d,i],["exit",d,i],["exit",c,i]]);let _=0;e[r][1].end.offset-e[r][1].start.offset&&(_=2,s=hi(s,[["enter",e[r][1],i],["exit",e[r][1],i]])),Si(e,l-1,r-l+3,s),r=l+s.length-_-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function xD(e,i){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,l=hs(s);let f;return p;function p(h){return f=h,e.enter("attentionSequence"),a(h)}function a(h){if(h===f)return e.consume(h),a;const d=e.exit("attentionSequence"),m=hs(h),c=!m||m===2&&l||r.includes(h)&&h!==42&&h!==95,_=!l||l===2&&m||r.includes(s)&&s!==42&&s!==95;return d._open=!!(f===42?c:c&&(l||!_)),d._close=!!(f===42?_:_&&(m||!c)),i(h)}}function cb(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const yD={name:"autolink",tokenize:bD};function bD(e,i,r){let s=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),f}function f(x){return dn(x)?(e.consume(x),p):x===64?r(x):d(x)}function p(x){return x===43||x===45||x===46||fn(x)?(s=1,a(x)):d(x)}function a(x){return x===58?(e.consume(x),s=0,h):(x===43||x===45||x===46||fn(x))&&s++<32?(e.consume(x),a):(s=0,d(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):x===null||x===32||x===60||lh(x)?r(x):(e.consume(x),h)}function d(x){return x===64?(e.consume(x),m):hD(x)?(e.consume(x),d):r(x)}function m(x){return fn(x)?c(x):r(x)}function c(x){return x===46?(e.consume(x),s=0,m):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):_(x)}function _(x){if((x===45||fn(x))&&s++<63){const E=x===45?_:c;return e.consume(x),E}return r(x)}}const Jl={partial:!0,tokenize:SD};function SD(e,i,r){return s;function s(f){return Ke(f)?at(e,l,"linePrefix")(f):l(f)}function l(f){return f===null||Ne(f)?i(f):r(f)}}const qC={continuation:{tokenize:CD},exit:ED,name:"blockQuote",tokenize:wD};function wD(e,i,r){const s=this;return l;function l(p){if(p===62){const a=s.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(p),e.exit("blockQuoteMarker"),f}return r(p)}function f(p){return Ke(p)?(e.enter("blockQuotePrefixWhitespace"),e.consume(p),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(p))}}function CD(e,i,r){const s=this;return l;function l(p){return Ke(p)?at(e,f,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p):f(p)}function f(p){return e.attempt(qC,i,r)(p)}}function ED(e){e.exit("blockQuote")}const VC={name:"characterEscape",tokenize:kD};function kD(e,i,r){return s;function s(f){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(f),e.exit("escapeMarker"),l}function l(f){return UC(f)?(e.enter("characterEscapeValue"),e.consume(f),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(f)}}const WC={name:"characterReference",tokenize:TD};function TD(e,i,r){const s=this;let l=0,f,p;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),h}function h(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),f=31,p=fn,m(c))}function d(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),f=6,p=dD,m):(e.enter("characterReferenceValue"),f=7,p=zm,m(c))}function m(c){if(c===59&&l){const _=e.exit("characterReferenceValue");return p===fn&&!Zg(s.sliceSerialize(_))?r(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return p(c)&&l++<f?(e.consume(c),m):r(c)}}const Fm={partial:!0,tokenize:RD};function RD(e,i,r){const s=this;return l;function l(p){return p===null?r(p):(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f)}function f(p){return s.parser.lazy[s.now().line]?r(p):i(p)}}const ub={concrete:!0,name:"codeFenced",tokenize:AD};function AD(e,i,r){const s=this,l={partial:!0,tokenize:L};let f=0,p=0,a;return h;function h(R){return d(R)}function d(R){const D=s.events[s.events.length-1];return f=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===a?(p++,e.consume(R),m):p<3?r(R):(e.exit("codeFencedFenceSequence"),Ke(R)?at(e,c,"whitespace")(R):c(R))}function c(R){return R===null||Ne(R)?(e.exit("codeFencedFence"),s.interrupt?i(R):e.check(Fm,w,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(R))}function _(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(R)):Ke(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,x,"whitespace")(R)):R===96&&R===a?r(R):(e.consume(R),_)}function x(R){return R===null||Ne(R)?c(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(R))}function E(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(R)):R===96&&R===a?r(R):(e.consume(R),E)}function w(R){return e.attempt(l,T,g)(R)}function g(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),b}function b(R){return f>0&&Ke(R)?at(e,S,"linePrefix",f+1)(R):S(R)}function S(R){return R===null||Ne(R)?e.check(Fm,w,T)(R):(e.enter("codeFlowValue"),y(R))}function y(R){return R===null||Ne(R)?(e.exit("codeFlowValue"),S(R)):(e.consume(R),y)}function T(R){return e.exit("codeFenced"),i(R)}function L(R,D,A){let j=0;return M;function M(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),I}function I(W){return R.enter("codeFencedFence"),Ke(W)?at(R,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):B(W)}function B(W){return W===a?(R.enter("codeFencedFenceSequence"),H(W)):A(W)}function H(W){return W===a?(j++,R.consume(W),H):j>=p?(R.exit("codeFencedFenceSequence"),Ke(W)?at(R,U,"whitespace")(W):U(W)):A(W)}function U(W){return W===null||Ne(W)?(R.exit("codeFencedFence"),D(W)):A(W)}}}const Wp={name:"codeIndented",tokenize:DD},LD={partial:!0,tokenize:MD};function DD(e,i,r){return s;function s(a){return e.enter("codeIndented"),$C(e,l,r,"linePrefix",4,4)(a)}function l(a){return a===null?p(a):Ne(a)?e.attempt(LD,l,p)(a):(e.enter("codeFlowValue"),f(a))}function f(a){return a===null||Ne(a)?(e.exit("codeFlowValue"),l(a)):(e.consume(a),f)}function p(a){return e.exit("codeIndented"),i(a)}}function MD(e,i,r){const s=this;return l;function l(p){return s.parser.lazy[s.now().line]?r(p):Ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):$C(e,i,f,"linePrefix",4,4)(p)}function f(p){return Ne(p)?l(p):r(p)}}const jD={name:"codeText",previous:ND,resolve:OD,tokenize:BD};function OD(e){let i=e.length-4,r=3,s,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(s=r;++s<i;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(s=r-1,i++;++s<=i;)l===void 0?s!==i&&e[s][1].type!=="lineEnding"&&(l=s):(s===i||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),i-=s-l-2,s=l+2),l=void 0);return e}function ND(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BD(e,i,r){let s=0,l,f;return p;function p(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),s++,a):(e.exit("codeTextSequence"),h(c))}function h(c){return c===null?r(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),h):c===96?(f=e.enter("codeTextSequence"),l=0,m(c)):Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(c))}function d(c){return c===null||c===32||c===96||Ne(c)?(e.exit("codeTextData"),h(c)):(e.consume(c),d)}function m(c){return c===96?(e.consume(c),l++,m):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),i(c)):(f.type="codeTextData",d(c))}}class PD{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(i,s):i>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(i,r,s){const l=r||0;this.setCursor(Math.trunc(i));const f=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&El(this.left,s),f.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),El(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),El(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);El(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);El(this.left,r.reverse())}}}function El(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function GC(e){const i={};let r=-1,s,l,f,p,a,h,d;const m=new PD(e);for(;++r<m.length;){for(;r in i;)r=i[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,f=0,f<h.length&&h[f][1].type==="lineEndingBlank"&&(f+=2),f<h.length&&h[f][1].type==="content"))for(;++f<h.length&&h[f][1].type!=="content";)h[f][1].type==="chunkText"&&(h[f][1]._isInFirstContentOfListItem=!0,f++);if(s[0]==="enter")s[1].contentType&&(Object.assign(i,ID(m,r)),r=i[r],d=!0);else if(s[1]._container){for(f=r,l=void 0;f--;)if(p=m.get(f),p[1].type==="lineEnding"||p[1].type==="lineEndingBlank")p[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),p[1].type="lineEnding",l=f);else if(!(p[1].type==="linePrefix"||p[1].type==="listItemIndent"))break;l&&(s[1].end={...m.get(l)[1].start},a=m.slice(l,r),a.unshift(s),m.splice(l,r-l+1,a))}}return Si(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function ID(e,i){const r=e.get(i)[1],s=e.get(i)[2];let l=i-1;const f=[];let p=r._tokenizer;p||(p=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(p._contentTypeTextTrailing=!0));const a=p.events,h=[],d={};let m,c,_=-1,x=r,E=0,w=0;const g=[w];for(;x;){for(;e.get(++l)[1]!==x;);f.push(l),x._tokenizer||(m=s.sliceStream(x),x.next||m.push(null),c&&p.defineSkip(x.start),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=!0),p.write(m),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=void 0)),c=x,x=x.next}for(x=r;++_<a.length;)a[_][0]==="exit"&&a[_-1][0]==="enter"&&a[_][1].type===a[_-1][1].type&&a[_][1].start.line!==a[_][1].end.line&&(w=_+1,g.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(p.events=[],x?(x._tokenizer=void 0,x.previous=void 0):g.pop(),_=g.length;_--;){const b=a.slice(g[_],g[_+1]),S=f.pop();h.push([S,S+b.length-1]),e.splice(S,2,b)}for(h.reverse(),_=-1;++_<h.length;)d[E+h[_][0]]=E+h[_][1],E+=h[_][1]-h[_][0]-1;return d}const zD={resolve:FD,tokenize:UD},HD={partial:!0,tokenize:$D};function FD(e){return GC(e),e}function UD(e,i){let r;return s;function s(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(a)}function l(a){return a===null?f(a):Ne(a)?e.check(HD,p,f)(a):(e.consume(a),l)}function f(a){return e.exit("chunkContent"),e.exit("content"),i(a)}function p(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function $D(e,i,r){const s=this;return l;function l(p){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),at(e,f,"linePrefix")}function f(p){if(p===null||Ne(p))return r(p);const a=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?i(p):e.interrupt(s.parser.constructs.flow,r,i)(p)}}function YC(e,i,r,s,l,f,p,a,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return c;function c(b){return b===60?(e.enter(s),e.enter(l),e.enter(f),e.consume(b),e.exit(f),_):b===null||b===32||b===41||lh(b)?r(b):(e.enter(s),e.enter(p),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(b))}function _(b){return b===62?(e.enter(f),e.consume(b),e.exit(f),e.exit(l),e.exit(s),i):(e.enter(a),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===62?(e.exit("chunkString"),e.exit(a),_(b)):b===null||b===60||Ne(b)?r(b):(e.consume(b),b===92?E:x)}function E(b){return b===60||b===62||b===92?(e.consume(b),x):x(b)}function w(b){return!m&&(b===null||b===41||yt(b))?(e.exit("chunkString"),e.exit(a),e.exit(p),e.exit(s),i(b)):m<d&&b===40?(e.consume(b),m++,w):b===41?(e.consume(b),m--,w):b===null||b===32||b===40||lh(b)?r(b):(e.consume(b),b===92?g:w)}function g(b){return b===40||b===41||b===92?(e.consume(b),w):w(b)}}function XC(e,i,r,s,l,f){const p=this;let a=0,h;return d;function d(x){return e.enter(s),e.enter(l),e.consume(x),e.exit(l),e.enter(f),m}function m(x){return a>999||x===null||x===91||x===93&&!h||x===94&&!a&&"_hiddenFootnoteSupport"in p.parser.constructs?r(x):x===93?(e.exit(f),e.enter(l),e.consume(x),e.exit(l),e.exit(s),i):Ne(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===null||x===91||x===93||Ne(x)||a++>999?(e.exit("chunkString"),m(x)):(e.consume(x),h||(h=!Ke(x)),x===92?_:c)}function _(x){return x===91||x===92||x===93?(e.consume(x),a++,c):c(x)}}function KC(e,i,r,s,l,f){let p;return a;function a(_){return _===34||_===39||_===40?(e.enter(s),e.enter(l),e.consume(_),e.exit(l),p=_===40?41:_,h):r(_)}function h(_){return _===p?(e.enter(l),e.consume(_),e.exit(l),e.exit(s),i):(e.enter(f),d(_))}function d(_){return _===p?(e.exit(f),h(p)):_===null?r(_):Ne(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),at(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===p||_===null||Ne(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?c:m)}function c(_){return _===p||_===92?(e.consume(_),m):m(_)}}function Dl(e,i){let r;return s;function s(l){return Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,s):Ke(l)?at(e,s,r?"linePrefix":"lineSuffix")(l):i(l)}}const qD={name:"definition",tokenize:WD},VD={partial:!0,tokenize:GD};function WD(e,i,r){const s=this;let l;return f;function f(x){return e.enter("definition"),p(x)}function p(x){return XC.call(s,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function a(x){return l=wi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):r(x)}function h(x){return yt(x)?Dl(e,d)(x):d(x)}function d(x){return YC(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(VD,c,c)(x)}function c(x){return Ke(x)?at(e,_,"whitespace")(x):_(x)}function _(x){return x===null||Ne(x)?(e.exit("definition"),s.parser.defined.push(l),i(x)):r(x)}}function GD(e,i,r){return s;function s(a){return yt(a)?Dl(e,l)(a):r(a)}function l(a){return KC(e,f,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function f(a){return Ke(a)?at(e,p,"whitespace")(a):p(a)}function p(a){return a===null||Ne(a)?i(a):r(a)}}const YD={name:"hardBreakEscape",tokenize:XD};function XD(e,i,r){return s;function s(f){return e.enter("hardBreakEscape"),e.consume(f),l}function l(f){return Ne(f)?(e.exit("hardBreakEscape"),i(f)):r(f)}}const KD={name:"headingAtx",resolve:QD,tokenize:ZD};function QD(e,i){let r=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s){const l={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},f={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"};Si(e,s,r-s+1,[["enter",l,i],["enter",f,i],["exit",f,i],["exit",l,i]])}return e}function ZD(e,i,r){let s=0;return l;function l(m){return e.enter("atxHeading"),f(m)}function f(m){return e.enter("atxHeadingSequence"),p(m)}function p(m){return m===35&&s++<6?(e.consume(m),p):m===null||yt(m)?(e.exit("atxHeadingSequence"),a(m)):r(m)}function a(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Ne(m)?(e.exit("atxHeading"),i(m)):Ke(m)?at(e,a,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),a(m))}function d(m){return m===null||m===35||yt(m)?(e.exit("atxHeadingText"),a(m)):(e.consume(m),d)}}const QC=["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"],Um=["pre","script","style","textarea"],JD={concrete:!0,name:"htmlFlow",resolveTo:tM,tokenize:nM},eM={partial:!0,tokenize:iM};function tM(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function nM(e,i,r){const s=this;let l,f,p,a,h;return d;function d(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),c}function c(F){return F===33?(e.consume(F),_):F===47?(e.consume(F),f=!0,w):F===63?(e.consume(F),l=3,s.interrupt?i:O):dn(F)?(e.consume(F),p=String.fromCharCode(F),g):r(F)}function _(F){return F===45?(e.consume(F),l=2,x):F===91?(e.consume(F),l=5,a=0,E):dn(F)?(e.consume(F),l=4,s.interrupt?i:O):r(F)}function x(F){return F===45?(e.consume(F),s.interrupt?i:O):r(F)}function E(F){const V="CDATA[";return F===V.charCodeAt(a++)?(e.consume(F),a===V.length?s.interrupt?i:B:E):r(F)}function w(F){return dn(F)?(e.consume(F),p=String.fromCharCode(F),g):r(F)}function g(F){if(F===null||F===47||F===62||yt(F)){const V=F===47,ne=p.toLowerCase();return!V&&!f&&Um.includes(ne)?(l=1,s.interrupt?i(F):B(F)):QC.includes(p.toLowerCase())?(l=6,V?(e.consume(F),b):s.interrupt?i(F):B(F)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(F):f?S(F):y(F))}return F===45||fn(F)?(e.consume(F),p+=String.fromCharCode(F),g):r(F)}function b(F){return F===62?(e.consume(F),s.interrupt?i:B):r(F)}function S(F){return Ke(F)?(e.consume(F),S):M(F)}function y(F){return F===47?(e.consume(F),M):F===58||F===95||dn(F)?(e.consume(F),T):Ke(F)?(e.consume(F),y):M(F)}function T(F){return F===45||F===46||F===58||F===95||fn(F)?(e.consume(F),T):L(F)}function L(F){return F===61?(e.consume(F),R):Ke(F)?(e.consume(F),L):y(F)}function R(F){return F===null||F===60||F===61||F===62||F===96?r(F):F===34||F===39?(e.consume(F),h=F,D):Ke(F)?(e.consume(F),R):A(F)}function D(F){return F===h?(e.consume(F),h=null,j):F===null||Ne(F)?r(F):(e.consume(F),D)}function A(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||yt(F)?L(F):(e.consume(F),A)}function j(F){return F===47||F===62||Ke(F)?y(F):r(F)}function M(F){return F===62?(e.consume(F),I):r(F)}function I(F){return F===null||Ne(F)?B(F):Ke(F)?(e.consume(F),I):r(F)}function B(F){return F===45&&l===2?(e.consume(F),Y):F===60&&l===1?(e.consume(F),Q):F===62&&l===4?(e.consume(F),G):F===63&&l===3?(e.consume(F),O):F===93&&l===5?(e.consume(F),z):Ne(F)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(eM,Z,H)(F)):F===null||Ne(F)?(e.exit("htmlFlowData"),H(F)):(e.consume(F),B)}function H(F){return e.check(Fm,U,Z)(F)}function U(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),W}function W(F){return F===null||Ne(F)?H(F):(e.enter("htmlFlowData"),B(F))}function Y(F){return F===45?(e.consume(F),O):B(F)}function Q(F){return F===47?(e.consume(F),p="",K):B(F)}function K(F){if(F===62){const V=p.toLowerCase();return Um.includes(V)?(e.consume(F),G):B(F)}return dn(F)&&p.length<8?(e.consume(F),p+=String.fromCharCode(F),K):B(F)}function z(F){return F===93?(e.consume(F),O):B(F)}function O(F){return F===62?(e.consume(F),G):F===45&&l===2?(e.consume(F),O):B(F)}function G(F){return F===null||Ne(F)?(e.exit("htmlFlowData"),Z(F)):(e.consume(F),G)}function Z(F){return e.exit("htmlFlow"),i(F)}}function iM(e,i,r){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Jl,i,r)}}const rM={name:"htmlText",tokenize:sM};function sM(e,i,r){const s=this;let l,f,p;return a;function a(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),L):O===63?(e.consume(O),y):dn(O)?(e.consume(O),A):r(O)}function d(O){return O===45?(e.consume(O),m):O===91?(e.consume(O),f=0,E):dn(O)?(e.consume(O),S):r(O)}function m(O){return O===45?(e.consume(O),x):r(O)}function c(O){return O===null?r(O):O===45?(e.consume(O),_):Ne(O)?(p=c,Q(O)):(e.consume(O),c)}function _(O){return O===45?(e.consume(O),x):c(O)}function x(O){return O===62?Y(O):O===45?_(O):c(O)}function E(O){const G="CDATA[";return O===G.charCodeAt(f++)?(e.consume(O),f===G.length?w:E):r(O)}function w(O){return O===null?r(O):O===93?(e.consume(O),g):Ne(O)?(p=w,Q(O)):(e.consume(O),w)}function g(O){return O===93?(e.consume(O),b):w(O)}function b(O){return O===62?Y(O):O===93?(e.consume(O),b):w(O)}function S(O){return O===null||O===62?Y(O):Ne(O)?(p=S,Q(O)):(e.consume(O),S)}function y(O){return O===null?r(O):O===63?(e.consume(O),T):Ne(O)?(p=y,Q(O)):(e.consume(O),y)}function T(O){return O===62?Y(O):y(O)}function L(O){return dn(O)?(e.consume(O),R):r(O)}function R(O){return O===45||fn(O)?(e.consume(O),R):D(O)}function D(O){return Ne(O)?(p=D,Q(O)):Ke(O)?(e.consume(O),D):Y(O)}function A(O){return O===45||fn(O)?(e.consume(O),A):O===47||O===62||yt(O)?j(O):r(O)}function j(O){return O===47?(e.consume(O),Y):O===58||O===95||dn(O)?(e.consume(O),M):Ne(O)?(p=j,Q(O)):Ke(O)?(e.consume(O),j):Y(O)}function M(O){return O===45||O===46||O===58||O===95||fn(O)?(e.consume(O),M):I(O)}function I(O){return O===61?(e.consume(O),B):Ne(O)?(p=I,Q(O)):Ke(O)?(e.consume(O),I):j(O)}function B(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),l=O,H):Ne(O)?(p=B,Q(O)):Ke(O)?(e.consume(O),B):(e.consume(O),U)}function H(O){return O===l?(e.consume(O),l=void 0,W):O===null?r(O):Ne(O)?(p=H,Q(O)):(e.consume(O),H)}function U(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||yt(O)?j(O):(e.consume(O),U)}function W(O){return O===47||O===62||yt(O)?j(O):r(O)}function Y(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):r(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),K}function K(O){return Ke(O)?at(e,z,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return e.enter("htmlTextData"),p(O)}}const Jg={name:"labelEnd",resolveAll:cM,resolveTo:uM,tokenize:hM},oM={tokenize:dM},aM={tokenize:fM},lM={tokenize:pM};function cM(e){let i=-1;const r=[];for(;++i<e.length;){const s=e[i][1];if(r.push(e[i]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",i+=l}}return e.length!==r.length&&Si(e,0,e.length,r),e}function uM(e,i){let r=e.length,s=0,l,f,p;for(;r--;){const m=e[r][1];if(l){if(m.type==="link"||m.type==="labelLink"&&m._inactive)break;e[r][0]==="enter"&&m.type==="labelLink"&&(m._inactive=!0)}else if(f){if(e[r][0]==="enter"&&(m.type==="labelImage"||m.type==="labelLink")&&!m._balanced&&(l=r,m.type!=="labelLink")){s=2;break}}else m.type==="labelEnd"&&(f=r)}const a={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[f][1].end}},d={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[f-2][1].start}};return p=[["enter",a,i],["enter",h,i]],p=hi(p,e.slice(l+1,l+s+3)),p=hi(p,[["enter",d,i]]),p=hi(p,Bh(i.parser.constructs.insideSpan.null,e.slice(l+s+4,f-3),i)),p=hi(p,[["exit",d,i],e[f-2],e[f-1],["exit",h,i]]),p=hi(p,e.slice(f+1)),p=hi(p,[["exit",a,i]]),Si(e,l,e.length,p),e}function hM(e,i,r){const s=this,l=s._labelStarts;let f,p;if(l){for(;l.length>0&&l[l.length-1]._balanced;)l.pop();f=l[l.length-1]}return a;function a(_){return f?f._inactive?c(_):(p=s.parser.defined.includes(wi(s.sliceSerialize({start:f.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):r(_)}function h(_){return _===40?e.attempt(oM,m,p?m:c)(_):_===91?e.attempt(aM,m,p?d:c)(_):p?m(_):c(_)}function d(_){return e.attempt(lM,m,c)(_)}function m(_){return l.pop(),i(_)}function c(_){return f._balanced=!0,r(_)}}function dM(e,i,r){return s;function s(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),l}function l(c){return yt(c)?Dl(e,f)(c):f(c)}function f(c){return c===41?m(c):YC(e,p,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function p(c){return yt(c)?Dl(e,h)(c):m(c)}function a(c){return r(c)}function h(c){return c===34||c===39||c===40?KC(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):m(c)}function d(c){return yt(c)?Dl(e,m)(c):m(c)}function m(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),i):r(c)}}function fM(e,i,r){const s=this;return l;function l(a){return XC.call(s,e,f,p,"reference","referenceMarker","referenceString")(a)}function f(a){return s.parser.defined.includes(wi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?i(a):r(a)}function p(a){return r(a)}}function pM(e,i,r){return s;function s(f){return e.enter("reference"),e.enter("referenceMarker"),e.consume(f),e.exit("referenceMarker"),l}function l(f){return f===93?(e.enter("referenceMarker"),e.consume(f),e.exit("referenceMarker"),e.exit("reference"),i):r(f)}}const mM={name:"labelStartImage",resolveAll:Jg.resolveAll,tokenize:gM};function gM(e,i,r){const s=this;let l;return f;function f(h){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(h),e.exit("labelImageMarker"),p}function p(h){return h===91?(e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),l=e.exit("labelImage"),a):r(h)}function a(h){return h===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(h):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(h))}}const vM={name:"labelStartLink",resolveAll:Jg.resolveAll,tokenize:_M};function _M(e,i,r){const s=this;let l;return f;function f(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),l=e.exit("labelLink"),p}function p(a){return a===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(a):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(a))}}const Gp={name:"lineEnding",tokenize:xM};function xM(e,i){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),at(e,i,"linePrefix")}}const Zu={name:"thematicBreak",tokenize:yM};function yM(e,i,r){let s=0,l;return f;function f(d){return e.enter("thematicBreak"),p(d)}function p(d){return l=d,a(d)}function a(d){return d===l?(e.enter("thematicBreakSequence"),h(d)):s>=3&&(d===null||Ne(d))?(e.exit("thematicBreak"),i(d)):r(d)}function h(d){return d===l?(e.consume(d),s++,h):(e.exit("thematicBreakSequence"),Ke(d)?at(e,a,"whitespace")(d):a(d))}}const jn={continuation:{tokenize:CM},exit:kM,name:"list",tokenize:wM},bM={partial:!0,tokenize:TM},SM={partial:!0,tokenize:EM};function wM(e,i,r){const s=this,l=s.events[s.events.length-1];let f=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,p=0;return a;function a(x){const E=s.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!s.containerState.marker||x===s.containerState.marker:zm(x)){if(s.containerState.type||(s.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Zu,r,d)(x):d(x);if(!s.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return r(x)}function h(x){return zm(x)&&++p<10?(e.consume(x),h):(!s.interrupt||p<2)&&(s.containerState.marker?x===s.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),d(x)):r(x)}function d(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||x,e.check(Jl,s.interrupt?r:m,e.attempt(bM,_,c))}function m(x){return s.containerState.initialBlankLine=!0,f++,_(x)}function c(x){return Ke(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),_):r(x)}function _(x){return s.containerState.size=f+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(x)}}function CM(e,i,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Jl,l,f);function l(a){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,at(e,i,"listItemIndent",s.containerState.size+1)(a)}function f(a){return s.containerState.furtherBlankLines||!Ke(a)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,p(a)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(SM,i,p)(a))}function p(a){return s.containerState._closeFlow=!0,s.interrupt=void 0,at(e,e.attempt(jn,i,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function EM(e,i,r){const s=this;return at(e,l,"listItemIndent",s.containerState.size+1);function l(f){const p=s.events[s.events.length-1];return p&&p[1].type==="listItemIndent"&&p[2].sliceSerialize(p[1],!0).length===s.containerState.size?i(f):r(f)}}function kM(e){e.exit(this.containerState.type)}function TM(e,i,r){const s=this;return at(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(f){const p=s.events[s.events.length-1];return!Ke(f)&&p&&p[1].type==="listItemPrefixWhitespace"?i(f):r(f)}}const hb={name:"setextUnderline",resolveTo:RM,tokenize:AM};function RM(e,i){const r=new ch;let s=e.length,l,f,p;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){l=s;break}e[s][1].type==="paragraph"&&(f=s)}else e[s][1].type==="content"&&r.add(s,1,[]),!p&&e[s][1].type==="definition"&&(p=s);const a={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[f][1].type="setextHeadingText",p?(r.add(f,0,[["enter",a,i]]),r.add(p+1,0,[["exit",e[l][1],i]]),e[l][1].end={...e[p][1].end}):e[l][1]=a,r.add(e.length,0,[["exit",a,i]]),r.consume(e),e}function AM(e,i,r){const s=this;let l;return f;function f(d){let m=s.events.length,c;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){c=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||c)?(e.enter("setextHeadingLine"),l=d,p(d)):r(d)}function p(d){return e.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===l?(e.consume(d),a):(e.exit("setextHeadingLineSequence"),Ke(d)?at(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Ne(d)?(e.exit("setextHeadingLine"),i(d)):r(d)}}const LM={tokenize:DM};function DM(e){const i=this,r=e.attempt(Jl,s,e.attempt(this.parser.constructs.flowInitial,l,at(e,e.attempt(this.parser.constructs.flow,l,e.attempt(zD,l)),"linePrefix")));return r;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEndingBlank"),e.consume(f),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),i.currentConstruct=void 0,r}}const MM={resolveAll:JC()},jM=ZC("string"),OM=ZC("text");function ZC(e){return{resolveAll:JC(e==="text"?NM:void 0),tokenize:i};function i(r){const s=this,l=this.parser.constructs[e],f=r.attempt(l,p,a);return p;function p(m){return d(m)?f(m):a(m)}function a(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return d(m)?(r.exit("data"),f(m)):(r.consume(m),h)}function d(m){if(m===null)return!0;const c=l[m];let _=-1;if(c)for(;++_<c.length;){const x=c[_];if(!x.previous||x.previous.call(s,s.previous))return!0}return!1}}}function JC(e){return i;function i(r,s){let l=-1,f;for(;++l<=r.length;)f===void 0?r[l]&&r[l][1].type==="data"&&(f=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==f+2&&(r[f][1].end=r[l-1][1].end,r.splice(f+2,l-f-2),l=f+2),f=void 0);return e?e(r,s):r}}function NM(e,i){const r=new ch;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const l=e[s-1][1],f=i.sliceStream(l);let p=f.length,a=-1,h=0,d;for(;p--;){const m=f[p];if(typeof m=="string"){for(a=m.length;m.charCodeAt(a-1)===32;)h++,a--;if(a)break;a=-1}else if(m===-2)d=!0,h++;else if(m!==-1){p++;break}}if(i._contentTypeTextTrailing&&s===e.length&&(h=0),h){const m={type:s===e.length||d||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?a:l.start._bufferIndex+a,_index:l.start._index+p,line:l.end.line,column:l.end.column-h,offset:l.end.offset-h},end:{...l.end}};l.end={...m.start},l.start.offset===l.end.offset?Object.assign(l,m):r.add(s,0,[["enter",m,i],["exit",m,i]])}s++}return r.consume(e),e}const BM={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:qC},PM={91:qD},IM={[-2]:Wp,[-1]:Wp,32:Wp},zM={35:KD,42:Zu,45:[hb,Zu],60:JD,61:hb,95:Zu,96:ub,126:ub},HM={38:WC,92:VC},FM={[-5]:Gp,[-4]:Gp,[-3]:Gp,33:mM,38:WC,42:Hm,60:[yD,rM],91:vM,92:[YD,VC],93:Jg,95:Hm,96:jD},UM={null:[Hm,MM]},$M={null:[42,95]},qM={null:[]},VM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$M,contentInitial:PM,disable:qM,document:BM,flow:zM,flowInitial:IM,insideSpan:UM,string:HM,text:FM},Symbol.toStringTag,{value:"Module"}));function WM(e,i,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},f=[];let p=[],a=[];const h={attempt:D(L),check:D(R),consume:S,enter:y,exit:T,interrupt:D(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:E,parser:e,previous:null,sliceSerialize:_,sliceStream:x,write:c};let m=i.tokenize.call(d,h);return i.resolveAll&&f.push(i),d;function c(I){return p=hi(p,I),g(),p[p.length-1]!==null?[]:(A(i,0),d.events=Bh(f,d.events,d),d.events)}function _(I,B){return YM(x(I),B)}function x(I){return GM(p,I)}function E(){const{_bufferIndex:I,_index:B,line:H,column:U,offset:W}=s;return{_bufferIndex:I,_index:B,line:H,column:U,offset:W}}function w(I){l[I.line]=I.column,M()}function g(){for(;s._index<p.length;){const I=p[s._index];if(typeof I=="string"){const B=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===B&&s._bufferIndex<I.length;)b(I.charCodeAt(s._bufferIndex))}else b(I)}}function b(I){m=m(I)}function S(I){Ne(I)?(s.line++,s.column=1,s.offset+=I===-3?2:1,M()):I!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===p[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=I}function y(I,B){const H=B||{};return H.type=I,H.start=E(),d.events.push(["enter",H,d]),a.push(H),H}function T(I){const B=a.pop();return B.end=E(),d.events.push(["exit",B,d]),B}function L(I,B){A(I,B.from)}function R(I,B){B.restore()}function D(I,B){return H;function H(U,W,Y){let Q,K,z,O;return Array.isArray(U)?Z(U):"tokenize"in U?Z([U]):G(U);function G(le){return X;function X($){const oe=$!==null&&le[$],ee=$!==null&&le.null,ue=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return Z(ue)($)}}function Z(le){return Q=le,K=0,le.length===0?Y:F(le[K])}function F(le){return X;function X($){return O=j(),z=le,le.partial||(d.currentConstruct=le),le.name&&d.parser.constructs.disable.null.includes(le.name)?ne():le.tokenize.call(B?Object.assign(Object.create(d),B):d,h,V,ne)($)}}function V(le){return I(z,O),W}function ne(le){return O.restore(),++K<Q.length?F(Q[K]):Y}}}function A(I,B){I.resolveAll&&!f.includes(I)&&f.push(I),I.resolve&&Si(d.events,B,d.events.length-B,I.resolve(d.events.slice(B),d)),I.resolveTo&&(d.events=I.resolveTo(d.events,d))}function j(){const I=E(),B=d.previous,H=d.currentConstruct,U=d.events.length,W=Array.from(a);return{from:U,restore:Y};function Y(){s=I,d.previous=B,d.currentConstruct=H,d.events.length=U,a=W,M()}}function M(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function GM(e,i){const r=i.start._index,s=i.start._bufferIndex,l=i.end._index,f=i.end._bufferIndex;let p;if(r===l)p=[e[r].slice(s,f)];else{if(p=e.slice(r,l),s>-1){const a=p[0];typeof a=="string"?p[0]=a.slice(s):p.shift()}f>0&&p.push(e[l].slice(0,f))}return p}function YM(e,i){let r=-1;const s=[];let l;for(;++r<e.length;){const f=e[r];let p;if(typeof f=="string")p=f;else switch(f){case-5:{p="\r";break}case-4:{p=`
510
510
  `;break}case-3:{p=`\r
511
- `;break}case-2:{p=i?" ":" ";break}case-1:{if(!i&&l)continue;p=" ";break}default:p=String.fromCharCode(f)}l=f===-2,s.push(p)}return s.join("")}function XM(e){const s={constructs:HC([VM,...(e||{}).extensions||[]]),content:l(fD),defined:[],document:l(mD),flow:l(LM),lazy:{},string:l(jM),text:l(OM)};return s;function l(f){return p;function p(a){return WM(s,f,a)}}}function KM(e){for(;!GC(e););return e}const db=/[\0\t\n\r]/g;function QM(){let e=1,i="",r=!0,s;return l;function l(f,p,a){f=i+(typeof f=="string"?f.toString():new TextDecoder(p||void 0).decode(f));const h=[];let d=0;for(i="",r&&(f.charCodeAt(0)===65279&&d++,r=void 0);d<f.length;){db.lastIndex=d;const m=db.exec(f),c=m&&m.index!==void 0?m.index:f.length,_=f.charCodeAt(c);if(!m){i=f.slice(d);break}if(_===10&&d===c&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),d<c&&(h.push(f.slice(d,c)),e+=c-d),_){case 0:{h.push(65533),e++;break}case 9:{const x=Math.ceil(e/4)*4;for(h.push(-2);e++<x;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}d=c+1}return a&&(s&&h.push(-5),i&&h.push(i),h.push(null)),h}}const ZM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JM(e){return e.replace(ZM,ej)}function ej(e,i,r){if(i)return i;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),f=l===120||l===88;return FC(r.slice(f?2:1),f?16:10)}return Zg(r)||e}const e2={}.hasOwnProperty;function tj(e,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),nj(r)(KM(XM(r).document().write(QM()(e,i,!0))))}function nj(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p($e),autolinkProtocol:M,autolinkEmail:M,atxHeading:p(qe),blockQuote:p(ue),characterEscape:M,characterReference:M,codeFenced:p(he),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:p(he,a),codeText:p(we,a),codeTextData:M,data:M,codeFlowValue:M,definition:p(Se),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:p(Re),hardBreakEscape:p(ke),hardBreakTrailing:p(ke),htmlFlow:p(ze,a),htmlFlowData:M,htmlText:p(ze,a),htmlTextData:M,image:p(Mt),label:a,link:p($e),listItem:p(Ie),listItemValue:x,listOrdered:p(Be,_),listUnordered:p(Be),paragraph:p(Te),reference:V,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:p(qe),strong:p(Ve),thematicBreak:p(st)},exit:{atxHeading:d(),atxHeadingSequence:R,autolink:d(),autolinkEmail:ee,autolinkProtocol:oe,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:X,characterReference:$,codeFenced:d(b),codeFencedFence:g,codeFencedFenceInfo:E,codeFencedFenceMeta:w,codeFlowValue:I,codeIndented:d(S),codeText:d(Y),codeTextData:I,data:I,definition:d(),definitionDestinationString:L,definitionLabelString:y,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(U),htmlFlowData:I,htmlText:d(W),htmlTextData:I,image:d(K),label:O,labelText:z,lineEnding:B,link:d(Q),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ne,resourceDestinationString:G,resourceTitleString:Z,resource:F,setextHeading:d(j),setextHeadingLineSequence:A,setextHeadingText:D,strong:d(),thematicBreak:d()}};t2(i,(e||{}).mdastExtensions||[]);const r={};return s;function s(fe){let ge={type:"root",children:[],position:void 0};const Le={stack:[ge],tokenStack:[],config:i,enter:h,exit:m,buffer:a,resume:c,data:r},De=[],Fe=[];let Me=-1;for(;++Me<fe.length;)if(Fe.push(fe[Me]),fe[Me][1].type==="listOrdered"||fe[Me][1].type==="listUnordered")if(fe[Me][0]==="enter")De.push(Fe.length-1);else{const Tt=De.pop();f(Fe,Tt)}for(fe=Fe,Me=-1;++Me<fe.length;){const Tt=i[fe[Me][0]];fe[Me][0]==="enter"&&i.beforeEnter.length>0&&l(i.beforeEnter,{...Le,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1]),e2.call(Tt,fe[Me][1].type)&&Tt[fe[Me][1].type].call({...Le,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1]),fe[Me][0]==="exit"&&i.afterExit.length>0&&l(i.afterExit,{...Le,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1])}if(Le.tokenStack.length>0){const Tt=Le.tokenStack[Le.tokenStack.length-1];(Tt[1]||fb).call(Le,void 0,Tt[0])}for(ge.position={start:is(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:is(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<i.transforms.length;)ge=i.transforms[Me](ge)||ge;return ge}function l(fe,ge,Le){let De=-1;for(;++De<fe.length;)fe[De].call(ge,Le)}function f(fe,ge){const Le=fe.length-1;let De=ge-1,Fe=-1,Me=!1,Tt,qt,kn,Jn;const ei=[];for(;++De<=Le;){const Wt=fe[De];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Fe++:Fe--,Jn=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(Tt&&!Jn&&!Fe&&!kn&&(kn=De),Jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jn=void 0}if(!Fe&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Fe===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(Tt){let ti=De;for(qt=void 0;ti--;){const _n=fe[ti];if(_n[1].type==="lineEnding"||_n[1].type==="lineEndingBlank"){if(_n[0]==="exit")continue;qt&&(fe[qt][1].type="lineEndingBlank",Me=!0),_n[1].type="lineEnding",qt=ti}else if(!(_n[1].type==="linePrefix"||_n[1].type==="blockQuotePrefix"||_n[1].type==="blockQuotePrefixWhitespace"||_n[1].type==="blockQuoteMarker"||_n[1].type==="listItemIndent"))break}kn&&(!qt||kn<qt)&&(Tt._spread=!0),Tt.end=Object.assign({},qt?fe[qt][1].start:Wt[1].end),ei.push({at:qt||De,event:["exit",Tt,Wt[2]]})}if(Wt[1].type==="listItemPrefix"){const ti={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};Tt=ti,ei.push({at:De,event:["enter",ti,Wt[2]]}),kn=void 0,Jn=!0}}}const eo=fe.splice(ge);let Vt=0;for(De=-1;++De<eo.length;){for(;Vt<ei.length&&ei[Vt].at===ge+De;)fe.push(ei[Vt++].event);fe.push(eo[De])}fe[ge][1]._spread=Me}function p(fe,ge){return Le;function Le(De){h.call(this,fe(De),De),ge&&ge.call(this,De)}}function a(){this.stack.push({type:"fragment",children:[]})}function h(fe,ge,Le){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([ge,Le||void 0]),fe.position={start:is(ge.start),end:void 0}}function d(fe){return ge;function ge(Le){fe&&fe.call(this,Le),m.call(this,Le)}}function m(fe,ge){const Le=this.stack.pop(),De=this.tokenStack.pop();if(!De)throw new Error("Cannot close `"+fe.type+"` ("+Ll({start:fe.start,end:fe.end})+"): it’s not open");De[0].type!==fe.type&&(ge?ge.call(this,fe,De[0]):(De[1]||fb).call(this,fe,De[0])),Le.position.end=is(fe.end)}function c(){return Qg(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function x(fe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function E(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=fe}function w(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=fe}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe.replace(/(\r?\n|\r)$/g,"")}function y(fe){const ge=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ge,Le.identifier=wi(this.sliceSerialize(fe)).toLowerCase()}function T(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=fe}function L(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=fe}function R(fe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Le=this.sliceSerialize(fe).length;ge.depth=Le}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function M(fe){const Le=this.stack[this.stack.length-1].children;let De=Le[Le.length-1];(!De||De.type!=="text")&&(De=gt(),De.position={start:is(fe.start),end:void 0},Le.push(De)),this.stack.push(De)}function I(fe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(fe),ge.position.end=is(fe.end)}function B(fe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ge.children[ge.children.length-1];Le.position.end=is(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ge.type)&&(M.call(this,fe),I.call(this,fe))}function H(){this.data.atHardBreak=!0}function U(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe}function W(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe}function Y(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe}function Q(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=ge,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function K(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=ge,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function z(fe){const ge=this.sliceSerialize(fe),Le=this.stack[this.stack.length-2];Le.label=JM(ge),Le.identifier=wi(ge).toLowerCase()}function O(){const fe=this.stack[this.stack.length-1],ge=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const De=fe.children;Le.children=De}else Le.alt=ge}function G(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=fe}function Z(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=fe}function F(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function ne(fe){const ge=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ge,Le.identifier=wi(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function le(fe){this.data.characterReferenceType=fe.type}function X(fe){const ge=this.sliceSerialize(fe),Le=this.data.characterReferenceType;let De;Le?(De=FC(ge,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Zg(ge);const Fe=this.stack[this.stack.length-1];Fe.value+=De}function $(fe){const ge=this.stack.pop();ge.position.end=is(fe.end)}function oe(fe){I.call(this,fe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(fe)}function ee(fe){I.call(this,fe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(fe)}function ue(){return{type:"blockquote",children:[],position:void 0}}function he(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function we(){return{type:"inlineCode",value:"",position:void 0}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Re(){return{type:"emphasis",children:[],position:void 0}}function qe(){return{type:"heading",depth:0,children:[],position:void 0}}function ke(){return{type:"break",position:void 0}}function ze(){return{type:"html",value:"",position:void 0}}function Mt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function $e(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Be(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[],position:void 0}}function Ie(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[],position:void 0}}function Te(){return{type:"paragraph",children:[],position:void 0}}function Ve(){return{type:"strong",children:[],position:void 0}}function gt(){return{type:"text",value:"",position:void 0}}function st(){return{type:"thematicBreak",position:void 0}}}function is(e){return{line:e.line,column:e.column,offset:e.offset}}function t2(e,i){let r=-1;for(;++r<i.length;){const s=i[r];Array.isArray(s)?t2(e,s):ij(e,s)}}function ij(e,i){let r;for(r in i)if(e2.call(i,r))switch(r){case"canContainEols":{const s=i[r];s&&e[r].push(...s);break}case"transforms":{const s=i[r];s&&e[r].push(...s);break}case"afterExit":case"beforeEnter":{const s=i[r];s&&e[r].push(s);break}case"enter":case"exit":{const s=i[r];s&&Object.assign(e[r],s);break}}}function fb(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Ll({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Ll({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Ll({start:i.start,end:i.end})+") is still open")}function rj(e){const i=this;i.parser=r;function r(s){return tj(s,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function sj(e,i){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)}function oj(e,i){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:`
511
+ `;break}case-2:{p=i?" ":" ";break}case-1:{if(!i&&l)continue;p=" ";break}default:p=String.fromCharCode(f)}l=f===-2,s.push(p)}return s.join("")}function XM(e){const s={constructs:HC([VM,...(e||{}).extensions||[]]),content:l(fD),defined:[],document:l(mD),flow:l(LM),lazy:{},string:l(jM),text:l(OM)};return s;function l(f){return p;function p(a){return WM(s,f,a)}}}function KM(e){for(;!GC(e););return e}const db=/[\0\t\n\r]/g;function QM(){let e=1,i="",r=!0,s;return l;function l(f,p,a){f=i+(typeof f=="string"?f.toString():new TextDecoder(p||void 0).decode(f));const h=[];let d=0;for(i="",r&&(f.charCodeAt(0)===65279&&d++,r=void 0);d<f.length;){db.lastIndex=d;const m=db.exec(f),c=m&&m.index!==void 0?m.index:f.length,_=f.charCodeAt(c);if(!m){i=f.slice(d);break}if(_===10&&d===c&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),d<c&&(h.push(f.slice(d,c)),e+=c-d),_){case 0:{h.push(65533),e++;break}case 9:{const x=Math.ceil(e/4)*4;for(h.push(-2);e++<x;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}d=c+1}return a&&(s&&h.push(-5),i&&h.push(i),h.push(null)),h}}const ZM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JM(e){return e.replace(ZM,ej)}function ej(e,i,r){if(i)return i;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),f=l===120||l===88;return FC(r.slice(f?2:1),f?16:10)}return Zg(r)||e}const e2={}.hasOwnProperty;function tj(e,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),nj(r)(KM(XM(r).document().write(QM()(e,i,!0))))}function nj(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p($e),autolinkProtocol:M,autolinkEmail:M,atxHeading:p(qe),blockQuote:p(ue),characterEscape:M,characterReference:M,codeFenced:p(he),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:p(he,a),codeText:p(we,a),codeTextData:M,data:M,codeFlowValue:M,definition:p(Se),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:p(Re),hardBreakEscape:p(ke),hardBreakTrailing:p(ke),htmlFlow:p(ze,a),htmlFlowData:M,htmlText:p(ze,a),htmlTextData:M,image:p(Mt),label:a,link:p($e),listItem:p(Ie),listItemValue:x,listOrdered:p(Be,_),listUnordered:p(Be),paragraph:p(Te),reference:V,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:p(qe),strong:p(Ve),thematicBreak:p(st)},exit:{atxHeading:d(),atxHeadingSequence:R,autolink:d(),autolinkEmail:ee,autolinkProtocol:oe,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:X,characterReference:$,codeFenced:d(b),codeFencedFence:g,codeFencedFenceInfo:E,codeFencedFenceMeta:w,codeFlowValue:I,codeIndented:d(S),codeText:d(Y),codeTextData:I,data:I,definition:d(),definitionDestinationString:L,definitionLabelString:y,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(U),htmlFlowData:I,htmlText:d(W),htmlTextData:I,image:d(K),label:O,labelText:z,lineEnding:B,link:d(Q),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ne,resourceDestinationString:G,resourceTitleString:Z,resource:F,setextHeading:d(j),setextHeadingLineSequence:A,setextHeadingText:D,strong:d(),thematicBreak:d()}};t2(i,(e||{}).mdastExtensions||[]);const r={};return s;function s(fe){let ge={type:"root",children:[],position:void 0};const Le={stack:[ge],tokenStack:[],config:i,enter:h,exit:m,buffer:a,resume:c,data:r},De=[],Fe=[];let Me=-1;for(;++Me<fe.length;)if(Fe.push(fe[Me]),fe[Me][1].type==="listOrdered"||fe[Me][1].type==="listUnordered")if(fe[Me][0]==="enter")De.push(Fe.length-1);else{const Tt=De.pop();f(Fe,Tt)}for(fe=Fe,Me=-1;++Me<fe.length;){const Tt=i[fe[Me][0]];fe[Me][0]==="enter"&&i.beforeEnter.length>0&&l(i.beforeEnter,{...Le,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1]),e2.call(Tt,fe[Me][1].type)&&Tt[fe[Me][1].type].call({...Le,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1]),fe[Me][0]==="exit"&&i.afterExit.length>0&&l(i.afterExit,{...Le,sliceSerialize:fe[Me][2].sliceSerialize},fe[Me][1])}if(Le.tokenStack.length>0){const Tt=Le.tokenStack[Le.tokenStack.length-1];(Tt[1]||fb).call(Le,void 0,Tt[0])}for(ge.position={start:is(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:is(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<i.transforms.length;)ge=i.transforms[Me](ge)||ge;return ge}function l(fe,ge,Le){let De=-1;for(;++De<fe.length;)fe[De].call(ge,Le)}function f(fe,ge){const Le=fe.length-1;let De=ge-1,Fe=-1,Me=!1,Tt,qt,kn,Jn;const ei=[];for(;++De<=Le;){const Wt=fe[De];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Fe++:Fe--,Jn=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(Tt&&!Jn&&!Fe&&!kn&&(kn=De),Jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jn=void 0}if(!Fe&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Fe===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(Tt){let ti=De;for(qt=void 0;ti--;){const xn=fe[ti];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;qt&&(fe[qt][1].type="lineEndingBlank",Me=!0),xn[1].type="lineEnding",qt=ti}else if(!(xn[1].type==="linePrefix"||xn[1].type==="blockQuotePrefix"||xn[1].type==="blockQuotePrefixWhitespace"||xn[1].type==="blockQuoteMarker"||xn[1].type==="listItemIndent"))break}kn&&(!qt||kn<qt)&&(Tt._spread=!0),Tt.end=Object.assign({},qt?fe[qt][1].start:Wt[1].end),ei.push({at:qt||De,event:["exit",Tt,Wt[2]]})}if(Wt[1].type==="listItemPrefix"){const ti={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};Tt=ti,ei.push({at:De,event:["enter",ti,Wt[2]]}),kn=void 0,Jn=!0}}}const to=fe.splice(ge);let Vt=0;for(De=-1;++De<to.length;){for(;Vt<ei.length&&ei[Vt].at===ge+De;)fe.push(ei[Vt++].event);fe.push(to[De])}fe[ge][1]._spread=Me}function p(fe,ge){return Le;function Le(De){h.call(this,fe(De),De),ge&&ge.call(this,De)}}function a(){this.stack.push({type:"fragment",children:[]})}function h(fe,ge,Le){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([ge,Le||void 0]),fe.position={start:is(ge.start),end:void 0}}function d(fe){return ge;function ge(Le){fe&&fe.call(this,Le),m.call(this,Le)}}function m(fe,ge){const Le=this.stack.pop(),De=this.tokenStack.pop();if(!De)throw new Error("Cannot close `"+fe.type+"` ("+Ll({start:fe.start,end:fe.end})+"): it’s not open");De[0].type!==fe.type&&(ge?ge.call(this,fe,De[0]):(De[1]||fb).call(this,fe,De[0])),Le.position.end=is(fe.end)}function c(){return Qg(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function x(fe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function E(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=fe}function w(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=fe}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe.replace(/(\r?\n|\r)$/g,"")}function y(fe){const ge=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ge,Le.identifier=wi(this.sliceSerialize(fe)).toLowerCase()}function T(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=fe}function L(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=fe}function R(fe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Le=this.sliceSerialize(fe).length;ge.depth=Le}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function M(fe){const Le=this.stack[this.stack.length-1].children;let De=Le[Le.length-1];(!De||De.type!=="text")&&(De=gt(),De.position={start:is(fe.start),end:void 0},Le.push(De)),this.stack.push(De)}function I(fe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(fe),ge.position.end=is(fe.end)}function B(fe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ge.children[ge.children.length-1];Le.position.end=is(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ge.type)&&(M.call(this,fe),I.call(this,fe))}function H(){this.data.atHardBreak=!0}function U(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe}function W(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe}function Y(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=fe}function Q(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=ge,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function K(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=ge,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function z(fe){const ge=this.sliceSerialize(fe),Le=this.stack[this.stack.length-2];Le.label=JM(ge),Le.identifier=wi(ge).toLowerCase()}function O(){const fe=this.stack[this.stack.length-1],ge=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const De=fe.children;Le.children=De}else Le.alt=ge}function G(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=fe}function Z(){const fe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=fe}function F(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function ne(fe){const ge=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ge,Le.identifier=wi(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function le(fe){this.data.characterReferenceType=fe.type}function X(fe){const ge=this.sliceSerialize(fe),Le=this.data.characterReferenceType;let De;Le?(De=FC(ge,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Zg(ge);const Fe=this.stack[this.stack.length-1];Fe.value+=De}function $(fe){const ge=this.stack.pop();ge.position.end=is(fe.end)}function oe(fe){I.call(this,fe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(fe)}function ee(fe){I.call(this,fe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(fe)}function ue(){return{type:"blockquote",children:[],position:void 0}}function he(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function we(){return{type:"inlineCode",value:"",position:void 0}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Re(){return{type:"emphasis",children:[],position:void 0}}function qe(){return{type:"heading",depth:0,children:[],position:void 0}}function ke(){return{type:"break",position:void 0}}function ze(){return{type:"html",value:"",position:void 0}}function Mt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function $e(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Be(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[],position:void 0}}function Ie(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[],position:void 0}}function Te(){return{type:"paragraph",children:[],position:void 0}}function Ve(){return{type:"strong",children:[],position:void 0}}function gt(){return{type:"text",value:"",position:void 0}}function st(){return{type:"thematicBreak",position:void 0}}}function is(e){return{line:e.line,column:e.column,offset:e.offset}}function t2(e,i){let r=-1;for(;++r<i.length;){const s=i[r];Array.isArray(s)?t2(e,s):ij(e,s)}}function ij(e,i){let r;for(r in i)if(e2.call(i,r))switch(r){case"canContainEols":{const s=i[r];s&&e[r].push(...s);break}case"transforms":{const s=i[r];s&&e[r].push(...s);break}case"afterExit":case"beforeEnter":{const s=i[r];s&&e[r].push(s);break}case"enter":case"exit":{const s=i[r];s&&Object.assign(e[r],s);break}}}function fb(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Ll({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Ll({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Ll({start:i.start,end:i.end})+") is still open")}function rj(e){const i=this;i.parser=r;function r(s){return tj(s,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function sj(e,i){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)}function oj(e,i){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:`
512
512
  `}]}function aj(e,i){const r=i.value?i.value+`
513
513
  `:"",s={},l=i.lang?i.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let f={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return i.meta&&(f.data={meta:i.meta}),e.patch(i,f),f=e.applyData(i,f),f={type:"element",tagName:"pre",properties:{},children:[f]},e.patch(i,f),f}function lj(e,i){const r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function cj(e,i){const r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function uj(e,i){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(i.identifier).toUpperCase(),l=Ea(s.toLowerCase()),f=e.footnoteOrder.indexOf(s);let p,a=e.footnoteCounts.get(s);a===void 0?(a=0,e.footnoteOrder.push(s),p=e.footnoteOrder.length):p=f+1,a+=1,e.footnoteCounts.set(s,a);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(p)}]};e.patch(i,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(i,d),e.applyData(i,d)}function hj(e,i){const r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function dj(e,i){if(e.options.allowDangerousHtml){const r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}}function n2(e,i){const r=i.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+s}];const l=e.all(i),f=l[0];f&&f.type==="text"?f.value="["+f.value:l.unshift({type:"text",value:"["});const p=l[l.length-1];return p&&p.type==="text"?p.value+=s:l.push({type:"text",value:s}),l}function fj(e,i){const r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return n2(e,i);const l={src:Ea(s.url||""),alt:i.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const f={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,f),e.applyData(i,f)}function pj(e,i){const r={src:Ea(i.url)};i.alt!==null&&i.alt!==void 0&&(r.alt=i.alt),i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,s),e.applyData(i,s)}function mj(e,i){const r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,s),e.applyData(i,s)}function gj(e,i){const r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return n2(e,i);const l={href:Ea(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const f={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,f),e.applyData(i,f)}function vj(e,i){const r={href:Ea(i.url)};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,s),e.applyData(i,s)}function _j(e,i,r){const s=e.all(i),l=r?xj(r):i2(i),f={},p=[];if(typeof i.checked=="boolean"){const m=s[0];let c;m&&m.type==="element"&&m.tagName==="p"?c=m:(c={type:"element",tagName:"p",properties:{},children:[]},s.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),f.className=["task-list-item"]}let a=-1;for(;++a<s.length;){const m=s[a];(l||a!==0||m.type!=="element"||m.tagName!=="p")&&p.push({type:"text",value:`
514
514
  `}),m.type==="element"&&m.tagName==="p"&&!l?p.push(...m.children):p.push(m)}const h=s[s.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&p.push({type:"text",value:`
@@ -518,7 +518,7 @@ Error generating stack: `+u.message+`
518
518
  `});++s<e.length;)s&&r.push({type:"text",value:`
519
519
  `}),r.push(e[s]);return i&&e.length>0&&r.push({type:"text",value:`
520
520
  `}),r}function bb(e){let i=0,r=e.charCodeAt(i);for(;r===9||r===32;)i++,r=e.charCodeAt(i);return e.slice(i)}function Sb(e,i){const r=Yj(e,i),s=r.one(e,void 0),l=zj(r),f=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&f.children.push({type:"text",value:`
521
- `},l),f}function Jj(e,i){return e&&"run"in e?async function(r,s){const l=Sb(r,{file:s,...i});await e.run(l,s)}:function(r,s){return Sb(r,{file:s,...e||i})}}function wb(e){if(e)throw e}var Yp,Cb;function eO(){if(Cb)return Yp;Cb=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):i.call(d)==="[object Array]"},f=function(d){if(!d||i.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),c=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!c)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},p=function(d,m){r&&m.name==="__proto__"?r(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},a=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(s)return s(d,m).value}else return;return d[m]};return Yp=function h(){var d,m,c,_,x,E,w=arguments[0],g=1,b=arguments.length,S=!1;for(typeof w=="boolean"&&(S=w,w=arguments[1]||{},g=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});g<b;++g)if(d=arguments[g],d!=null)for(m in d)c=a(w,m),_=a(d,m),w!==_&&(S&&_&&(f(_)||(x=l(_)))?(x?(x=!1,E=c&&l(c)?c:[]):E=c&&f(c)?c:{},p(w,{name:m,newValue:h(S,E,_)})):typeof _<"u"&&p(w,{name:m,newValue:_}));return w},Yp}var tO=eO();const Xp=ng(tO);function Gm(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nO(){const e=[],i={run:r,use:s};return i;function r(...l){let f=-1;const p=l.pop();if(typeof p!="function")throw new TypeError("Expected function as last argument, not "+p);a(null,...l);function a(h,...d){const m=e[++f];let c=-1;if(h){p(h);return}for(;++c<l.length;)(d[c]===null||d[c]===void 0)&&(d[c]=l[c]);l=d,m?iO(m,a)(...d):p(null,...d)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),i}}function iO(e,i){let r;return s;function s(...p){const a=e.length>p.length;let h;a&&p.push(l);try{h=e.apply(this,p)}catch(d){const m=d;if(a&&r)throw m;return l(m)}a||(h&&h.then&&typeof h.then=="function"?h.then(f,l):h instanceof Error?l(h):f(h))}function l(p,...a){r||(r=!0,i(p,...a))}function f(p){l(null,p)}}const Pi={basename:rO,dirname:sO,extname:oO,join:aO,sep:"/"};function rO(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');ec(e);let r=0,s=-1,l=e.length,f;if(i===void 0||i.length===0||i.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(f){r=l+1;break}}else s<0&&(f=!0,s=l+1);return s<0?"":e.slice(r,s)}if(i===e)return"";let p=-1,a=i.length-1;for(;l--;)if(e.codePointAt(l)===47){if(f){r=l+1;break}}else p<0&&(f=!0,p=l+1),a>-1&&(e.codePointAt(l)===i.codePointAt(a--)?a<0&&(s=l):(a=-1,s=p));return r===s?s=p:s<0&&(s=e.length),e.slice(r,s)}function sO(e){if(ec(e),e.length===0)return".";let i=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){i=r;break}}else s||(s=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function oO(e){ec(e);let i=e.length,r=-1,s=0,l=-1,f=0,p;for(;i--;){const a=e.codePointAt(i);if(a===47){if(p){s=i+1;break}continue}r<0&&(p=!0,r=i+1),a===46?l<0?l=i:f!==1&&(f=1):l>-1&&(f=-1)}return l<0||r<0||f===0||f===1&&l===r-1&&l===s+1?"":e.slice(l,r)}function aO(...e){let i=-1,r;for(;++i<e.length;)ec(e[i]),e[i]&&(r=r===void 0?e[i]:r+"/"+e[i]);return r===void 0?".":lO(r)}function lO(e){ec(e);const i=e.codePointAt(0)===47;let r=cO(e,!i);return r.length===0&&!i&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),i?"/"+r:r}function cO(e,i){let r="",s=0,l=-1,f=0,p=-1,a,h;for(;++p<=e.length;){if(p<e.length)a=e.codePointAt(p);else{if(a===47)break;a=47}if(a===47){if(!(l===p-1||f===1))if(l!==p-1&&f===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),l=p,f=0;continue}}else if(r.length>0){r="",s=0,l=p,f=0;continue}}i&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(l+1,p):r=e.slice(l+1,p),s=p-l-1;l=p,f=0}else a===46&&f>-1?f++:f=-1}return r}function ec(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uO={cwd:hO};function hO(){return"/"}function Ym(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dO(e){if(typeof e=="string")e=new URL(e);else if(!Ym(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return fO(e)}function fO(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const i=e.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const s=i.codePointAt(r+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(i)}const Kp=["history","path","basename","stem","extname","dirname"];class c2{constructor(i){let r;i?Ym(i)?r={path:i}:typeof i=="string"||pO(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":uO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Kp.length;){const f=Kp[s];f in r&&r[f]!==void 0&&r[f]!==null&&(this[f]=f==="history"?[...r[f]]:r[f])}let l;for(l in r)Kp.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?Pi.basename(this.path):void 0}set basename(i){Zp(i,"basename"),Qp(i,"basename"),this.path=Pi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Pi.dirname(this.path):void 0}set dirname(i){Eb(this.basename,"dirname"),this.path=Pi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Pi.extname(this.path):void 0}set extname(i){if(Qp(i,"extname"),Eb(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Ym(i)&&(i=dO(i)),Zp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Pi.basename(this.path,this.extname):void 0}set stem(i){Zp(i,"stem"),Qp(i,"stem"),this.path=Pi.join(this.dirname||"",i+(this.extname||""))}fail(i,r,s){const l=this.message(i,r,s);throw l.fatal=!0,l}info(i,r,s){const l=this.message(i,r,s);return l.fatal=void 0,l}message(i,r,s){const l=new vn(i,r,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Qp(e,i){if(e&&e.includes(Pi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Pi.sep+"`")}function Zp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function Eb(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function pO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mO=(function(e){const s=this.constructor.prototype,l=s[e],f=function(){return l.apply(f,arguments)};return Object.setPrototypeOf(f,s),f}),gO={}.hasOwnProperty;class sv extends mO{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=nO()}copy(){const i=new sv;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];i.use(...s)}return i.data(Xp(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(tm("data",this.frozen),this.namespace[i]=r,this):gO.call(this.namespace,i)&&this.namespace[i]||void 0:i?(tm("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=r.call(i,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=$u(i),s=this.parser||this.Parser;return Jp("parse",s),s(String(r),r)}process(i,r){const s=this;return this.freeze(),Jp("process",this.parser||this.Parser),em("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(f,p){const a=$u(i),h=s.parse(a);s.run(h,a,function(m,c,_){if(m||!c||!_)return d(m);const x=c,E=s.stringify(x,_);xO(E)?_.value=E:_.result=E,d(m,_)});function d(m,c){m||!c?p(m):f?f(c):r(void 0,c)}}}processSync(i){let r=!1,s;return this.freeze(),Jp("processSync",this.parser||this.Parser),em("processSync",this.compiler||this.Compiler),this.process(i,l),Tb("processSync","process",r),s;function l(f,p){r=!0,wb(f),s=p}}run(i,r,s){kb(i),this.freeze();const l=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?f(void 0,s):new Promise(f);function f(p,a){const h=$u(r);l.run(i,h,d);function d(m,c,_){const x=c||i;m?a(m):p?p(x):s(void 0,x,_)}}}runSync(i,r){let s=!1,l;return this.run(i,r,f),Tb("runSync","run",s),l;function f(p,a){wb(p),l=a,s=!0}}stringify(i,r){this.freeze();const s=$u(r),l=this.compiler||this.Compiler;return em("stringify",l),kb(i),l(i,s)}use(i,...r){const s=this.attachers,l=this.namespace;if(tm("use",this.frozen),i!=null)if(typeof i=="function")h(i,r);else if(typeof i=="object")Array.isArray(i)?a(i):p(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function f(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...c]=d;h(m,c)}else p(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function p(d){if(!("plugins"in d)&&!("settings"in d))throw new 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");a(d.plugins),d.settings&&(l.settings=Xp(!0,l.settings,d.settings))}function a(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const c=d[m];f(c)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let c=-1,_=-1;for(;++c<s.length;)if(s[c][0]===d){_=c;break}if(_===-1)s.push([d,...m]);else if(m.length>0){let[x,...E]=m;const w=s[_][1];Gm(w)&&Gm(x)&&(x=Xp(!0,w,x)),s[_]=[d,x,...E]}}}}const vO=new sv().freeze();function Jp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function em(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tm(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function kb(e){if(!Gm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tb(e,i,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function $u(e){return _O(e)?e:new c2(e)}function _O(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xO(e){return typeof e=="string"||yO(e)}function yO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rb=[],Ab={allowDangerousHtml:!0},SO=/^(https?|ircs?|mailto|xmpp)$/i,wO=[{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 CO(e){const i=EO(e),r=kO(e);return TO(i.runSync(i.parse(r),r),e)}function EO(e){const i=e.rehypePlugins||Rb,r=e.remarkPlugins||Rb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ab}:Ab;return vO().use(rj).use(r).use(Jj,s).use(i)}function kO(e){const i=e.children||"",r=new c2;return typeof i=="string"&&(r.value=i),r}function TO(e,i){const r=i.allowedElements,s=i.allowElement,l=i.components,f=i.disallowedElements,p=i.skipHtml,a=i.unwrapDisallowed,h=i.urlTransform||RO;for(const m of wO)Object.hasOwn(i,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+bO+m.id,void 0);return rv(e,d),VL(e,{Fragment:v.Fragment,components:l,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(m,c,_){if(m.type==="raw"&&_&&typeof c=="number")return p?_.children.splice(c,1):_.children[c]={type:"text",value:m.value},c;if(m.type==="element"){let x;for(x in Vp)if(Object.hasOwn(Vp,x)&&Object.hasOwn(m.properties,x)){const E=m.properties[x],w=Vp[x];(w===null||w.includes(m.tagName))&&(m.properties[x]=h(String(E||""),x,m))}}if(m.type==="element"){let x=r?!r.includes(m.tagName):f?f.includes(m.tagName):!1;if(!x&&s&&typeof c=="number"&&(x=!s(m,c,_)),x&&_&&typeof c=="number")return a&&m.children?_.children.splice(c,1,...m.children):_.children.splice(c,1),c}}}function RO(e){const i=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return i===-1||l!==-1&&i>l||r!==-1&&i>r||s!==-1&&i>s||SO.test(e.slice(0,i))?e:""}function Lb(e,i){const r=String(e);if(typeof i!="string")throw new TypeError("Expected character");let s=0,l=r.indexOf(i);for(;l!==-1;)s++,l=r.indexOf(i,l+i.length);return s}function AO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LO(e,i,r){const l=Ih((r||{}).ignore||[]),f=DO(i);let p=-1;for(;++p<f.length;)qm(e,a);function a(d,m,c){if(d.type==="text"&&typeof c=="number")return h(d,m,c);if(l(d,c,m[m.length-1]))return $m}function h(d,m,c){const _=m[m.length-1],x=f[p][0],E=f[p][1];let w=0,g=!1,b=[];x.lastIndex=0;let S=x.exec(d.value);for(;S;){const T=S.index,L={index:S.index,input:S.input,stack:[...m,d]};let R=E(...S,L);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1)x.lastIndex=T+1;else{if(w!==T&&y({type:"text",value:d.value.slice(w,T)}),Array.isArray(R))for(const D of R)y(D);else R&&y(R);w=T+S[0].length,g=!0}if(!x.global)break;S=x.exec(d.value)}return g?(w<d.value.length&&y({type:"text",value:d.value.slice(w)}),_.children.splice(c,1,...b)):b=[d],c+b.length;function y(T){const L=b[b.length-1];L&&L.type==="text"&&T.type==="text"?L.value+=T.value:b.push(T)}}}function DO(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],r=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<r.length;){const l=r[s];i.push([MO(l[0]),jO(l[1])])}return i}function MO(e){return typeof e=="string"?new RegExp(AO(e),"g"):e}function jO(e){return typeof e=="function"?e:function(){return e}}const nm="phrasing",im=["autolink","link","image","label"];function OO(){return{transforms:[FO],enter:{literalAutolink:BO,literalAutolinkEmail:rm,literalAutolinkHttp:rm,literalAutolinkWww:rm},exit:{literalAutolink:HO,literalAutolinkEmail:zO,literalAutolinkHttp:PO,literalAutolinkWww:IO}}}function NO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:nm,notInConstruct:im},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:nm,notInConstruct:im},{character:":",before:"[ps]",after:"\\/",inConstruct:nm,notInConstruct:im}]}}function BO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rm(e){this.config.enter.autolinkProtocol.call(this,e)}function PO(e){this.config.exit.autolinkProtocol.call(this,e)}function IO(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function zO(e){this.config.exit.autolinkEmail.call(this,e)}function HO(e){this.exit(e)}function FO(e){LO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,UO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),$O]],{ignore:["link","linkReference"]})}function UO(e,i,r,s,l){let f="";if(!u2(l)||(/^w/i.test(i)&&(r=i+r,i="",f="http://"),!qO(r)))return!1;const p=VO(r+s);if(!p[0])return!1;const a={type:"link",title:null,url:f+i+p[0],children:[{type:"text",value:i+p[0]}]};return p[1]?[a,{type:"text",value:p[1]}]:a}function $O(e,i,r,s){return!u2(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function qO(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function VO(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],s=r.indexOf(")");const l=Lb(e,"(");let f=Lb(e,")");for(;s!==-1&&l>f;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),f++;return[e,r]}function u2(e,i){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Ks(r)||Nh(r))&&(!i||r!==47)}h2.peek=eN;function WO(){this.buffer()}function GO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YO(){this.buffer()}function XO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KO(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=wi(this.sliceSerialize(e)).toLowerCase(),r.label=i}function QO(e){this.exit(e)}function ZO(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=wi(this.sliceSerialize(e)).toLowerCase(),r.label=i}function JO(e){this.exit(e)}function eN(){return"["}function h2(e,i,r,s){const l=r.createTracker(s);let f=l.move("[^");const p=r.enter("footnoteReference"),a=r.enter("reference");return f+=l.move(r.safe(r.associationId(e),{after:"]",before:f})),a(),p(),f+=l.move("]"),f}function tN(){return{enter:{gfmFootnoteCallString:WO,gfmFootnoteCall:GO,gfmFootnoteDefinitionLabelString:YO,gfmFootnoteDefinition:XO},exit:{gfmFootnoteCallString:KO,gfmFootnoteCall:QO,gfmFootnoteDefinitionLabelString:ZO,gfmFootnoteDefinition:JO}}}function nN(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:h2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,l,f,p){const a=f.createTracker(p);let h=a.move("[^");const d=f.enter("footnoteDefinition"),m=f.enter("label");return h+=a.move(f.safe(f.associationId(s),{before:h,after:"]"})),m(),h+=a.move("]:"),s.children&&s.children.length>0&&(a.shift(4),h+=a.move((i?`
521
+ `},l),f}function Jj(e,i){return e&&"run"in e?async function(r,s){const l=Sb(r,{file:s,...i});await e.run(l,s)}:function(r,s){return Sb(r,{file:s,...e||i})}}function wb(e){if(e)throw e}var Yp,Cb;function eO(){if(Cb)return Yp;Cb=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):i.call(d)==="[object Array]"},f=function(d){if(!d||i.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),c=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!c)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},p=function(d,m){r&&m.name==="__proto__"?r(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},a=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(s)return s(d,m).value}else return;return d[m]};return Yp=function h(){var d,m,c,_,x,E,w=arguments[0],g=1,b=arguments.length,S=!1;for(typeof w=="boolean"&&(S=w,w=arguments[1]||{},g=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});g<b;++g)if(d=arguments[g],d!=null)for(m in d)c=a(w,m),_=a(d,m),w!==_&&(S&&_&&(f(_)||(x=l(_)))?(x?(x=!1,E=c&&l(c)?c:[]):E=c&&f(c)?c:{},p(w,{name:m,newValue:h(S,E,_)})):typeof _<"u"&&p(w,{name:m,newValue:_}));return w},Yp}var tO=eO();const Xp=ng(tO);function Gm(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nO(){const e=[],i={run:r,use:s};return i;function r(...l){let f=-1;const p=l.pop();if(typeof p!="function")throw new TypeError("Expected function as last argument, not "+p);a(null,...l);function a(h,...d){const m=e[++f];let c=-1;if(h){p(h);return}for(;++c<l.length;)(d[c]===null||d[c]===void 0)&&(d[c]=l[c]);l=d,m?iO(m,a)(...d):p(null,...d)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),i}}function iO(e,i){let r;return s;function s(...p){const a=e.length>p.length;let h;a&&p.push(l);try{h=e.apply(this,p)}catch(d){const m=d;if(a&&r)throw m;return l(m)}a||(h&&h.then&&typeof h.then=="function"?h.then(f,l):h instanceof Error?l(h):f(h))}function l(p,...a){r||(r=!0,i(p,...a))}function f(p){l(null,p)}}const Pi={basename:rO,dirname:sO,extname:oO,join:aO,sep:"/"};function rO(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');ec(e);let r=0,s=-1,l=e.length,f;if(i===void 0||i.length===0||i.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(f){r=l+1;break}}else s<0&&(f=!0,s=l+1);return s<0?"":e.slice(r,s)}if(i===e)return"";let p=-1,a=i.length-1;for(;l--;)if(e.codePointAt(l)===47){if(f){r=l+1;break}}else p<0&&(f=!0,p=l+1),a>-1&&(e.codePointAt(l)===i.codePointAt(a--)?a<0&&(s=l):(a=-1,s=p));return r===s?s=p:s<0&&(s=e.length),e.slice(r,s)}function sO(e){if(ec(e),e.length===0)return".";let i=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){i=r;break}}else s||(s=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function oO(e){ec(e);let i=e.length,r=-1,s=0,l=-1,f=0,p;for(;i--;){const a=e.codePointAt(i);if(a===47){if(p){s=i+1;break}continue}r<0&&(p=!0,r=i+1),a===46?l<0?l=i:f!==1&&(f=1):l>-1&&(f=-1)}return l<0||r<0||f===0||f===1&&l===r-1&&l===s+1?"":e.slice(l,r)}function aO(...e){let i=-1,r;for(;++i<e.length;)ec(e[i]),e[i]&&(r=r===void 0?e[i]:r+"/"+e[i]);return r===void 0?".":lO(r)}function lO(e){ec(e);const i=e.codePointAt(0)===47;let r=cO(e,!i);return r.length===0&&!i&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),i?"/"+r:r}function cO(e,i){let r="",s=0,l=-1,f=0,p=-1,a,h;for(;++p<=e.length;){if(p<e.length)a=e.codePointAt(p);else{if(a===47)break;a=47}if(a===47){if(!(l===p-1||f===1))if(l!==p-1&&f===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),l=p,f=0;continue}}else if(r.length>0){r="",s=0,l=p,f=0;continue}}i&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(l+1,p):r=e.slice(l+1,p),s=p-l-1;l=p,f=0}else a===46&&f>-1?f++:f=-1}return r}function ec(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uO={cwd:hO};function hO(){return"/"}function Ym(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dO(e){if(typeof e=="string")e=new URL(e);else if(!Ym(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return fO(e)}function fO(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const i=e.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const s=i.codePointAt(r+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(i)}const Kp=["history","path","basename","stem","extname","dirname"];class c2{constructor(i){let r;i?Ym(i)?r={path:i}:typeof i=="string"||pO(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":uO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Kp.length;){const f=Kp[s];f in r&&r[f]!==void 0&&r[f]!==null&&(this[f]=f==="history"?[...r[f]]:r[f])}let l;for(l in r)Kp.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?Pi.basename(this.path):void 0}set basename(i){Zp(i,"basename"),Qp(i,"basename"),this.path=Pi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Pi.dirname(this.path):void 0}set dirname(i){Eb(this.basename,"dirname"),this.path=Pi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Pi.extname(this.path):void 0}set extname(i){if(Qp(i,"extname"),Eb(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Ym(i)&&(i=dO(i)),Zp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Pi.basename(this.path,this.extname):void 0}set stem(i){Zp(i,"stem"),Qp(i,"stem"),this.path=Pi.join(this.dirname||"",i+(this.extname||""))}fail(i,r,s){const l=this.message(i,r,s);throw l.fatal=!0,l}info(i,r,s){const l=this.message(i,r,s);return l.fatal=void 0,l}message(i,r,s){const l=new _n(i,r,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Qp(e,i){if(e&&e.includes(Pi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Pi.sep+"`")}function Zp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function Eb(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function pO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mO=(function(e){const s=this.constructor.prototype,l=s[e],f=function(){return l.apply(f,arguments)};return Object.setPrototypeOf(f,s),f}),gO={}.hasOwnProperty;class sv extends mO{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=nO()}copy(){const i=new sv;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];i.use(...s)}return i.data(Xp(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(tm("data",this.frozen),this.namespace[i]=r,this):gO.call(this.namespace,i)&&this.namespace[i]||void 0:i?(tm("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=r.call(i,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=$u(i),s=this.parser||this.Parser;return Jp("parse",s),s(String(r),r)}process(i,r){const s=this;return this.freeze(),Jp("process",this.parser||this.Parser),em("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(f,p){const a=$u(i),h=s.parse(a);s.run(h,a,function(m,c,_){if(m||!c||!_)return d(m);const x=c,E=s.stringify(x,_);xO(E)?_.value=E:_.result=E,d(m,_)});function d(m,c){m||!c?p(m):f?f(c):r(void 0,c)}}}processSync(i){let r=!1,s;return this.freeze(),Jp("processSync",this.parser||this.Parser),em("processSync",this.compiler||this.Compiler),this.process(i,l),Tb("processSync","process",r),s;function l(f,p){r=!0,wb(f),s=p}}run(i,r,s){kb(i),this.freeze();const l=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?f(void 0,s):new Promise(f);function f(p,a){const h=$u(r);l.run(i,h,d);function d(m,c,_){const x=c||i;m?a(m):p?p(x):s(void 0,x,_)}}}runSync(i,r){let s=!1,l;return this.run(i,r,f),Tb("runSync","run",s),l;function f(p,a){wb(p),l=a,s=!0}}stringify(i,r){this.freeze();const s=$u(r),l=this.compiler||this.Compiler;return em("stringify",l),kb(i),l(i,s)}use(i,...r){const s=this.attachers,l=this.namespace;if(tm("use",this.frozen),i!=null)if(typeof i=="function")h(i,r);else if(typeof i=="object")Array.isArray(i)?a(i):p(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function f(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...c]=d;h(m,c)}else p(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function p(d){if(!("plugins"in d)&&!("settings"in d))throw new 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");a(d.plugins),d.settings&&(l.settings=Xp(!0,l.settings,d.settings))}function a(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const c=d[m];f(c)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let c=-1,_=-1;for(;++c<s.length;)if(s[c][0]===d){_=c;break}if(_===-1)s.push([d,...m]);else if(m.length>0){let[x,...E]=m;const w=s[_][1];Gm(w)&&Gm(x)&&(x=Xp(!0,w,x)),s[_]=[d,x,...E]}}}}const vO=new sv().freeze();function Jp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function em(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tm(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function kb(e){if(!Gm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tb(e,i,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function $u(e){return _O(e)?e:new c2(e)}function _O(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xO(e){return typeof e=="string"||yO(e)}function yO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rb=[],Ab={allowDangerousHtml:!0},SO=/^(https?|ircs?|mailto|xmpp)$/i,wO=[{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 CO(e){const i=EO(e),r=kO(e);return TO(i.runSync(i.parse(r),r),e)}function EO(e){const i=e.rehypePlugins||Rb,r=e.remarkPlugins||Rb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ab}:Ab;return vO().use(rj).use(r).use(Jj,s).use(i)}function kO(e){const i=e.children||"",r=new c2;return typeof i=="string"&&(r.value=i),r}function TO(e,i){const r=i.allowedElements,s=i.allowElement,l=i.components,f=i.disallowedElements,p=i.skipHtml,a=i.unwrapDisallowed,h=i.urlTransform||RO;for(const m of wO)Object.hasOwn(i,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+bO+m.id,void 0);return rv(e,d),VL(e,{Fragment:v.Fragment,components:l,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(m,c,_){if(m.type==="raw"&&_&&typeof c=="number")return p?_.children.splice(c,1):_.children[c]={type:"text",value:m.value},c;if(m.type==="element"){let x;for(x in Vp)if(Object.hasOwn(Vp,x)&&Object.hasOwn(m.properties,x)){const E=m.properties[x],w=Vp[x];(w===null||w.includes(m.tagName))&&(m.properties[x]=h(String(E||""),x,m))}}if(m.type==="element"){let x=r?!r.includes(m.tagName):f?f.includes(m.tagName):!1;if(!x&&s&&typeof c=="number"&&(x=!s(m,c,_)),x&&_&&typeof c=="number")return a&&m.children?_.children.splice(c,1,...m.children):_.children.splice(c,1),c}}}function RO(e){const i=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return i===-1||l!==-1&&i>l||r!==-1&&i>r||s!==-1&&i>s||SO.test(e.slice(0,i))?e:""}function Lb(e,i){const r=String(e);if(typeof i!="string")throw new TypeError("Expected character");let s=0,l=r.indexOf(i);for(;l!==-1;)s++,l=r.indexOf(i,l+i.length);return s}function AO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LO(e,i,r){const l=Ih((r||{}).ignore||[]),f=DO(i);let p=-1;for(;++p<f.length;)qm(e,a);function a(d,m,c){if(d.type==="text"&&typeof c=="number")return h(d,m,c);if(l(d,c,m[m.length-1]))return $m}function h(d,m,c){const _=m[m.length-1],x=f[p][0],E=f[p][1];let w=0,g=!1,b=[];x.lastIndex=0;let S=x.exec(d.value);for(;S;){const T=S.index,L={index:S.index,input:S.input,stack:[...m,d]};let R=E(...S,L);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1)x.lastIndex=T+1;else{if(w!==T&&y({type:"text",value:d.value.slice(w,T)}),Array.isArray(R))for(const D of R)y(D);else R&&y(R);w=T+S[0].length,g=!0}if(!x.global)break;S=x.exec(d.value)}return g?(w<d.value.length&&y({type:"text",value:d.value.slice(w)}),_.children.splice(c,1,...b)):b=[d],c+b.length;function y(T){const L=b[b.length-1];L&&L.type==="text"&&T.type==="text"?L.value+=T.value:b.push(T)}}}function DO(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],r=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<r.length;){const l=r[s];i.push([MO(l[0]),jO(l[1])])}return i}function MO(e){return typeof e=="string"?new RegExp(AO(e),"g"):e}function jO(e){return typeof e=="function"?e:function(){return e}}const nm="phrasing",im=["autolink","link","image","label"];function OO(){return{transforms:[FO],enter:{literalAutolink:BO,literalAutolinkEmail:rm,literalAutolinkHttp:rm,literalAutolinkWww:rm},exit:{literalAutolink:HO,literalAutolinkEmail:zO,literalAutolinkHttp:PO,literalAutolinkWww:IO}}}function NO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:nm,notInConstruct:im},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:nm,notInConstruct:im},{character:":",before:"[ps]",after:"\\/",inConstruct:nm,notInConstruct:im}]}}function BO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rm(e){this.config.enter.autolinkProtocol.call(this,e)}function PO(e){this.config.exit.autolinkProtocol.call(this,e)}function IO(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function zO(e){this.config.exit.autolinkEmail.call(this,e)}function HO(e){this.exit(e)}function FO(e){LO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,UO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),$O]],{ignore:["link","linkReference"]})}function UO(e,i,r,s,l){let f="";if(!u2(l)||(/^w/i.test(i)&&(r=i+r,i="",f="http://"),!qO(r)))return!1;const p=VO(r+s);if(!p[0])return!1;const a={type:"link",title:null,url:f+i+p[0],children:[{type:"text",value:i+p[0]}]};return p[1]?[a,{type:"text",value:p[1]}]:a}function $O(e,i,r,s){return!u2(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function qO(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function VO(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],s=r.indexOf(")");const l=Lb(e,"(");let f=Lb(e,")");for(;s!==-1&&l>f;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),f++;return[e,r]}function u2(e,i){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Qs(r)||Nh(r))&&(!i||r!==47)}h2.peek=eN;function WO(){this.buffer()}function GO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YO(){this.buffer()}function XO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KO(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=wi(this.sliceSerialize(e)).toLowerCase(),r.label=i}function QO(e){this.exit(e)}function ZO(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=wi(this.sliceSerialize(e)).toLowerCase(),r.label=i}function JO(e){this.exit(e)}function eN(){return"["}function h2(e,i,r,s){const l=r.createTracker(s);let f=l.move("[^");const p=r.enter("footnoteReference"),a=r.enter("reference");return f+=l.move(r.safe(r.associationId(e),{after:"]",before:f})),a(),p(),f+=l.move("]"),f}function tN(){return{enter:{gfmFootnoteCallString:WO,gfmFootnoteCall:GO,gfmFootnoteDefinitionLabelString:YO,gfmFootnoteDefinition:XO},exit:{gfmFootnoteCallString:KO,gfmFootnoteCall:QO,gfmFootnoteDefinitionLabelString:ZO,gfmFootnoteDefinition:JO}}}function nN(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:h2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,l,f,p){const a=f.createTracker(p);let h=a.move("[^");const d=f.enter("footnoteDefinition"),m=f.enter("label");return h+=a.move(f.safe(f.associationId(s),{before:h,after:"]"})),m(),h+=a.move("]:"),s.children&&s.children.length>0&&(a.shift(4),h+=a.move((i?`
522
522
  `:" ")+f.indentLines(f.containerFlow(s,a.current()),i?d2:iN))),d(),h}}function iN(e,i,r){return i===0?e:d2(e,i,r)}function d2(e,i,r){return(r?"":" ")+e}const rN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ov.attention=cN;ov.peek=uN;function sN(){return{canContainEols:["delete"],enter:{strikethrough:aN},exit:{strikethrough:lN}}}function oN(){return{handlers:{delete:ov},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rN}]}}function aN(e){this.enter({type:"delete",children:[],position:void 0},e)}function lN(e){this.exit(e)}function ov(e,i,r,s){const l=r.createTracker(s),f=r.stack.includes("strikethrough")?"~":"~~",p=r.enter("strikethrough");let a=l.move(f);return a+=r.containerPhrasing(e,{...l.current(),before:a,after:"~"}),a+=l.move(f),p(),a}function cN(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function uN(){return"~"}function hN(e){return e.length}function dN(e,i){const r=i||{},s=(r.align||[]).concat(),l=r.stringLength||hN,f=[],p=[],a=[],h=[];let d=0,m=-1;for(;++m<e.length;){const w=[],g=[];let b=-1;for(e[m].length>d&&(d=e[m].length);++b<e[m].length;){const S=fN(e[m][b]);if(r.alignDelimiters!==!1){const y=l(S);g[b]=y,(h[b]===void 0||y>h[b])&&(h[b]=y)}w.push(S)}p[m]=w,a[m]=g}let c=-1;if(typeof s=="object"&&"length"in s)for(;++c<d;)f[c]=Db(s[c]);else{const w=Db(s);for(;++c<d;)f[c]=w}c=-1;const _=[],x=[];for(;++c<d;){const w=f[c];let g="",b="";w===99?(g=":",b=":"):w===108?g=":":w===114&&(b=":");let S=r.alignDelimiters===!1?1:Math.max(1,h[c]-g.length-b.length);const y=g+"-".repeat(S)+b;r.alignDelimiters!==!1&&(S=g.length+S+b.length,S>h[c]&&(h[c]=S),x[c]=S),_[c]=y}p.splice(1,0,_),a.splice(1,0,x),m=-1;const E=[];for(;++m<p.length;){const w=p[m],g=a[m];c=-1;const b=[];for(;++c<d;){const S=w[c]||"";let y="",T="";if(r.alignDelimiters!==!1){const L=h[c]-(g[c]||0),R=f[c];R===114?y=" ".repeat(L):R===99?L%2?(y=" ".repeat(L/2+.5),T=" ".repeat(L/2-.5)):(y=" ".repeat(L/2),T=y):T=" ".repeat(L)}r.delimiterStart!==!1&&!c&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&S==="")&&(r.delimiterStart!==!1||c)&&b.push(" "),r.alignDelimiters!==!1&&b.push(y),b.push(S),r.alignDelimiters!==!1&&b.push(T),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||c!==d-1)&&b.push("|")}E.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return E.join(`
523
523
  `)}function fN(e){return e==null?"":String(e)}function Db(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}const pN=Ih(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mN(e,i,r,s){const l=r.enter("blockquote"),f=r.createTracker(s);f.move("> "),f.shift(2);const p=r.indentLines(r.containerFlow(e,f.current()),gN);return l(),p}function gN(e,i,r){return">"+(r?"":" ")+e}function vN(e,i){return Mb(e,i.inConstruct,!0)&&!Mb(e,i.notInConstruct,!1)}function Mb(e,i,r){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return r;let s=-1;for(;++s<i.length;)if(e.includes(i[s]))return!0;return!1}function jb(e,i,r,s){let l=-1;for(;++l<r.unsafe.length;){const f=r.unsafe[l];if(f.character===`
524
524
  `&&!f.before&&!f.after&&vN(r.stack,f))return/[\t ]/.test(s.before)?"":" "}return`\\
@@ -536,10 +536,10 @@ Error generating stack: `+u.message+`
536
536
  `,...f.current()});const m=d.charCodeAt(0);return(m===9||m===32)&&(d=f2(m)+d.slice(1)),d=d?p+" "+d:p,r.options.closeAtx&&(d+=" "+p),h(),a(),d}g2.peek=NN;function g2(e){return e.value||""}function NN(){return"<"}v2.peek=BN;function v2(e,i,r,s){const l=av(r),f=l==='"'?"Quote":"Apostrophe",p=r.enter("image");let a=r.enter("label");const h=r.createTracker(s);let d=h.move("![");return d+=h.move(r.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(r.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(a=r.enter("destinationRaw"),d+=h.move(r.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),a(),e.title&&(a=r.enter(`title${f}`),d+=h.move(" "+l),d+=h.move(r.safe(e.title,{before:d,after:l,...h.current()})),d+=h.move(l),a()),d+=h.move(")"),p(),d}function BN(){return"!"}_2.peek=PN;function _2(e,i,r,s){const l=e.referenceType,f=r.enter("imageReference");let p=r.enter("label");const a=r.createTracker(s);let h=a.move("![");const d=r.safe(e.alt,{before:h,after:"]",...a.current()});h+=a.move(d+"]["),p();const m=r.stack;r.stack=m.filter(function(_){return _!=="phrasing"}),p=r.enter("reference");const c=r.safe(r.associationId(e),{before:h,after:"]",...a.current()});return p(),r.stack=m,f(),l==="full"||!d||d!==c?h+=a.move(c+"]"):l==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function PN(){return"!"}x2.peek=IN;function x2(e,i,r){let s=e.value||"",l="`",f=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^\n\r ]/.test(s)&&(/^[\n\r ]/.test(s)&&/[\n\r ]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++f<r.unsafe.length;){const p=r.unsafe[f],a=r.compilePattern(p);if(!p.atBreak)continue;let h;for(;h=a.exec(s);){let d=h.index;s.charCodeAt(d)===10&&s.charCodeAt(d-1)===13&&d--,s=s.slice(0,d)+" "+s.slice(h.index+1)}}return l+s+l}function IN(){return"`"}function y2(e,i){const r=Qg(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}b2.peek=zN;function b2(e,i,r,s){const l=av(r),f=l==='"'?"Quote":"Apostrophe",p=r.createTracker(s);if(y2(e,r)){const E=r.stack;r.stack=E.filter(function(b){return b!=="phrasing"});const w=r.enter("autolink");let g=p.move("<");return g+=p.move(r.containerPhrasing(e,{before:g,after:">",...p.current()})),g+=p.move(">"),w(),r.stack=E,g}const a=r.enter("link");let h=r.enter("label"),d=p.move("[");const m=r.containerPhrasing(e,{before:d,after:"](",...p.current()});d+=p.move(m),h(),d+=p.move("](");const c=/[\0- \u007F]/.test(e.url),_=s.before.charAt(s.before.length-1);let x=e.title||void 0;if(!x&&!c&&(_===`
537
537
  `||_==="\r")){let E=0;for(;E<m.length&&m.charCodeAt(E)!==93;)E+=m.charCodeAt(E)===92?2:1;m.charCodeAt(E+1)===58&&(x="")}return!e.url&&typeof x=="string"||c?(h=r.enter("destinationLiteral"),d+=p.move("<"),d+=p.move(r.safe(e.url,{before:d,after:">",...p.current()})),d+=p.move(">")):(h=r.enter("destinationRaw"),d+=p.move(r.safe(e.url,{before:d,after:typeof x=="string"?" ":")",...p.current()}))),h(),typeof x=="string"&&(h=r.enter(`title${f}`),d+=p.move(" "+l),d+=p.move(r.safe(x,{before:d,after:l,...p.current()})),d+=p.move(l),h()),d+=p.move(")"),a(),d}function zN(e,i,r){return y2(e,r)?"<":"["}S2.peek=HN;function S2(e,i,r,s){const l=e.referenceType,f=r.enter("linkReference");let p=r.enter("label");const a=r.createTracker(s);let h=a.move("[");const d=r.containerPhrasing(e,{before:h,after:"]",...a.current()});h+=a.move(d+"]["),p();const m=r.stack;r.stack=m.filter(function(_){return _!=="phrasing"}),p=r.enter("reference");const c=r.safe(r.associationId(e),{before:h,after:"]",...a.current()});return p(),r.stack=m,f(),l==="full"||!d||d!==c?h+=a.move(c+"]"):l==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function HN(){return"["}function hv(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function FN(e){const i=hv(e),r=e.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function UN(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function w2(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function $N(e,i,r,s){const l=r.enter("list"),f=r.bulletCurrent;let p=e.ordered?UN(r):hv(r);const a=e.ordered?p==="."?")":".":FN(r);let h=i&&r.bulletLastUsed?p===r.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((p==="*"||p==="-")&&m&&(!m.children||!m.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(h=!0),w2(r)===p&&m){let c=-1;for(;++c<e.children.length;){const _=e.children[c];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(p=a),r.bulletCurrent=p;const d=r.containerFlow(e,s);return r.bulletLastUsed=p,r.bulletCurrent=f,l(),d}function qN(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function VN(e,i,r,s){const l=qN(r);let f=r.bulletCurrent||hv(r);i&&i.type==="list"&&i.ordered&&(f=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(e))+f);let p=f.length+1;(l==="tab"||l==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(p=Math.ceil(p/4)*4);const a=r.createTracker(s);a.move(f+" ".repeat(p-f.length)),a.shift(p);const h=r.enter("listItem"),d=r.indentLines(r.containerFlow(e,a.current()),m);return h(),d;function m(c,_,x){return _?(x?"":" ".repeat(p))+c:(x?f:f+" ".repeat(p-f.length))+c}}function WN(e,i,r,s){const l=r.enter("paragraph"),f=r.enter("phrasing"),p=r.containerPhrasing(e,s);return f(),l(),p}function GN(e,i,r,s){if(!e.children.some(function(a){return pN(a)}))return r.containerFlow(e,s);const f=r.enter("phrasing"),p=r.containerPhrasing(e,s);return f(),p}function YN(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}dv.attention=C2;dv.peek=XN;function dv(e,i,r,s){const l=r.enter("phrasing"),f=lv(e,C2,r,r.createTracker(s)),p=Hh([f],s.before,s.after);return l(),p}function C2(e,i){return{construct:"strong",markers:YN(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function XN(e,i,r){return r.options.strong||"*"}function KN(e,i,r,s){const l=i?i.children:[],f=r.indexStack[r.indexStack.length-1];return r.safe(e.value,{...s,afterNode:l[f+1],beforeNode:l[f-1]})}function QN(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function ZN(e,i,r){const s=(w2(r)+(r.options.ruleSpaces?" ":"")).repeat(QN(r));return r.options.ruleSpaces?s.slice(0,-1):s}const E2={blockquote:mN,break:jb,code:bN,definition:wN,emphasis:uv,hardBreak:jb,heading:ON,html:g2,image:v2,imageReference:_2,inlineCode:x2,link:b2,linkReference:S2,list:$N,listItem:VN,paragraph:WN,root:GN,strong:dv,text:KN,thematicBreak:ZN};function JN(){return{enter:{table:e7,tableData:Nb,tableHeader:Nb,tableRow:n7},exit:{codeText:i7,table:t7,tableData:sm,tableHeader:sm,tableRow:sm}}}function e7(e){const i=e._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function t7(e){this.exit(e),this.data.inTable=void 0}function n7(e){this.enter({type:"tableRow",children:[]},e)}function sm(e){this.exit(e)}function Nb(e){this.enter({type:"tableCell",children:[]},e)}function i7(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,r7));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(e)}function r7(e,i){return i==="|"?i:e}function s7(e){const i=e||{},r=i.tableCellPadding,s=i.tablePipeAlign,l=i.stringLength,f=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
538
538
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:p,tableCell:h,tableRow:a}};function p(x,E,w,g){return d(m(x,w,g),x.align)}function a(x,E,w,g){const b=c(x,w,g),S=d([b]);return S.slice(0,S.indexOf(`
539
- `))}function h(x,E,w,g){const b=w.enter("tableCell"),S=w.enter("phrasing"),y=w.containerPhrasing(x,{...g,before:f,after:f});return S(),b(),y}function d(x,E){return dN(x,{align:E,alignDelimiters:s,padding:r,stringLength:l})}function m(x,E,w){const g=x.children;let b=-1;const S=[],y=E.enter("table");for(;++b<g.length;)S[b]=c(g[b],E,w);return y(),S}function c(x,E,w){const g=x.children;let b=-1;const S=[],y=E.enter("tableRow");for(;++b<g.length;)S[b]=h(g[b],x,E,w);return y(),S}function _(x,E,w){let g=E2.inlineCode(x,E,w);return w.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function o7(){return{exit:{taskListCheckValueChecked:Bb,taskListCheckValueUnchecked:Bb,paragraph:l7}}}function a7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c7}}}function Bb(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function l7(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const l=i.children;let f=-1,p;for(;++f<l.length;){const a=l[f];if(a.type==="paragraph"){p=a;break}}p===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function c7(e,i,r,s){const l=e.children[0],f=typeof e.checked=="boolean"&&l&&l.type==="paragraph",p="["+(e.checked?"x":" ")+"] ",a=r.createTracker(s);f&&a.move(p);let h=E2.listItem(e,i,r,{...s,...a.current()});return f&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(m){return m+p}}function u7(){return[OO(),tN(),sN(),JN(),o7()]}function h7(e){return{extensions:[NO(),nN(e),oN(),s7(e),a7()]}}const d7={tokenize:_7,partial:!0},k2={tokenize:x7,partial:!0},T2={tokenize:y7,partial:!0},R2={tokenize:b7,partial:!0},f7={tokenize:S7,partial:!0},A2={name:"wwwAutolink",tokenize:g7,previous:D2},L2={name:"protocolAutolink",tokenize:v7,previous:M2},kr={name:"emailAutolink",tokenize:m7,previous:j2},Wi={};function p7(){return{text:Wi}}let Fs=48;for(;Fs<123;)Wi[Fs]=kr,Fs++,Fs===58?Fs=65:Fs===91&&(Fs=97);Wi[43]=kr;Wi[45]=kr;Wi[46]=kr;Wi[95]=kr;Wi[72]=[kr,L2];Wi[104]=[kr,L2];Wi[87]=[kr,A2];Wi[119]=[kr,A2];function m7(e,i,r){const s=this;let l,f;return p;function p(c){return!Xm(c)||!j2.call(s,s.previous)||fv(s.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Xm(c)?(e.consume(c),a):c===64?(e.consume(c),h):r(c)}function h(c){return c===46?e.check(f7,m,d)(c):c===45||c===95||fn(c)?(f=!0,e.consume(c),h):m(c)}function d(c){return e.consume(c),l=!0,h}function m(c){return f&&l&&dn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(c)):r(c)}}function g7(e,i,r){const s=this;return l;function l(p){return p!==87&&p!==119||!D2.call(s,s.previous)||fv(s.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(d7,e.attempt(k2,e.attempt(T2,f),r),r)(p))}function f(p){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(p)}}function v7(e,i,r){const s=this;let l="",f=!1;return p;function p(c){return(c===72||c===104)&&M2.call(s,s.previous)&&!fv(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),a):r(c)}function a(c){if(dn(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const _=l.toLowerCase();if(_==="http"||_==="https")return e.consume(c),h}return r(c)}function h(c){return c===47?(e.consume(c),f?d:(f=!0,h)):r(c)}function d(c){return c===null||lh(c)||yt(c)||Ks(c)||Nh(c)?r(c):e.attempt(k2,e.attempt(T2,m),r)(c)}function m(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(c)}}function _7(e,i,r){let s=0;return l;function l(p){return(p===87||p===119)&&s<3?(s++,e.consume(p),l):p===46&&s===3?(e.consume(p),f):r(p)}function f(p){return p===null?r(p):i(p)}}function x7(e,i,r){let s,l,f;return p;function p(d){return d===46||d===95?e.check(R2,h,a)(d):d===null||yt(d)||Ks(d)||d!==45&&Nh(d)?h(d):(f=!0,e.consume(d),p)}function a(d){return d===95?s=!0:(l=s,s=void 0),e.consume(d),p}function h(d){return l||s||!f?r(d):i(d)}}function y7(e,i){let r=0,s=0;return l;function l(p){return p===40?(r++,e.consume(p),l):p===41&&s<r?f(p):p===33||p===34||p===38||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===60||p===63||p===93||p===95||p===126?e.check(R2,i,f)(p):p===null||yt(p)||Ks(p)?i(p):(e.consume(p),l)}function f(p){return p===41&&s++,e.consume(p),l}}function b7(e,i,r){return s;function s(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),s):a===38?(e.consume(a),f):a===93?(e.consume(a),l):a===60||a===null||yt(a)||Ks(a)?i(a):r(a)}function l(a){return a===null||a===40||a===91||yt(a)||Ks(a)?i(a):s(a)}function f(a){return dn(a)?p(a):r(a)}function p(a){return a===59?(e.consume(a),s):dn(a)?(e.consume(a),p):r(a)}}function S7(e,i,r){return s;function s(f){return e.consume(f),l}function l(f){return fn(f)?r(f):i(f)}}function D2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function M2(e){return!dn(e)}function j2(e){return!(e===47||Xm(e))}function Xm(e){return e===43||e===45||e===46||e===95||fn(e)}function fv(e){let i=e.length,r=!1;for(;i--;){const s=e[i][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const w7={tokenize:D7,partial:!0};function C7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7,continuation:{tokenize:A7},exit:L7}},text:{91:{name:"gfmFootnoteCall",tokenize:T7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:E7,resolveTo:k7}}}}function E7(e,i,r){const s=this;let l=s.events.length;const f=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let p;for(;l--;){const h=s.events[l][1];if(h.type==="labelImage"){p=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!p||!p._balanced)return r(h);const d=wi(s.sliceSerialize({start:p.end,end:s.now()}));return d.codePointAt(0)!==94||!f.includes(d.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),i(h))}}function k7(e,i){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const f={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},p={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},a=[e[r+1],e[r+2],["enter",s,i],e[r+3],e[r+4],["enter",l,i],["exit",l,i],["enter",f,i],["enter",p,i],["exit",p,i],["exit",f,i],e[e.length-2],e[e.length-1],["exit",s,i]];return e.splice(r,e.length-r+1,...a),e}function T7(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let f=0,p;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),h}function h(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(c){if(f>999||c===93&&!p||c===null||c===91||yt(c))return r(c);if(c===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return l.includes(wi(s.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(c)}return yt(c)||(p=!0),f++,e.consume(c),c===92?m:d}function m(c){return c===91||c===92||c===93?(e.consume(c),f++,d):d(c)}}function R7(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let f,p=0,a;return h;function h(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):r(E)}function m(E){if(p>999||E===93&&!a||E===null||E===91||yt(E))return r(E);if(E===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return f=wi(s.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(E)||(a=!0),p++,e.consume(E),E===92?c:m}function c(E){return E===91||E===92||E===93?(e.consume(E),p++,m):m(E)}function _(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),l.includes(f)||l.push(f),at(e,x,"gfmFootnoteDefinitionWhitespace")):r(E)}function x(E){return i(E)}}function A7(e,i,r){return e.check(Jl,i,e.attempt(w7,i,r))}function L7(e){e.exit("gfmFootnoteDefinition")}function D7(e,i,r){const s=this;return at(e,l,"gfmFootnoteDefinitionIndent",5);function l(f){const p=s.events[s.events.length-1];return p&&p[1].type==="gfmFootnoteDefinitionIndent"&&p[2].sliceSerialize(p[1],!0).length===4?i(f):r(f)}}function M7(e){let r=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:f,resolveAll:l};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(p,a){let h=-1;for(;++h<p.length;)if(p[h][0]==="enter"&&p[h][1].type==="strikethroughSequenceTemporary"&&p[h][1]._close){let d=h;for(;d--;)if(p[d][0]==="exit"&&p[d][1].type==="strikethroughSequenceTemporary"&&p[d][1]._open&&p[h][1].end.offset-p[h][1].start.offset===p[d][1].end.offset-p[d][1].start.offset){p[h][1].type="strikethroughSequence",p[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},p[d][1].start),end:Object.assign({},p[h][1].end)},c={type:"strikethroughText",start:Object.assign({},p[d][1].end),end:Object.assign({},p[h][1].start)},_=[["enter",m,a],["enter",p[d][1],a],["exit",p[d][1],a],["enter",c,a]],x=a.parser.constructs.insideSpan.null;x&&Si(_,_.length,0,Bh(x,p.slice(d+1,h),a)),Si(_,_.length,0,[["exit",c,a],["enter",p[h][1],a],["exit",p[h][1],a],["exit",m,a]]),Si(p,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<p.length;)p[h][1].type==="strikethroughSequenceTemporary"&&(p[h][1].type="data");return p}function f(p,a,h){const d=this.previous,m=this.events;let c=0;return _;function _(E){return d===126&&m[m.length-1][1].type!=="characterEscape"?h(E):(p.enter("strikethroughSequenceTemporary"),x(E))}function x(E){const w=hs(d);if(E===126)return c>1?h(E):(p.consume(E),c++,x);if(c<2&&!r)return h(E);const g=p.exit("strikethroughSequenceTemporary"),b=hs(E);return g._open=!b||b===2&&!!w,g._close=!w||w===2&&!!b,a(E)}}}class j7{constructor(){this.map=[],this.index=new Map}add(i,r,s){O7(this,i,r,s)}consume(i){if(this.map.sort(function(f,p){return f[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const f of l)i.push(f);l=s.pop()}this.map.length=0,this.index.clear()}}function O7(e,i,r,s){if(r===0&&s.length===0)return;const l=e.index.get(i);if(l){l[1]+=r,l[2].push(...s);return}const f=[i,r,s];e.map.push(f),e.index.set(i,f)}function N7(e,i){let r=!1;const s=[];for(;i<e.length;){const l=e[i];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const f=s.length-1;s[f]=s[f]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return s}function B7(){return{flow:{null:{name:"table",tokenize:P7,resolveAll:I7}}}}function P7(e,i,r){const s=this;let l=0,f=0,p;return a;function a(M){let I=s.events.length-1;for(;I>-1;){const{type:U}=s.events[I][1];if(U==="lineEnding"||U==="linePrefix")I--;else break}const B=I>-1?s.events[I][1].type:null,H=B==="tableHead"||B==="tableRow"?R:h;return H===R&&s.parser.lazy[s.now().line]?r(M):H(M)}function h(M){return e.enter("tableHead"),e.enter("tableRow"),d(M)}function d(M){return M===124||(p=!0,f+=1),m(M)}function m(M){return M===null?r(M):Ne(M)?f>1?(f=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),x):r(M):Ke(M)?at(e,m,"whitespace")(M):(f+=1,p&&(p=!1,l+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),p=!0,m):(e.enter("data"),c(M)))}function c(M){return M===null||M===124||yt(M)?(e.exit("data"),m(M)):(e.consume(M),M===92?_:c)}function _(M){return M===92||M===124?(e.consume(M),c):c(M)}function x(M){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(M):(e.enter("tableDelimiterRow"),p=!1,Ke(M)?at(e,E,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):E(M))}function E(M){return M===45||M===58?g(M):M===124?(p=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):L(M)}function w(M){return Ke(M)?at(e,g,"whitespace")(M):g(M)}function g(M){return M===58?(f+=1,p=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),b):M===45?(f+=1,b(M)):M===null||Ne(M)?T(M):L(M)}function b(M){return M===45?(e.enter("tableDelimiterFiller"),S(M)):L(M)}function S(M){return M===45?(e.consume(M),S):M===58?(p=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(M))}function y(M){return Ke(M)?at(e,T,"whitespace")(M):T(M)}function T(M){return M===124?E(M):M===null||Ne(M)?!p||l!==f?L(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(M)):L(M)}function L(M){return r(M)}function R(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||Ne(M)?(e.exit("tableRow"),i(M)):Ke(M)?at(e,D,"whitespace")(M):(e.enter("data"),A(M))}function A(M){return M===null||M===124||yt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?j:A)}function j(M){return M===92||M===124?(e.consume(M),A):A(M)}}function I7(e,i){let r=-1,s=!0,l=0,f=[0,0,0,0],p=[0,0,0,0],a=!1,h=0,d,m,c;const _=new j7;for(;++r<e.length;){const x=e[r],E=x[1];x[0]==="enter"?E.type==="tableHead"?(a=!1,h!==0&&(Pb(_,i,h,d,m),m=void 0,h=0),d={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},_.add(r,0,[["enter",d,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(s=!0,c=void 0,f=[0,0,0,0],p=[0,r+1,0,0],a&&(a=!1,m={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},_.add(r,0,[["enter",m,i]])),l=E.type==="tableDelimiterRow"?2:m?3:1):l&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(s=!1,p[2]===0&&(f[1]!==0&&(p[0]=p[1],c=Vu(_,i,f,l,void 0,c),f=[0,0,0,0]),p[2]=r)):E.type==="tableCellDivider"&&(s?s=!1:(f[1]!==0&&(p[0]=p[1],c=Vu(_,i,f,l,void 0,c)),f=p,p=[f[1],r,0,0])):E.type==="tableHead"?(a=!0,h=r):E.type==="tableRow"||E.type==="tableDelimiterRow"?(h=r,f[1]!==0?(p[0]=p[1],c=Vu(_,i,f,l,r,c)):p[1]!==0&&(c=Vu(_,i,p,l,r,c)),l=0):l&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(p[3]=r)}for(h!==0&&Pb(_,i,h,d,m),_.consume(i.events),r=-1;++r<i.events.length;){const x=i.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=N7(i.events,r))}return e}function Vu(e,i,r,s,l,f){const p=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(f.end=Object.assign({},ta(i.events,r[0])),e.add(r[0],0,[["exit",f,i]]));const h=ta(i.events,r[1]);if(f={type:p,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",f,i]]),r[2]!==0){const d=ta(i.events,r[2]),m=ta(i.events,r[3]),c={type:a,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(r[2],0,[["enter",c,i]]),s!==2){const _=i.events[r[2]],x=i.events[r[3]];if(_[1].end=Object.assign({},x[1].end),_[1].type="chunkText",_[1].contentType="text",r[3]>r[2]+1){const E=r[2]+1,w=r[3]-r[2]-1;e.add(E,w,[])}}e.add(r[3]+1,0,[["exit",c,i]])}return l!==void 0&&(f.end=Object.assign({},ta(i.events,l)),e.add(l,0,[["exit",f,i]]),f=void 0),f}function Pb(e,i,r,s,l){const f=[],p=ta(i.events,r);l&&(l.end=Object.assign({},p),f.push(["exit",l,i])),s.end=Object.assign({},p),f.push(["exit",s,i]),e.add(r+1,0,f)}function ta(e,i){const r=e[i],s=r[0]==="enter"?"start":"end";return r[1][s]}const z7={name:"tasklistCheck",tokenize:F7};function H7(){return{text:{91:z7}}}function F7(e,i,r){const s=this;return l;function l(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),f)}function f(h){return yt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),p):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),p):r(h)}function p(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(h)}function a(h){return Ne(h)?i(h):Ke(h)?e.check({tokenize:U7},i,r)(h):r(h)}}function U7(e,i,r){return at(e,s,"whitespace");function s(l){return l===null?r(l):i(l)}}function $7(e){return HC([p7(),C7(),M7(e),B7(),H7()])}const q7={};function V7(e){const i=this,r=e||q7,s=i.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),f=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),p=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push($7(r)),f.push(u7()),p.push(h7(r))}function pv({children:e,className:i}){return v.jsx("div",{className:xe("space-y-2 font-serif leading-relaxed",i),children:v.jsx(CO,{remarkPlugins:[V7],components:{p:({children:r})=>v.jsx("p",{className:"whitespace-pre-wrap",children:r}),h1:({children:r})=>v.jsx("h1",{className:"font-sans text-sm font-semibold",children:r}),h2:({children:r})=>v.jsx("h2",{className:"font-sans text-sm font-semibold",children:r}),h3:({children:r})=>v.jsx("h3",{className:"font-sans text-xs font-semibold uppercase tracking-wide",children:r}),ul:({children:r})=>v.jsx("ul",{className:"list-disc space-y-1 pl-4",children:r}),ol:({children:r})=>v.jsx("ol",{className:"list-decimal space-y-1 pl-4",children:r}),li:({children:r})=>v.jsx("li",{className:"marker:text-muted-foreground",children:r}),a:({children:r,href:s})=>v.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2",children:r}),blockquote:({children:r})=>v.jsx("blockquote",{className:"border-l-2 border-border pl-3 italic text-foreground/80",children:r}),code:({className:r,children:s})=>!!r?v.jsx("code",{className:"block overflow-x-auto font-mono text-xs",children:s}):v.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:s}),pre:({children:r})=>v.jsx("pre",{className:"overflow-x-auto rounded-md bg-muted p-2 font-mono text-xs",children:r}),table:({children:r})=>v.jsx("div",{className:"overflow-x-auto",children:v.jsx("table",{className:"w-full border-collapse text-xs",children:r})}),th:({children:r})=>v.jsx("th",{className:"border-b px-2 py-1 text-left font-sans font-medium",children:r}),td:({children:r})=>v.jsx("td",{className:"border-b border-border/50 px-2 py-1 align-top",children:r}),hr:()=>v.jsx("hr",{className:"border-border"})},children:e})})}function W7(e){const i=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(e);if(!i)return{fields:[],body:e};const r=[];for(const s of i[1].split(/\r?\n/)){const l=/^([A-Za-z0-9_-]+):\s*(.*)$/.exec(s);l?r.push([l[1],l[2]]):r.length&&s.trim()&&(r[r.length-1][1]+=` ${s.trim()}`)}return{fields:r,body:e.slice(i[0].length)}}function G7({mode:e,onChange:i,editable:r}){const s=[["view",rg,"View mode"],["edit",Vi,r?"Edit mode":"Edit mode (read-only)"]];return v.jsx("div",{className:"flex rounded-md border bg-card p-0.5",children:s.map(([l,f,p])=>v.jsx("button",{title:p,"aria-label":p,"aria-pressed":e===l,onClick:()=>i(l),className:xe("rounded p-1 transition-colors",e===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:v.jsx(f,{size:13})},l))})}function tc({value:e,onChange:i,rows:r=24,fill:s=!1,blame:l,fileBlame:f,defaultMode:p="view",className:a}){const[h,d]=P.useState(p),{fields:m,body:c}=W7(e),_={height:s?"100%":`${r*1.6+1}rem`};return v.jsxs("div",{className:xe("flex flex-col overflow-hidden rounded border bg-transparent",s&&"h-full",a),children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b px-2 py-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:h==="view"?"View":i?"Edit":"Raw (read-only)"}),v.jsx(G7,{mode:h,onChange:d,editable:!!i})]}),h==="view"?v.jsxs("div",{className:xe("overflow-y-auto px-4 py-3",s&&"min-h-0 flex-1"),style:s?void 0:_,children:[m.length>0&&v.jsx("table",{className:"mb-3 w-full border-collapse text-[11px]",children:v.jsx("tbody",{children:m.map(([x,E])=>v.jsxs("tr",{className:"border-b border-border/60",children:[v.jsx("td",{className:"w-32 py-1 pr-3 align-top font-mono text-muted-foreground",children:x}),v.jsx("td",{className:"py-1 align-top [overflow-wrap:anywhere]",children:E})]},x))})}),c.trim()?v.jsx(pv,{className:"text-xs",children:c}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Empty."})]}):v.jsx("div",{className:xe(s&&"min-h-0 flex-1"),style:s?void 0:_,children:v.jsx(EC,{value:e,onChange:i,language:"markdown",wrap:!0,blame:l,fileBlame:f})})]})}function Y7(e,i){const r=e.split(`
539
+ `))}function h(x,E,w,g){const b=w.enter("tableCell"),S=w.enter("phrasing"),y=w.containerPhrasing(x,{...g,before:f,after:f});return S(),b(),y}function d(x,E){return dN(x,{align:E,alignDelimiters:s,padding:r,stringLength:l})}function m(x,E,w){const g=x.children;let b=-1;const S=[],y=E.enter("table");for(;++b<g.length;)S[b]=c(g[b],E,w);return y(),S}function c(x,E,w){const g=x.children;let b=-1;const S=[],y=E.enter("tableRow");for(;++b<g.length;)S[b]=h(g[b],x,E,w);return y(),S}function _(x,E,w){let g=E2.inlineCode(x,E,w);return w.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function o7(){return{exit:{taskListCheckValueChecked:Bb,taskListCheckValueUnchecked:Bb,paragraph:l7}}}function a7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c7}}}function Bb(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function l7(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const l=i.children;let f=-1,p;for(;++f<l.length;){const a=l[f];if(a.type==="paragraph"){p=a;break}}p===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function c7(e,i,r,s){const l=e.children[0],f=typeof e.checked=="boolean"&&l&&l.type==="paragraph",p="["+(e.checked?"x":" ")+"] ",a=r.createTracker(s);f&&a.move(p);let h=E2.listItem(e,i,r,{...s,...a.current()});return f&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(m){return m+p}}function u7(){return[OO(),tN(),sN(),JN(),o7()]}function h7(e){return{extensions:[NO(),nN(e),oN(),s7(e),a7()]}}const d7={tokenize:_7,partial:!0},k2={tokenize:x7,partial:!0},T2={tokenize:y7,partial:!0},R2={tokenize:b7,partial:!0},f7={tokenize:S7,partial:!0},A2={name:"wwwAutolink",tokenize:g7,previous:D2},L2={name:"protocolAutolink",tokenize:v7,previous:M2},kr={name:"emailAutolink",tokenize:m7,previous:j2},Wi={};function p7(){return{text:Wi}}let Fs=48;for(;Fs<123;)Wi[Fs]=kr,Fs++,Fs===58?Fs=65:Fs===91&&(Fs=97);Wi[43]=kr;Wi[45]=kr;Wi[46]=kr;Wi[95]=kr;Wi[72]=[kr,L2];Wi[104]=[kr,L2];Wi[87]=[kr,A2];Wi[119]=[kr,A2];function m7(e,i,r){const s=this;let l,f;return p;function p(c){return!Xm(c)||!j2.call(s,s.previous)||fv(s.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Xm(c)?(e.consume(c),a):c===64?(e.consume(c),h):r(c)}function h(c){return c===46?e.check(f7,m,d)(c):c===45||c===95||fn(c)?(f=!0,e.consume(c),h):m(c)}function d(c){return e.consume(c),l=!0,h}function m(c){return f&&l&&dn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(c)):r(c)}}function g7(e,i,r){const s=this;return l;function l(p){return p!==87&&p!==119||!D2.call(s,s.previous)||fv(s.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(d7,e.attempt(k2,e.attempt(T2,f),r),r)(p))}function f(p){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(p)}}function v7(e,i,r){const s=this;let l="",f=!1;return p;function p(c){return(c===72||c===104)&&M2.call(s,s.previous)&&!fv(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),a):r(c)}function a(c){if(dn(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const _=l.toLowerCase();if(_==="http"||_==="https")return e.consume(c),h}return r(c)}function h(c){return c===47?(e.consume(c),f?d:(f=!0,h)):r(c)}function d(c){return c===null||lh(c)||yt(c)||Qs(c)||Nh(c)?r(c):e.attempt(k2,e.attempt(T2,m),r)(c)}function m(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(c)}}function _7(e,i,r){let s=0;return l;function l(p){return(p===87||p===119)&&s<3?(s++,e.consume(p),l):p===46&&s===3?(e.consume(p),f):r(p)}function f(p){return p===null?r(p):i(p)}}function x7(e,i,r){let s,l,f;return p;function p(d){return d===46||d===95?e.check(R2,h,a)(d):d===null||yt(d)||Qs(d)||d!==45&&Nh(d)?h(d):(f=!0,e.consume(d),p)}function a(d){return d===95?s=!0:(l=s,s=void 0),e.consume(d),p}function h(d){return l||s||!f?r(d):i(d)}}function y7(e,i){let r=0,s=0;return l;function l(p){return p===40?(r++,e.consume(p),l):p===41&&s<r?f(p):p===33||p===34||p===38||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===60||p===63||p===93||p===95||p===126?e.check(R2,i,f)(p):p===null||yt(p)||Qs(p)?i(p):(e.consume(p),l)}function f(p){return p===41&&s++,e.consume(p),l}}function b7(e,i,r){return s;function s(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),s):a===38?(e.consume(a),f):a===93?(e.consume(a),l):a===60||a===null||yt(a)||Qs(a)?i(a):r(a)}function l(a){return a===null||a===40||a===91||yt(a)||Qs(a)?i(a):s(a)}function f(a){return dn(a)?p(a):r(a)}function p(a){return a===59?(e.consume(a),s):dn(a)?(e.consume(a),p):r(a)}}function S7(e,i,r){return s;function s(f){return e.consume(f),l}function l(f){return fn(f)?r(f):i(f)}}function D2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function M2(e){return!dn(e)}function j2(e){return!(e===47||Xm(e))}function Xm(e){return e===43||e===45||e===46||e===95||fn(e)}function fv(e){let i=e.length,r=!1;for(;i--;){const s=e[i][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const w7={tokenize:D7,partial:!0};function C7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7,continuation:{tokenize:A7},exit:L7}},text:{91:{name:"gfmFootnoteCall",tokenize:T7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:E7,resolveTo:k7}}}}function E7(e,i,r){const s=this;let l=s.events.length;const f=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let p;for(;l--;){const h=s.events[l][1];if(h.type==="labelImage"){p=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!p||!p._balanced)return r(h);const d=wi(s.sliceSerialize({start:p.end,end:s.now()}));return d.codePointAt(0)!==94||!f.includes(d.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),i(h))}}function k7(e,i){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const f={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},p={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},a=[e[r+1],e[r+2],["enter",s,i],e[r+3],e[r+4],["enter",l,i],["exit",l,i],["enter",f,i],["enter",p,i],["exit",p,i],["exit",f,i],e[e.length-2],e[e.length-1],["exit",s,i]];return e.splice(r,e.length-r+1,...a),e}function T7(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let f=0,p;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),h}function h(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(c){if(f>999||c===93&&!p||c===null||c===91||yt(c))return r(c);if(c===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return l.includes(wi(s.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(c)}return yt(c)||(p=!0),f++,e.consume(c),c===92?m:d}function m(c){return c===91||c===92||c===93?(e.consume(c),f++,d):d(c)}}function R7(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let f,p=0,a;return h;function h(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):r(E)}function m(E){if(p>999||E===93&&!a||E===null||E===91||yt(E))return r(E);if(E===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return f=wi(s.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(E)||(a=!0),p++,e.consume(E),E===92?c:m}function c(E){return E===91||E===92||E===93?(e.consume(E),p++,m):m(E)}function _(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),l.includes(f)||l.push(f),at(e,x,"gfmFootnoteDefinitionWhitespace")):r(E)}function x(E){return i(E)}}function A7(e,i,r){return e.check(Jl,i,e.attempt(w7,i,r))}function L7(e){e.exit("gfmFootnoteDefinition")}function D7(e,i,r){const s=this;return at(e,l,"gfmFootnoteDefinitionIndent",5);function l(f){const p=s.events[s.events.length-1];return p&&p[1].type==="gfmFootnoteDefinitionIndent"&&p[2].sliceSerialize(p[1],!0).length===4?i(f):r(f)}}function M7(e){let r=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:f,resolveAll:l};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(p,a){let h=-1;for(;++h<p.length;)if(p[h][0]==="enter"&&p[h][1].type==="strikethroughSequenceTemporary"&&p[h][1]._close){let d=h;for(;d--;)if(p[d][0]==="exit"&&p[d][1].type==="strikethroughSequenceTemporary"&&p[d][1]._open&&p[h][1].end.offset-p[h][1].start.offset===p[d][1].end.offset-p[d][1].start.offset){p[h][1].type="strikethroughSequence",p[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},p[d][1].start),end:Object.assign({},p[h][1].end)},c={type:"strikethroughText",start:Object.assign({},p[d][1].end),end:Object.assign({},p[h][1].start)},_=[["enter",m,a],["enter",p[d][1],a],["exit",p[d][1],a],["enter",c,a]],x=a.parser.constructs.insideSpan.null;x&&Si(_,_.length,0,Bh(x,p.slice(d+1,h),a)),Si(_,_.length,0,[["exit",c,a],["enter",p[h][1],a],["exit",p[h][1],a],["exit",m,a]]),Si(p,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<p.length;)p[h][1].type==="strikethroughSequenceTemporary"&&(p[h][1].type="data");return p}function f(p,a,h){const d=this.previous,m=this.events;let c=0;return _;function _(E){return d===126&&m[m.length-1][1].type!=="characterEscape"?h(E):(p.enter("strikethroughSequenceTemporary"),x(E))}function x(E){const w=hs(d);if(E===126)return c>1?h(E):(p.consume(E),c++,x);if(c<2&&!r)return h(E);const g=p.exit("strikethroughSequenceTemporary"),b=hs(E);return g._open=!b||b===2&&!!w,g._close=!w||w===2&&!!b,a(E)}}}class j7{constructor(){this.map=[],this.index=new Map}add(i,r,s){O7(this,i,r,s)}consume(i){if(this.map.sort(function(f,p){return f[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const f of l)i.push(f);l=s.pop()}this.map.length=0,this.index.clear()}}function O7(e,i,r,s){if(r===0&&s.length===0)return;const l=e.index.get(i);if(l){l[1]+=r,l[2].push(...s);return}const f=[i,r,s];e.map.push(f),e.index.set(i,f)}function N7(e,i){let r=!1;const s=[];for(;i<e.length;){const l=e[i];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const f=s.length-1;s[f]=s[f]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return s}function B7(){return{flow:{null:{name:"table",tokenize:P7,resolveAll:I7}}}}function P7(e,i,r){const s=this;let l=0,f=0,p;return a;function a(M){let I=s.events.length-1;for(;I>-1;){const{type:U}=s.events[I][1];if(U==="lineEnding"||U==="linePrefix")I--;else break}const B=I>-1?s.events[I][1].type:null,H=B==="tableHead"||B==="tableRow"?R:h;return H===R&&s.parser.lazy[s.now().line]?r(M):H(M)}function h(M){return e.enter("tableHead"),e.enter("tableRow"),d(M)}function d(M){return M===124||(p=!0,f+=1),m(M)}function m(M){return M===null?r(M):Ne(M)?f>1?(f=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),x):r(M):Ke(M)?at(e,m,"whitespace")(M):(f+=1,p&&(p=!1,l+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),p=!0,m):(e.enter("data"),c(M)))}function c(M){return M===null||M===124||yt(M)?(e.exit("data"),m(M)):(e.consume(M),M===92?_:c)}function _(M){return M===92||M===124?(e.consume(M),c):c(M)}function x(M){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(M):(e.enter("tableDelimiterRow"),p=!1,Ke(M)?at(e,E,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):E(M))}function E(M){return M===45||M===58?g(M):M===124?(p=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):L(M)}function w(M){return Ke(M)?at(e,g,"whitespace")(M):g(M)}function g(M){return M===58?(f+=1,p=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),b):M===45?(f+=1,b(M)):M===null||Ne(M)?T(M):L(M)}function b(M){return M===45?(e.enter("tableDelimiterFiller"),S(M)):L(M)}function S(M){return M===45?(e.consume(M),S):M===58?(p=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(M))}function y(M){return Ke(M)?at(e,T,"whitespace")(M):T(M)}function T(M){return M===124?E(M):M===null||Ne(M)?!p||l!==f?L(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(M)):L(M)}function L(M){return r(M)}function R(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||Ne(M)?(e.exit("tableRow"),i(M)):Ke(M)?at(e,D,"whitespace")(M):(e.enter("data"),A(M))}function A(M){return M===null||M===124||yt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?j:A)}function j(M){return M===92||M===124?(e.consume(M),A):A(M)}}function I7(e,i){let r=-1,s=!0,l=0,f=[0,0,0,0],p=[0,0,0,0],a=!1,h=0,d,m,c;const _=new j7;for(;++r<e.length;){const x=e[r],E=x[1];x[0]==="enter"?E.type==="tableHead"?(a=!1,h!==0&&(Pb(_,i,h,d,m),m=void 0,h=0),d={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},_.add(r,0,[["enter",d,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(s=!0,c=void 0,f=[0,0,0,0],p=[0,r+1,0,0],a&&(a=!1,m={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},_.add(r,0,[["enter",m,i]])),l=E.type==="tableDelimiterRow"?2:m?3:1):l&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(s=!1,p[2]===0&&(f[1]!==0&&(p[0]=p[1],c=Vu(_,i,f,l,void 0,c),f=[0,0,0,0]),p[2]=r)):E.type==="tableCellDivider"&&(s?s=!1:(f[1]!==0&&(p[0]=p[1],c=Vu(_,i,f,l,void 0,c)),f=p,p=[f[1],r,0,0])):E.type==="tableHead"?(a=!0,h=r):E.type==="tableRow"||E.type==="tableDelimiterRow"?(h=r,f[1]!==0?(p[0]=p[1],c=Vu(_,i,f,l,r,c)):p[1]!==0&&(c=Vu(_,i,p,l,r,c)),l=0):l&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(p[3]=r)}for(h!==0&&Pb(_,i,h,d,m),_.consume(i.events),r=-1;++r<i.events.length;){const x=i.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=N7(i.events,r))}return e}function Vu(e,i,r,s,l,f){const p=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(f.end=Object.assign({},na(i.events,r[0])),e.add(r[0],0,[["exit",f,i]]));const h=na(i.events,r[1]);if(f={type:p,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",f,i]]),r[2]!==0){const d=na(i.events,r[2]),m=na(i.events,r[3]),c={type:a,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(r[2],0,[["enter",c,i]]),s!==2){const _=i.events[r[2]],x=i.events[r[3]];if(_[1].end=Object.assign({},x[1].end),_[1].type="chunkText",_[1].contentType="text",r[3]>r[2]+1){const E=r[2]+1,w=r[3]-r[2]-1;e.add(E,w,[])}}e.add(r[3]+1,0,[["exit",c,i]])}return l!==void 0&&(f.end=Object.assign({},na(i.events,l)),e.add(l,0,[["exit",f,i]]),f=void 0),f}function Pb(e,i,r,s,l){const f=[],p=na(i.events,r);l&&(l.end=Object.assign({},p),f.push(["exit",l,i])),s.end=Object.assign({},p),f.push(["exit",s,i]),e.add(r+1,0,f)}function na(e,i){const r=e[i],s=r[0]==="enter"?"start":"end";return r[1][s]}const z7={name:"tasklistCheck",tokenize:F7};function H7(){return{text:{91:z7}}}function F7(e,i,r){const s=this;return l;function l(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),f)}function f(h){return yt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),p):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),p):r(h)}function p(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(h)}function a(h){return Ne(h)?i(h):Ke(h)?e.check({tokenize:U7},i,r)(h):r(h)}}function U7(e,i,r){return at(e,s,"whitespace");function s(l){return l===null?r(l):i(l)}}function $7(e){return HC([p7(),C7(),M7(e),B7(),H7()])}const q7={};function V7(e){const i=this,r=e||q7,s=i.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),f=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),p=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push($7(r)),f.push(u7()),p.push(h7(r))}function pv({children:e,className:i}){return v.jsx("div",{className:xe("space-y-2 font-serif leading-relaxed",i),children:v.jsx(CO,{remarkPlugins:[V7],components:{p:({children:r})=>v.jsx("p",{className:"whitespace-pre-wrap",children:r}),h1:({children:r})=>v.jsx("h1",{className:"font-sans text-sm font-semibold",children:r}),h2:({children:r})=>v.jsx("h2",{className:"font-sans text-sm font-semibold",children:r}),h3:({children:r})=>v.jsx("h3",{className:"font-sans text-xs font-semibold uppercase tracking-wide",children:r}),ul:({children:r})=>v.jsx("ul",{className:"list-disc space-y-1 pl-4",children:r}),ol:({children:r})=>v.jsx("ol",{className:"list-decimal space-y-1 pl-4",children:r}),li:({children:r})=>v.jsx("li",{className:"marker:text-muted-foreground",children:r}),a:({children:r,href:s})=>v.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2",children:r}),blockquote:({children:r})=>v.jsx("blockquote",{className:"border-l-2 border-border pl-3 italic text-foreground/80",children:r}),code:({className:r,children:s})=>!!r?v.jsx("code",{className:"block overflow-x-auto font-mono text-xs",children:s}):v.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:s}),pre:({children:r})=>v.jsx("pre",{className:"overflow-x-auto rounded-md bg-muted p-2 font-mono text-xs",children:r}),table:({children:r})=>v.jsx("div",{className:"overflow-x-auto",children:v.jsx("table",{className:"w-full border-collapse text-xs",children:r})}),th:({children:r})=>v.jsx("th",{className:"border-b px-2 py-1 text-left font-sans font-medium",children:r}),td:({children:r})=>v.jsx("td",{className:"border-b border-border/50 px-2 py-1 align-top",children:r}),hr:()=>v.jsx("hr",{className:"border-border"})},children:e})})}function W7(e){const i=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(e);if(!i)return{fields:[],body:e};const r=[];for(const s of i[1].split(/\r?\n/)){const l=/^([A-Za-z0-9_-]+):\s*(.*)$/.exec(s);l?r.push([l[1],l[2]]):r.length&&s.trim()&&(r[r.length-1][1]+=` ${s.trim()}`)}return{fields:r,body:e.slice(i[0].length)}}function G7({mode:e,onChange:i,editable:r}){const s=[["view",rg,"View mode"],["edit",Vi,r?"Edit mode":"Edit mode (read-only)"]];return v.jsx("div",{className:"flex rounded-md border bg-card p-0.5",children:s.map(([l,f,p])=>v.jsx("button",{title:p,"aria-label":p,"aria-pressed":e===l,onClick:()=>i(l),className:xe("rounded p-1 transition-colors",e===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:v.jsx(f,{size:13})},l))})}function tc({value:e,onChange:i,rows:r=24,fill:s=!1,blame:l,fileBlame:f,defaultMode:p="view",className:a}){const[h,d]=P.useState(p),{fields:m,body:c}=W7(e),_={height:s?"100%":`${r*1.6+1}rem`};return v.jsxs("div",{className:xe("flex flex-col overflow-hidden rounded border bg-transparent",s&&"h-full",a),children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b px-2 py-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:h==="view"?"View":i?"Edit":"Raw (read-only)"}),v.jsx(G7,{mode:h,onChange:d,editable:!!i})]}),h==="view"?v.jsxs("div",{className:xe("overflow-y-auto px-4 py-3",s&&"min-h-0 flex-1"),style:s?void 0:_,children:[m.length>0&&v.jsx("table",{className:"mb-3 w-full border-collapse text-[11px]",children:v.jsx("tbody",{children:m.map(([x,E])=>v.jsxs("tr",{className:"border-b border-border/60",children:[v.jsx("td",{className:"w-32 py-1 pr-3 align-top font-mono text-muted-foreground",children:x}),v.jsx("td",{className:"py-1 align-top [overflow-wrap:anywhere]",children:E})]},x))})}),c.trim()?v.jsx(pv,{className:"text-xs",children:c}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Empty."})]}):v.jsx("div",{className:xe(s&&"min-h-0 flex-1"),style:s?void 0:_,children:v.jsx(EC,{value:e,onChange:i,language:"markdown",wrap:!0,blame:l,fileBlame:f})})]})}function Y7(e,i){const r=e.split(`
540
540
  `),s=i.split(`
541
- `),l=Array.from({length:r.length+1},()=>new Uint32Array(s.length+1));for(let h=r.length-1;h>=0;h-=1)for(let d=s.length-1;d>=0;d-=1)l[h][d]=r[h]===s[d]?l[h+1][d+1]+1:Math.max(l[h+1][d],l[h][d+1]);const f=[];let p=0,a=0;for(;p<r.length&&a<s.length;)r[p]===s[a]?(f.push({type:" ",line:r[p]}),p+=1,a+=1):l[p+1][a]>=l[p][a+1]?f.push({type:"-",line:r[p++]}):f.push({type:"+",line:s[a++]});for(;p<r.length;)f.push({type:"-",line:r[p++]});for(;a<s.length;)f.push({type:"+",line:s[a++]});return f}function fh({before:e,after:i}){const r=Y7(e,i);return v.jsx("pre",{className:"max-h-[60vh] overflow-auto rounded border font-mono text-[11px]",children:r.filter((s,l)=>s.type!==" "||r.slice(Math.max(0,l-2),l+3).some(f=>f.type!==" ")).map((s,l)=>v.jsxs("div",{className:xe("px-2",s.type==="+"&&"bg-success/20",s.type==="-"&&"bg-destructive/20"),children:[s.type," ",s.line]},l))})}function O2({path:e,title:i,badge:r,subtitle:s,onSaved:l}){const f=pn(),[p,a]=P.useState(null),[h,d]=P.useState(!1),[m,c]=P.useState(""),[_,x]=P.useState(null);if(P.useEffect(()=>{a(null),x(null),ve.memoryFile(e).then(g=>{a(g.content),c(g.content),d(g.writable)},g=>x(g.message))},[e]),_)return v.jsx("div",{className:"text-xs text-severity-critical",children:_});if(p===null)return v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."});const E=m!==p,w=()=>f({title:`Write ${i}?`,description:"Writes the real file on disk.",body:v.jsx(fh,{before:p,after:m}),confirmLabel:"Write file",maxWidth:"max-w-3xl",run:async()=>{const g=await ve.saveMemoryFile(e,m);a(g.content),ye.getState().notify("Written."),l==null||l()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsxs("h2",{className:"flex items-center gap-2 font-mono text-sm font-semibold",children:[v.jsx("span",{className:"min-w-0 truncate",children:i}),r]}),v.jsxs("p",{className:"break-all text-[11px] text-muted-foreground",children:[s??e,!h&&" · read-only (managed by a plugin)",h&&!p&&" · does not exist yet; saving creates it"]})]}),h&&v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[E&&v.jsx(_e,{onClick:()=>c(p),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!E,onClick:()=>void w(),children:"Review & save"})]})]}),v.jsx(tc,{rows:26,value:m,onChange:h?c:void 0})]})}var X7=Object.defineProperty,xr=(e,i)=>X7(e,"name",{value:i,configurable:!0}),mv="Checkbox",[K7,cB]=br(mv),[Q7,gv]=K7(mv);function N2(e){const{__scopeCheckbox:i,checked:r,children:s,defaultChecked:l,disabled:f,form:p,name:a,onCheckedChange:h,required:d,value:m="on",internal_do_not_use_render:c}=e,[_,x]=Ws({prop:r,defaultProp:l??!1,onChange:h,caller:mv}),[E,w]=P.useState(null),[g,b]=P.useState(null),[S,y]=P.useState(null),T=E?!!p||!!E.closest("form"):!0,L={checked:_,disabled:f,setChecked:x,control:E,setControl:w,name:a,form:p,value:m,userClick:S,onUserClick:y,required:d,defaultChecked:fi(l)?!1:l,isFormControl:T,bubbleInput:g,setBubbleInput:b};return v.jsx(Q7,{scope:i,...L,children:B2(c)?c(L):s})}xr(N2,"CheckboxProvider");var Z7="CheckboxTrigger",J7=P.forwardRef(xr(function({__scopeCheckbox:i,onKeyDown:r,onClick:s,...l},f){const{control:p,value:a,disabled:h,checked:d,required:m,setControl:c,setChecked:_,onUserClick:x,isFormControl:E,bubbleInput:w}=gv(Z7,i),g=ht(f,c),b=P.useRef(d);return P.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const y=xr(()=>_(b.current),"reset");return S.addEventListener("reset",y),()=>S.removeEventListener("reset",y)}},[p,_]),v.jsx(wt.button,{type:"button",role:"checkbox","aria-checked":fi(d)?"mixed":d,"aria-required":m,"data-state":vv(d),"data-disabled":h?"":void 0,disabled:h,value:a,...l,ref:g,onKeyDown:tt(r,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:tt(s,S=>{const y=S.isPropagationStopped();x({requestedChecked:fi(d)?!0:!d,hasConsumerStoppedPropagation:y}),_(T=>fi(T)?!0:!T),w&&E&&(y||S.stopPropagation())})})},"CheckboxTrigger")),e8=P.forwardRef(xr(function(i,r){const{__scopeCheckbox:s,name:l,checked:f,defaultChecked:p,required:a,disabled:h,value:d,onCheckedChange:m,form:c,..._}=i;return v.jsx(N2,{__scopeCheckbox:s,checked:f,defaultChecked:p,disabled:h,required:a,onCheckedChange:m,name:l,form:c,value:d,internal_do_not_use_render:({isFormControl:x})=>v.jsxs(v.Fragment,{children:[v.jsx(J7,{..._,ref:r,__scopeCheckbox:s}),x&&v.jsx(r8,{__scopeCheckbox:s})]})})},"Checkbox")),t8="CheckboxIndicator",n8=P.forwardRef(xr(function(i,r){const{__scopeCheckbox:s,forceMount:l,...f}=i,p=gv(t8,s);return v.jsx(Sr,{present:l||fi(p.checked)||p.checked===!0,children:v.jsx(wt.span,{"data-state":vv(p.checked),"data-disabled":p.disabled?"":void 0,...f,ref:r,style:{pointerEvents:"none",...i.style}})})},"CheckboxIndicator")),i8="CheckboxBubbleInput",r8=P.forwardRef(xr(function({__scopeCheckbox:i,onClick:r,...s},l){const{control:f,userClick:p,checked:a,defaultChecked:h,required:d,disabled:m,name:c,value:_,form:x,bubbleInput:E,setBubbleInput:w}=gv(i8,i),g=ht(l,w),b=Lg(f),S=P.useRef(!1),y=P.useRef(a),T=P.useRef(p),L=P.useRef(null);P.useEffect(()=>{const D=E;if(!D)return;const A=window.HTMLInputElement.prototype,M=Object.getOwnPropertyDescriptor(A,"checked").set;if(!M)return;const I=y.current!==a;y.current=a;const B=p!==null&&p!==T.current;if(T.current=p,B)L.current=I?null:p,I&&(D.indeterminate=fi(a),M.call(D,fi(a)?!1:a)),D.dispatchEvent(new Event("click",{bubbles:!p.hasConsumerStoppedPropagation}));else if(I){const H=L.current;L.current=null;const U=(H==null?void 0:H.requestedChecked)===a;S.current=!0,D.indeterminate=fi(a),M.call(D,fi(a)?!1:a),D.dispatchEvent(new Event("click",{bubbles:!(U&&H.hasConsumerStoppedPropagation)})),S.current=!1}},[E,a,p]);const R=P.useRef(fi(a)?!1:a);return v.jsx(wt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??R.current,required:d,disabled:m,name:c,value:_,form:x,...s,tabIndex:-1,ref:g,onClick:tt(r,D=>{S.current&&D.stopPropagation()}),style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function B2(e){return typeof e=="function"}xr(B2,"isFunction");function fi(e){return e==="indeterminate"}xr(fi,"isIndeterminate");function vv(e){return fi(e)?"indeterminate":e?"checked":"unchecked"}xr(vv,"getState");function Fh({id:e,label:i,ariaLabel:r,checked:s,onCheckedChange:l,disabled:f,title:p,className:a}){const h=e??(i?`cb-${String(i).toLowerCase().replace(/\s+/g,"-")}`:void 0);return v.jsxs("div",{className:xe("flex items-center gap-2",a),title:p,children:[v.jsx(e8,{id:h,checked:s,onCheckedChange:d=>l(d===!0),"aria-label":r,disabled:f,className:"h-4 w-4 shrink-0 cursor-pointer rounded border border-border bg-transparent focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:v.jsx(n8,{className:"flex items-center justify-center",children:v.jsx($l,{className:"h-3 w-3 text-primary",strokeWidth:3})})}),i&&v.jsx("label",{htmlFor:h,className:"cursor-pointer select-none text-xs",children:i})]})}function s8({path:e,kind:i,tick:r}){const[s,l]=P.useState(!1),[f,p]=P.useState(0);P.useEffect(()=>{let h=!1;return Xt.stat(e).then(d=>!h&&p(d.mtimeMs),()=>{}),()=>{h=!0}},[e,r]),P.useEffect(()=>l(!1),[e,f]);const a=`${Om(e)}?v=${f}`;return s?v.jsx(nn,{icon:mm,title:"The browser cannot show this file.",hint:"Its format is not one this browser plays or displays."}):v.jsxs("div",{className:"flex h-full items-center justify-center overflow-auto rounded border bg-muted/20 p-3",children:[i==="image"&&v.jsx("img",{src:a,alt:e,onError:()=>l(!0),className:"max-h-full max-w-full object-contain"}),i==="audio"&&v.jsx("audio",{controls:!0,src:a,onError:()=>l(!0),className:"w-full max-w-xl"},a),i==="video"&&v.jsx("video",{controls:!0,src:a,onError:()=>l(!0),className:"max-h-full max-w-full"},a)]})}function Ib(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const o8=1500,a8=1e3,zb="clauder-hub:file-blame";function l8(e){const i=Math.floor((Date.now()/1e3-e)/86400);if(i<1){const r=Math.floor((Date.now()/1e3-e)/3600);return r<1?"just now":`${r} hour${r>1?"s":""} ago`}return i<30?`${i} day${i>1?"s":""} ago`:new Date(e*1e3).toLocaleDateString()}const c8=e=>Xt.commit(e).then(i=>i.message);function u8({path:e}){const i=en(F=>F.drafts[e]),{put:r,drop:s}=en.getState(),l=ye(F=>F.ticks.files),[f,p]=P.useState(null),[a,h]=P.useState(null),[d,m]=P.useState(!1),[c,_]=P.useState(!1),[x,E]=P.useState(null),w=P.useRef(!1),g=P.useRef(null),b=P.useRef(0),S=P.useRef(0),y=rs(i),T=Wy(e),L=dL(e),[R,D]=P.useState("preview"),[A,j]=P.useState(null),[M,I]=P.useState(()=>{try{return localStorage.getItem(zb)==="1"}catch{return!1}}),B=()=>{const F=!M;I(F);try{localStorage.setItem(zb,F?"1":"0")}catch{}},H=i==null?void 0:i.mtimeMs;P.useEffect(()=>{if(H===void 0)return;let F=!1;return Xt.blame(e).then(V=>!F&&j(V),()=>!F&&j(null)),()=>{F=!0}},[e,H]);const U=P.useMemo(()=>A!=null&&A.available&&!y?{you:A.you,commits:A.commits,lines:A.lines,details:c8}:void 0,[A,y]),W=(()=>{if(!(A!=null&&A.available))return null;const F=Object.values(A.commits).filter(X=>!X.uncommitted),V=F.sort((X,$)=>$.time-X.time)[0],ne=new Set(F.map(X=>X.author)).size,le=Object.values(A.commits).some(X=>X.uncommitted);return{latest:V,authors:ne,uncommitted:le,you:A.you}})(),Y=P.useCallback((F=!1)=>{if(!F&&rs(en.getState().drafts[e])||Wy(e))return;const V=Lu();Xt.read(e).then(ne=>{if(Lu()===V){if(h(null),_(!1),E(null),ne.kind!=="text"){p({kind:ne.kind,size:ne.size}),s(e);return}p(null),r(e,{text:ne.content,base:ne.content,mtimeMs:ne.mtimeMs})}},ne=>h(ne.message))},[e,r,s]);P.useEffect(()=>Y(),[Y,l]);const Q=P.useCallback(async(F=!1,V=!1)=>{var X;const ne=en.getState().drafts[e];if(!ne||w.current)return;const le=Lu();m(!0),w.current=!0;try{const $=await Xt.write(e,ne.text,F?void 0:ne.mtimeMs);if(g.current=null,Lu()!==le)return;const oe=((X=en.getState().drafts[e])==null?void 0:X.text)??ne.text;r(e,{text:oe,base:ne.text,mtimeMs:$.mtimeMs}),_(!1),E(null),V||ye.getState().notify("Saved.")}catch($){$ instanceof CC&&$.status===409?_(!0):(g.current=ne.text,ye.getState().notify($.message,"error"))}finally{m(!1),w.current=!1}},[e,r]);P.useEffect(()=>{let F=!1;const V=async()=>{const le=en.getState().drafts[e];if(F||!le||w.current||document.hidden)return;const X=await Xt.stat(e).catch(()=>null);if(!X||F||w.current)return;const $=en.getState().drafts[e];if($){if(!X.exists){if(S.current===-1)return;E(oe=>(oe==null?void 0:oe.state)==="deleted"?oe:{state:"deleted",comparing:!1});return}if(X.mtimeMs!==$.mtimeMs){if(!rs($))return Y(!0);b.current=X.mtimeMs,X.mtimeMs!==S.current&&E(oe=>(oe==null?void 0:oe.state)==="changed"?oe:{state:"changed",comparing:!1})}}},ne=setInterval(()=>void V(),o8);return()=>{F=!0,clearInterval(ne)}},[e,Y]);const K=uy(F=>F.on);P.useEffect(()=>{if(!K||!y||c||x||(i==null?void 0:i.text)===g.current)return;const F=window.setTimeout(()=>void Q(!1,!0),a8);return()=>window.clearTimeout(F)},[K,y,c,x,i==null?void 0:i.text,Q]);const z=async()=>{const F=await Xt.read(e).catch(()=>null);(F==null?void 0:F.kind)==="text"&&E({state:"changed",content:F.content,comparing:!0})};P.useEffect(()=>{const F=V=>{(V.ctrlKey||V.metaKey)&&V.key.toLowerCase()==="s"&&(V.preventDefault(),rs(en.getState().drafts[e])&&Q())};return window.addEventListener("keydown",F,!0),()=>window.removeEventListener("keydown",F,!0)},[e,Q]),P.useEffect(()=>Bn.getState().show(e),[e]);const O=F=>{const V=en.getState().drafts[e];V&&r(e,{...V,text:F}),Bn.getState().pin(e)},G=e.split("/").pop()??e,Z=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"project root";return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("div",{className:"space-y-3 px-5 pb-3 pt-4",children:[v.jsx(Er,{group:"Files",title:G,description:Z,action:(T||i)&&v.jsxs(v.Fragment,{children:[L&&i&&v.jsxs(_e,{onClick:()=>D(R==="preview"?"code":"preview"),title:R==="preview"?"Edit the HTML":"Show the page",children:[R==="preview"?v.jsx(R3,{size:13}):v.jsx(rg,{size:13})," ",R==="preview"?"Code":"Preview"]}),(T||L)&&v.jsx("a",{href:Om(e),target:"_blank",rel:"noreferrer",title:"Open in a new browser tab",className:"inline-flex items-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(ma,{size:13})}),i&&v.jsxs(v.Fragment,{children:[y&&!K&&v.jsx("span",{className:"self-center text-[11px] text-severity-warning",children:"Unsaved, kept while this page is open"}),v.jsx(Fh,{label:"Auto save",title:"For every file: saves 1 second after you stop typing",checked:K,onCheckedChange:F=>{uy.getState().set(F),ye.getState().notify(F?"Auto save on: every file saves itself 1 second after you stop typing.":"Auto save off: save with the Save button or Ctrl+S.")},className:"mr-1"}),y&&v.jsx(_e,{onClick:()=>r(e,{...i,text:i.base}),children:"Discard"}),v.jsxs(_e,{variant:"primary",disabled:!y||d,onClick:()=>void Q(),title:"Save (Ctrl+S)",children:[v.jsx(K3,{size:13})," ",d?"Saving...":"Save"]})]})]})}),A&&v.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[v.jsx(j3,{size:13,className:"shrink-0"}),A.available?v.jsxs(v.Fragment,{children:[(W==null?void 0:W.latest)&&v.jsxs("span",{className:"min-w-0 truncate",title:W.latest.summary,children:["Last change: ",v.jsx("span",{className:"text-foreground",children:W.latest.author===W.you?"You":W.latest.author}),", ",l8(W.latest.time)," · ",W.latest.summary]}),v.jsxs("span",{children:[(W==null?void 0:W.authors)??0," author",(W==null?void 0:W.authors)===1?"":"s"]}),(W==null?void 0:W.uncommitted)&&v.jsx("span",{className:"text-severity-warning",children:"uncommitted changes"}),y&&v.jsx("span",{children:"blame hidden while editing"}),v.jsxs("button",{className:xe("ml-auto rounded px-1.5 py-0.5 transition-colors",M?"bg-primary/15 text-primary":"hover:bg-muted hover:text-foreground"),onClick:B,title:"Show who last changed every line",children:["File blame ",M?"on":"off"]})]}):v.jsx("span",{children:A.reason})]}),x&&!c&&v.jsxs("div",{className:"space-y-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"flex-1",children:x.state==="deleted"?"This file was deleted on disk. Your unsaved edits are still here.":"This file changed on disk while you were editing it. Your edits are kept; saving will ask before overwriting."}),x.state==="changed"&&v.jsx(_e,{onClick:()=>x.comparing?E({...x,comparing:!1}):void z(),children:x.comparing?"Hide changes":"Compare"}),x.state==="changed"&&v.jsx(_e,{onClick:()=>Y(!0),children:"Reload from disk"}),v.jsx(_e,{variant:"ghost",onClick:()=>{S.current=x.state==="deleted"?-1:b.current,E(null)},children:"Keep editing"})]}),x.comparing&&x.content!==void 0&&i&&v.jsx(fh,{before:x.content,after:i.text})]}),c&&v.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[v.jsx("span",{className:"flex-1",children:"This file changed on disk since it was opened. Overwrite it with your version, or reload it and lose your edits."}),v.jsx(_e,{variant:"primary",onClick:()=>void Q(!0),children:"Overwrite"}),v.jsx(_e,{onClick:()=>Y(!0),children:"Reload from disk"})]})]}),v.jsx("div",{className:"min-h-0 flex-1 px-5 pb-5",children:T?v.jsx(s8,{path:e,kind:T,tick:l}):a?v.jsx(nn,{icon:mm,title:a}):f?v.jsx(nn,{icon:mm,title:f.kind==="binary"?"A binary file":"Too large to open here",hint:f.kind==="binary"?`${Ib(f.size)}; it is not shown as text.`:`${Ib(f.size)}; files over 2 MB are not opened in the editor.`}):i?L&&R==="preview"?v.jsx("iframe",{title:G,src:`${Om(e)}?v=${i.mtimeMs}`,sandbox:"allow-scripts allow-forms allow-popups allow-modals",className:"h-full w-full rounded border bg-white"},i.mtimeMs):hL(e)?v.jsx(tc,{fill:!0,value:i.text,onChange:O,blame:U,fileBlame:M}):v.jsx("div",{className:"h-full overflow-hidden rounded border",children:v.jsx(EC,{path:e,value:i.text,onChange:O,blame:U,fileBlame:M})}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})})]})}function h8({value:e,onChange:i,categories:r,allowNone:s=!0}){return v.jsxs(ia,{value:e,onValueChange:i,children:[s&&v.jsx(Cn,{value:"",children:"None (stays open until you stop it)"}),v.jsx(Cn,{value:"auto",children:"Auto (Claude picks one)"}),r.map(l=>v.jsx(Cn,{value:l.name,children:l.name},l.id))]})}const d8={"claude-system":"Appended to Claude's system prompt","claude-typed":"Typed into the session",channel:"Sent to channels"};function f8(){const e=ut(()=>ve.prompts(),[]),[i,r]=P.useState("preview"),[s,l]=P.useState(!1),f=p=>{r(p),l(!0)};return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Settings",title:"Hub prompts",description:"Text the hub adds to sessions and sends to channels."})}),v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:xe("w-full shrink-0 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",s&&"hidden"),children:[v.jsx(Hb,{active:i==="preview",onClick:()=>f("preview"),children:"Preview what a session gets"}),["claude-system","claude-typed","channel"].map(p=>v.jsxs("div",{className:"mt-3",children:[v.jsx("div",{className:"px-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:d8[p]}),(e.data??[]).filter(a=>a.audience===p).map(a=>v.jsxs(Hb,{active:i===a.key,onClick:()=>f(a.key),children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.label}),a.overridden&&v.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-primary",title:"Edited"})]},a.key))]},p))]}),v.jsxs("div",{className:xe("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!s&&"hidden"),children:[v.jsx(Ig,{onClick:()=>l(!1)}),i==="preview"?v.jsx(m8,{}):e.data&&v.jsx(p8,{prompt:e.data.find(p=>p.key===i),onSaved:e.reload},i)]})]})]})}function Hb({active:e,onClick:i,children:r}){return v.jsxs("button",{onClick:i,className:xe("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs",e?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(wS,{size:12,className:"shrink-0"}),r]})}function p8({prompt:e,onSaved:i}){const r=pn(),[s,l]=P.useState(e.text),f=s!==e.text,p=()=>r({title:`Save "${e.label}"?`,description:"New sessions get the new text.",body:v.jsx(fh,{before:e.text,after:s}),confirmLabel:"Save",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,s),ye.getState().notify("Saved."),i()}}),a=()=>r({title:"Restore the default text?",description:"Your version is discarded.",body:v.jsx(fh,{before:e.text,after:e.defaultText}),confirmLabel:"Restore default",tone:"destructive",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,null),l(e.defaultText),i()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.label,e.overridden&&v.jsx(nt,{tone:"on",children:"edited"})]}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.overridden&&v.jsxs(_e,{variant:"ghost",onClick:()=>void a(),children:[v.jsx(X3,{size:12})," Restore default"]}),f&&v.jsx(_e,{onClick:()=>l(e.text),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!f,onClick:()=>void p(),children:"Review & save"})]})]}),e.placeholders.length>0&&v.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Placeholders:"," ",e.placeholders.map(h=>v.jsx("code",{className:"mr-1 rounded bg-muted px-1 font-mono",children:`{{${h}}}`},h))]}),v.jsx(tc,{rows:22,value:s,onChange:l})]})}function m8(){const[e,i]=P.useState(""),[r,s]=P.useState([]),l=ut(()=>ve.previewSystemPrompt(e),[],e);return P.useEffect(()=>{ve.categories().then(s)},[]),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-sm font-semibold",children:"What the hub appends to a session"}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Passed with --append-system-prompt-file, after Claude Code's own system prompt and your CLAUDE.md files, which still load as usual. Pick a category to see the done protocol a triggered run gets."})]}),v.jsx("div",{className:"w-full max-w-[18rem]",children:v.jsx(h8,{value:e,onChange:i,categories:r})}),l.data?v.jsx(tc,{rows:24,value:l.data.text}):v.jsx(nn,{variant:"inline",title:"Loading..."})]})}function P2(e){const[i,r]=P.useState(()=>window.matchMedia(e).matches);return P.useEffect(()=>{const s=window.matchMedia(e),l=()=>r(s.matches);return l(),s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),i}function ph(e,i,{min:r=200,max:s=720}={}){const l=P.useCallback(d=>Math.min(s,Math.max(r,Math.round(d))),[r,s]),[f,p]=P.useState(()=>{try{const d=Number(localStorage.getItem(e));return d?l(d):i}catch{return i}});P.useEffect(()=>{try{localStorage.setItem(e,String(f))}catch{}},[e,f]);const a=P.useCallback(d=>p(m=>l(m+d)),[l]),h=P.useCallback(()=>p(i),[i]);return{width:f,resizeBy:a,reset:h}}function Km({placeholder:e,disabled:i,onSend:r,value:s,onChange:l,autoFocus:f,className:p}){return v.jsx(qg,{rows:1,autoFocus:f,value:s,disabled:i,placeholder:`${e.replace(/\.\.\.$/,"")} (Enter to send)`,onChange:a=>l(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s.trim()&&r(s))},className:xe("min-h-[32px] flex-1 font-sans",p)})}const Qm=e=>`clauder-hub:answer:${e}`;function g8(e,i){const[r,s]=P.useState(()=>{try{const f=localStorage.getItem(Qm(e));return f?{...i,...JSON.parse(f)}:i}catch{return i}});return[r,f=>{s(f);try{localStorage.setItem(Qm(e),JSON.stringify(f))}catch{}}]}function v8(e){try{localStorage.removeItem(Qm(e))}catch{}}function _8(e){const i=e.findIndex(r=>/recommended/i.test(r.label));return i===-1?0:i}function x8({interactionId:e,questions:i,busy:r,onChoose:s,onReply:l}){const f=i.length>1,[p,a]=g8(e,{picks:{},otherOpen:{},others:{},free:""}),{picks:h,otherOpen:d,others:m,free:c}=p,_=w=>a({...p,...w}),x=w=>{const g=h[w];return!!(g&&("option"in g||g.other.trim()))},E=()=>i.map((w,g)=>{const b=h[g];return"option"in b?String(b.option+1):b.other.trim()}).join(`
542
- `);return v.jsxs("div",{className:"space-y-3",children:[i.map((w,g)=>{const b=_8(w.options),S=h[g];return v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx("span",{className:"mt-px grid h-5 w-5 shrink-0 place-items-center rounded-full bg-primary/15 text-[11px] font-semibold tabular-nums text-primary",children:g+1}),v.jsxs("div",{className:"min-w-0",children:[w.header&&v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:w.header}),v.jsx("div",{className:"break-words text-sm font-semibold leading-snug",children:w.question})]})]}),v.jsxs("div",{className:"space-y-1 pl-7",children:[w.options.map((y,T)=>{const L=!!(S&&"option"in S&&S.option===T);return v.jsxs("button",{disabled:r,onClick:()=>f?_({picks:{...h,[g]:{option:T}}}):s(T),className:xe("flex w-full items-start gap-2.5 rounded-md border px-3 py-1.5 text-left transition-colors hover:bg-muted disabled:opacity-50",T===b&&"border-primary",L&&"bg-primary/15"),children:[v.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:T+1}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"block text-xs font-medium",children:y.label}),y.description&&v.jsx("span",{className:"block text-[11px] text-muted-foreground",children:y.description})]})]},T)}),d[g]?v.jsx("div",{className:xe("rounded-md border px-2 py-1",S&&"other"in S&&"bg-primary/15"),children:v.jsx(Km,{autoFocus:!0,placeholder:"Your own answer",disabled:r,value:m[g]??"",onChange:y=>_({others:{...m,[g]:y},...f?{picks:{...h,[g]:{other:y}}}:{}}),onSend:y=>f?_({picks:{...h,[g]:{other:y}}}):l(y),className:"border-0 bg-transparent px-1 focus:ring-0"})}):v.jsxs("button",{disabled:r,onClick:()=>_({otherOpen:{...d,[g]:!0}}),className:"flex w-full items-center gap-2.5 rounded-md border border-dashed px-3 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:[v.jsx(Vi,{size:12,className:"shrink-0"})," Other, in your own words..."]})]})]},g)}),f&&v.jsxs("div",{className:"flex items-end gap-1.5",children:[v.jsx(Km,{placeholder:"Or answer all of it in your own words",disabled:r,value:c,onChange:w=>_({free:w}),onSend:w=>l(w)}),v.jsx(_e,{variant:"primary",disabled:r||!i.every((w,g)=>x(g)),onClick:()=>l(E()),children:"Send answers"})]})]})}function y8(e,i){P.useEffect(()=>{i||v8(e)},[e,i])}const b8={permission:{label:"Permission",icon:Z3},question:{label:"Question",icon:xS},turn:{label:"Waiting",icon:q3},mcp:{label:"MCP suggested",icon:Vl},done:{label:"Done",icon:_S}};function S8(e){var f,p;const i=e.answer;if(!i)return null;const r=e.presented,s={permission:{1:0,2:1,3:2},mcp:{install:0,skip:1}},l=e.kind==="question"?Number(i)-1:(f=s[e.kind])==null?void 0:f[i];return l!==void 0&&Number.isInteger(l)&&((p=r==null?void 0:r.choices[l])==null?void 0:p.label)||i}function Hl({interaction:e,showSession:i=!1,compact:r=!1,project:s}){var L,R;const l=ye(D=>D.sessions),f=ye(D=>D.go),p=D=>s?window.location.hash=`#/${encodeURIComponent(s.id)}/session/${D.id}`:f(D),[a,h]=P.useState(""),[d,m]=P.useState(!1),[c,_]=P.useState(!1),x=b8[e.kind],E=e.status==="open",w=l.find(D=>D.id===e.sessionId);y8(e.id,E);const g=e.presented??{kind:e.kind,sessionTitle:(w==null?void 0:w.title)??"",headline:e.title,choices:[],quickReplies:[],freeText:"Reply to the session...",details:e.body?{label:"Details",text:e.body,format:"markdown"}:void 0},b=async D=>{m(!0);const A=await rt(D,"Sent to the session.");m(!1),A&&h("")},S=D=>b(()=>s?ve.chooseIn(s.id,e.id,D.ref):ve.choose(e.id,D.ref)),y=D=>D.trim()&&b(()=>s?ve.answerIn(s.id,e.id,D):ve.answer(e.id,D)),T=async()=>{m(!0),await rt(()=>s?ve.dismissIn(s.id,e.id):ve.dismiss(e.id),"Dismissed."),m(!1)};return v.jsxs("div",{className:xe("card p-3",E&&"border-primary/60"),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nt,{tone:E?"warning":e.kind==="done"?"success":"off",icon:x.icon,children:x.label}),s&&v.jsx(nt,{tone:"off",children:s.name}),i&&v.jsx("button",{className:"min-w-0 truncate text-xs font-medium hover:underline",onClick:()=>p({kind:"session",id:e.sessionId}),children:(w==null?void 0:w.title)??(((L=e.presented)==null?void 0:L.sessionTitle)||e.sessionId.slice(0,8))}),v.jsx("span",{className:"ml-auto shrink-0 text-[11px] text-muted-foreground",children:va(e.createdAt)}),i&&v.jsxs(_e,{variant:"muted",className:"shrink-0",title:w!=null&&w.live?"Open the session's terminal":"Open the session (not running; resume it there)","aria-label":"Open the session's terminal",onClick:()=>p({kind:"session",id:e.sessionId}),children:[v.jsx(kS,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Terminal"})]}),E&&v.jsx(_e,{variant:"ghost",size:"icon",className:"shrink-0",disabled:d,title:"Dismiss (nothing is sent to the session)","aria-label":"Dismiss",onClick:()=>void T(),children:v.jsx(En,{size:13})})]}),v.jsx("div",{className:xe("mt-2 break-words text-sm font-medium",e.kind==="permission"&&"font-mono text-[13px]",r&&"line-clamp-2"),children:g.headline}),g.question&&!r&&v.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:g.question}),E&&!r&&v.jsx("div",{className:"mt-3 space-y-2.5",children:e.kind==="question"&&((R=g.questions)!=null&&R.length)?v.jsx(x8,{interactionId:e.id,questions:g.questions,busy:d,onChoose:D=>void S({ref:`o:${D}`}),onReply:D=>void y(D)}):v.jsxs(v.Fragment,{children:[g.choices.some(D=>D.description)?v.jsx("div",{className:"space-y-1",children:g.choices.map((D,A)=>v.jsxs("button",{disabled:d,onClick:()=>void S(D),className:xe("flex w-full items-start gap-2.5 rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted disabled:opacity-50",D.tone==="primary"&&"border-primary"),children:[v.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:A+1}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"block text-xs font-medium",children:D.label}),D.description&&v.jsx("span",{className:"block text-[11px] text-muted-foreground",children:D.description})]})]},D.ref))}):g.choices.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.choices.map(D=>v.jsx(_e,{variant:D.tone==="primary"?"primary":D.tone==="danger"?"destructive":"muted",disabled:d,onClick:()=>void S(D),children:D.label},D.ref))}),g.quickReplies.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.quickReplies.map(D=>v.jsx("button",{disabled:d,onClick:()=>void S(D),className:"rounded-full border px-2.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:D.label},D.ref))}),g.freeText&&v.jsx(Km,{placeholder:g.freeText,disabled:d,value:a,onChange:h,onSend:D=>void y(D)})]})}),g.details&&!r&&v.jsxs("div",{className:"mt-2",children:[v.jsxs("button",{className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>_(!c),children:[v.jsx(pa,{size:12,className:xe("transition-transform",c&&"rotate-90")}),g.details.label]}),c&&(g.details.format==="code"?v.jsx("pre",{className:"mt-1.5 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 font-mono text-[11px]",children:g.details.text}):v.jsx(pv,{className:"mt-1.5 max-h-72 overflow-auto rounded bg-muted/40 p-2 text-xs",children:g.details.text}))]}),!E&&e.status==="answered"&&v.jsxs("div",{className:"mt-2 break-words text-[11px] text-muted-foreground",children:[e.answeredBy,": ",v.jsx("span",{className:"text-foreground",children:S8(e)})]}),!E&&e.status==="closed"&&e.answeredBy&&e.kind!=="done"&&v.jsxs("div",{className:"mt-2 text-[11px] text-muted-foreground",children:["Closed (",e.answeredBy,")."]})]})}function w8({size:e=18,className:i}){return v.jsxs("svg",{viewBox:"0 18 48 30",width:e,height:e*30/48,className:i,role:"img","aria-label":"Clauder Hub",children:[v.jsx("rect",{width:"36",height:"24",x:"6",y:"18",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"9",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"15",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"30",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"36",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"7.5",height:"6",y:"33",fill:"#d77757"}),v.jsx("rect",{width:"7.5",height:"6",x:"40.5",y:"33",fill:"#d77757"}),v.jsx("rect",{width:"9",height:"9",x:"12",y:"24"}),v.jsx("rect",{width:"9",height:"9",x:"27",y:"24"}),v.jsx("rect",{width:"3",height:"6",x:"22.5",y:"22.5",transform:"rotate(90 24 25.5)"}),v.jsx("rect",{width:"3",height:"7",x:"37",y:"22",transform:"rotate(90 38.5 25.5)"}),v.jsx("rect",{width:"3",height:"7",x:"8",y:"22",transform:"rotate(90 9.5 25.5)"})]})}function C8({temp:e,choice:i}){const[r,s]=P.useState(i.current);return v.jsxs("div",{className:"space-y-0.5 rounded-md border px-2.5 py-2",children:[v.jsx(Fh,{label:`Also clear its Claude temp folder (${hg(e.bytes)})`,checked:r,onCheckedChange:l=>{i.current=l,s(l)}}),v.jsx("div",{className:"truncate pl-6 font-mono text-[10px] text-muted-foreground",title:e.path,children:e.path})]})}function Uh(e){const{view:i,sessions:r,go:s}=ye.getState();if(i.kind!=="session"||!e.includes(i.id))return;const l=r.filter(h=>h.live||h.id===i.id),f=l.findIndex(h=>h.id===i.id),p=h=>!e.includes(h.id),a=l.slice(0,Math.max(f,0)).reverse().find(p)??l.slice(f+1).find(p);a&&s({kind:"session",id:a.id})}function $h(){const e=pn(),i=P.useRef(""),r=P.useRef(!0),s=a=>!a||a===ye.getState().projectId;return{rename:(a,h)=>(i.current=a.title,e({title:"Rename session",description:"Also shown in Claude Code's /resume.",body:v.jsx(pi,{autoFocus:!0,size:"md",defaultValue:a.title,onChange:d=>i.current=d.target.value,onFocus:d=>d.target.select()}),confirmLabel:"Rename",run:async()=>{await ve.renameSession(a.id,i.current,s(h)?void 0:h),s(h)&&await ye.getState().refreshSessions()}})),remove:async a=>{const h=await ve.deletionPlan(a.id).catch(m=>(ye.getState().notify(m.message,"error"),null));if(!h)return!1;r.current=!0;const d=await e({title:`Delete "${a.title}" permanently?`,description:a.live?"It is running and will be stopped first. This cannot be undone.":"Removed from ~/.claude. This cannot be undone.",body:v.jsxs("div",{className:"space-y-2 text-xs",children:[h.files.length?v.jsx("div",{className:"divide-y rounded-md border",children:h.files.map(m=>v.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate font-mono text-[11px]",title:m.path,children:m.path}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:m.what})]}),v.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:hg(m.bytes)})]},m.path))}):v.jsx("div",{className:"text-muted-foreground",children:"No files on disk; only the hub's own record of it goes."}),h.temp&&v.jsx(C8,{temp:h.temp,choice:r}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Also removed: its interactions and MCP suggestions in the hub. Kept: your prompt history (~/.claude/history.jsonl), which every project shares."})]}),confirmLabel:"Delete permanently",tone:"destructive",maxWidth:"max-w-xl",run:async()=>{await ve.deleteSession(a.id,r.current),await ye.getState().refreshSessions(),ye.getState().notify("Deleted.")}});if(d){const{view:m,go:c}=ye.getState();m.kind==="session"&&m.id===a.id&&c({kind:"page",page:"overview"})}return d},stop:(a,h)=>e({title:`Stop "${a.title}"?`,description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(a.id,s(h)?void 0:h),s(h)&&Uh([a.id])}})}}let I2=null;const E8=fetch("/api/file-icons/manifest").then(e=>e.ok?e.json():null).then(e=>I2=e).catch(()=>null);function k8(e,i,r,s){const l=i.toLowerCase(),f=(h,d)=>Object.hasOwn(h,d)?h[d]:void 0;if(r)return f(s?e.folderNamesExpanded:e.folderNames,l)??(s?e.folderExpanded:e.folder);const p=f(e.fileNames,l);if(p)return p;const a=l.split(".");for(let h=1;h<a.length;h++){const d=f(e.fileExtensions,a.slice(h).join("."));if(d)return d}return e.file}function z2({name:e,folder:i=!1,open:r=!1,size:s=14,className:l}){const[f,p]=P.useState(I2);if(P.useEffect(()=>{f||E8.then(a=>a&&p(a))},[f]),!f){const a=i?r?ca:og:sg;return v.jsx(a,{size:s-1,className:xe("shrink-0",l)})}return v.jsx("img",{src:`/api/file-icons/${k8(f,e,i,r)}.svg`,alt:"",width:s,height:s,draggable:!1,className:xe("shrink-0",l)})}var T8=Object.defineProperty,Ut=(e,i)=>T8(e,"name",{value:i,configurable:!0}),[_v,uB]=br("Tooltip",[Sa]),qh=Sa(),R8="TooltipProvider",A8=700,Zm="tooltip.open",[L8,xv]=_v(R8),D8=Ut(e=>{const{__scopeTooltip:i,delayDuration:r=A8,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:f}=e,p=P.useRef(!0),a=P.useRef(!1),h=P.useRef(0);return P.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),v.jsx(L8,{scope:i,isOpenDelayedRef:p,delayDuration:r,onOpen:P.useCallback(()=>{s<=0||(window.clearTimeout(h.current),p.current=!1)},[s]),onClose:P.useCallback(()=>{s<=0||(window.clearTimeout(h.current),h.current=window.setTimeout(()=>p.current=!0,s))},[s]),isPointerInTransitRef:a,onPointerInTransitChange:P.useCallback(d=>{a.current=d},[]),disableHoverableContent:l,children:f})},"TooltipProvider"),Jm="Tooltip",[M8,nc]=_v(Jm),j8=Ut(e=>{const{__scopeTooltip:i,children:r,open:s,defaultOpen:l,onOpenChange:f,disableHoverableContent:p,delayDuration:a}=e,h=xv(Jm,e.__scopeTooltip),d=qh(i),[m,c]=P.useState(null),[_,x]=P.useState(void 0),E=Fi(),w=P.useRef(0),g=p??h.disableHoverableContent,b=a??h.delayDuration,S=P.useRef(!1),[y,T]=Ws({prop:s,defaultProp:l??!1,onChange:Ut(M=>{M?(h.onOpen(),document.dispatchEvent(new CustomEvent(Zm))):h.onClose(),f==null||f(M)},"onChange"),caller:Jm}),L=P.useMemo(()=>y?S.current?"delayed-open":"instant-open":"closed",[y]),R=P.useCallback(()=>{window.clearTimeout(w.current),w.current=0,S.current=!1,T(!0)},[T]),D=P.useCallback(()=>{window.clearTimeout(w.current),w.current=0,T(!1)},[T]),A=P.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{S.current=!0,T(!0),w.current=0},b)},[b,T]);P.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]);const j=_??E;return v.jsx(Dg,{...d,children:v.jsx(M8,{scope:i,contentId:j,setContentId:x,open:y,stateAttribute:L,trigger:m,onTriggerChange:c,onTriggerEnter:P.useCallback(()=>{h.isOpenDelayedRef.current?A():R()},[h.isOpenDelayedRef,A,R]),onTriggerLeave:P.useCallback(()=>{g?D():(window.clearTimeout(w.current),w.current=0)},[D,g]),onOpen:R,onClose:D,disableHoverableContent:g,children:r})})},"Tooltip"),Fb="TooltipTrigger",O8=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,"aria-describedby":l,...f}=i,p=nc(Fb,s),a=xv(Fb,s),h=qh(s),d=P.useRef(null),m=ht(r,d,p.onTriggerChange),c=P.useRef(!1),_=P.useRef(!1),x=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),v.jsx(Mg,{asChild:!0,...h,children:v.jsx(wt.button,{"aria-describedby":p.open?Y2(l,p.contentId):l,"data-state":p.stateAttribute,...f,ref:m,onPointerMove:tt(i.onPointerMove,E=>{E.pointerType!=="touch"&&!_.current&&!a.isPointerInTransitRef.current&&(p.onTriggerEnter(),_.current=!0)}),onPointerLeave:tt(i.onPointerLeave,()=>{p.onTriggerLeave(),_.current=!1}),onPointerDown:tt(i.onPointerDown,()=>{p.open&&p.onClose(),c.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:tt(i.onFocus,()=>{c.current||p.onOpen()}),onBlur:tt(i.onBlur,p.onClose),onClick:tt(i.onClick,p.onClose)})})},"TooltipTrigger")),H2="TooltipPortal",[N8,B8]=_v(H2,{forceMount:void 0}),P8=Ut(e=>{const{__scopeTooltip:i,forceMount:r,children:s,container:l}=e,f=nc(H2,i);return v.jsx(N8,{scope:i,forceMount:r,children:v.jsx(Sr,{present:r||f.open,children:v.jsx(wh,{asChild:!0,container:l,children:s})})})},"TooltipPortal"),Fl="TooltipContent",I8=P.forwardRef(Ut(function(i,r){const s=B8(Fl,i.__scopeTooltip),{forceMount:l=s.forceMount,side:f="top",...p}=i,a=nc(Fl,i.__scopeTooltip);return v.jsx(Sr,{present:l||a.open,children:a.disableHoverableContent?v.jsx(F2,{side:f,...p,ref:r}):v.jsx(z8,{side:f,...p,ref:r})})},"TooltipContent")),z8=P.forwardRef(Ut(function(i,r){const s=nc(Fl,i.__scopeTooltip),l=xv(Fl,i.__scopeTooltip),f=P.useRef(null),p=ht(r,f),[a,h]=P.useState(null),{trigger:d,onClose:m}=s,c=f.current,{onPointerInTransitChange:_}=l,x=P.useCallback(()=>{h(null),_(!1)},[_]),E=P.useCallback((w,g)=>{const b=w.currentTarget,S={x:w.clientX,y:w.clientY},y=U2(S,b.getBoundingClientRect()),T=$2(S,y),L=q2(g.getBoundingClientRect()),R=W2([...T,...L]);h(R),_(!0)},[_]);return P.useEffect(()=>()=>x(),[x]),P.useEffect(()=>{if(d&&c){const w=Ut(b=>E(b,c),"handleTriggerLeave"),g=Ut(b=>E(b,d),"handleContentLeave");return d.addEventListener("pointerleave",w),c.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",w),c.removeEventListener("pointerleave",g)}}},[d,c,E,x]),P.useEffect(()=>{if(a){const w=Ut(g=>{const b=g.target,S={x:g.clientX,y:g.clientY},y=(d==null?void 0:d.contains(b))||(c==null?void 0:c.contains(b)),T=!V2(S,a);y?x():T&&(x(),m())},"handleTrackPointerGrace");return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,c,a,m,x]),v.jsx(F2,{...i,ref:p})},"TooltipContentHoverable")),H8=XS("TooltipContent"),F2=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,children:l,"aria-label":f,id:p,onEscapeKeyDown:a,onPointerDownOutside:h,...d}=i,m=nc(Fl,s),c=qh(s),{onClose:_}=m,[x,E]=P.useState(null),w=ht(r,E);xg(x),P.useEffect(()=>(document.addEventListener(Zm,_),()=>document.removeEventListener(Zm,_)),[_]),P.useEffect(()=>{if(m.trigger){const b=Ut(S=>{S.target instanceof Node&&S.target.contains(m.trigger)&&_()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[m.trigger,_]);const{setContentId:g}=m;return $t(()=>(g(p),()=>{g(void 0)}),[p,g]),v.jsx(Sh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:h,onFocusOutside:b=>b.preventDefault(),onDismiss:_,children:v.jsxs(jg,{"data-state":m.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:m.contentId,...c,...d,ref:w,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(H8,{children:l}),f?v.jsx(T6,{id:m.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),F8=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,...l}=i,f=qh(s);return v.jsx(qA,{...f,...l,ref:r})},"TooltipArrow"));function U2(e,i){const r=Math.abs(i.top-e.y),s=Math.abs(i.bottom-e.y),l=Math.abs(i.right-e.x),f=Math.abs(i.left-e.x);switch(Math.min(r,s,l,f)){case f:return"left";case l:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}Ut(U2,"getExitSideFromRect");function $2(e,i,r=5){const s=[];switch(i){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}Ut($2,"getPaddedExitPoints");function q2(e){const{top:i,right:r,bottom:s,left:l}=e;return[{x:l,y:i},{x:r,y:i},{x:r,y:s},{x:l,y:s}]}Ut(q2,"getPointsFromRect");function V2(e,i){const{x:r,y:s}=e;let l=!1;for(let f=0,p=i.length-1;f<i.length;p=f++){const a=i[f],h=i[p],d=a.x,m=a.y,c=h.x,_=h.y;m>s!=_>s&&r<(c-d)*(s-m)/(_-m)+d&&(l=!l)}return l}Ut(V2,"isPointInPolygon");function W2(e){const i=e.slice();return i.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),G2(i)}Ut(W2,"getHull");function G2(e){if(e.length<=1)return e.slice();const i=[];for(let s=0;s<e.length;s++){const l=e[s];for(;i.length>=2;){const f=i[i.length-1],p=i[i.length-2];if((f.x-p.x)*(l.y-p.y)>=(f.y-p.y)*(l.x-p.x))i.pop();else break}i.push(l)}i.pop();const r=[];for(let s=e.length-1;s>=0;s--){const l=e[s];for(;r.length>=2;){const f=r[r.length-1],p=r[r.length-2];if((f.x-p.x)*(l.y-p.y)>=(f.y-p.y)*(l.x-p.x))r.pop();else break}r.push(l)}return r.pop(),i.length===1&&r.length===1&&i[0].x===r[0].x&&i[0].y===r[0].y?i:i.concat(r)}Ut(G2,"getHullPresorted");function Y2(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Ut(Y2,"concatAriaDescribedby");function ur({content:e,children:i,side:r="top",asChild:s=!1,className:l,wide:f}){return e?v.jsx(D8,{delayDuration:300,children:v.jsxs(j8,{children:[v.jsx(O8,{asChild:!0,children:s?i:v.jsx("span",{className:xe("inline-flex",l),children:i})}),v.jsx(P8,{children:v.jsxs(I8,{side:r,sideOffset:6,collisionPadding:8,className:xe("z-[100] rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95 dark:bg-secondary dark:text-foreground",f?"max-w-md":"max-w-xs"),children:[e,v.jsx(F8,{className:"fill-foreground dark:fill-secondary"})]})})]})}):v.jsx(v.Fragment,{children:i})}const Ub=()=>`clauder-hub:files-expanded:${ye.getState().projectId}`,$b="clauder-hub:files-show-ignored",X2=P.createContext(null),Vh=()=>P.useContext(X2);function qb(e,i){try{const r=localStorage.getItem(e);return r===null?i:JSON.parse(r)}catch{return i}}function Vb(e,i){try{localStorage.setItem(e,JSON.stringify(i))}catch{}}const K2=(e,i)=>e?`${e}/${i}`:i,Q2=e=>e.includes("/")?e.slice(0,e.lastIndexOf("/")):"";async function eg(e,i,r){const s=dr.getState().item;if(!s)return;if(s.mode==="copy"){await rt(()=>Xt.copy(s.path,e))&&e&&r(e);return}const l=s.path.split("/").pop()??s.path,f=K2(e,l);if(f===s.path)return dr.getState().set(null);const p=await rt(()=>Xt.rename(s.path,f));if(!p)return;dr.getState().set(null),en.getState().move(s.path,p.path),Bn.getState().rename(s.path,p.path),e&&r(e);const a=ye.getState().view;a.kind==="file"&&(a.path===s.path||a.path.startsWith(`${s.path}/`))&&i({kind:"file",path:p.path+a.path.slice(s.path.length)})}function U8(){const[e,i]=P.useState(()=>qb($b,!1)),[r,s]=P.useState(()=>new Set(qb(Ub(),[]))),[l,f]=P.useState(0),[p,a]=P.useState(null),[h,d]=P.useState(null),m=dr(g=>g.item),c=ye(g=>g.go);P.useEffect(()=>Vb(Ub(),[...r]),[r]),P.useEffect(()=>{const g=()=>f(b=>b+1);return window.addEventListener("focus",g),()=>window.removeEventListener("focus",g)},[]);const _=(g,b)=>s(S=>{const y=new Set(S);return b??!y.has(g)?y.add(g):y.delete(g),y}),x={showIgnored:e,epoch:l,expanded:r,toggle:_,editing:p,setEditing:a,openMenu:(g,b,S)=>d({entry:g,x:b,y:S})},E=ye(g=>{var b;return((b=g.health)==null?void 0:b.project)??"Project"}),w=g=>{g.defaultPrevented||(g.preventDefault(),d({entry:{name:E,path:"",kind:"dir",size:0,ignored:!1},x:g.clientX,y:g.clientY}))};return v.jsxs(X2.Provider,{value:x,children:[v.jsxs("div",{className:"flex min-h-full flex-col",onContextMenu:w,children:[v.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-0.5 bg-background px-3 pb-1",children:[v.jsx("div",{className:"flex-1 text-[10px] text-muted-foreground",children:"Project files"}),v.jsx(ur,{content:"New file",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"New file",onClick:()=>a({kind:"file",parent:""}),children:v.jsx(pm,{size:13})})}),v.jsx(ur,{content:"New folder",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"New folder",onClick:()=>a({kind:"folder",parent:""}),children:v.jsx(gm,{size:13})})}),v.jsx(ur,{content:e?"Hide ignored":"Show ignored",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Show ignored","aria-pressed":e,className:xe(e&&"bg-muted text-foreground"),onClick:()=>{i(!e),Vb($b,!e)},children:e?v.jsx(rg,{size:13}):v.jsx(D3,{size:13})})}),m&&v.jsx(ur,{content:`Paste ${m.path.split("/").pop()} into the project root`,asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Paste into the project root",onClick:()=>void eg("",c,g=>_(g,!0)),children:v.jsx(fm,{size:13})})}),v.jsx(ur,{content:"Refresh",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Refresh",onClick:()=>f(l+1),children:v.jsx(yh,{size:13})})})]}),v.jsx("div",{className:"flex-1 px-2",children:v.jsx(Z2,{path:"",depth:0})})]}),h&&v.jsx(q8,{...h,onClose:()=>d(null)})]})}function Z2({path:e,depth:i}){const{showIgnored:r,epoch:s,editing:l}=Vh(),{data:f,error:p}=ut(()=>Xt.list(e,r),["files","sessions"],[e,r,s]),a=l&&l.kind!=="rename"&&l.parent===e?l.kind:null,h={paddingLeft:`${i*12+8}px`};return v.jsxs(v.Fragment,{children:[a&&v.jsx(J2,{depth:i,icon:a==="folder"?og:sg,initial:""}),p&&v.jsx("div",{className:"py-1 text-[11px] text-severity-critical",style:h,children:p}),!f&&!p&&v.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:h,children:"Loading..."}),f&&!f.entries.length&&!a&&v.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:h,children:"Empty"}),f==null?void 0:f.entries.map(d=>v.jsx($8,{entry:d,depth:i},d.path))]})}function $8({entry:e,depth:i}){const{expanded:r,toggle:s,editing:l,openMenu:f}=Vh(),p=ye(x=>x.go),a=ye(x=>x.view.kind==="file"&&x.view.path===e.path),h=en(x=>rs(x.drafts[e.path])),d=dr(x=>{var E;return((E=x.item)==null?void 0:E.mode)==="cut"&&x.item.path===e.path}),m=e.kind==="dir"&&r.has(e.path),c=P.useRef({fired:!1}),_=()=>window.clearTimeout(c.current.timer);return(l==null?void 0:l.kind)==="rename"&&l.entry.path===e.path?v.jsx(J2,{depth:i,icon:e.kind==="dir"?og:sg,initial:e.name}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>{c.current.fired||(e.kind==="dir"?s(e.path):p({kind:"file",path:e.path}))},onDoubleClick:()=>e.kind==="file"&&Bn.getState().pin(e.path),onContextMenu:x=>{x.preventDefault(),f(e,x.clientX,x.clientY)},onPointerDown:x=>{if(c.current.fired=!1,x.pointerType!=="touch")return;const{clientX:E,clientY:w}=x;window.clearTimeout(c.current.timer),c.current.timer=window.setTimeout(()=>{c.current.fired=!0,f(e,E,w)},500)},onPointerUp:_,onPointerLeave:_,onPointerCancel:_,title:e.path,className:xe("flex w-full select-none items-center gap-1.5 rounded-md py-1 pr-8 text-left text-xs transition-colors [-webkit-touch-callout:none] md:pr-2",a?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground",e.ignored&&"opacity-55",d&&"opacity-45"),style:{paddingLeft:`${i*12+4}px`},children:[e.kind==="dir"?m?v.jsx(ql,{size:11,className:"shrink-0"}):v.jsx(pa,{size:11,className:"shrink-0"}):v.jsx("span",{className:"w-[11px] shrink-0"}),v.jsx(z2,{name:e.name,folder:e.kind==="dir",open:m}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name}),h&&v.jsx("span",{title:"Unsaved changes",className:"h-1.5 w-1.5 shrink-0 rounded-full bg-severity-warning"})]}),v.jsx("button",{"aria-label":"File actions",title:"File actions",onClick:x=>{const E=x.currentTarget.getBoundingClientRect();f(e,E.right-192,E.bottom+4)},className:"absolute right-1 top-0.5 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:v.jsx(yS,{size:13})})]}),m&&v.jsx(Z2,{path:e.path,depth:i+1})]})}function J2({depth:e,icon:i,initial:r}){const{editing:s,setEditing:l,toggle:f}=Vh(),p=ye(c=>c.go),[a,h]=P.useState(r),d=P.useRef(!1),m=async()=>{const c=a.trim();if(d.current)return;if(!s||!c)return l(null);if(s.kind==="rename"&&/[\\/]/.test(c)){ye.getState().notify("A name cannot contain / or \\. To move it, use Cut and Paste.","error");return}const _=s.kind==="rename"?Q2(s.entry.path):s.parent,x=c.startsWith("/")?c.replace(/^\/+/,""):K2(_,c);if(d.current=!0,s.kind==="rename"){const E=s.entry.path;if(x===E)return l(null);const w=await rt(()=>Xt.rename(E,x));if(d.current=!1,!w)return;en.getState().move(E,w.path),Bn.getState().rename(E,w.path);const g=ye.getState().view;g.kind==="file"&&(g.path===E||g.path.startsWith(`${E}/`))&&p({kind:"file",path:w.path+g.path.slice(E.length)})}else{const E=await rt(()=>s.kind==="folder"?Xt.mkdir(x):Xt.create(x));if(d.current=!1,!E)return;s.kind==="file"?p({kind:"file",path:E.path}):f(E.path,!0)}l(null)};return v.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-2",style:{paddingLeft:`${e*12+19}px`},children:[v.jsx(i,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("input",{autoFocus:!0,value:a,onChange:c=>h(c.target.value),onFocus:c=>{const _=r.lastIndexOf(".");c.currentTarget.setSelectionRange(0,_>0?_:r.length)},onKeyDown:c=>{c.key==="Enter"&&m(),c.key==="Escape"&&l(null)},onBlur:()=>!d.current&&l(null),placeholder:(s==null?void 0:s.kind)==="folder"?"Folder name":"File name",spellCheck:!1,className:"min-w-0 flex-1 rounded border border-primary/60 bg-background px-1.5 py-0.5 text-xs focus:outline-none"})]})}function q8({entry:e,x:i,y:r,onClose:s}){const{setEditing:l,toggle:f}=Vh(),p=ye(g=>g.go),a=ye(g=>{var b;return((b=g.health)==null?void 0:b.projectRoot)??""}),h=dr(g=>g.item),d=a.includes("\\"),m=e.path==="",c=m?a:a?d?`${a}\\${e.path.replace(/\//g,"\\")}`:`${a}/${e.path}`:e.path,_=(g,b)=>{var S;return void((S=navigator.clipboard)==null?void 0:S.writeText(g).then(()=>ye.getState().notify(`Copied the ${b}.`),()=>ye.getState().notify("The browser did not allow copying.","error")))};P.useEffect(()=>{const g=()=>s(),b=S=>S.key==="Escape"&&s();return window.addEventListener("pointerdown",g),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),window.addEventListener("keydown",b),()=>{window.removeEventListener("pointerdown",g),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),window.removeEventListener("keydown",b)}},[s]);const x=async()=>{if(!await rt(()=>Xt.remove(e.path),`Deleted ${e.name}.`))return;const{drafts:b,drop:S}=en.getState();for(const R of Object.keys(b))(R===e.path||R.startsWith(`${e.path}/`))&&S(R);const y=ye.getState().view,T=y.kind==="file"?y.path:null,L=Bn.getState().close(V4(e.path),T);T&&L!==T?p(L?{kind:"file",path:L}:{kind:"page",page:"overview"}):y.kind==="file"&&(y.path===e.path||y.path.startsWith(`${e.path}/`))&&p({kind:"page",page:"overview"})},E=(g,b,S,y=!1)=>{const T=b;return v.jsxs("button",{onPointerDown:L=>{L.stopPropagation(),s(),window.setTimeout(S)},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",y?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(T,{size:13}),g]})},w=g=>()=>{f(e.path,!0),l({kind:g,parent:e.path})};return m?v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-220))},onPointerDown:g=>g.stopPropagation(),children:[E("New file",pm,()=>l({kind:"file",parent:""})),E("New folder",gm,()=>l({kind:"folder",parent:""})),h&&E("Paste",fm,()=>void eg("",p,g=>f(g,!0))),v.jsx("div",{className:"my-1 border-t"}),E("Copy Path",Rl,()=>_(c,"path")),E("Reveal in File Explorer",ca,()=>void rt(()=>Xt.reveal("")))]}):v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-380))},onPointerDown:g=>g.stopPropagation(),children:[e.kind==="file"?v.jsxs(v.Fragment,{children:[E("Open",Ul,()=>p({kind:"file",path:e.path})),E("Open in new window",ma,()=>dg({kind:"file",path:e.path}))]}):v.jsxs(v.Fragment,{children:[E("New file",pm,w("file")),E("New folder",gm,w("folder"))]}),v.jsx("div",{className:"my-1 border-t"}),E("Cut",Q3,()=>dr.getState().set({mode:"cut",path:e.path})),E("Copy",xh,()=>{dr.getState().set({mode:"copy",path:e.path}),rt(()=>Xt.copyToClipboard(e.path),"Copied: paste it here, or with Ctrl+V in Slack, Teams or a mail.")}),h&&E(`Paste${e.kind==="dir"?" into folder":" here"}`,fm,()=>void eg(e.kind==="dir"?e.path:Q2(e.path),p,g=>f(g,!0))),v.jsx("div",{className:"my-1 border-t"}),E("Copy Path",Rl,()=>_(c,"path")),E("Copy Relative Path",Rl,()=>_(e.path,"relative path")),E("Reveal in File Explorer",ca,()=>void rt(()=>Xt.reveal(e.path))),v.jsx("div",{className:"my-1 border-t"}),E("Rename",Vi,()=>l({kind:"rename",entry:e})),v.jsx("div",{className:"my-1 border-t"}),E("Delete",yr,()=>void x(),!0)]})}const Wb=[{id:"operation",label:"Operation",items:[{page:"overview",label:"Overview",icon:z3},{page:"inbox",label:"Inbox",icon:ls},{page:"automation",label:"Automation",icon:_h}]},{id:"project",label:"Project",items:[{page:"instructions",label:"Instructions",icon:k3},{page:"agents",label:"Agents",icon:mS},{page:"skills",label:"Skills",icon:cg},{page:"commands",label:"Commands",icon:A3},{page:"mcp-servers",label:"MCP servers",icon:Vl},{page:"hooks",label:"Hooks",icon:LS},{page:"plugins",label:"Plugins",icon:Y3}]},{id:"settings",label:"Settings",items:[{page:"claude-settings",label:"Claude settings",icon:J3},{page:"channels",label:"Channels",icon:Wl},{page:"hub-prompts",label:"Hub prompts",icon:wS},{page:"mcp-suggestions",label:"MCP suggestions",icon:G3},{page:"presets",label:"Toolset presets",icon:ag},{page:"categories",label:"Task categories",icon:RS}]}];function Wh({session:e}){const i=e.status==="waiting"?"bg-severity-warning animate-status-pulse":e.status==="running"?"bg-success animate-status-pulse":e.status==="done"?"border border-success bg-transparent":"bg-muted-foreground/40";return v.jsx("span",{className:xe("inline-block h-2 w-2 shrink-0 rounded-full",i)})}const V8={manual:"hub",cron:"cron",webhook:"webhook",queue:"queue",external:"terminal"},Gb="clauder-hub:folded-groups",Yb="clauder-hub:sidebar-tab",W8="clauder-hub:history-hide-tasks",tg="clauder:focus-sessions";function G8(e,i){const[r,s]=P.useState(()=>{try{const f=localStorage.getItem(e);return f===null?i:f==="1"}catch{return i}});return[r,f=>{s(f);try{localStorage.setItem(e,f?"1":"0")}catch{}}]}function Y8(){const[e,i]=P.useState(()=>{try{const s=localStorage.getItem(Yb);return s==="workspace"||s==="files"?s:"sessions"}catch{return"sessions"}});return[e,s=>{i(s);try{localStorage.setItem(Yb,s)}catch{}}]}function X8(){const[e,i]=P.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem(Gb)??"[]"))}catch{return new Set}});return P.useEffect(()=>{try{localStorage.setItem(Gb,JSON.stringify([...e]))}catch{}},[e]),[e,s=>i(l=>{const f=new Set(l);return f.has(s)?f.delete(s):f.add(s),f})]}function e5(e){const i=ye(f=>f.go),[r,s]=P.useState(!1);return{starting:r,newSession:async()=>{if(r)return;s(!0);const f=Math.max(80,Math.floor((window.innerWidth-e-40)/7.8)),p=Math.max(24,Math.floor((window.innerHeight-140)/17)),a=await rt(()=>ve.startSession({cols:f,rows:p}));s(!1),a&&(await ye.getState().refreshSessions(),i({kind:"session",id:a.sessionId}))}}}const K8=[{kind:"hub",label:"Hub task",icon:Gl},{kind:"create-job",label:"Create a job",icon:_h},{kind:"queue-run",label:"Queue a run",icon:ua},{kind:"create-category",label:"New task category",icon:RS},{kind:"create-preset",label:"New toolset preset",icon:ag},{kind:"create-channel",label:"Add a channel",icon:Wl}];function t5({beside:e,size:i="sm",full:r=!1}){const{starting:s,newSession:l}=e5(e),{starting:f,start:p}=Qs(),[a,h]=P.useState(!1),d=s||f,m=c=>{h(!1),c()};return v.jsxs("div",{className:xe("flex",r&&"w-full"),children:[v.jsxs(_e,{variant:"primary",size:i,className:"flex-1 rounded-r-none",disabled:d,onClick:()=>void l(),"aria-label":"New session",children:[v.jsx(Qn,{size:i==="md"?14:13})," ",d?"Starting...":"New session"]}),v.jsxs(Pg,{open:a,onOpenChange:h,align:"end",className:"w-56 p-1",trigger:v.jsx(_e,{variant:"primary",size:i,className:"rounded-l-none border-l border-primary-foreground/25 px-2",disabled:d,"aria-label":"More ways to start",title:"Plain session or hub task",children:v.jsx(ql,{size:14})}),children:[v.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>m(l),children:[v.jsx(Qn,{size:13})," New session"]}),v.jsx("div",{className:"mx-2 mb-0.5 mt-1.5 border-t pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub task"}),K8.map(c=>v.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>m(()=>p(c.kind)),children:[v.jsx(c.icon,{size:13,className:"text-primary"})," ",c.label]},c.kind))]})]})}function Q8({onMenu:e}){const i=ye(r=>r.health);return v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[v.jsx(_e,{variant:"ghost",size:"icon",onClick:e,"aria-label":"Open menu",title:"Menu",children:v.jsx(SS,{size:16})}),v.jsx(da,{}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(Yh,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:(i==null?void 0:i.project)??"..."}),v.jsx(yv,{})]})]}),v.jsx(t5,{beside:0})]})}function Xb({width:e,collapsed:i,onToggle:r,drawer:s=!1}){const{sessions:l,open:f,view:p,go:a,health:h}=ye(),[d,m]=P.useState(""),[c,_]=X8(),[x,E]=Y8(),{starting:w,newSession:g}=e5(s?0:i?48:Number(e)),b=P.useMemo(()=>{const I=d.trim().toLowerCase();return I?l.filter(B=>`${B.title} ${B.firstPrompt??""} ${B.id}`.toLowerCase().includes(I)):l},[l,d]),S=b.filter(I=>I.live),y=b.filter(I=>!I.live),[T,L]=G8(W8,!0),R=T?y.filter(I=>!I.purpose):y,[D,A]=P.useState(0),j=P.useRef(null);P.useEffect(()=>{const I=()=>{E("sessions"),A(B=>B+1),window.setTimeout(()=>{var B;return(B=j.current)==null?void 0:B.scrollIntoView({block:"nearest",behavior:"smooth"})},50)};return window.addEventListener(tg,I),()=>window.removeEventListener(tg,I)},[E]);const M=I=>p.kind==="page"&&p.page===I;return i?v.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[v.jsx(da,{className:"mb-2"}),v.jsx(ur,{content:"New session",side:"right",asChild:!0,children:v.jsx(_e,{variant:"primary",size:"icon",disabled:w,onClick:()=>void g(),children:v.jsx(Qn,{size:14})})}),Wb.map(I=>v.jsx("div",{className:"flex flex-col items-center gap-1 border-t pt-1",children:I.items.map(B=>v.jsx(ur,{content:`${I.label} · ${B.label}`,side:"right",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon",className:xe(M(B.page)&&"bg-muted text-foreground"),onClick:()=>a({kind:"page",page:B.page}),children:v.jsx(B.icon,{size:15})})},B.page))},I.id)),v.jsx("div",{className:"flex-1"}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:v.jsx(vS,{size:15})})]}):v.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[v.jsx(da,{}),v.jsxs("div",{className:"min-w-0",children:[v.jsx(Yh,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx(ur,{content:h==null?void 0:h.projectRoot,wide:!0,className:"min-w-0",children:v.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:(h==null?void 0:h.project)??"..."})}),v.jsx(yv,{})]})]}),s?v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Close menu",children:v.jsx(En,{size:15})}):v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Collapse sidebar",children:v.jsx(gS,{size:15})})]}),v.jsx("div",{className:"px-3 pb-2",children:v.jsx(t5,{beside:i?48:typeof e=="number"?e:280,size:"md",full:!0})}),v.jsx("div",{className:"mx-3 mb-2 flex rounded-md bg-muted p-0.5",children:[["sessions","Sessions",null],["workspace","Workspace",f.length?String(f.length):null],["files","Files",null]].map(([I,B,H])=>v.jsxs("button",{onClick:()=>E(I),className:xe("flex flex-1 items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors",x===I?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[B,I==="sessions"&&S.length>0&&v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success",title:`${S.length} running`}),H&&v.jsx("span",{className:xe("rounded-full px-1.5 text-[10px] font-semibold",I==="workspace"?"bg-severity-warning text-background":"bg-success/20 text-success"),children:H})]},I))}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:x==="files"?v.jsx(U8,{}):x==="workspace"?v.jsx("nav",{className:"px-2",children:Wb.map(I=>{const B=c.has(I.id),H=I.items.some(U=>M(U.page));return v.jsxs("div",{className:"pb-1",children:[v.jsxs("button",{onClick:()=>_(I.id),className:"flex w-full items-center gap-1 px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[B?v.jsx(pa,{size:11}):v.jsx(ql,{size:11}),I.label,B&&I.id==="operation"&&f.length>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] text-background",children:f.length})]}),(!B||H)&&I.items.filter(U=>!B||M(U.page)).map(U=>v.jsxs("button",{onClick:()=>a({kind:"page",page:U.page}),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",M(U.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(U.icon,{size:14}),U.label,U.page==="inbox"&&f.length>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:f.length})]},U.page))]},I.id)})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"sticky top-0 z-10 bg-background px-3 pb-1",children:v.jsxs("div",{className:"relative",children:[v.jsx(lg,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(pi,{value:d,onChange:I=>m(I.target.value),placeholder:"Search sessions",className:"pl-6"})]})}),v.jsxs("div",{className:"px-2",children:[v.jsx("div",{ref:j,children:v.jsx(Kb,{title:`Live (${S.length})`,sessions:S,flash:D})}),v.jsx(Kb,{title:`History (${R.length})`,sessions:R,action:v.jsxs("label",{className:"flex cursor-pointer select-none items-center gap-1",title:"Hide the hub's own configuration sessions",children:[v.jsx("input",{type:"checkbox",className:"h-3 w-3 accent-[hsl(var(--primary))]",checked:T,onChange:I=>L(I.target.checked)}),"Hide hub tasks"]})}),!b.length&&v.jsx("div",{className:"px-2 pt-3 text-xs text-muted-foreground",children:d?"No match.":"No sessions yet. Start one above."})]})]})})]})}function Z8({session:e,x:i,y:r,onClose:s}){const l=ye(a=>a.go),f=$h();P.useEffect(()=>{const a=()=>s(),h=d=>d.key==="Escape"&&s();return window.addEventListener("pointerdown",a),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),window.addEventListener("keydown",h),()=>{window.removeEventListener("pointerdown",a),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a),window.removeEventListener("keydown",h)}},[s]);const p=(a,h,d,m={})=>{const c=h;return v.jsxs("button",{disabled:m.disabled,title:m.hint,onPointerDown:_=>{_.stopPropagation(),!m.disabled&&(s(),d())},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs disabled:cursor-not-allowed disabled:opacity-40",m.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(c,{size:13}),a]})};return v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-270)},onPointerDown:a=>a.stopPropagation(),children:[p("Open",Ul,()=>l({kind:"session",id:e.id})),p("Open in new window",ma,()=>dg({kind:"session",id:e.id})),p("Rename",Vi,()=>void f.rename(e)),v.jsx("div",{className:"my-1 border-t"}),e.quiet?p("Allow notifications",ls,()=>void rt(()=>ve.setSessionQuiet(e.id,!1),"Notifications back on for this session.")):p("Do not disturb",la,()=>void rt(()=>ve.setSessionQuiet(e.id,!0),"Nothing from this session goes out on a channel."),{hint:"Its questions still wait in the inbox; no channel hears of them"}),p(`Clear waiting${e.openInteractions?` (${e.openInteractions})`:""}`,U3,()=>void rt(()=>ve.dismissWaiting(e.id),"Cleared."),{disabled:!e.openInteractions,hint:"Puts away what it waits on, unanswered; nothing is typed into it"}),v.jsx("div",{className:"my-1 border-t"}),e.live&&p("Stop",bh,()=>void f.stop(e),{hint:"Stops its terminal; the conversation is kept for a later resume"}),p("Delete permanently",yr,()=>void f.remove(e),{danger:!0,hint:e.live?"Stops it first":void 0})]})}function Kb({title:e,sessions:i,action:r,flash:s=0}){const{view:l,go:f}=ye(),[p,a]=P.useState(null),h=P.useRef({fired:!1}),d=(c,_)=>{if(h.current.fired=!1,_.pointerType!=="touch")return;const{clientX:x,clientY:E}=_;window.clearTimeout(h.current.timer),h.current.timer=window.setTimeout(()=>{h.current.fired=!0,a({session:c,x,y:E})},500)},m=()=>window.clearTimeout(h.current.timer);return!i.length&&!r?null:v.jsxs("div",{className:xe("mt-3 rounded-md",s>0&&"sessions-flash"),children:[p&&v.jsx(Z8,{...p,onClose:()=>a(null)}),v.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:e}),r]}),v.jsx("div",{className:"space-y-0.5",children:i.map(c=>{const _=l.kind==="session"&&l.id===c.id;return v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>!h.current.fired&&f({kind:"session",id:c.id}),onContextMenu:x=>{x.preventDefault(),a({session:c,x:x.clientX,y:x.clientY})},onPointerDown:x=>d(c,x),onPointerUp:m,onPointerLeave:m,onPointerCancel:m,className:xe("block w-full select-none rounded-md px-2 py-1.5 pr-8 text-left transition-colors [-webkit-touch-callout:none] md:select-auto md:pr-2",_?"bg-muted":"hover:bg-muted/60"),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Wh,{session:c}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:c.title}),c.purpose&&v.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-primary/15 px-1 text-[9px] font-medium text-primary",title:`Hub task: ${c.purpose.title}`,children:[v.jsx(Gl,{size:9})," task"]}),c.quiet&&v.jsx("span",{className:"shrink-0 text-muted-foreground",title:"Do not disturb: no channel hears from it",children:v.jsx(la,{size:11})}),c.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:c.openInteractions})]}),v.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 pl-4 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:V8[c.origin]}),v.jsx("span",{children:"·"}),v.jsx("span",{children:va(c.lastAt)}),c.tokens&&v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"·"}),v.jsxs("span",{children:[On(os(c.tokens))," tok"]})]}),c.diskBytes?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"·"}),v.jsx("span",{title:"On disk: transcript, subagents, file snapshots and temp folder",children:hg(c.diskBytes)})]}):null]})]}),v.jsx("button",{"aria-label":"Session actions",title:"Session actions",onClick:x=>{const E=x.currentTarget.getBoundingClientRect();a({session:c,x:E.right-192,y:E.bottom+4})},className:"absolute right-1 top-1 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:v.jsx(yS,{size:14})})]},c.id)})})]},s)}function n5({x:e,y:i,items:r,onClose:s}){return P.useEffect(()=>{const l=()=>s(),f=p=>p.key==="Escape"&&s();return window.addEventListener("pointerdown",l),window.addEventListener("keydown",f),()=>{window.removeEventListener("pointerdown",l),window.removeEventListener("keydown",f)}},[s]),v.jsx("div",{role:"menu",className:"fixed z-50 w-44 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(e,window.innerWidth-184),top:Math.min(i,window.innerHeight-180)},onPointerDown:l=>l.stopPropagation(),children:r.map(([l,f,p,a,h])=>v.jsxs("button",{disabled:h,onClick:()=>{s(),p()},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",a&&"mt-1 border-t pt-2"),children:[v.jsx(f,{size:13}),l]},l))})}function J8(){const e=ye(_=>_.sessions),i=ye(_=>_.view),r=ye(_=>_.go),s=pn(),l=P.useRef(null),f=$h(),[p,a]=P.useState(null),h=e.filter(_=>_.live),d=i.kind==="session"?i.id:null;if(P.useEffect(()=>{var _,x;d&&((x=(_=l.current)==null?void 0:_.querySelector(`[data-session="${CSS.escape(d)}"]`))==null||x.scrollIntoView({block:"nearest",inline:"nearest"}))},[d,h.length]),!h.length)return null;const m=_=>f.stop(_),c=(_,x)=>s({title:`Stop ${x?"all ":""}${_.length} ${x?"running":"other"} terminal${_.length>1?"s":""}?`,description:"Their conversations are kept for a later resume.",body:v.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:_.map(E=>v.jsx("div",{className:"truncate",children:E.title},E.id))}),confirmLabel:x?"Stop all":"Stop others",tone:"destructive",run:async()=>{await Promise.all(_.map(E=>ve.killSession(E.id))),Uh(_.map(E=>E.id))}});return v.jsxs("div",{ref:l,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[p&&v.jsx(n5,{x:p.x,y:p.y,onClose:()=>a(null),items:[["Open",Ul,()=>r({kind:"session",id:p.session.id})],["Rename",Vi,()=>void f.rename(p.session)],["Close",En,()=>void m(p.session),!0],["Close Others",$s,()=>void c(h.filter(_=>_.id!==p.session.id),!1),!1,h.length<2],["Close All",$s,()=>void c(h,!0)]]}),v.jsx("div",{className:"flex shrink-0 items-center px-2 text-muted-foreground",title:"Running terminals",children:v.jsx(kS,{size:13})}),h.map(_=>{const x=_.id===d;return v.jsxs("div",{"data-session":_.id,title:_.status==="waiting"?`${_.title} (waiting on you)`:_.title,onClick:()=>r({kind:"session",id:_.id}),onContextMenu:E=>{E.preventDefault(),a({session:_,x:E.clientX,y:E.clientY})},onAuxClick:E=>{E.button===1&&(E.preventDefault(),m(_))},className:xe("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",x?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(Wh,{session:_}),v.jsx("span",{className:"truncate",children:_.title}),_.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:_.openInteractions}),v.jsx("button",{"aria-label":`Stop ${_.title}`,title:"Stop this terminal",onClick:E=>{E.stopPropagation(),m(_)},className:xe("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!x&&"invisible group-hover:visible"),children:v.jsx(En,{size:12})})]},_.id)})]})}const i5="clauder-hub:live-panel";function e9(){try{return localStorage.getItem(i5)!=="0"}catch{return!0}}const Gh=_a((e,i)=>({open:e9(),toggle:()=>{const r=!i().open;e({open:r});try{localStorage.setItem(i5,r?"1":"0")}catch{}}}));function t9(){const{open:e,toggle:i}=Gh(),r=e?CS:W3;return v.jsx("button",{onClick:i,title:e?"Hide the live sessions panel":"Show the live sessions of every project, on the right","aria-label":e?"Hide live sessions":"Show live sessions","aria-pressed":e,className:"self-center rounded p-0.5 text-muted-foreground/70 hover:bg-muted hover:text-foreground",children:v.jsx(r,{size:13})})}function n9({status:e}){return v.jsx("span",{className:xe("inline-block h-2 w-2 shrink-0 rounded-full",e==="waiting"?"bg-severity-warning animate-status-pulse":e==="running"?"bg-success animate-status-pulse":"bg-muted-foreground/40")})}function r5({width:e}){const i=Gh(f=>f.toggle),r=ut(()=>ve.globalLive(),["projects","sessions","interactions","channels"]),s=r.data??[],l=s.reduce((f,p)=>f+p.live.length,0);return v.jsxs("aside",{"aria-label":"Live sessions",style:{width:e},className:"flex shrink-0 flex-col border-l bg-background",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2",children:[v.jsx("span",{className:"text-xs font-semibold",children:"Live sessions"}),v.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-muted px-1 text-[10px] font-semibold leading-none tabular-nums text-muted-foreground",children:l}),v.jsx("div",{className:"flex-1"}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:i,title:"Hide this panel","aria-label":"Hide live sessions",children:v.jsx(CS,{size:13})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:[r.data&&!s.length&&v.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Nothing is running in any project."}),s.map(f=>v.jsx(i9,{project:f},f.id))]})]})}function i9({project:e}){const i=ye(S=>S.projectId),r=ye(S=>S.view),s=ye(S=>S.openProject),l=ye(S=>S.openSessionIn),[f,p]=P.useState(!1),[a,h]=P.useState(!1),[d,m]=P.useState(null),[c,_]=P.useState(null),x=$h(),E=pn(),w=i===e.id,g=(S,y)=>E({title:`Stop ${y?"all ":""}${S.length} ${y?"running":"other"} terminal${S.length>1?"s":""} in ${e.name}?`,description:"Their conversations are kept for a later resume.",body:v.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:S.map(T=>v.jsx("div",{className:"truncate",children:T.title},T.id))}),confirmLabel:y?"Stop all":"Stop others",tone:"destructive",run:async()=>{await Promise.all(S.map(T=>ve.killSession(T.id,w?void 0:e.id))),w&&Uh(S.map(T=>T.id))}}),b=async()=>{if(f)return;p(!0);const S=document.querySelector("main"),y=Math.max(80,Math.floor((((S==null?void 0:S.clientWidth)??window.innerWidth)-40)/7.8)),T=Math.max(24,Math.floor((window.innerHeight-140)/17)),L=await rt(()=>ve.startSessionIn(e.id,{cols:y,rows:T}));p(!1),L&&(w&&await ye.getState().refreshSessions(),l(e.id,L.sessionId))};return v.jsxs("div",{className:"px-1.5 py-1",children:[c&&v.jsx(wv,{project:e,x:c.x,y:c.y,onClose:()=>_(null)}),v.jsxs("div",{className:"group flex items-center gap-1 px-1.5 py-1",onContextMenu:S=>{S.preventDefault(),_({x:S.clientX,y:S.clientY})},children:[v.jsx("button",{onClick:()=>s(e.id),title:`Open ${e.name}`,className:xe("min-w-0 flex-1 truncate text-left text-[11px] font-semibold uppercase tracking-wide hover:text-foreground",w?"text-foreground":"text-muted-foreground"),children:e.name}),v.jsxs(Pg,{open:a,onOpenChange:h,align:"end",className:"w-64 p-1",trigger:v.jsx(_e,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`Resume a session of ${e.name}`,"aria-label":"Resume a session",disabled:!e.recent.length,children:v.jsx(N3,{size:12})}),children:[v.jsx("div",{className:"px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Resume"}),e.recent.map(S=>v.jsxs("button",{onClick:()=>{h(!1),l(e.id,S.id)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.lastAt&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:va(S.lastAt)})]},S.id))]}),v.jsx(_e,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`New session in ${e.name}`,"aria-label":"New session",disabled:f,onClick:()=>void b(),children:v.jsx(Qn,{size:12})})]}),e.live.map(S=>{const y=w&&r.kind==="session"&&r.id===S.id;return v.jsxs("button",{onClick:()=>l(e.id,S.id),onContextMenu:T=>{T.preventDefault(),m({session:S,x:T.clientX,y:T.clientY})},title:S.title,className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",y?"bg-primary/15 text-foreground":"hover:bg-muted"),children:[v.jsx(n9,{status:S.status}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none tabular-nums text-background",children:S.openInteractions})]},S.id)}),d&&v.jsx(n5,{x:d.x,y:d.y,onClose:()=>m(null),items:[["Open",Ul,()=>l(e.id,d.session.id)],["Rename",Vi,()=>void x.rename(d.session,e.id)],["Close",En,()=>void x.stop(d.session,e.id),!0],["Close Others",$s,()=>void g(e.live.filter(S=>S.id!==d.session.id),!1),!1,e.live.length<2],["Close All",$s,()=>void g(e.live,!0)]]})]})}function s5({open:e,onOpenChange:i}){const r=ye(x=>x.openProject),[s,l]=P.useState(null),[f,p]=P.useState(""),[a,h]=P.useState(null),[d,m]=P.useState(!1),c=async x=>{try{const E=await ve.folders(x);l(E),p(E.path),h(null)}catch(E){h(E.message)}};P.useEffect(()=>{e&&c(s==null?void 0:s.path)},[e]);const _=async x=>{m(!0);try{const E=await ve.addProject(x);i(!1),r(E.id)}catch(E){h(E.message)}finally{m(!1)}};return v.jsx(Iw,{open:e,onOpenChange:i,title:"Open folder",description:"Its sessions, jobs and channels run in the hub from now on.",maxWidth:"max-w-xl",height:"h-[min(36rem,calc(100dvh-2rem))]",footer:v.jsxs(v.Fragment,{children:[v.jsx(_e,{onClick:()=>i(!1),children:"Cancel"}),v.jsx(_e,{variant:"primary",disabled:!f.trim()||d,onClick:()=>void _(f.trim()),children:d?"Opening...":"Open this folder"})]}),children:v.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[v.jsxs("form",{className:"flex gap-1.5",onSubmit:x=>{x.preventDefault(),c(f.trim())},children:[v.jsx(pi,{value:f,onChange:x=>p(x.target.value),placeholder:"C:\\Source code\\your-repo",className:"font-mono"}),v.jsx(_e,{type:"submit",title:"Go to this folder",children:v.jsx(pa,{size:13})})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[v.jsxs(_e,{variant:"ghost",disabled:!(s!=null&&s.parent),onClick:()=>(s==null?void 0:s.parent)&&void c(s.parent),title:"Up one folder",children:[v.jsx(C3,{size:12})," Up"]}),v.jsxs(_e,{variant:"ghost",onClick:()=>void c(s==null?void 0:s.home),children:[v.jsx(B3,{size:12})," Home"]}),((s==null?void 0:s.drives.length)??0)>1&&s.drives.map(x=>v.jsxs(_e,{variant:"ghost",onClick:()=>void c(x),children:[v.jsx(O3,{size:12})," ",x]},x))]}),a&&v.jsx("div",{className:"text-xs text-severity-critical",children:a}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-md border",children:s!=null&&s.folders.length?s.folders.map(x=>v.jsxs("button",{onClick:()=>void c(x.path),onDoubleClick:()=>void _(x.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs hover:bg-muted",title:x.git?"A git repository. Double-click to open it.":x.path,children:[x.git?v.jsx(bS,{size:13,className:"shrink-0 text-primary"}):v.jsx(ca,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.name}),x.git&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"git"})]},x.path)):v.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:s?"No folders in here.":"Loading..."})})]})})}function da({className:e}){const i=ye(r=>r.openProject);return v.jsx("button",{onClick:()=>i(hr),title:"Global: every project","aria-label":"Go to Global",className:xe("shrink-0 rounded hover:opacity-80",e),children:v.jsx(w8,{size:20})})}let Qb=null;function Yh(){const e=ye(s=>s.openProject),[i,r]=P.useState(null);return P.useEffect(()=>{Qb??(Qb=ve.hub().then(s=>s.version??null).catch(()=>null)),Qb.then(r)},[]),v.jsxs("span",{className:"flex items-baseline gap-1.5",children:[v.jsx("button",{onClick:()=>e(hr),title:"Global: every project",className:"text-left text-sm font-semibold leading-tight hover:underline",children:"Clauder Hub"}),i&&v.jsxs("span",{className:"text-[10px] font-normal leading-tight text-muted-foreground/70",children:["v",i]}),v.jsx(r9,{}),v.jsx(t9,{})]})}function r9(){var r;const e=ye(s=>s.projectId),i=ut(()=>ve.channels(),["channels"],e);return!((r=i.data)!=null&&r.paused)||!i.data.channels.length?null:v.jsx("button",{onClick:m6,title:"Notifications are paused on every channel. Click to turn them back on.","aria-label":"Notifications paused",className:"self-center text-severity-warning hover:text-foreground",children:v.jsx(la,{size:12})})}function yv(){const e=ye(l=>l.projectId),i=ye(l=>l.openProject),s=(ut(()=>ve.projects(),["projects"]).data??[]).filter(l=>l.id!==e).reduce((l,f)=>l+f.waiting,0);return v.jsxs("button",{onClick:()=>i(hr),className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Back to the global home: every project",children:["Change",s>0&&v.jsx("span",{className:"grid h-3.5 min-w-[0.875rem] place-items-center rounded-full bg-severity-warning px-1 text-[9px] font-semibold leading-none tabular-nums text-background",children:s})]})}function mh({onDrag:e,onReset:i}){const r=P.useRef(0);return v.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize, double-click to reset",className:"group relative w-1 shrink-0 cursor-col-resize bg-border/60 transition-colors hover:bg-primary/60",onDoubleClick:i,onPointerDown:s=>{s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),r.current=s.clientX,document.body.style.userSelect="none"},onPointerMove:s=>{if(!s.currentTarget.hasPointerCapture(s.pointerId))return;const l=s.clientX-r.current;l&&(r.current=s.clientX,e(l))},onPointerUp:s=>{s.currentTarget.releasePointerCapture(s.pointerId),document.body.style.userSelect=""},onPointerCancel:()=>{document.body.style.userSelect=""},children:v.jsx("span",{className:"absolute inset-y-0 -left-1 -right-1"})})}function o5({tools:e}){const i=B4(e),r={};for(const l of i.mcp){const{server:f,tool:p}=N4(l.name),a=r[f]??(r[f]={count:0,errors:0,tools:[]});a.count+=l.count,a.errors+=l.errors,a.tools.push(`${p} ×${l.count}`)}const s=l=>l.map(f=>({key:f.name,label:f.name,value:f.count,note:f.errors?`${f.errors} failed`:void 0}));return v.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[v.jsx(Dt,{title:`Built-in tools (${i["built-in"].reduce((l,f)=>l+f.count,0)})`,children:v.jsx(as,{rows:s(i["built-in"]),format:String})}),v.jsx(Dt,{title:`MCP servers (${i.mcp.reduce((l,f)=>l+f.count,0)})`,description:"Calls grouped by server; hover a bar for its tools.",children:v.jsx(as,{rows:Object.entries(r).map(([l,f])=>({key:l,label:l,value:f.count,note:f.errors?`${f.errors} failed`:void 0,sublabel:f.tools.slice(0,3).join(", ")})),format:String,empty:"No MCP calls."})})]})}function s9({agent:e}){const[i,r]=P.useState(!1),s=Object.values(e.tools).reduce((l,f)=>l+f.count,0);return v.jsxs("div",{className:"rounded-md border",children:[v.jsxs("button",{className:"flex w-full items-center gap-2 px-2.5 py-2 text-left",onClick:()=>r(!i),style:{paddingLeft:10+(e.depth-1)*16},children:[i?v.jsx(ql,{size:13}):v.jsx(pa,{size:13}),v.jsx(mS,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e.agentType}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:e.description}),v.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:[s," calls · ",On(os(e.tokens))," tok"]})]}),i&&v.jsxs("div",{className:"grid gap-3 border-t p-3 md:grid-cols-2",children:[v.jsxs("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[v.jsxs("div",{children:["Model: ",e.model??"inherited",e.fork&&" · fork"]}),v.jsxs("div",{children:[Vs(e.startedAt)," → ",Vs(e.lastAt)]}),v.jsxs("div",{children:["Output ",On(e.tokens.output)," · cache read ",On(e.tokens.cacheRead)]})]}),v.jsx(as,{rows:Object.entries(e.tools).map(([l,f])=>({key:l,label:l,value:f.count})),format:String,limit:6,empty:"No tool calls."}),e.recent.length>0&&v.jsx("div",{className:"md:col-span-2",children:v.jsx(a5,{calls:e.recent.slice(-10)})})]})]})}function a5({calls:e}){return v.jsx("div",{className:"divide-y rounded-md border",children:[...e].reverse().map(i=>v.jsxs("div",{className:"flex items-baseline gap-2 px-2.5 py-1.5 text-[11px]",children:[v.jsx("span",{className:"hidden w-20 shrink-0 whitespace-nowrap tabular-nums text-muted-foreground sm:block",children:i.ts?new Date(i.ts).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}),v.jsx("span",{className:xe("max-w-[60%] shrink-0 truncate font-mono sm:max-w-none",i.error&&"text-severity-critical"),children:i.name.startsWith("mcp__")?i.name.replace(/^mcp__/,"mcp:"):i.name}),v.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:i.summary})]},i.id))})}function o9({data:e}){const i=e.detail;if(!i)return v.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Claude has not written anything for this session yet."});const r=i.totals,s=Object.values(r.tools).reduce((l,f)=>l+f.count,0);return v.jsxs("div",{className:"space-y-3",children:[v.jsx(oC,{tokens:r.tokens}),v.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[v.jsx(Dt,{title:"Tokens by model",children:v.jsx(as,{rows:Object.entries(r.tokensByModel).filter(([,l])=>os(l)>0).map(([l,f])=>({key:l,label:l,value:os(f)}))})}),v.jsx(Dt,{title:"Skills & commands",children:v.jsx(as,{rows:Object.entries(i.skills).map(([l,f])=>({key:l,label:l,value:f})),format:String,empty:"No skills used."})}),v.jsx(Dt,{title:"Shape",children:v.jsxs("div",{className:"space-y-1 text-xs",children:[v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Prompts"}),v.jsx("span",{className:"tabular-nums",children:e.session.turns??0})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Tool calls (all agents)"}),v.jsx("span",{className:"tabular-nums",children:s})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Subagents"}),v.jsx("span",{className:"tabular-nums",children:i.subagents.length})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Branch"}),v.jsx("span",{className:"font-mono text-[11px]",children:e.session.gitBranch??"-"})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Permission mode"}),v.jsx("span",{children:e.session.permissionMode??"-"})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Claude Code"}),v.jsx("span",{children:e.session.version??"-"})]})]})})]}),v.jsx(o5,{tools:r.tools}),v.jsx(Dt,{title:`Subagents (${i.subagents.length})`,description:"Each one's own tokens and calls; a fork's inherited context is counted once, on its parent.",children:i.subagents.length?v.jsx("div",{className:"space-y-1.5",children:i.subagents.map(l=>v.jsx(s9,{agent:l},l.id))}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No subagents."})}),v.jsx(Dt,{title:"Recent calls (main thread)",children:i.recent.length?v.jsx(a5,{calls:i.recent.slice(-40)}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No tool calls yet."})})]})}const a9=(e,i)=>JSON.stringify(e)===JSON.stringify(i),om=e=>e.variables.length?e:{...e,variables:[{name:"",value:""}]};function l9({sessionId:e,live:i,current:r}){const s=pn(),[l,f]=P.useState(()=>om(r));P.useEffect(()=>f(om(r)),[JSON.stringify(r)]);const p={notes:l.notes.trim(),variables:l.variables.map(m=>({name:m.name.trim(),value:m.value.trim()})).filter(m=>m.name)},a=!a9(p,r),h=(m,c)=>f({...l,variables:l.variables.map((_,x)=>x===m?{..._,...c}:_)}),d=()=>s({title:i?"Save and restart this session?":"Save this setup?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Save & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionSetup(e,p),ye.getState().notify(i?"Restarting with the new setup.":"Saved.")}});return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("h2",{className:"text-sm font-semibold",children:"Setup"}),v.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:"For this session only, appended to its system prompt. Applies at start-up."})]}),v.jsxs("div",{className:"flex gap-1.5",children:[v.jsx(_e,{disabled:!a,onClick:()=>f(om(r)),children:"Reset"}),v.jsx(_e,{variant:"primary",disabled:!a,onClick:()=>void d(),children:i?"Save & restart":"Save"})]})]}),v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Notes"}),v.jsx(tc,{rows:10,defaultMode:"edit",value:l.notes,onChange:m=>f({...l,notes:m})})]}),v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Names"}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Short names you use in this session and what each stands for, e.g. OUT → C:\\reports\\2026."}),l.variables.map((m,c)=>v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(pi,{className:"w-48 shrink-0 font-mono",placeholder:"Name",value:m.name,onChange:_=>h(c,{name:_.target.value})}),v.jsx(pi,{className:"min-w-0 flex-1",placeholder:"What it stands for",value:m.value,onChange:_=>h(c,{value:_.target.value})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Remove",onClick:()=>f({...l,variables:l.variables.filter((_,x)=>x!==c)}),children:v.jsx(En,{size:13})})]},c)),v.jsxs(_e,{variant:"ghost",onClick:()=>f({...l,variables:[...l.variables,{name:"",value:""}]}),children:[v.jsx(Qn,{size:12})," Add a name"]})]})]})}function bv({title:e,subtitle:i,badge:r,mono:s,defaultOpen:l,children:f}){const[p,a]=P.useState(!!l);return v.jsxs("div",{className:"rounded-md bg-muted/30",children:[v.jsxs("button",{onClick:()=>a(!p),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50",children:[v.jsx(pa,{size:13,className:xe("shrink-0 transition-transform",p&&"rotate-90")}),v.jsxs("span",{className:"min-w-0 flex-1",children:[v.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[v.jsx("span",{className:xe("min-w-0 truncate text-xs font-medium",s&&"font-mono"),title:typeof e=="string"?e:void 0,children:e}),r&&v.jsx("span",{className:"shrink-0",children:r})]}),i&&v.jsx("span",{className:"block truncate text-[11px] text-muted-foreground",children:i})]})]}),p&&v.jsx("div",{className:"bg-muted/20 px-3 py-2",children:f})]})}function ds(){return v.jsx(nt,{tone:"on",className:"px-1 py-0 text-[9px] leading-[14px]",title:"Applies to every project on this machine, not only this one.",children:"global"})}const c9=[{kind:"plugins",title:"Plugins"},{kind:"agents",title:"Agents"},{kind:"skills",title:"Skills"},{kind:"mcp",title:"MCP servers"}];function u9({on:e,disabled:i,onToggle:r}){return v.jsx("button",{role:"switch","aria-checked":e,disabled:i,onClick:r,className:xe("relative h-4 w-7 shrink-0 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-40",e?"bg-primary":"bg-foreground/20"),children:v.jsx("span",{className:xe("absolute top-0.5 h-3 w-3 rounded-full bg-background transition-all",e?"left-3.5":"left-0.5")})})}function l5({catalog:e,value:i,onChange:r}){const[s,l]=P.useState(""),f=P.useMemo(()=>new Set(e.filter(m=>m.kind==="plugins"&&m.scope==="user").map(m=>m.id)),[e]),p=m=>m.scope==="user"||m.scope==="plugin"&&!!(m.plugin&&f.has(m.plugin)),a=m=>{const c=i[m.kind];r({...i,[m.kind]:c.includes(m.id)?c.filter(_=>_!==m.id):[...c,m.id]})},h=(m,c,_)=>{const x=new Set(_.map(w=>w.id)),E=i[m].filter(w=>!x.has(w));r({...i,[m]:c?E:[...E,...x]})},d=s.trim().toLowerCase();return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(lg,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(pi,{value:s,onChange:m=>l(m.target.value),placeholder:"Filter",className:"pl-6"})]}),c9.map(({kind:m,title:c})=>{const _=e.filter(w=>w.kind===m);if(!_.length)return null;const x=d?_.filter(w=>`${w.label} ${w.description}`.toLowerCase().includes(d)):_,E=_.filter(w=>i[m].includes(w.id)||w.plugin&&i.plugins.includes(w.plugin)).length;return v.jsxs(bv,{title:c,badge:v.jsx(nt,{tone:E?"warning":"off",children:E?`${E} of ${_.length} off`:`${_.length} on`}),defaultOpen:!0,children:[v.jsxs("div",{className:"mb-1.5 flex gap-3 text-[11px] text-muted-foreground",children:[v.jsx("button",{className:"hover:text-foreground",onClick:()=>h(m,!0,x),children:"All on"}),v.jsx("button",{className:"hover:text-foreground",onClick:()=>h(m,!1,x),children:"All off"})]}),x.length?v.jsx("div",{className:"divide-y rounded-md border bg-background",children:x.map(w=>{const g=!!(w.plugin&&i.plugins.includes(w.plugin)),b=!g&&!i[m].includes(w.id);return v.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[v.jsx(u9,{on:b,disabled:g,onToggle:()=>a(w)}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] text-foreground",children:w.label}),p(w)&&v.jsx(ds,{})]}),w.description&&v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:w.description})]}),g?v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"off with its plugin"}):!w.leavesContext&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",title:"Turning this off blocks its use; Claude may still see it listed.",children:"blocks use only"}),v.jsx("span",{className:"hidden w-16 shrink-0 text-right text-[10px] text-muted-foreground sm:block",children:w.scope})]},w.id)})}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No match."})]},m)})]})}function gh(e){return e.agents.length+e.skills.length+e.mcp.length+e.plugins.length}const h9=(e,i)=>JSON.stringify(e)===JSON.stringify(i);function d9({sessionId:e,live:i,current:r}){const s=pn(),l=ut(()=>ve.toolsetCatalog(),[]),f=ut(()=>ve.presets(),["jobs"]),[p,a]=P.useState(r),h=P.useRef("");P.useEffect(()=>a(r),[JSON.stringify(r)]);const d=!h9(p,r),m=()=>s({title:i?"Apply and restart this session?":"Save this toolset?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Apply & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionToolset(e,p),ye.getState().notify(i?"Restarting with the new toolset.":"Saved.")}}),c=()=>(h.current="",s({title:"Save as a preset",description:"Reusable by jobs and new sessions.",body:v.jsx(pi,{autoFocus:!0,placeholder:"Preset name, e.g. Frontend only",onChange:_=>h.current=_.target.value}),confirmLabel:"Save preset",run:async()=>{await ve.savePreset({name:h.current,toolset:p}),ye.getState().notify("Preset saved."),f.reload()}}));return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("h2",{className:"text-sm font-semibold",children:"Toolset"}),v.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[gh(r)?`${gh(r)} turned off for this session.`:"Everything is on."," Applies at start-up."]})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.data&&f.data.length>0&&v.jsxs(ia,{value:"",onValueChange:_=>{var E;const x=(E=f.data)==null?void 0:E.find(w=>w.id===_);x&&a(x.toolset)},className:"w-40",children:[v.jsx(Cn,{value:"",children:"Use a preset..."}),f.data.map(_=>v.jsxs(Cn,{value:_.id,children:[_.name,_.isDefault?" (default)":""]},_.id))]}),v.jsx(_e,{onClick:()=>void c(),children:"Save as preset"}),d&&v.jsx(_e,{onClick:()=>a(r),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!d,onClick:()=>void m(),children:i?"Apply & restart":"Save"})]})]}),l.data?v.jsx(l5,{catalog:l.data,value:p,onChange:a}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})]})}var am={exports:{}},Zb;function f9(){return Zb||(Zb=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const f=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(f._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,f=l._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const p=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),c=h-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),_=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-p;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(c/f.css.cell.height))}}}})(),r})()))})(am)),am.exports}var p9=f9(),eh={exports:{}},m9=eh.exports,Jb;function g9(){return Jb||(Jb=1,(function(e,i){(function(r,s){e.exports=s()})(m9,(()=>(()=>{var r={433:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV11=void 0;const d=h(938),m=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],c=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],_=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],x=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let E;function w(g,b){let S,y=0,T=b.length-1;if(g<b[0][0]||g>b[T][1])return!1;for(;T>=y;)if(S=y+T>>1,g>b[S][1])y=S+1;else{if(!(g<b[S][0]))return!0;T=S-1}return!1}a.UnicodeV11=class{constructor(){if(this.version="11",!E){E=new Uint8Array(65536),E.fill(1),E[0]=0,E.fill(0,1,32),E.fill(0,127,160);for(let g=0;g<m.length;++g)E.fill(0,m[g][0],m[g][1]+1);for(let g=0;g<_.length;++g)E.fill(2,_[g][0],_[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?E[g]:w(g,c)?0:w(g,x)?2:1}charProperties(g,b){let S=this.wcwidth(g),y=S===0&&b!==0;if(y){const T=d.UnicodeService.extractWidth(b);T===0?y=!1:T>S&&(S=T)}return d.UnicodeService.createPropertyValue(0,S,y)}}},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const m=[];for(let c=0;c<this._listeners.length;c++)m.push(this._listeners[c]);for(let c=0;c<m.length;c++)m[c].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(h,d){return h((m=>d.fire(m)))},a.runAndSubscribe=function(h,d){return d(void 0),h((m=>d(m)))}},490:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=h(938),m=[[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]],c=[[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]];let _;a.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<m.length;++x)_.fill(0,m[x][0],m[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(E,w){let g,b=0,S=w.length-1;if(E<w[0][0]||E>w[S][1])return!1;for(;S>=b;)if(g=b+S>>1,E>w[g][1])b=g+1;else{if(!(E<w[g][0]))return!0;S=g-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,E){let w=this.wcwidth(x),g=w===0&&E!==0;if(g){const b=d.UnicodeService.extractWidth(E);b===0?g=!1:b>w&&(w=b)}return d.UnicodeService.createPropertyValue(0,w,g)}}},938:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=h(345),m=h(490);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,E,w=!1){return(16777215&x)<<3|(3&E)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new m.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let E=0,w=0;const g=x.length;for(let b=0;b<g;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=g)return E+this.wcwidth(S);const L=x.charCodeAt(b);56320<=L&&L<=57343?S=1024*(S-55296)+L-56320+65536:E+=this.wcwidth(L)}const y=this.charProperties(S,w);let T=c.extractWidth(y);c.extractShouldJoin(y)&&(T-=c.extractWidth(w)),E+=T,w=y}return E}charProperties(x,E){return this._activeProvider.charProperties(x,E)}}a.UnicodeService=c}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p](h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.Unicode11Addon=void 0;const a=l(433);p.Unicode11Addon=class{activate(h){h.unicode.register(new a.UnicodeV11)}dispose(){}}})(),f})()))})(eh)),eh.exports}var v9=g9(),lm={exports:{}},eS;function _9(){return eS||(eS=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(p,a)=>{function h(m){try{const c=new URL(m),_=c.password&&c.username?`${c.protocol}//${c.username}:${c.password}@${c.host}`:c.username?`${c.protocol}//${c.username}@${c.host}`:`${c.protocol}//${c.host}`;return m.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(m,c,_,x={}){this._terminal=m,this._regex=c,this._handler=_,this._options=x}provideLinks(m,c){const _=d.computeLink(m,this._regex,this._terminal,this._handler);c(this._addCallbacks(_))}_addCallbacks(m){return m.map((c=>(c.leave=this._options.leave,c.hover=(_,x)=>{if(this._options.hover){const{range:E}=c;this._options.hover(_,x,E)}},c)))}};class d{static computeLink(c,_,x,E){const w=new RegExp(_.source,(_.flags||"")+"g"),[g,b]=d._getWindowedLineStrings(c-1,x),S=g.join("");let y;const T=[];for(;y=w.exec(S);){const L=y[0];if(!h(L))continue;const[R,D]=d._mapStrIdx(x,b,0,y.index),[A,j]=d._mapStrIdx(x,R,D,L.length);if(R===-1||D===-1||A===-1||j===-1)continue;const M={start:{x:D+1,y:R+1},end:{x:j,y:A+1}};T.push({range:M,text:L,activate:E})}return T}static _getWindowedLineStrings(c,_){let x,E=c,w=c,g=0,b="";const S=[];if(x=_.buffer.active.getLine(c)){const y=x.translateToString(!0);if(x.isWrapped&&y[0]!==" "){for(g=0;(x=_.buffer.active.getLine(--E))&&g<2048&&(b=x.translateToString(!0),g+=b.length,S.push(b),x.isWrapped&&b.indexOf(" ")===-1););S.reverse()}for(S.push(y),g=0;(x=_.buffer.active.getLine(++w))&&x.isWrapped&&g<2048&&(b=x.translateToString(!0),g+=b.length,S.push(b),b.indexOf(" ")===-1););}return[S,E]}static _mapStrIdx(c,_,x,E){const w=c.buffer.active,g=w.getNullCell();let b=x;for(;E;){const S=w.getLine(_);if(!S)return[-1,-1];for(let y=b;y<S.length;++y){S.getCell(y,g);const T=g.getChars();if(g.getWidth()&&(E-=T.length||1,y===S.length-1&&T==="")){const L=w.getLine(_+1);L&&L.isWrapped&&(L.getCell(0,g),g.getWidth()===2&&(E+=1))}if(E<0)return[_,y]}_++,b=0}return[_,b]}}a.LinkComputer=d}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p](h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const a=l(6),h=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(m,c){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(m=d,c={}){this._handler=m,this._options=c}activate(m){this._terminal=m;const c=this._options,_=c.urlRegex||h;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,c))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),f})()))})(lm)),lm.exports}var x9=_9(),cm={exports:{}},tS;function y9(){return tS||(tS=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={965:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GlyphRenderer=void 0;const d=h(374),m=h(509),c=h(855),_=h(859),x=h(381),E=11,w=E*Float32Array.BYTES_PER_ELEMENT;let g,b=0,S=0,y=0;class T extends _.Disposable{constructor(R,D,A,j){super(),this._terminal=R,this._gl=D,this._dimensions=A,this._optionsService=j,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const M=this._gl;m.TextureAtlas.maxAtlasPages===void 0&&(m.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS))),m.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,x.createProgram)(M,`#version 300 es
541
+ `),l=Array.from({length:r.length+1},()=>new Uint32Array(s.length+1));for(let h=r.length-1;h>=0;h-=1)for(let d=s.length-1;d>=0;d-=1)l[h][d]=r[h]===s[d]?l[h+1][d+1]+1:Math.max(l[h+1][d],l[h][d+1]);const f=[];let p=0,a=0;for(;p<r.length&&a<s.length;)r[p]===s[a]?(f.push({type:" ",line:r[p]}),p+=1,a+=1):l[p+1][a]>=l[p][a+1]?f.push({type:"-",line:r[p++]}):f.push({type:"+",line:s[a++]});for(;p<r.length;)f.push({type:"-",line:r[p++]});for(;a<s.length;)f.push({type:"+",line:s[a++]});return f}function fh({before:e,after:i}){const r=Y7(e,i);return v.jsx("pre",{className:"max-h-[60vh] overflow-auto rounded border font-mono text-[11px]",children:r.filter((s,l)=>s.type!==" "||r.slice(Math.max(0,l-2),l+3).some(f=>f.type!==" ")).map((s,l)=>v.jsxs("div",{className:xe("px-2",s.type==="+"&&"bg-success/20",s.type==="-"&&"bg-destructive/20"),children:[s.type," ",s.line]},l))})}function O2({path:e,title:i,badge:r,subtitle:s,onSaved:l}){const f=pn(),[p,a]=P.useState(null),[h,d]=P.useState(!1),[m,c]=P.useState(""),[_,x]=P.useState(null);if(P.useEffect(()=>{a(null),x(null),ve.memoryFile(e).then(g=>{a(g.content),c(g.content),d(g.writable)},g=>x(g.message))},[e]),_)return v.jsx("div",{className:"text-xs text-severity-critical",children:_});if(p===null)return v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."});const E=m!==p,w=()=>f({title:`Write ${i}?`,description:"Writes the real file on disk.",body:v.jsx(fh,{before:p,after:m}),confirmLabel:"Write file",maxWidth:"max-w-3xl",run:async()=>{const g=await ve.saveMemoryFile(e,m);a(g.content),ye.getState().notify("Written."),l==null||l()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsxs("h2",{className:"flex items-center gap-2 font-mono text-sm font-semibold",children:[v.jsx("span",{className:"min-w-0 truncate",children:i}),r]}),v.jsxs("p",{className:"break-all text-[11px] text-muted-foreground",children:[s??e,!h&&" · read-only (managed by a plugin)",h&&!p&&" · does not exist yet; saving creates it"]})]}),h&&v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[E&&v.jsx(_e,{onClick:()=>c(p),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!E,onClick:()=>void w(),children:"Review & save"})]})]}),v.jsx(tc,{rows:26,value:m,onChange:h?c:void 0})]})}var X7=Object.defineProperty,xr=(e,i)=>X7(e,"name",{value:i,configurable:!0}),mv="Checkbox",[K7,cB]=br(mv),[Q7,gv]=K7(mv);function N2(e){const{__scopeCheckbox:i,checked:r,children:s,defaultChecked:l,disabled:f,form:p,name:a,onCheckedChange:h,required:d,value:m="on",internal_do_not_use_render:c}=e,[_,x]=Gs({prop:r,defaultProp:l??!1,onChange:h,caller:mv}),[E,w]=P.useState(null),[g,b]=P.useState(null),[S,y]=P.useState(null),T=E?!!p||!!E.closest("form"):!0,L={checked:_,disabled:f,setChecked:x,control:E,setControl:w,name:a,form:p,value:m,userClick:S,onUserClick:y,required:d,defaultChecked:fi(l)?!1:l,isFormControl:T,bubbleInput:g,setBubbleInput:b};return v.jsx(Q7,{scope:i,...L,children:B2(c)?c(L):s})}xr(N2,"CheckboxProvider");var Z7="CheckboxTrigger",J7=P.forwardRef(xr(function({__scopeCheckbox:i,onKeyDown:r,onClick:s,...l},f){const{control:p,value:a,disabled:h,checked:d,required:m,setControl:c,setChecked:_,onUserClick:x,isFormControl:E,bubbleInput:w}=gv(Z7,i),g=ht(f,c),b=P.useRef(d);return P.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const y=xr(()=>_(b.current),"reset");return S.addEventListener("reset",y),()=>S.removeEventListener("reset",y)}},[p,_]),v.jsx(wt.button,{type:"button",role:"checkbox","aria-checked":fi(d)?"mixed":d,"aria-required":m,"data-state":vv(d),"data-disabled":h?"":void 0,disabled:h,value:a,...l,ref:g,onKeyDown:tt(r,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:tt(s,S=>{const y=S.isPropagationStopped();x({requestedChecked:fi(d)?!0:!d,hasConsumerStoppedPropagation:y}),_(T=>fi(T)?!0:!T),w&&E&&(y||S.stopPropagation())})})},"CheckboxTrigger")),e8=P.forwardRef(xr(function(i,r){const{__scopeCheckbox:s,name:l,checked:f,defaultChecked:p,required:a,disabled:h,value:d,onCheckedChange:m,form:c,..._}=i;return v.jsx(N2,{__scopeCheckbox:s,checked:f,defaultChecked:p,disabled:h,required:a,onCheckedChange:m,name:l,form:c,value:d,internal_do_not_use_render:({isFormControl:x})=>v.jsxs(v.Fragment,{children:[v.jsx(J7,{..._,ref:r,__scopeCheckbox:s}),x&&v.jsx(r8,{__scopeCheckbox:s})]})})},"Checkbox")),t8="CheckboxIndicator",n8=P.forwardRef(xr(function(i,r){const{__scopeCheckbox:s,forceMount:l,...f}=i,p=gv(t8,s);return v.jsx(Sr,{present:l||fi(p.checked)||p.checked===!0,children:v.jsx(wt.span,{"data-state":vv(p.checked),"data-disabled":p.disabled?"":void 0,...f,ref:r,style:{pointerEvents:"none",...i.style}})})},"CheckboxIndicator")),i8="CheckboxBubbleInput",r8=P.forwardRef(xr(function({__scopeCheckbox:i,onClick:r,...s},l){const{control:f,userClick:p,checked:a,defaultChecked:h,required:d,disabled:m,name:c,value:_,form:x,bubbleInput:E,setBubbleInput:w}=gv(i8,i),g=ht(l,w),b=Lg(f),S=P.useRef(!1),y=P.useRef(a),T=P.useRef(p),L=P.useRef(null);P.useEffect(()=>{const D=E;if(!D)return;const A=window.HTMLInputElement.prototype,M=Object.getOwnPropertyDescriptor(A,"checked").set;if(!M)return;const I=y.current!==a;y.current=a;const B=p!==null&&p!==T.current;if(T.current=p,B)L.current=I?null:p,I&&(D.indeterminate=fi(a),M.call(D,fi(a)?!1:a)),D.dispatchEvent(new Event("click",{bubbles:!p.hasConsumerStoppedPropagation}));else if(I){const H=L.current;L.current=null;const U=(H==null?void 0:H.requestedChecked)===a;S.current=!0,D.indeterminate=fi(a),M.call(D,fi(a)?!1:a),D.dispatchEvent(new Event("click",{bubbles:!(U&&H.hasConsumerStoppedPropagation)})),S.current=!1}},[E,a,p]);const R=P.useRef(fi(a)?!1:a);return v.jsx(wt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??R.current,required:d,disabled:m,name:c,value:_,form:x,...s,tabIndex:-1,ref:g,onClick:tt(r,D=>{S.current&&D.stopPropagation()}),style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function B2(e){return typeof e=="function"}xr(B2,"isFunction");function fi(e){return e==="indeterminate"}xr(fi,"isIndeterminate");function vv(e){return fi(e)?"indeterminate":e?"checked":"unchecked"}xr(vv,"getState");function Fh({id:e,label:i,ariaLabel:r,checked:s,onCheckedChange:l,disabled:f,title:p,className:a}){const h=e??(i?`cb-${String(i).toLowerCase().replace(/\s+/g,"-")}`:void 0);return v.jsxs("div",{className:xe("flex items-center gap-2",a),title:p,children:[v.jsx(e8,{id:h,checked:s,onCheckedChange:d=>l(d===!0),"aria-label":r,disabled:f,className:"h-4 w-4 shrink-0 cursor-pointer rounded border border-border bg-transparent focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:v.jsx(n8,{className:"flex items-center justify-center",children:v.jsx($l,{className:"h-3 w-3 text-primary",strokeWidth:3})})}),i&&v.jsx("label",{htmlFor:h,className:"cursor-pointer select-none text-xs",children:i})]})}function s8({path:e,kind:i,tick:r}){const[s,l]=P.useState(!1),[f,p]=P.useState(0);P.useEffect(()=>{let h=!1;return Xt.stat(e).then(d=>!h&&p(d.mtimeMs),()=>{}),()=>{h=!0}},[e,r]),P.useEffect(()=>l(!1),[e,f]);const a=`${Om(e)}?v=${f}`;return s?v.jsx(nn,{icon:mm,title:"The browser cannot show this file.",hint:"Its format is not one this browser plays or displays."}):v.jsxs("div",{className:"flex h-full items-center justify-center overflow-auto rounded border bg-muted/20 p-3",children:[i==="image"&&v.jsx("img",{src:a,alt:e,onError:()=>l(!0),className:"max-h-full max-w-full object-contain"}),i==="audio"&&v.jsx("audio",{controls:!0,src:a,onError:()=>l(!0),className:"w-full max-w-xl"},a),i==="video"&&v.jsx("video",{controls:!0,src:a,onError:()=>l(!0),className:"max-h-full max-w-full"},a)]})}function Ib(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const o8=1500,a8=1e3,zb="clauder-hub:file-blame";function l8(e){const i=Math.floor((Date.now()/1e3-e)/86400);if(i<1){const r=Math.floor((Date.now()/1e3-e)/3600);return r<1?"just now":`${r} hour${r>1?"s":""} ago`}return i<30?`${i} day${i>1?"s":""} ago`:new Date(e*1e3).toLocaleDateString()}const c8=e=>Xt.commit(e).then(i=>i.message);function u8({path:e}){const i=en(F=>F.drafts[e]),{put:r,drop:s}=en.getState(),l=ye(F=>F.ticks.files),[f,p]=P.useState(null),[a,h]=P.useState(null),[d,m]=P.useState(!1),[c,_]=P.useState(!1),[x,E]=P.useState(null),w=P.useRef(!1),g=P.useRef(null),b=P.useRef(0),S=P.useRef(0),y=rs(i),T=Wy(e),L=dL(e),[R,D]=P.useState("preview"),[A,j]=P.useState(null),[M,I]=P.useState(()=>{try{return localStorage.getItem(zb)==="1"}catch{return!1}}),B=()=>{const F=!M;I(F);try{localStorage.setItem(zb,F?"1":"0")}catch{}},H=i==null?void 0:i.mtimeMs;P.useEffect(()=>{if(H===void 0)return;let F=!1;return Xt.blame(e).then(V=>!F&&j(V),()=>!F&&j(null)),()=>{F=!0}},[e,H]);const U=P.useMemo(()=>A!=null&&A.available&&!y?{you:A.you,commits:A.commits,lines:A.lines,details:c8}:void 0,[A,y]),W=(()=>{if(!(A!=null&&A.available))return null;const F=Object.values(A.commits).filter(X=>!X.uncommitted),V=F.sort((X,$)=>$.time-X.time)[0],ne=new Set(F.map(X=>X.author)).size,le=Object.values(A.commits).some(X=>X.uncommitted);return{latest:V,authors:ne,uncommitted:le,you:A.you}})(),Y=P.useCallback((F=!1)=>{if(!F&&rs(en.getState().drafts[e])||Wy(e))return;const V=Lu();Xt.read(e).then(ne=>{if(Lu()===V){if(h(null),_(!1),E(null),ne.kind!=="text"){p({kind:ne.kind,size:ne.size}),s(e);return}p(null),r(e,{text:ne.content,base:ne.content,mtimeMs:ne.mtimeMs})}},ne=>h(ne.message))},[e,r,s]);P.useEffect(()=>Y(),[Y,l]);const Q=P.useCallback(async(F=!1,V=!1)=>{var X;const ne=en.getState().drafts[e];if(!ne||w.current)return;const le=Lu();m(!0),w.current=!0;try{const $=await Xt.write(e,ne.text,F?void 0:ne.mtimeMs);if(g.current=null,Lu()!==le)return;const oe=((X=en.getState().drafts[e])==null?void 0:X.text)??ne.text;r(e,{text:oe,base:ne.text,mtimeMs:$.mtimeMs}),_(!1),E(null),V||ye.getState().notify("Saved.")}catch($){$ instanceof CC&&$.status===409?_(!0):(g.current=ne.text,ye.getState().notify($.message,"error"))}finally{m(!1),w.current=!1}},[e,r]);P.useEffect(()=>{let F=!1;const V=async()=>{const le=en.getState().drafts[e];if(F||!le||w.current||document.hidden)return;const X=await Xt.stat(e).catch(()=>null);if(!X||F||w.current)return;const $=en.getState().drafts[e];if($){if(!X.exists){if(S.current===-1)return;E(oe=>(oe==null?void 0:oe.state)==="deleted"?oe:{state:"deleted",comparing:!1});return}if(X.mtimeMs!==$.mtimeMs){if(!rs($))return Y(!0);b.current=X.mtimeMs,X.mtimeMs!==S.current&&E(oe=>(oe==null?void 0:oe.state)==="changed"?oe:{state:"changed",comparing:!1})}}},ne=setInterval(()=>void V(),o8);return()=>{F=!0,clearInterval(ne)}},[e,Y]);const K=uy(F=>F.on);P.useEffect(()=>{if(!K||!y||c||x||(i==null?void 0:i.text)===g.current)return;const F=window.setTimeout(()=>void Q(!1,!0),a8);return()=>window.clearTimeout(F)},[K,y,c,x,i==null?void 0:i.text,Q]);const z=async()=>{const F=await Xt.read(e).catch(()=>null);(F==null?void 0:F.kind)==="text"&&E({state:"changed",content:F.content,comparing:!0})};P.useEffect(()=>{const F=V=>{(V.ctrlKey||V.metaKey)&&V.key.toLowerCase()==="s"&&(V.preventDefault(),rs(en.getState().drafts[e])&&Q())};return window.addEventListener("keydown",F,!0),()=>window.removeEventListener("keydown",F,!0)},[e,Q]),P.useEffect(()=>Bn.getState().show(e),[e]);const O=F=>{const V=en.getState().drafts[e];V&&r(e,{...V,text:F}),Bn.getState().pin(e)},G=e.split("/").pop()??e,Z=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"project root";return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("div",{className:"space-y-3 px-5 pb-3 pt-4",children:[v.jsx(Er,{group:"Files",title:G,description:Z,action:(T||i)&&v.jsxs(v.Fragment,{children:[L&&i&&v.jsxs(_e,{onClick:()=>D(R==="preview"?"code":"preview"),title:R==="preview"?"Edit the HTML":"Show the page",children:[R==="preview"?v.jsx(R3,{size:13}):v.jsx(rg,{size:13})," ",R==="preview"?"Code":"Preview"]}),(T||L)&&v.jsx("a",{href:Om(e),target:"_blank",rel:"noreferrer",title:"Open in a new browser tab",className:"inline-flex items-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(ma,{size:13})}),i&&v.jsxs(v.Fragment,{children:[y&&!K&&v.jsx("span",{className:"self-center text-[11px] text-severity-warning",children:"Unsaved, kept while this page is open"}),v.jsx(Fh,{label:"Auto save",title:"For every file: saves 1 second after you stop typing",checked:K,onCheckedChange:F=>{uy.getState().set(F),ye.getState().notify(F?"Auto save on: every file saves itself 1 second after you stop typing.":"Auto save off: save with the Save button or Ctrl+S.")},className:"mr-1"}),y&&v.jsx(_e,{onClick:()=>r(e,{...i,text:i.base}),children:"Discard"}),v.jsxs(_e,{variant:"primary",disabled:!y||d,onClick:()=>void Q(),title:"Save (Ctrl+S)",children:[v.jsx(K3,{size:13})," ",d?"Saving...":"Save"]})]})]})}),A&&v.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[v.jsx(j3,{size:13,className:"shrink-0"}),A.available?v.jsxs(v.Fragment,{children:[(W==null?void 0:W.latest)&&v.jsxs("span",{className:"min-w-0 truncate",title:W.latest.summary,children:["Last change: ",v.jsx("span",{className:"text-foreground",children:W.latest.author===W.you?"You":W.latest.author}),", ",l8(W.latest.time)," · ",W.latest.summary]}),v.jsxs("span",{children:[(W==null?void 0:W.authors)??0," author",(W==null?void 0:W.authors)===1?"":"s"]}),(W==null?void 0:W.uncommitted)&&v.jsx("span",{className:"text-severity-warning",children:"uncommitted changes"}),y&&v.jsx("span",{children:"blame hidden while editing"}),v.jsxs("button",{className:xe("ml-auto rounded px-1.5 py-0.5 transition-colors",M?"bg-primary/15 text-primary":"hover:bg-muted hover:text-foreground"),onClick:B,title:"Show who last changed every line",children:["File blame ",M?"on":"off"]})]}):v.jsx("span",{children:A.reason})]}),x&&!c&&v.jsxs("div",{className:"space-y-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"flex-1",children:x.state==="deleted"?"This file was deleted on disk. Your unsaved edits are still here.":"This file changed on disk while you were editing it. Your edits are kept; saving will ask before overwriting."}),x.state==="changed"&&v.jsx(_e,{onClick:()=>x.comparing?E({...x,comparing:!1}):void z(),children:x.comparing?"Hide changes":"Compare"}),x.state==="changed"&&v.jsx(_e,{onClick:()=>Y(!0),children:"Reload from disk"}),v.jsx(_e,{variant:"ghost",onClick:()=>{S.current=x.state==="deleted"?-1:b.current,E(null)},children:"Keep editing"})]}),x.comparing&&x.content!==void 0&&i&&v.jsx(fh,{before:x.content,after:i.text})]}),c&&v.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[v.jsx("span",{className:"flex-1",children:"This file changed on disk since it was opened. Overwrite it with your version, or reload it and lose your edits."}),v.jsx(_e,{variant:"primary",onClick:()=>void Q(!0),children:"Overwrite"}),v.jsx(_e,{onClick:()=>Y(!0),children:"Reload from disk"})]})]}),v.jsx("div",{className:"min-h-0 flex-1 px-5 pb-5",children:T?v.jsx(s8,{path:e,kind:T,tick:l}):a?v.jsx(nn,{icon:mm,title:a}):f?v.jsx(nn,{icon:mm,title:f.kind==="binary"?"A binary file":"Too large to open here",hint:f.kind==="binary"?`${Ib(f.size)}; it is not shown as text.`:`${Ib(f.size)}; files over 2 MB are not opened in the editor.`}):i?L&&R==="preview"?v.jsx("iframe",{title:G,src:`${Om(e)}?v=${i.mtimeMs}`,sandbox:"allow-scripts allow-forms allow-popups allow-modals",className:"h-full w-full rounded border bg-white"},i.mtimeMs):hL(e)?v.jsx(tc,{fill:!0,value:i.text,onChange:O,blame:U,fileBlame:M}):v.jsx("div",{className:"h-full overflow-hidden rounded border",children:v.jsx(EC,{path:e,value:i.text,onChange:O,blame:U,fileBlame:M})}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})})]})}function h8({value:e,onChange:i,categories:r,allowNone:s=!0}){return v.jsxs(ia,{value:e,onValueChange:i,children:[s&&v.jsx(En,{value:"",children:"None (stays open until you stop it)"}),v.jsx(En,{value:"auto",children:"Auto (Claude picks one)"}),r.map(l=>v.jsx(En,{value:l.name,children:l.name},l.id))]})}const d8={"claude-system":"Appended to Claude's system prompt","claude-typed":"Typed into the session",channel:"Sent to channels"};function f8(){const e=ut(()=>ve.prompts(),[]),[i,r]=P.useState("preview"),[s,l]=P.useState(!1),f=p=>{r(p),l(!0)};return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Settings",title:"Hub prompts",description:"Text the hub adds to sessions and sends to channels."})}),v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:xe("w-full shrink-0 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",s&&"hidden"),children:[v.jsx(Hb,{active:i==="preview",onClick:()=>f("preview"),children:"Preview what a session gets"}),["claude-system","claude-typed","channel"].map(p=>v.jsxs("div",{className:"mt-3",children:[v.jsx("div",{className:"px-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:d8[p]}),(e.data??[]).filter(a=>a.audience===p).map(a=>v.jsxs(Hb,{active:i===a.key,onClick:()=>f(a.key),children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.label}),a.overridden&&v.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-primary",title:"Edited"})]},a.key))]},p))]}),v.jsxs("div",{className:xe("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!s&&"hidden"),children:[v.jsx(Ig,{onClick:()=>l(!1)}),i==="preview"?v.jsx(m8,{}):e.data&&v.jsx(p8,{prompt:e.data.find(p=>p.key===i),onSaved:e.reload},i)]})]})]})}function Hb({active:e,onClick:i,children:r}){return v.jsxs("button",{onClick:i,className:xe("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs",e?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(wS,{size:12,className:"shrink-0"}),r]})}function p8({prompt:e,onSaved:i}){const r=pn(),[s,l]=P.useState(e.text),f=s!==e.text,p=()=>r({title:`Save "${e.label}"?`,description:"New sessions get the new text.",body:v.jsx(fh,{before:e.text,after:s}),confirmLabel:"Save",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,s),ye.getState().notify("Saved."),i()}}),a=()=>r({title:"Restore the default text?",description:"Your version is discarded.",body:v.jsx(fh,{before:e.text,after:e.defaultText}),confirmLabel:"Restore default",tone:"destructive",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,null),l(e.defaultText),i()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.label,e.overridden&&v.jsx(nt,{tone:"on",children:"edited"})]}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.overridden&&v.jsxs(_e,{variant:"ghost",onClick:()=>void a(),children:[v.jsx(X3,{size:12})," Restore default"]}),f&&v.jsx(_e,{onClick:()=>l(e.text),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!f,onClick:()=>void p(),children:"Review & save"})]})]}),e.placeholders.length>0&&v.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Placeholders:"," ",e.placeholders.map(h=>v.jsx("code",{className:"mr-1 rounded bg-muted px-1 font-mono",children:`{{${h}}}`},h))]}),v.jsx(tc,{rows:22,value:s,onChange:l})]})}function m8(){const[e,i]=P.useState(""),[r,s]=P.useState([]),l=ut(()=>ve.previewSystemPrompt(e),[],e);return P.useEffect(()=>{ve.categories().then(s)},[]),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-sm font-semibold",children:"What the hub appends to a session"}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Passed with --append-system-prompt-file, after Claude Code's own system prompt and your CLAUDE.md files, which still load as usual. Pick a category to see the done protocol a triggered run gets."})]}),v.jsx("div",{className:"w-full max-w-[18rem]",children:v.jsx(h8,{value:e,onChange:i,categories:r})}),l.data?v.jsx(tc,{rows:24,value:l.data.text}):v.jsx(nn,{variant:"inline",title:"Loading..."})]})}function P2(e){const[i,r]=P.useState(()=>window.matchMedia(e).matches);return P.useEffect(()=>{const s=window.matchMedia(e),l=()=>r(s.matches);return l(),s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),i}function ph(e,i,{min:r=200,max:s=720}={}){const l=P.useCallback(d=>Math.min(s,Math.max(r,Math.round(d))),[r,s]),[f,p]=P.useState(()=>{try{const d=Number(localStorage.getItem(e));return d?l(d):i}catch{return i}});P.useEffect(()=>{try{localStorage.setItem(e,String(f))}catch{}},[e,f]);const a=P.useCallback(d=>p(m=>l(m+d)),[l]),h=P.useCallback(()=>p(i),[i]);return{width:f,resizeBy:a,reset:h}}function Km({placeholder:e,disabled:i,onSend:r,value:s,onChange:l,autoFocus:f,className:p}){return v.jsx(qg,{rows:1,autoFocus:f,value:s,disabled:i,placeholder:`${e.replace(/\.\.\.$/,"")} (Enter to send)`,onChange:a=>l(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s.trim()&&r(s))},className:xe("min-h-[32px] flex-1 font-sans",p)})}const Qm=e=>`clauder-hub:answer:${e}`;function g8(e,i){const[r,s]=P.useState(()=>{try{const f=localStorage.getItem(Qm(e));return f?{...i,...JSON.parse(f)}:i}catch{return i}});return[r,f=>{s(f);try{localStorage.setItem(Qm(e),JSON.stringify(f))}catch{}}]}function v8(e){try{localStorage.removeItem(Qm(e))}catch{}}function _8(e){const i=e.findIndex(r=>/recommended/i.test(r.label));return i===-1?0:i}function x8({interactionId:e,questions:i,busy:r,onChoose:s,onReply:l}){const f=i.length>1,[p,a]=g8(e,{picks:{},otherOpen:{},others:{},free:""}),{picks:h,otherOpen:d,others:m,free:c}=p,_=w=>a({...p,...w}),x=w=>{const g=h[w];return!!(g&&("option"in g||g.other.trim()))},E=()=>i.map((w,g)=>{const b=h[g];return"option"in b?String(b.option+1):b.other.trim()}).join(`
542
+ `);return v.jsxs("div",{className:"space-y-3",children:[i.map((w,g)=>{const b=_8(w.options),S=h[g];return v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx("span",{className:"mt-px grid h-5 w-5 shrink-0 place-items-center rounded-full bg-primary/15 text-[11px] font-semibold tabular-nums text-primary",children:g+1}),v.jsxs("div",{className:"min-w-0",children:[w.header&&v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:w.header}),v.jsx("div",{className:"break-words text-sm font-semibold leading-snug",children:w.question})]})]}),v.jsxs("div",{className:"space-y-1 pl-7",children:[w.options.map((y,T)=>{const L=!!(S&&"option"in S&&S.option===T);return v.jsxs("button",{disabled:r,onClick:()=>f?_({picks:{...h,[g]:{option:T}}}):s(T),className:xe("flex w-full items-start gap-2.5 rounded-md border px-3 py-1.5 text-left transition-colors hover:bg-muted disabled:opacity-50",T===b&&"border-primary",L&&"bg-primary/15"),children:[v.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:T+1}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"block text-xs font-medium",children:y.label}),y.description&&v.jsx("span",{className:"block text-[11px] text-muted-foreground",children:y.description})]})]},T)}),d[g]?v.jsx("div",{className:xe("rounded-md border px-2 py-1",S&&"other"in S&&"bg-primary/15"),children:v.jsx(Km,{autoFocus:!0,placeholder:"Your own answer",disabled:r,value:m[g]??"",onChange:y=>_({others:{...m,[g]:y},...f?{picks:{...h,[g]:{other:y}}}:{}}),onSend:y=>f?_({picks:{...h,[g]:{other:y}}}):l(y),className:"border-0 bg-transparent px-1 focus:ring-0"})}):v.jsxs("button",{disabled:r,onClick:()=>_({otherOpen:{...d,[g]:!0}}),className:"flex w-full items-center gap-2.5 rounded-md border border-dashed px-3 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:[v.jsx(Vi,{size:12,className:"shrink-0"})," Other, in your own words..."]})]})]},g)}),f&&v.jsxs("div",{className:"flex items-end gap-1.5",children:[v.jsx(Km,{placeholder:"Or answer all of it in your own words",disabled:r,value:c,onChange:w=>_({free:w}),onSend:w=>l(w)}),v.jsx(_e,{variant:"primary",disabled:r||!i.every((w,g)=>x(g)),onClick:()=>l(E()),children:"Send answers"})]})]})}function y8(e,i){P.useEffect(()=>{i||v8(e)},[e,i])}const b8={permission:{label:"Permission",icon:Z3},question:{label:"Question",icon:xS},turn:{label:"Waiting",icon:q3},mcp:{label:"MCP suggested",icon:Vl},done:{label:"Done",icon:_S}};function S8(e){var f,p;const i=e.answer;if(!i)return null;const r=e.presented,s={permission:{1:0,2:1,3:2},mcp:{install:0,skip:1}},l=e.kind==="question"?Number(i)-1:(f=s[e.kind])==null?void 0:f[i];return l!==void 0&&Number.isInteger(l)&&((p=r==null?void 0:r.choices[l])==null?void 0:p.label)||i}function Hl({interaction:e,showSession:i=!1,compact:r=!1,project:s}){var L,R;const l=ye(D=>D.sessions),f=ye(D=>D.go),p=D=>s?window.location.hash=`#/${encodeURIComponent(s.id)}/session/${D.id}`:f(D),[a,h]=P.useState(""),[d,m]=P.useState(!1),[c,_]=P.useState(!1),x=b8[e.kind],E=e.status==="open",w=l.find(D=>D.id===e.sessionId);y8(e.id,E);const g=e.presented??{kind:e.kind,sessionTitle:(w==null?void 0:w.title)??"",headline:e.title,choices:[],quickReplies:[],freeText:"Reply to the session...",details:e.body?{label:"Details",text:e.body,format:"markdown"}:void 0},b=async D=>{m(!0);const A=await rt(D,"Sent to the session.");m(!1),A&&h("")},S=D=>b(()=>s?ve.chooseIn(s.id,e.id,D.ref):ve.choose(e.id,D.ref)),y=D=>D.trim()&&b(()=>s?ve.answerIn(s.id,e.id,D):ve.answer(e.id,D)),T=async()=>{m(!0),await rt(()=>s?ve.dismissIn(s.id,e.id):ve.dismiss(e.id),"Dismissed."),m(!1)};return v.jsxs("div",{className:xe("card p-3",E&&"border-primary/60"),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nt,{tone:E?"warning":e.kind==="done"?"success":"off",icon:x.icon,children:x.label}),s&&v.jsx(nt,{tone:"off",children:s.name}),i&&v.jsx("button",{className:"min-w-0 truncate text-xs font-medium hover:underline",onClick:()=>p({kind:"session",id:e.sessionId}),children:(w==null?void 0:w.title)??(((L=e.presented)==null?void 0:L.sessionTitle)||e.sessionId.slice(0,8))}),v.jsx("span",{className:"ml-auto shrink-0 text-[11px] text-muted-foreground",children:va(e.createdAt)}),i&&v.jsxs(_e,{variant:"muted",className:"shrink-0",title:w!=null&&w.live?"Open the session's terminal":"Open the session (not running; resume it there)","aria-label":"Open the session's terminal",onClick:()=>p({kind:"session",id:e.sessionId}),children:[v.jsx(kS,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Terminal"})]}),E&&v.jsx(_e,{variant:"ghost",size:"icon",className:"shrink-0",disabled:d,title:"Dismiss (nothing is sent to the session)","aria-label":"Dismiss",onClick:()=>void T(),children:v.jsx(vn,{size:13})})]}),v.jsx("div",{className:xe("mt-2 break-words text-sm font-medium",e.kind==="permission"&&"font-mono text-[13px]",r&&"line-clamp-2"),children:g.headline}),g.question&&!r&&v.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:g.question}),E&&!r&&v.jsx("div",{className:"mt-3 space-y-2.5",children:e.kind==="question"&&((R=g.questions)!=null&&R.length)?v.jsx(x8,{interactionId:e.id,questions:g.questions,busy:d,onChoose:D=>void S({ref:`o:${D}`}),onReply:D=>void y(D)}):v.jsxs(v.Fragment,{children:[g.choices.some(D=>D.description)?v.jsx("div",{className:"space-y-1",children:g.choices.map((D,A)=>v.jsxs("button",{disabled:d,onClick:()=>void S(D),className:xe("flex w-full items-start gap-2.5 rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted disabled:opacity-50",D.tone==="primary"&&"border-primary"),children:[v.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:A+1}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"block text-xs font-medium",children:D.label}),D.description&&v.jsx("span",{className:"block text-[11px] text-muted-foreground",children:D.description})]})]},D.ref))}):g.choices.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.choices.map(D=>v.jsx(_e,{variant:D.tone==="primary"?"primary":D.tone==="danger"?"destructive":"muted",disabled:d,onClick:()=>void S(D),children:D.label},D.ref))}),g.quickReplies.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.quickReplies.map(D=>v.jsx("button",{disabled:d,onClick:()=>void S(D),className:"rounded-full border px-2.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:D.label},D.ref))}),g.freeText&&v.jsx(Km,{placeholder:g.freeText,disabled:d,value:a,onChange:h,onSend:D=>void y(D)})]})}),g.details&&!r&&v.jsxs("div",{className:"mt-2",children:[v.jsxs("button",{className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>_(!c),children:[v.jsx(pa,{size:12,className:xe("transition-transform",c&&"rotate-90")}),g.details.label]}),c&&(g.details.format==="code"?v.jsx("pre",{className:"mt-1.5 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 font-mono text-[11px]",children:g.details.text}):v.jsx(pv,{className:"mt-1.5 max-h-72 overflow-auto rounded bg-muted/40 p-2 text-xs",children:g.details.text}))]}),!E&&e.status==="answered"&&v.jsxs("div",{className:"mt-2 break-words text-[11px] text-muted-foreground",children:[e.answeredBy,": ",v.jsx("span",{className:"text-foreground",children:S8(e)})]}),!E&&e.status==="closed"&&e.answeredBy&&e.kind!=="done"&&v.jsxs("div",{className:"mt-2 text-[11px] text-muted-foreground",children:["Closed (",e.answeredBy,")."]})]})}function w8({size:e=18,className:i}){return v.jsxs("svg",{viewBox:"0 18 48 30",width:e,height:e*30/48,className:i,role:"img","aria-label":"Clauder Hub",children:[v.jsx("rect",{width:"36",height:"24",x:"6",y:"18",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"9",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"15",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"30",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"3",height:"9",x:"36",y:"39",fill:"#d77757"}),v.jsx("rect",{width:"7.5",height:"6",y:"33",fill:"#d77757"}),v.jsx("rect",{width:"7.5",height:"6",x:"40.5",y:"33",fill:"#d77757"}),v.jsx("rect",{width:"9",height:"9",x:"12",y:"24"}),v.jsx("rect",{width:"9",height:"9",x:"27",y:"24"}),v.jsx("rect",{width:"3",height:"6",x:"22.5",y:"22.5",transform:"rotate(90 24 25.5)"}),v.jsx("rect",{width:"3",height:"7",x:"37",y:"22",transform:"rotate(90 38.5 25.5)"}),v.jsx("rect",{width:"3",height:"7",x:"8",y:"22",transform:"rotate(90 9.5 25.5)"})]})}function C8({temp:e,choice:i}){const[r,s]=P.useState(i.current);return v.jsxs("div",{className:"space-y-0.5 rounded-md border px-2.5 py-2",children:[v.jsx(Fh,{label:`Also clear its Claude temp folder (${hg(e.bytes)})`,checked:r,onCheckedChange:l=>{i.current=l,s(l)}}),v.jsx("div",{className:"truncate pl-6 font-mono text-[10px] text-muted-foreground",title:e.path,children:e.path})]})}function Uh(e){const{view:i,sessions:r,go:s}=ye.getState();if(i.kind!=="session"||!e.includes(i.id))return;const l=r.filter(h=>h.live||h.id===i.id),f=l.findIndex(h=>h.id===i.id),p=h=>!e.includes(h.id),a=l.slice(0,Math.max(f,0)).reverse().find(p)??l.slice(f+1).find(p);a&&s({kind:"session",id:a.id})}function $h(){const e=pn(),i=P.useRef(""),r=P.useRef(!0),s=a=>!a||a===ye.getState().projectId;return{rename:(a,h)=>(i.current=a.title,e({title:"Rename session",description:"Also shown in Claude Code's /resume.",body:v.jsx(pi,{autoFocus:!0,size:"md",defaultValue:a.title,onChange:d=>i.current=d.target.value,onFocus:d=>d.target.select()}),confirmLabel:"Rename",run:async()=>{await ve.renameSession(a.id,i.current,s(h)?void 0:h),s(h)&&await ye.getState().refreshSessions()}})),remove:async a=>{const h=await ve.deletionPlan(a.id).catch(m=>(ye.getState().notify(m.message,"error"),null));if(!h)return!1;r.current=!0;const d=await e({title:`Delete "${a.title}" permanently?`,description:a.live?"It is running and will be stopped first. This cannot be undone.":"Removed from ~/.claude. This cannot be undone.",body:v.jsxs("div",{className:"space-y-2 text-xs",children:[h.files.length?v.jsx("div",{className:"divide-y rounded-md border",children:h.files.map(m=>v.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate font-mono text-[11px]",title:m.path,children:m.path}),v.jsx("div",{className:"text-[10px] text-muted-foreground",children:m.what})]}),v.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:hg(m.bytes)})]},m.path))}):v.jsx("div",{className:"text-muted-foreground",children:"No files on disk; only the hub's own record of it goes."}),h.temp&&v.jsx(C8,{temp:h.temp,choice:r}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Also removed: its interactions and MCP suggestions in the hub. Kept: your prompt history (~/.claude/history.jsonl), which every project shares."})]}),confirmLabel:"Delete permanently",tone:"destructive",maxWidth:"max-w-xl",run:async()=>{await ve.deleteSession(a.id,r.current),await ye.getState().refreshSessions(),ye.getState().notify("Deleted.")}});if(d){const{view:m,go:c}=ye.getState();m.kind==="session"&&m.id===a.id&&c({kind:"page",page:"overview"})}return d},stop:(a,h)=>e({title:`Stop "${a.title}"?`,description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(a.id,s(h)?void 0:h),s(h)&&Uh([a.id])}})}}let I2=null;const E8=fetch("/api/file-icons/manifest").then(e=>e.ok?e.json():null).then(e=>I2=e).catch(()=>null);function k8(e,i,r,s){const l=i.toLowerCase(),f=(h,d)=>Object.hasOwn(h,d)?h[d]:void 0;if(r)return f(s?e.folderNamesExpanded:e.folderNames,l)??(s?e.folderExpanded:e.folder);const p=f(e.fileNames,l);if(p)return p;const a=l.split(".");for(let h=1;h<a.length;h++){const d=f(e.fileExtensions,a.slice(h).join("."));if(d)return d}return e.file}function z2({name:e,folder:i=!1,open:r=!1,size:s=14,className:l}){const[f,p]=P.useState(I2);if(P.useEffect(()=>{f||E8.then(a=>a&&p(a))},[f]),!f){const a=i?r?ca:og:sg;return v.jsx(a,{size:s-1,className:xe("shrink-0",l)})}return v.jsx("img",{src:`/api/file-icons/${k8(f,e,i,r)}.svg`,alt:"",width:s,height:s,draggable:!1,className:xe("shrink-0",l)})}var T8=Object.defineProperty,Ut=(e,i)=>T8(e,"name",{value:i,configurable:!0}),[_v,uB]=br("Tooltip",[Sa]),qh=Sa(),R8="TooltipProvider",A8=700,Zm="tooltip.open",[L8,xv]=_v(R8),D8=Ut(e=>{const{__scopeTooltip:i,delayDuration:r=A8,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:f}=e,p=P.useRef(!0),a=P.useRef(!1),h=P.useRef(0);return P.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),v.jsx(L8,{scope:i,isOpenDelayedRef:p,delayDuration:r,onOpen:P.useCallback(()=>{s<=0||(window.clearTimeout(h.current),p.current=!1)},[s]),onClose:P.useCallback(()=>{s<=0||(window.clearTimeout(h.current),h.current=window.setTimeout(()=>p.current=!0,s))},[s]),isPointerInTransitRef:a,onPointerInTransitChange:P.useCallback(d=>{a.current=d},[]),disableHoverableContent:l,children:f})},"TooltipProvider"),Jm="Tooltip",[M8,nc]=_v(Jm),j8=Ut(e=>{const{__scopeTooltip:i,children:r,open:s,defaultOpen:l,onOpenChange:f,disableHoverableContent:p,delayDuration:a}=e,h=xv(Jm,e.__scopeTooltip),d=qh(i),[m,c]=P.useState(null),[_,x]=P.useState(void 0),E=Fi(),w=P.useRef(0),g=p??h.disableHoverableContent,b=a??h.delayDuration,S=P.useRef(!1),[y,T]=Gs({prop:s,defaultProp:l??!1,onChange:Ut(M=>{M?(h.onOpen(),document.dispatchEvent(new CustomEvent(Zm))):h.onClose(),f==null||f(M)},"onChange"),caller:Jm}),L=P.useMemo(()=>y?S.current?"delayed-open":"instant-open":"closed",[y]),R=P.useCallback(()=>{window.clearTimeout(w.current),w.current=0,S.current=!1,T(!0)},[T]),D=P.useCallback(()=>{window.clearTimeout(w.current),w.current=0,T(!1)},[T]),A=P.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{S.current=!0,T(!0),w.current=0},b)},[b,T]);P.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]);const j=_??E;return v.jsx(Dg,{...d,children:v.jsx(M8,{scope:i,contentId:j,setContentId:x,open:y,stateAttribute:L,trigger:m,onTriggerChange:c,onTriggerEnter:P.useCallback(()=>{h.isOpenDelayedRef.current?A():R()},[h.isOpenDelayedRef,A,R]),onTriggerLeave:P.useCallback(()=>{g?D():(window.clearTimeout(w.current),w.current=0)},[D,g]),onOpen:R,onClose:D,disableHoverableContent:g,children:r})})},"Tooltip"),Fb="TooltipTrigger",O8=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,"aria-describedby":l,...f}=i,p=nc(Fb,s),a=xv(Fb,s),h=qh(s),d=P.useRef(null),m=ht(r,d,p.onTriggerChange),c=P.useRef(!1),_=P.useRef(!1),x=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),v.jsx(Mg,{asChild:!0,...h,children:v.jsx(wt.button,{"aria-describedby":p.open?Y2(l,p.contentId):l,"data-state":p.stateAttribute,...f,ref:m,onPointerMove:tt(i.onPointerMove,E=>{E.pointerType!=="touch"&&!_.current&&!a.isPointerInTransitRef.current&&(p.onTriggerEnter(),_.current=!0)}),onPointerLeave:tt(i.onPointerLeave,()=>{p.onTriggerLeave(),_.current=!1}),onPointerDown:tt(i.onPointerDown,()=>{p.open&&p.onClose(),c.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:tt(i.onFocus,()=>{c.current||p.onOpen()}),onBlur:tt(i.onBlur,p.onClose),onClick:tt(i.onClick,p.onClose)})})},"TooltipTrigger")),H2="TooltipPortal",[N8,B8]=_v(H2,{forceMount:void 0}),P8=Ut(e=>{const{__scopeTooltip:i,forceMount:r,children:s,container:l}=e,f=nc(H2,i);return v.jsx(N8,{scope:i,forceMount:r,children:v.jsx(Sr,{present:r||f.open,children:v.jsx(wh,{asChild:!0,container:l,children:s})})})},"TooltipPortal"),Fl="TooltipContent",I8=P.forwardRef(Ut(function(i,r){const s=B8(Fl,i.__scopeTooltip),{forceMount:l=s.forceMount,side:f="top",...p}=i,a=nc(Fl,i.__scopeTooltip);return v.jsx(Sr,{present:l||a.open,children:a.disableHoverableContent?v.jsx(F2,{side:f,...p,ref:r}):v.jsx(z8,{side:f,...p,ref:r})})},"TooltipContent")),z8=P.forwardRef(Ut(function(i,r){const s=nc(Fl,i.__scopeTooltip),l=xv(Fl,i.__scopeTooltip),f=P.useRef(null),p=ht(r,f),[a,h]=P.useState(null),{trigger:d,onClose:m}=s,c=f.current,{onPointerInTransitChange:_}=l,x=P.useCallback(()=>{h(null),_(!1)},[_]),E=P.useCallback((w,g)=>{const b=w.currentTarget,S={x:w.clientX,y:w.clientY},y=U2(S,b.getBoundingClientRect()),T=$2(S,y),L=q2(g.getBoundingClientRect()),R=W2([...T,...L]);h(R),_(!0)},[_]);return P.useEffect(()=>()=>x(),[x]),P.useEffect(()=>{if(d&&c){const w=Ut(b=>E(b,c),"handleTriggerLeave"),g=Ut(b=>E(b,d),"handleContentLeave");return d.addEventListener("pointerleave",w),c.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",w),c.removeEventListener("pointerleave",g)}}},[d,c,E,x]),P.useEffect(()=>{if(a){const w=Ut(g=>{const b=g.target,S={x:g.clientX,y:g.clientY},y=(d==null?void 0:d.contains(b))||(c==null?void 0:c.contains(b)),T=!V2(S,a);y?x():T&&(x(),m())},"handleTrackPointerGrace");return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,c,a,m,x]),v.jsx(F2,{...i,ref:p})},"TooltipContentHoverable")),H8=XS("TooltipContent"),F2=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,children:l,"aria-label":f,id:p,onEscapeKeyDown:a,onPointerDownOutside:h,...d}=i,m=nc(Fl,s),c=qh(s),{onClose:_}=m,[x,E]=P.useState(null),w=ht(r,E);xg(x),P.useEffect(()=>(document.addEventListener(Zm,_),()=>document.removeEventListener(Zm,_)),[_]),P.useEffect(()=>{if(m.trigger){const b=Ut(S=>{S.target instanceof Node&&S.target.contains(m.trigger)&&_()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[m.trigger,_]);const{setContentId:g}=m;return $t(()=>(g(p),()=>{g(void 0)}),[p,g]),v.jsx(Sh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:h,onFocusOutside:b=>b.preventDefault(),onDismiss:_,children:v.jsxs(jg,{"data-state":m.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:m.contentId,...c,...d,ref:w,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(H8,{children:l}),f?v.jsx(T6,{id:m.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),F8=P.forwardRef(Ut(function(i,r){const{__scopeTooltip:s,...l}=i,f=qh(s);return v.jsx(qA,{...f,...l,ref:r})},"TooltipArrow"));function U2(e,i){const r=Math.abs(i.top-e.y),s=Math.abs(i.bottom-e.y),l=Math.abs(i.right-e.x),f=Math.abs(i.left-e.x);switch(Math.min(r,s,l,f)){case f:return"left";case l:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}Ut(U2,"getExitSideFromRect");function $2(e,i,r=5){const s=[];switch(i){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}Ut($2,"getPaddedExitPoints");function q2(e){const{top:i,right:r,bottom:s,left:l}=e;return[{x:l,y:i},{x:r,y:i},{x:r,y:s},{x:l,y:s}]}Ut(q2,"getPointsFromRect");function V2(e,i){const{x:r,y:s}=e;let l=!1;for(let f=0,p=i.length-1;f<i.length;p=f++){const a=i[f],h=i[p],d=a.x,m=a.y,c=h.x,_=h.y;m>s!=_>s&&r<(c-d)*(s-m)/(_-m)+d&&(l=!l)}return l}Ut(V2,"isPointInPolygon");function W2(e){const i=e.slice();return i.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),G2(i)}Ut(W2,"getHull");function G2(e){if(e.length<=1)return e.slice();const i=[];for(let s=0;s<e.length;s++){const l=e[s];for(;i.length>=2;){const f=i[i.length-1],p=i[i.length-2];if((f.x-p.x)*(l.y-p.y)>=(f.y-p.y)*(l.x-p.x))i.pop();else break}i.push(l)}i.pop();const r=[];for(let s=e.length-1;s>=0;s--){const l=e[s];for(;r.length>=2;){const f=r[r.length-1],p=r[r.length-2];if((f.x-p.x)*(l.y-p.y)>=(f.y-p.y)*(l.x-p.x))r.pop();else break}r.push(l)}return r.pop(),i.length===1&&r.length===1&&i[0].x===r[0].x&&i[0].y===r[0].y?i:i.concat(r)}Ut(G2,"getHullPresorted");function Y2(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Ut(Y2,"concatAriaDescribedby");function ur({content:e,children:i,side:r="top",asChild:s=!1,className:l,wide:f}){return e?v.jsx(D8,{delayDuration:300,children:v.jsxs(j8,{children:[v.jsx(O8,{asChild:!0,children:s?i:v.jsx("span",{className:xe("inline-flex",l),children:i})}),v.jsx(P8,{children:v.jsxs(I8,{side:r,sideOffset:6,collisionPadding:8,className:xe("z-[100] rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95 dark:bg-secondary dark:text-foreground",f?"max-w-md":"max-w-xs"),children:[e,v.jsx(F8,{className:"fill-foreground dark:fill-secondary"})]})})]})}):v.jsx(v.Fragment,{children:i})}const Ub=()=>`clauder-hub:files-expanded:${ye.getState().projectId}`,$b="clauder-hub:files-show-ignored",X2=P.createContext(null),Vh=()=>P.useContext(X2);function qb(e,i){try{const r=localStorage.getItem(e);return r===null?i:JSON.parse(r)}catch{return i}}function Vb(e,i){try{localStorage.setItem(e,JSON.stringify(i))}catch{}}const K2=(e,i)=>e?`${e}/${i}`:i,Q2=e=>e.includes("/")?e.slice(0,e.lastIndexOf("/")):"";async function eg(e,i,r){const s=dr.getState().item;if(!s)return;if(s.mode==="copy"){await rt(()=>Xt.copy(s.path,e))&&e&&r(e);return}const l=s.path.split("/").pop()??s.path,f=K2(e,l);if(f===s.path)return dr.getState().set(null);const p=await rt(()=>Xt.rename(s.path,f));if(!p)return;dr.getState().set(null),en.getState().move(s.path,p.path),Bn.getState().rename(s.path,p.path),e&&r(e);const a=ye.getState().view;a.kind==="file"&&(a.path===s.path||a.path.startsWith(`${s.path}/`))&&i({kind:"file",path:p.path+a.path.slice(s.path.length)})}function U8(){const[e,i]=P.useState(()=>qb($b,!1)),[r,s]=P.useState(()=>new Set(qb(Ub(),[]))),[l,f]=P.useState(0),[p,a]=P.useState(null),[h,d]=P.useState(null),m=dr(g=>g.item),c=ye(g=>g.go);P.useEffect(()=>Vb(Ub(),[...r]),[r]),P.useEffect(()=>{const g=()=>f(b=>b+1);return window.addEventListener("focus",g),()=>window.removeEventListener("focus",g)},[]);const _=(g,b)=>s(S=>{const y=new Set(S);return b??!y.has(g)?y.add(g):y.delete(g),y}),x={showIgnored:e,epoch:l,expanded:r,toggle:_,editing:p,setEditing:a,openMenu:(g,b,S)=>d({entry:g,x:b,y:S})},E=ye(g=>{var b;return((b=g.health)==null?void 0:b.project)??"Project"}),w=g=>{g.defaultPrevented||(g.preventDefault(),d({entry:{name:E,path:"",kind:"dir",size:0,ignored:!1},x:g.clientX,y:g.clientY}))};return v.jsxs(X2.Provider,{value:x,children:[v.jsxs("div",{className:"flex min-h-full flex-col",onContextMenu:w,children:[v.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-0.5 bg-background px-3 pb-1",children:[v.jsx("div",{className:"flex-1 text-[10px] text-muted-foreground",children:"Project files"}),v.jsx(ur,{content:"New file",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"New file",onClick:()=>a({kind:"file",parent:""}),children:v.jsx(pm,{size:13})})}),v.jsx(ur,{content:"New folder",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"New folder",onClick:()=>a({kind:"folder",parent:""}),children:v.jsx(gm,{size:13})})}),v.jsx(ur,{content:e?"Hide ignored":"Show ignored",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Show ignored","aria-pressed":e,className:xe(e&&"bg-muted text-foreground"),onClick:()=>{i(!e),Vb($b,!e)},children:e?v.jsx(rg,{size:13}):v.jsx(D3,{size:13})})}),m&&v.jsx(ur,{content:`Paste ${m.path.split("/").pop()} into the project root`,asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Paste into the project root",onClick:()=>void eg("",c,g=>_(g,!0)),children:v.jsx(fm,{size:13})})}),v.jsx(ur,{content:"Refresh",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon","aria-label":"Refresh",onClick:()=>f(l+1),children:v.jsx(yh,{size:13})})})]}),v.jsx("div",{className:"flex-1 px-2",children:v.jsx(Z2,{path:"",depth:0})})]}),h&&v.jsx(q8,{...h,onClose:()=>d(null)})]})}function Z2({path:e,depth:i}){const{showIgnored:r,epoch:s,editing:l}=Vh(),{data:f,error:p}=ut(()=>Xt.list(e,r),["files","sessions"],[e,r,s]),a=l&&l.kind!=="rename"&&l.parent===e?l.kind:null,h={paddingLeft:`${i*12+8}px`};return v.jsxs(v.Fragment,{children:[a&&v.jsx(J2,{depth:i,icon:a==="folder"?og:sg,initial:""}),p&&v.jsx("div",{className:"py-1 text-[11px] text-severity-critical",style:h,children:p}),!f&&!p&&v.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:h,children:"Loading..."}),f&&!f.entries.length&&!a&&v.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:h,children:"Empty"}),f==null?void 0:f.entries.map(d=>v.jsx($8,{entry:d,depth:i},d.path))]})}function $8({entry:e,depth:i}){const{expanded:r,toggle:s,editing:l,openMenu:f}=Vh(),p=ye(x=>x.go),a=ye(x=>x.view.kind==="file"&&x.view.path===e.path),h=en(x=>rs(x.drafts[e.path])),d=dr(x=>{var E;return((E=x.item)==null?void 0:E.mode)==="cut"&&x.item.path===e.path}),m=e.kind==="dir"&&r.has(e.path),c=P.useRef({fired:!1}),_=()=>window.clearTimeout(c.current.timer);return(l==null?void 0:l.kind)==="rename"&&l.entry.path===e.path?v.jsx(J2,{depth:i,icon:e.kind==="dir"?og:sg,initial:e.name}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>{c.current.fired||(e.kind==="dir"?s(e.path):p({kind:"file",path:e.path}))},onDoubleClick:()=>e.kind==="file"&&Bn.getState().pin(e.path),onContextMenu:x=>{x.preventDefault(),f(e,x.clientX,x.clientY)},onPointerDown:x=>{if(c.current.fired=!1,x.pointerType!=="touch")return;const{clientX:E,clientY:w}=x;window.clearTimeout(c.current.timer),c.current.timer=window.setTimeout(()=>{c.current.fired=!0,f(e,E,w)},500)},onPointerUp:_,onPointerLeave:_,onPointerCancel:_,title:e.path,className:xe("flex w-full select-none items-center gap-1.5 rounded-md py-1 pr-8 text-left text-xs transition-colors [-webkit-touch-callout:none] md:pr-2",a?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground",e.ignored&&"opacity-55",d&&"opacity-45"),style:{paddingLeft:`${i*12+4}px`},children:[e.kind==="dir"?m?v.jsx(ql,{size:11,className:"shrink-0"}):v.jsx(pa,{size:11,className:"shrink-0"}):v.jsx("span",{className:"w-[11px] shrink-0"}),v.jsx(z2,{name:e.name,folder:e.kind==="dir",open:m}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name}),h&&v.jsx("span",{title:"Unsaved changes",className:"h-1.5 w-1.5 shrink-0 rounded-full bg-severity-warning"})]}),v.jsx("button",{"aria-label":"File actions",title:"File actions",onClick:x=>{const E=x.currentTarget.getBoundingClientRect();f(e,E.right-192,E.bottom+4)},className:"absolute right-1 top-0.5 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:v.jsx(yS,{size:13})})]}),m&&v.jsx(Z2,{path:e.path,depth:i+1})]})}function J2({depth:e,icon:i,initial:r}){const{editing:s,setEditing:l,toggle:f}=Vh(),p=ye(c=>c.go),[a,h]=P.useState(r),d=P.useRef(!1),m=async()=>{const c=a.trim();if(d.current)return;if(!s||!c)return l(null);if(s.kind==="rename"&&/[\\/]/.test(c)){ye.getState().notify("A name cannot contain / or \\. To move it, use Cut and Paste.","error");return}const _=s.kind==="rename"?Q2(s.entry.path):s.parent,x=c.startsWith("/")?c.replace(/^\/+/,""):K2(_,c);if(d.current=!0,s.kind==="rename"){const E=s.entry.path;if(x===E)return l(null);const w=await rt(()=>Xt.rename(E,x));if(d.current=!1,!w)return;en.getState().move(E,w.path),Bn.getState().rename(E,w.path);const g=ye.getState().view;g.kind==="file"&&(g.path===E||g.path.startsWith(`${E}/`))&&p({kind:"file",path:w.path+g.path.slice(E.length)})}else{const E=await rt(()=>s.kind==="folder"?Xt.mkdir(x):Xt.create(x));if(d.current=!1,!E)return;s.kind==="file"?p({kind:"file",path:E.path}):f(E.path,!0)}l(null)};return v.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-2",style:{paddingLeft:`${e*12+19}px`},children:[v.jsx(i,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("input",{autoFocus:!0,value:a,onChange:c=>h(c.target.value),onFocus:c=>{const _=r.lastIndexOf(".");c.currentTarget.setSelectionRange(0,_>0?_:r.length)},onKeyDown:c=>{c.key==="Enter"&&m(),c.key==="Escape"&&l(null)},onBlur:()=>!d.current&&l(null),placeholder:(s==null?void 0:s.kind)==="folder"?"Folder name":"File name",spellCheck:!1,className:"min-w-0 flex-1 rounded border border-primary/60 bg-background px-1.5 py-0.5 text-xs focus:outline-none"})]})}function q8({entry:e,x:i,y:r,onClose:s}){const{setEditing:l,toggle:f}=Vh(),p=ye(g=>g.go),a=ye(g=>{var b;return((b=g.health)==null?void 0:b.projectRoot)??""}),h=dr(g=>g.item),d=a.includes("\\"),m=e.path==="",c=m?a:a?d?`${a}\\${e.path.replace(/\//g,"\\")}`:`${a}/${e.path}`:e.path,_=(g,b)=>{var S;return void((S=navigator.clipboard)==null?void 0:S.writeText(g).then(()=>ye.getState().notify(`Copied the ${b}.`),()=>ye.getState().notify("The browser did not allow copying.","error")))};P.useEffect(()=>{const g=()=>s(),b=S=>S.key==="Escape"&&s();return window.addEventListener("pointerdown",g),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),window.addEventListener("keydown",b),()=>{window.removeEventListener("pointerdown",g),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),window.removeEventListener("keydown",b)}},[s]);const x=async()=>{if(!await rt(()=>Xt.remove(e.path),`Deleted ${e.name}.`))return;const{drafts:b,drop:S}=en.getState();for(const R of Object.keys(b))(R===e.path||R.startsWith(`${e.path}/`))&&S(R);const y=ye.getState().view,T=y.kind==="file"?y.path:null,L=Bn.getState().close(V4(e.path),T);T&&L!==T?p(L?{kind:"file",path:L}:{kind:"page",page:"overview"}):y.kind==="file"&&(y.path===e.path||y.path.startsWith(`${e.path}/`))&&p({kind:"page",page:"overview"})},E=(g,b,S,y=!1)=>{const T=b;return v.jsxs("button",{onPointerDown:L=>{L.stopPropagation(),s(),window.setTimeout(S)},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",y?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(T,{size:13}),g]})},w=g=>()=>{f(e.path,!0),l({kind:g,parent:e.path})};return m?v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-220))},onPointerDown:g=>g.stopPropagation(),children:[E("New file",pm,()=>l({kind:"file",parent:""})),E("New folder",gm,()=>l({kind:"folder",parent:""})),h&&E("Paste",fm,()=>void eg("",p,g=>f(g,!0))),v.jsx("div",{className:"my-1 border-t"}),E("Copy Path",Rl,()=>_(c,"path")),E("Reveal in File Explorer",ca,()=>void rt(()=>Xt.reveal("")))]}):v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-380))},onPointerDown:g=>g.stopPropagation(),children:[e.kind==="file"?v.jsxs(v.Fragment,{children:[E("Open",Ul,()=>p({kind:"file",path:e.path})),E("Open in new window",ma,()=>dg({kind:"file",path:e.path}))]}):v.jsxs(v.Fragment,{children:[E("New file",pm,w("file")),E("New folder",gm,w("folder"))]}),v.jsx("div",{className:"my-1 border-t"}),E("Cut",Q3,()=>dr.getState().set({mode:"cut",path:e.path})),E("Copy",xh,()=>{dr.getState().set({mode:"copy",path:e.path}),rt(()=>Xt.copyToClipboard(e.path),"Copied: paste it here, or with Ctrl+V in Slack, Teams or a mail.")}),h&&E(`Paste${e.kind==="dir"?" into folder":" here"}`,fm,()=>void eg(e.kind==="dir"?e.path:Q2(e.path),p,g=>f(g,!0))),v.jsx("div",{className:"my-1 border-t"}),E("Copy Path",Rl,()=>_(c,"path")),E("Copy Relative Path",Rl,()=>_(e.path,"relative path")),E("Reveal in File Explorer",ca,()=>void rt(()=>Xt.reveal(e.path))),v.jsx("div",{className:"my-1 border-t"}),E("Rename",Vi,()=>l({kind:"rename",entry:e})),v.jsx("div",{className:"my-1 border-t"}),E("Delete",yr,()=>void x(),!0)]})}const Wb=[{id:"operation",label:"Operation",items:[{page:"overview",label:"Overview",icon:z3},{page:"inbox",label:"Inbox",icon:ls},{page:"automation",label:"Automation",icon:_h}]},{id:"project",label:"Project",items:[{page:"instructions",label:"Instructions",icon:k3},{page:"agents",label:"Agents",icon:mS},{page:"skills",label:"Skills",icon:cg},{page:"commands",label:"Commands",icon:A3},{page:"mcp-servers",label:"MCP servers",icon:Vl},{page:"hooks",label:"Hooks",icon:LS},{page:"plugins",label:"Plugins",icon:Y3}]},{id:"settings",label:"Settings",items:[{page:"claude-settings",label:"Claude settings",icon:J3},{page:"channels",label:"Channels",icon:Wl},{page:"hub-prompts",label:"Hub prompts",icon:wS},{page:"mcp-suggestions",label:"MCP suggestions",icon:G3},{page:"presets",label:"Toolset presets",icon:ag},{page:"categories",label:"Task categories",icon:RS}]}];function Wh({session:e}){const i=e.status==="waiting"?"bg-severity-warning animate-status-pulse":e.status==="running"?"bg-success animate-status-pulse":e.status==="done"?"border border-success bg-transparent":"bg-muted-foreground/40";return v.jsx("span",{className:xe("inline-block h-2 w-2 shrink-0 rounded-full",i)})}const V8={manual:"hub",cron:"cron",webhook:"webhook",queue:"queue",external:"terminal"},Gb="clauder-hub:folded-groups",Yb="clauder-hub:sidebar-tab",W8="clauder-hub:history-hide-tasks",tg="clauder:focus-sessions";function G8(e,i){const[r,s]=P.useState(()=>{try{const f=localStorage.getItem(e);return f===null?i:f==="1"}catch{return i}});return[r,f=>{s(f);try{localStorage.setItem(e,f?"1":"0")}catch{}}]}function Y8(){const[e,i]=P.useState(()=>{try{const s=localStorage.getItem(Yb);return s==="workspace"||s==="files"?s:"sessions"}catch{return"sessions"}});return[e,s=>{i(s);try{localStorage.setItem(Yb,s)}catch{}}]}function X8(){const[e,i]=P.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem(Gb)??"[]"))}catch{return new Set}});return P.useEffect(()=>{try{localStorage.setItem(Gb,JSON.stringify([...e]))}catch{}},[e]),[e,s=>i(l=>{const f=new Set(l);return f.has(s)?f.delete(s):f.add(s),f})]}function e5(e){const i=ye(f=>f.go),[r,s]=P.useState(!1);return{starting:r,newSession:async()=>{if(r)return;s(!0);const f=Math.max(80,Math.floor((window.innerWidth-e-40)/7.8)),p=Math.max(24,Math.floor((window.innerHeight-140)/17)),a=await rt(()=>ve.startSession({cols:f,rows:p}));s(!1),a&&(await ye.getState().refreshSessions(),i({kind:"session",id:a.sessionId}))}}}const K8=[{kind:"hub",label:"Hub task",icon:Gl},{kind:"create-job",label:"Create a job",icon:_h},{kind:"queue-run",label:"Queue a run",icon:ua},{kind:"create-category",label:"New task category",icon:RS},{kind:"create-preset",label:"New toolset preset",icon:ag},{kind:"create-channel",label:"Add a channel",icon:Wl}];function t5({beside:e,size:i="sm",full:r=!1}){const{starting:s,newSession:l}=e5(e),{starting:f,start:p}=Zs(),[a,h]=P.useState(!1),d=s||f,m=c=>{h(!1),c()};return v.jsxs("div",{className:xe("flex",r&&"w-full"),children:[v.jsxs(_e,{variant:"primary",size:i,className:"flex-1 rounded-r-none",disabled:d,onClick:()=>void l(),"aria-label":"New session",children:[v.jsx(Qn,{size:i==="md"?14:13})," ",d?"Starting...":"New session"]}),v.jsxs(Pg,{open:a,onOpenChange:h,align:"end",className:"w-56 p-1",trigger:v.jsx(_e,{variant:"primary",size:i,className:"rounded-l-none border-l border-primary-foreground/25 px-2",disabled:d,"aria-label":"More ways to start",title:"Plain session or hub task",children:v.jsx(ql,{size:14})}),children:[v.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>m(l),children:[v.jsx(Qn,{size:13})," New session"]}),v.jsx("div",{className:"mx-2 mb-0.5 mt-1.5 border-t pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub task"}),K8.map(c=>v.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>m(()=>p(c.kind)),children:[v.jsx(c.icon,{size:13,className:"text-primary"})," ",c.label]},c.kind))]})]})}function Q8({onMenu:e}){const i=ye(r=>r.health);return v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[v.jsx(_e,{variant:"ghost",size:"icon",onClick:e,"aria-label":"Open menu",title:"Menu",children:v.jsx(SS,{size:16})}),v.jsx(da,{}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(Yh,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:(i==null?void 0:i.project)??"..."}),v.jsx(yv,{})]})]}),v.jsx(t5,{beside:0})]})}function Xb({width:e,collapsed:i,onToggle:r,drawer:s=!1}){const{sessions:l,open:f,view:p,go:a,health:h}=ye(),[d,m]=P.useState(""),[c,_]=X8(),[x,E]=Y8(),{starting:w,newSession:g}=e5(s?0:i?48:Number(e)),b=P.useMemo(()=>{const I=d.trim().toLowerCase();return I?l.filter(B=>`${B.title} ${B.firstPrompt??""} ${B.id}`.toLowerCase().includes(I)):l},[l,d]),S=b.filter(I=>I.live),y=b.filter(I=>!I.live),[T,L]=G8(W8,!0),R=T?y.filter(I=>!I.purpose):y,[D,A]=P.useState(0),j=P.useRef(null);P.useEffect(()=>{const I=()=>{E("sessions"),A(B=>B+1),window.setTimeout(()=>{var B;return(B=j.current)==null?void 0:B.scrollIntoView({block:"nearest",behavior:"smooth"})},50)};return window.addEventListener(tg,I),()=>window.removeEventListener(tg,I)},[E]);const M=I=>p.kind==="page"&&p.page===I;return i?v.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[v.jsx(da,{className:"mb-2"}),v.jsx(ur,{content:"New session",side:"right",asChild:!0,children:v.jsx(_e,{variant:"primary",size:"icon",disabled:w,onClick:()=>void g(),children:v.jsx(Qn,{size:14})})}),Wb.map(I=>v.jsx("div",{className:"flex flex-col items-center gap-1 border-t pt-1",children:I.items.map(B=>v.jsx(ur,{content:`${I.label} · ${B.label}`,side:"right",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon",className:xe(M(B.page)&&"bg-muted text-foreground"),onClick:()=>a({kind:"page",page:B.page}),children:v.jsx(B.icon,{size:15})})},B.page))},I.id)),v.jsx("div",{className:"flex-1"}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:v.jsx(vS,{size:15})})]}):v.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[v.jsx(da,{}),v.jsxs("div",{className:"min-w-0",children:[v.jsx(Yh,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx(ur,{content:h==null?void 0:h.projectRoot,wide:!0,className:"min-w-0",children:v.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:(h==null?void 0:h.project)??"..."})}),v.jsx(yv,{})]})]}),s?v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Close menu",children:v.jsx(vn,{size:15})}):v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Collapse sidebar",children:v.jsx(gS,{size:15})})]}),v.jsx("div",{className:"px-3 pb-2",children:v.jsx(t5,{beside:i?48:typeof e=="number"?e:280,size:"md",full:!0})}),v.jsx("div",{className:"mx-3 mb-2 flex rounded-md bg-muted p-0.5",children:[["sessions","Sessions",null],["workspace","Workspace",f.length?String(f.length):null],["files","Files",null]].map(([I,B,H])=>v.jsxs("button",{onClick:()=>E(I),className:xe("flex flex-1 items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors",x===I?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[B,I==="sessions"&&S.length>0&&v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success",title:`${S.length} running`}),H&&v.jsx("span",{className:xe("rounded-full px-1.5 text-[10px] font-semibold",I==="workspace"?"bg-severity-warning text-background":"bg-success/20 text-success"),children:H})]},I))}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:x==="files"?v.jsx(U8,{}):x==="workspace"?v.jsx("nav",{className:"px-2",children:Wb.map(I=>{const B=c.has(I.id),H=I.items.some(U=>M(U.page));return v.jsxs("div",{className:"pb-1",children:[v.jsxs("button",{onClick:()=>_(I.id),className:"flex w-full items-center gap-1 px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[B?v.jsx(pa,{size:11}):v.jsx(ql,{size:11}),I.label,B&&I.id==="operation"&&f.length>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] text-background",children:f.length})]}),(!B||H)&&I.items.filter(U=>!B||M(U.page)).map(U=>v.jsxs("button",{onClick:()=>a({kind:"page",page:U.page}),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",M(U.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(U.icon,{size:14}),U.label,U.page==="inbox"&&f.length>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:f.length})]},U.page))]},I.id)})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"sticky top-0 z-10 bg-background px-3 pb-1",children:v.jsxs("div",{className:"relative",children:[v.jsx(lg,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(pi,{value:d,onChange:I=>m(I.target.value),placeholder:"Search sessions",className:"pl-6"})]})}),v.jsxs("div",{className:"px-2",children:[v.jsx("div",{ref:j,children:v.jsx(Kb,{title:`Live (${S.length})`,sessions:S,flash:D})}),v.jsx(Kb,{title:`History (${R.length})`,sessions:R,action:v.jsxs("label",{className:"flex cursor-pointer select-none items-center gap-1",title:"Hide the hub's own configuration sessions",children:[v.jsx("input",{type:"checkbox",className:"h-3 w-3 accent-[hsl(var(--primary))]",checked:T,onChange:I=>L(I.target.checked)}),"Hide hub tasks"]})}),!b.length&&v.jsx("div",{className:"px-2 pt-3 text-xs text-muted-foreground",children:d?"No match.":"No sessions yet. Start one above."})]})]})})]})}function Z8({session:e,x:i,y:r,onClose:s}){const l=ye(a=>a.go),f=$h();P.useEffect(()=>{const a=()=>s(),h=d=>d.key==="Escape"&&s();return window.addEventListener("pointerdown",a),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),window.addEventListener("keydown",h),()=>{window.removeEventListener("pointerdown",a),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a),window.removeEventListener("keydown",h)}},[s]);const p=(a,h,d,m={})=>{const c=h;return v.jsxs("button",{disabled:m.disabled,title:m.hint,onPointerDown:_=>{_.stopPropagation(),!m.disabled&&(s(),d())},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs disabled:cursor-not-allowed disabled:opacity-40",m.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(c,{size:13}),a]})};return v.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-270)},onPointerDown:a=>a.stopPropagation(),children:[p("Open",Ul,()=>l({kind:"session",id:e.id})),p("Open in new window",ma,()=>dg({kind:"session",id:e.id})),p("Rename",Vi,()=>void f.rename(e)),v.jsx("div",{className:"my-1 border-t"}),e.quiet?p("Allow notifications",ls,()=>void rt(()=>ve.setSessionQuiet(e.id,!1),"Notifications back on for this session.")):p("Do not disturb",la,()=>void rt(()=>ve.setSessionQuiet(e.id,!0),"Nothing from this session goes out on a channel."),{hint:"Its questions still wait in the inbox; no channel hears of them"}),p(`Clear waiting${e.openInteractions?` (${e.openInteractions})`:""}`,U3,()=>void rt(()=>ve.dismissWaiting(e.id),"Cleared."),{disabled:!e.openInteractions,hint:"Puts away what it waits on, unanswered; nothing is typed into it"}),v.jsx("div",{className:"my-1 border-t"}),e.live&&p("Stop",bh,()=>void f.stop(e),{hint:"Stops its terminal; the conversation is kept for a later resume"}),p("Delete permanently",yr,()=>void f.remove(e),{danger:!0,hint:e.live?"Stops it first":void 0})]})}function Kb({title:e,sessions:i,action:r,flash:s=0}){const{view:l,go:f}=ye(),[p,a]=P.useState(null),h=P.useRef({fired:!1}),d=(c,_)=>{if(h.current.fired=!1,_.pointerType!=="touch")return;const{clientX:x,clientY:E}=_;window.clearTimeout(h.current.timer),h.current.timer=window.setTimeout(()=>{h.current.fired=!0,a({session:c,x,y:E})},500)},m=()=>window.clearTimeout(h.current.timer);return!i.length&&!r?null:v.jsxs("div",{className:xe("mt-3 rounded-md",s>0&&"sessions-flash"),children:[p&&v.jsx(Z8,{...p,onClose:()=>a(null)}),v.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:e}),r]}),v.jsx("div",{className:"space-y-0.5",children:i.map(c=>{const _=l.kind==="session"&&l.id===c.id;return v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>!h.current.fired&&f({kind:"session",id:c.id}),onContextMenu:x=>{x.preventDefault(),a({session:c,x:x.clientX,y:x.clientY})},onPointerDown:x=>d(c,x),onPointerUp:m,onPointerLeave:m,onPointerCancel:m,className:xe("block w-full select-none rounded-md px-2 py-1.5 pr-8 text-left transition-colors [-webkit-touch-callout:none] md:select-auto md:pr-2",_?"bg-muted":"hover:bg-muted/60"),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Wh,{session:c}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:c.title}),c.purpose&&v.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-primary/15 px-1 text-[9px] font-medium text-primary",title:`Hub task: ${c.purpose.title}`,children:[v.jsx(Gl,{size:9})," task"]}),c.quiet&&v.jsx("span",{className:"shrink-0 text-muted-foreground",title:"Do not disturb: no channel hears from it",children:v.jsx(la,{size:11})}),c.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:c.openInteractions})]}),v.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 pl-4 text-[10px] text-muted-foreground",children:[v.jsx("span",{children:V8[c.origin]}),v.jsx("span",{children:"·"}),v.jsx("span",{children:va(c.lastAt)}),c.tokens&&v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"·"}),v.jsxs("span",{children:[On(os(c.tokens))," tok"]})]}),c.diskBytes?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"·"}),v.jsx("span",{title:"On disk: transcript, subagents, file snapshots and temp folder",children:hg(c.diskBytes)})]}):null]})]}),v.jsx("button",{"aria-label":"Session actions",title:"Session actions",onClick:x=>{const E=x.currentTarget.getBoundingClientRect();a({session:c,x:E.right-192,y:E.bottom+4})},className:"absolute right-1 top-1 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:v.jsx(yS,{size:14})})]},c.id)})})]},s)}function n5({x:e,y:i,items:r,onClose:s}){return P.useEffect(()=>{const l=()=>s(),f=p=>p.key==="Escape"&&s();return window.addEventListener("pointerdown",l),window.addEventListener("keydown",f),()=>{window.removeEventListener("pointerdown",l),window.removeEventListener("keydown",f)}},[s]),v.jsx("div",{role:"menu",className:"fixed z-50 w-44 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(e,window.innerWidth-184),top:Math.min(i,window.innerHeight-180)},onPointerDown:l=>l.stopPropagation(),children:r.map(([l,f,p,a,h])=>v.jsxs("button",{disabled:h,onClick:()=>{s(),p()},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",a&&"mt-1 border-t pt-2"),children:[v.jsx(f,{size:13}),l]},l))})}function J8(){const e=ye(_=>_.sessions),i=ye(_=>_.view),r=ye(_=>_.go),s=pn(),l=P.useRef(null),f=$h(),[p,a]=P.useState(null),h=e.filter(_=>_.live),d=i.kind==="session"?i.id:null;if(P.useEffect(()=>{var _,x;d&&((x=(_=l.current)==null?void 0:_.querySelector(`[data-session="${CSS.escape(d)}"]`))==null||x.scrollIntoView({block:"nearest",inline:"nearest"}))},[d,h.length]),!h.length)return null;const m=_=>f.stop(_),c=(_,x)=>s({title:`Stop ${x?"all ":""}${_.length} ${x?"running":"other"} terminal${_.length>1?"s":""}?`,description:"Their conversations are kept for a later resume.",body:v.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:_.map(E=>v.jsx("div",{className:"truncate",children:E.title},E.id))}),confirmLabel:x?"Stop all":"Stop others",tone:"destructive",run:async()=>{await Promise.all(_.map(E=>ve.killSession(E.id))),Uh(_.map(E=>E.id))}});return v.jsxs("div",{ref:l,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[p&&v.jsx(n5,{x:p.x,y:p.y,onClose:()=>a(null),items:[["Open",Ul,()=>r({kind:"session",id:p.session.id})],["Rename",Vi,()=>void f.rename(p.session)],["Close",vn,()=>void m(p.session),!0],["Close Others",qs,()=>void c(h.filter(_=>_.id!==p.session.id),!1),!1,h.length<2],["Close All",qs,()=>void c(h,!0)]]}),v.jsx("div",{className:"flex shrink-0 items-center px-2 text-muted-foreground",title:"Running terminals",children:v.jsx(kS,{size:13})}),h.map(_=>{const x=_.id===d;return v.jsxs("div",{"data-session":_.id,title:_.status==="waiting"?`${_.title} (waiting on you)`:_.title,onClick:()=>r({kind:"session",id:_.id}),onContextMenu:E=>{E.preventDefault(),a({session:_,x:E.clientX,y:E.clientY})},onAuxClick:E=>{E.button===1&&(E.preventDefault(),m(_))},className:xe("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",x?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(Wh,{session:_}),v.jsx("span",{className:"truncate",children:_.title}),_.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:_.openInteractions}),v.jsx("button",{"aria-label":`Stop ${_.title}`,title:"Stop this terminal",onClick:E=>{E.stopPropagation(),m(_)},className:xe("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!x&&"invisible group-hover:visible"),children:v.jsx(vn,{size:12})})]},_.id)})]})}const i5="clauder-hub:live-panel";function e9(){try{return localStorage.getItem(i5)!=="0"}catch{return!0}}const Gh=_a((e,i)=>({open:e9(),toggle:()=>{const r=!i().open;e({open:r});try{localStorage.setItem(i5,r?"1":"0")}catch{}}}));function t9(){const{open:e,toggle:i}=Gh(),r=e?CS:W3;return v.jsx("button",{onClick:i,title:e?"Hide the live sessions panel":"Show the live sessions of every project, on the right","aria-label":e?"Hide live sessions":"Show live sessions","aria-pressed":e,className:"self-center rounded p-0.5 text-muted-foreground/70 hover:bg-muted hover:text-foreground",children:v.jsx(r,{size:13})})}function n9({status:e}){return v.jsx("span",{className:xe("inline-block h-2 w-2 shrink-0 rounded-full",e==="waiting"?"bg-severity-warning animate-status-pulse":e==="running"?"bg-success animate-status-pulse":e==="done"?"border border-success bg-transparent":"bg-muted-foreground/40")})}function r5({width:e}){const i=Gh(f=>f.toggle),r=ut(()=>ve.globalLive(),["projects","sessions","interactions","channels"]),s=r.data??[],l=s.reduce((f,p)=>f+p.open.length,0);return v.jsxs("aside",{"aria-label":"Live sessions",style:{width:e},className:"flex shrink-0 flex-col border-l bg-background",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2",children:[v.jsx("span",{className:"text-xs font-semibold",children:"Open sessions"}),v.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-muted px-1 text-[10px] font-semibold leading-none tabular-nums text-muted-foreground",children:l}),v.jsx("div",{className:"flex-1"}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:i,title:"Hide this panel","aria-label":"Hide live sessions",children:v.jsx(CS,{size:13})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:[r.data&&!s.length&&v.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No session is open in any project."}),s.map(f=>v.jsx(i9,{project:f},f.id))]})]})}function i9({project:e}){const i=ye(S=>S.projectId),r=ye(S=>S.view),s=ye(S=>S.openProject),l=ye(S=>S.openSessionIn),[f,p]=P.useState(!1),[a,h]=P.useState(!1),[d,m]=P.useState(null),[c,_]=P.useState(null),x=$h(),E=pn(),w=i===e.id,g=(S,y)=>{if(!S.length)return;const T=async()=>{await ve.closeOpenSessions(e.id,S.map(R=>R.id)),w&&Uh(S.filter(R=>R.live).map(R=>R.id))},L=S.filter(R=>R.live).length;return L?E({title:S.length===1?`Close "${S[0].title}"?`:`Close ${y} in ${e.name}?`,description:`${L===1?"Its terminal stops":`${L} terminals stop`}; the conversation${S.length>1?"s are":" is"} kept for a later resume.`,body:S.length>1?v.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:S.map(R=>v.jsx("div",{className:"truncate",children:R.title},R.id))}):void 0,confirmLabel:"Close",tone:"destructive",run:T}):void rt(T)},b=async()=>{if(f)return;p(!0);const S=document.querySelector("main"),y=Math.max(80,Math.floor((((S==null?void 0:S.clientWidth)??window.innerWidth)-40)/7.8)),T=Math.max(24,Math.floor((window.innerHeight-140)/17)),L=await rt(()=>ve.startSessionIn(e.id,{cols:y,rows:T}));p(!1),L&&(w&&await ye.getState().refreshSessions(),l(e.id,L.sessionId))};return v.jsxs("div",{className:"px-1.5 py-1",children:[c&&v.jsx(wv,{project:e,x:c.x,y:c.y,onClose:()=>_(null)}),v.jsxs("div",{className:"group flex items-center gap-1 px-1.5 py-1",onContextMenu:S=>{S.preventDefault(),_({x:S.clientX,y:S.clientY})},children:[v.jsx("button",{onClick:()=>s(e.id),title:`Open ${e.name}`,className:xe("min-w-0 flex-1 truncate text-left text-[11px] font-semibold uppercase tracking-wide hover:text-foreground",w?"text-foreground":"text-muted-foreground"),children:e.name}),v.jsxs(Pg,{open:a,onOpenChange:h,align:"end",className:"w-64 p-1",trigger:v.jsx(_e,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`Resume a session of ${e.name}`,"aria-label":"Resume a session",disabled:!e.recent.length,children:v.jsx(N3,{size:12})}),children:[v.jsx("div",{className:"px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Resume"}),e.recent.map(S=>v.jsxs("button",{onClick:()=>{h(!1),l(e.id,S.id)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.lastAt&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:va(S.lastAt)})]},S.id))]}),v.jsx(_e,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`New session in ${e.name}`,"aria-label":"New session",disabled:f,onClick:()=>void b(),children:v.jsx(Qn,{size:12})})]}),e.open.map(S=>{const y=w&&r.kind==="session"&&r.id===S.id,T=()=>l(e.id,S.id);return v.jsxs("div",{role:"button",tabIndex:0,onClick:T,onKeyDown:L=>{L.key!=="Enter"&&L.key!==" "||(L.preventDefault(),T())},onContextMenu:L=>{L.preventDefault(),m({session:S,x:L.clientX,y:L.clientY})},title:S.live?S.title:`${S.title} (stopped; opening it resumes it)`,className:xe("group/row flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",y?"bg-primary/15 text-foreground":"hover:bg-muted",!S.live&&!y&&"text-muted-foreground"),children:[v.jsx(n9,{status:S.status}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.openInteractions>0&&v.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none tabular-nums text-background",children:S.openInteractions}),v.jsx("button",{onClick:L=>{L.stopPropagation(),g([S],"it")},title:S.live?"Close: stops its terminal, after asking":"Close","aria-label":`Close ${S.title}`,className:"invisible grid h-4 w-4 shrink-0 place-items-center rounded text-muted-foreground hover:bg-foreground/10 hover:text-foreground group-hover/row:visible group-focus-within/row:visible",children:v.jsx(vn,{size:12})})]},S.id)}),d&&v.jsx(n5,{x:d.x,y:d.y,onClose:()=>m(null),items:[["Open",Ul,()=>l(e.id,d.session.id)],["Rename",Vi,()=>void x.rename(d.session,e.id)],["Close",vn,()=>void g([d.session],"it"),!0],["Close Others",qs,()=>void g(e.open.filter(S=>S.id!==d.session.id),"the others"),!1,e.open.length<2],["Close All",qs,()=>void g(e.open,"all")]]})]})}function s5({open:e,onOpenChange:i}){const r=ye(x=>x.openProject),[s,l]=P.useState(null),[f,p]=P.useState(""),[a,h]=P.useState(null),[d,m]=P.useState(!1),c=async x=>{try{const E=await ve.folders(x);l(E),p(E.path),h(null)}catch(E){h(E.message)}};P.useEffect(()=>{e&&c(s==null?void 0:s.path)},[e]);const _=async x=>{m(!0);try{const E=await ve.addProject(x);i(!1),r(E.id)}catch(E){h(E.message)}finally{m(!1)}};return v.jsx(Iw,{open:e,onOpenChange:i,title:"Open folder",description:"Its sessions, jobs and channels run in the hub from now on.",maxWidth:"max-w-xl",height:"h-[min(36rem,calc(100dvh-2rem))]",footer:v.jsxs(v.Fragment,{children:[v.jsx(_e,{onClick:()=>i(!1),children:"Cancel"}),v.jsx(_e,{variant:"primary",disabled:!f.trim()||d,onClick:()=>void _(f.trim()),children:d?"Opening...":"Open this folder"})]}),children:v.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[v.jsxs("form",{className:"flex gap-1.5",onSubmit:x=>{x.preventDefault(),c(f.trim())},children:[v.jsx(pi,{value:f,onChange:x=>p(x.target.value),placeholder:"C:\\Source code\\your-repo",className:"font-mono"}),v.jsx(_e,{type:"submit",title:"Go to this folder",children:v.jsx(pa,{size:13})})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[v.jsxs(_e,{variant:"ghost",disabled:!(s!=null&&s.parent),onClick:()=>(s==null?void 0:s.parent)&&void c(s.parent),title:"Up one folder",children:[v.jsx(C3,{size:12})," Up"]}),v.jsxs(_e,{variant:"ghost",onClick:()=>void c(s==null?void 0:s.home),children:[v.jsx(B3,{size:12})," Home"]}),((s==null?void 0:s.drives.length)??0)>1&&s.drives.map(x=>v.jsxs(_e,{variant:"ghost",onClick:()=>void c(x),children:[v.jsx(O3,{size:12})," ",x]},x))]}),a&&v.jsx("div",{className:"text-xs text-severity-critical",children:a}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-md border",children:s!=null&&s.folders.length?s.folders.map(x=>v.jsxs("button",{onClick:()=>void c(x.path),onDoubleClick:()=>void _(x.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs hover:bg-muted",title:x.git?"A git repository. Double-click to open it.":x.path,children:[x.git?v.jsx(bS,{size:13,className:"shrink-0 text-primary"}):v.jsx(ca,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.name}),x.git&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"git"})]},x.path)):v.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:s?"No folders in here.":"Loading..."})})]})})}function da({className:e}){const i=ye(r=>r.openProject);return v.jsx("button",{onClick:()=>i(hr),title:"Global: every project","aria-label":"Go to Global",className:xe("shrink-0 rounded hover:opacity-80",e),children:v.jsx(w8,{size:20})})}let Qb=null;function Yh(){const e=ye(s=>s.openProject),[i,r]=P.useState(null);return P.useEffect(()=>{Qb??(Qb=ve.hub().then(s=>s.version??null).catch(()=>null)),Qb.then(r)},[]),v.jsxs("span",{className:"flex items-baseline gap-1.5",children:[v.jsx("button",{onClick:()=>e(hr),title:"Global: every project",className:"text-left text-sm font-semibold leading-tight hover:underline",children:"Clauder Hub"}),i&&v.jsxs("span",{className:"text-[10px] font-normal leading-tight text-muted-foreground/70",children:["v",i]}),v.jsx(r9,{}),v.jsx(t9,{})]})}function r9(){var r;const e=ye(s=>s.projectId),i=ut(()=>ve.channels(),["channels"],e);return!((r=i.data)!=null&&r.paused)||!i.data.channels.length?null:v.jsx("button",{onClick:m6,title:"Notifications are paused on every channel. Click to turn them back on.","aria-label":"Notifications paused",className:"self-center text-severity-warning hover:text-foreground",children:v.jsx(la,{size:12})})}function yv(){const e=ye(l=>l.projectId),i=ye(l=>l.openProject),s=(ut(()=>ve.projects(),["projects"]).data??[]).filter(l=>l.id!==e).reduce((l,f)=>l+f.waiting,0);return v.jsxs("button",{onClick:()=>i(hr),className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Back to the global home: every project",children:["Change",s>0&&v.jsx("span",{className:"grid h-3.5 min-w-[0.875rem] place-items-center rounded-full bg-severity-warning px-1 text-[9px] font-semibold leading-none tabular-nums text-background",children:s})]})}function mh({onDrag:e,onReset:i}){const r=P.useRef(0);return v.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize, double-click to reset",className:"group relative w-1 shrink-0 cursor-col-resize bg-border/60 transition-colors hover:bg-primary/60",onDoubleClick:i,onPointerDown:s=>{s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),r.current=s.clientX,document.body.style.userSelect="none"},onPointerMove:s=>{if(!s.currentTarget.hasPointerCapture(s.pointerId))return;const l=s.clientX-r.current;l&&(r.current=s.clientX,e(l))},onPointerUp:s=>{s.currentTarget.releasePointerCapture(s.pointerId),document.body.style.userSelect=""},onPointerCancel:()=>{document.body.style.userSelect=""},children:v.jsx("span",{className:"absolute inset-y-0 -left-1 -right-1"})})}function o5({tools:e}){const i=B4(e),r={};for(const l of i.mcp){const{server:f,tool:p}=N4(l.name),a=r[f]??(r[f]={count:0,errors:0,tools:[]});a.count+=l.count,a.errors+=l.errors,a.tools.push(`${p} ×${l.count}`)}const s=l=>l.map(f=>({key:f.name,label:f.name,value:f.count,note:f.errors?`${f.errors} failed`:void 0}));return v.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[v.jsx(Dt,{title:`Built-in tools (${i["built-in"].reduce((l,f)=>l+f.count,0)})`,children:v.jsx(as,{rows:s(i["built-in"]),format:String})}),v.jsx(Dt,{title:`MCP servers (${i.mcp.reduce((l,f)=>l+f.count,0)})`,description:"Calls grouped by server; hover a bar for its tools.",children:v.jsx(as,{rows:Object.entries(r).map(([l,f])=>({key:l,label:l,value:f.count,note:f.errors?`${f.errors} failed`:void 0,sublabel:f.tools.slice(0,3).join(", ")})),format:String,empty:"No MCP calls."})})]})}function s9({agent:e}){const[i,r]=P.useState(!1),s=Object.values(e.tools).reduce((l,f)=>l+f.count,0);return v.jsxs("div",{className:"rounded-md border",children:[v.jsxs("button",{className:"flex w-full items-center gap-2 px-2.5 py-2 text-left",onClick:()=>r(!i),style:{paddingLeft:10+(e.depth-1)*16},children:[i?v.jsx(ql,{size:13}):v.jsx(pa,{size:13}),v.jsx(mS,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e.agentType}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:e.description}),v.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:[s," calls · ",On(os(e.tokens))," tok"]})]}),i&&v.jsxs("div",{className:"grid gap-3 border-t p-3 md:grid-cols-2",children:[v.jsxs("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[v.jsxs("div",{children:["Model: ",e.model??"inherited",e.fork&&" · fork"]}),v.jsxs("div",{children:[Ws(e.startedAt)," → ",Ws(e.lastAt)]}),v.jsxs("div",{children:["Output ",On(e.tokens.output)," · cache read ",On(e.tokens.cacheRead)]})]}),v.jsx(as,{rows:Object.entries(e.tools).map(([l,f])=>({key:l,label:l,value:f.count})),format:String,limit:6,empty:"No tool calls."}),e.recent.length>0&&v.jsx("div",{className:"md:col-span-2",children:v.jsx(a5,{calls:e.recent.slice(-10)})})]})]})}function a5({calls:e}){return v.jsx("div",{className:"divide-y rounded-md border",children:[...e].reverse().map(i=>v.jsxs("div",{className:"flex items-baseline gap-2 px-2.5 py-1.5 text-[11px]",children:[v.jsx("span",{className:"hidden w-20 shrink-0 whitespace-nowrap tabular-nums text-muted-foreground sm:block",children:i.ts?new Date(i.ts).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}),v.jsx("span",{className:xe("max-w-[60%] shrink-0 truncate font-mono sm:max-w-none",i.error&&"text-severity-critical"),children:i.name.startsWith("mcp__")?i.name.replace(/^mcp__/,"mcp:"):i.name}),v.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:i.summary})]},i.id))})}function o9({data:e}){const i=e.detail;if(!i)return v.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Claude has not written anything for this session yet."});const r=i.totals,s=Object.values(r.tools).reduce((l,f)=>l+f.count,0);return v.jsxs("div",{className:"space-y-3",children:[v.jsx(oC,{tokens:r.tokens}),v.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[v.jsx(Dt,{title:"Tokens by model",children:v.jsx(as,{rows:Object.entries(r.tokensByModel).filter(([,l])=>os(l)>0).map(([l,f])=>({key:l,label:l,value:os(f)}))})}),v.jsx(Dt,{title:"Skills & commands",children:v.jsx(as,{rows:Object.entries(i.skills).map(([l,f])=>({key:l,label:l,value:f})),format:String,empty:"No skills used."})}),v.jsx(Dt,{title:"Shape",children:v.jsxs("div",{className:"space-y-1 text-xs",children:[v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Prompts"}),v.jsx("span",{className:"tabular-nums",children:e.session.turns??0})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Tool calls (all agents)"}),v.jsx("span",{className:"tabular-nums",children:s})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Subagents"}),v.jsx("span",{className:"tabular-nums",children:i.subagents.length})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Branch"}),v.jsx("span",{className:"font-mono text-[11px]",children:e.session.gitBranch??"-"})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Permission mode"}),v.jsx("span",{children:e.session.permissionMode??"-"})]}),v.jsxs("div",{className:"flex justify-between",children:[v.jsx("span",{className:"text-muted-foreground",children:"Claude Code"}),v.jsx("span",{children:e.session.version??"-"})]})]})})]}),v.jsx(o5,{tools:r.tools}),v.jsx(Dt,{title:`Subagents (${i.subagents.length})`,description:"Each one's own tokens and calls; a fork's inherited context is counted once, on its parent.",children:i.subagents.length?v.jsx("div",{className:"space-y-1.5",children:i.subagents.map(l=>v.jsx(s9,{agent:l},l.id))}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No subagents."})}),v.jsx(Dt,{title:"Recent calls (main thread)",children:i.recent.length?v.jsx(a5,{calls:i.recent.slice(-40)}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No tool calls yet."})})]})}const a9=(e,i)=>JSON.stringify(e)===JSON.stringify(i),om=e=>e.variables.length?e:{...e,variables:[{name:"",value:""}]};function l9({sessionId:e,live:i,current:r}){const s=pn(),[l,f]=P.useState(()=>om(r));P.useEffect(()=>f(om(r)),[JSON.stringify(r)]);const p={notes:l.notes.trim(),variables:l.variables.map(m=>({name:m.name.trim(),value:m.value.trim()})).filter(m=>m.name)},a=!a9(p,r),h=(m,c)=>f({...l,variables:l.variables.map((_,x)=>x===m?{..._,...c}:_)}),d=()=>s({title:i?"Save and restart this session?":"Save this setup?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Save & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionSetup(e,p),ye.getState().notify(i?"Restarting with the new setup.":"Saved.")}});return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("h2",{className:"text-sm font-semibold",children:"Setup"}),v.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:"For this session only, appended to its system prompt. Applies at start-up."})]}),v.jsxs("div",{className:"flex gap-1.5",children:[v.jsx(_e,{disabled:!a,onClick:()=>f(om(r)),children:"Reset"}),v.jsx(_e,{variant:"primary",disabled:!a,onClick:()=>void d(),children:i?"Save & restart":"Save"})]})]}),v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Notes"}),v.jsx(tc,{rows:10,defaultMode:"edit",value:l.notes,onChange:m=>f({...l,notes:m})})]}),v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Names"}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Short names you use in this session and what each stands for, e.g. OUT → C:\\reports\\2026."}),l.variables.map((m,c)=>v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(pi,{className:"w-48 shrink-0 font-mono",placeholder:"Name",value:m.name,onChange:_=>h(c,{name:_.target.value})}),v.jsx(pi,{className:"min-w-0 flex-1",placeholder:"What it stands for",value:m.value,onChange:_=>h(c,{value:_.target.value})}),v.jsx(_e,{variant:"ghost",size:"icon",title:"Remove",onClick:()=>f({...l,variables:l.variables.filter((_,x)=>x!==c)}),children:v.jsx(vn,{size:13})})]},c)),v.jsxs(_e,{variant:"ghost",onClick:()=>f({...l,variables:[...l.variables,{name:"",value:""}]}),children:[v.jsx(Qn,{size:12})," Add a name"]})]})]})}function bv({title:e,subtitle:i,badge:r,mono:s,defaultOpen:l,children:f}){const[p,a]=P.useState(!!l);return v.jsxs("div",{className:"rounded-md bg-muted/30",children:[v.jsxs("button",{onClick:()=>a(!p),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50",children:[v.jsx(pa,{size:13,className:xe("shrink-0 transition-transform",p&&"rotate-90")}),v.jsxs("span",{className:"min-w-0 flex-1",children:[v.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[v.jsx("span",{className:xe("min-w-0 truncate text-xs font-medium",s&&"font-mono"),title:typeof e=="string"?e:void 0,children:e}),r&&v.jsx("span",{className:"shrink-0",children:r})]}),i&&v.jsx("span",{className:"block truncate text-[11px] text-muted-foreground",children:i})]})]}),p&&v.jsx("div",{className:"bg-muted/20 px-3 py-2",children:f})]})}function ds(){return v.jsx(nt,{tone:"on",className:"px-1 py-0 text-[9px] leading-[14px]",title:"Applies to every project on this machine, not only this one.",children:"global"})}const c9=[{kind:"plugins",title:"Plugins"},{kind:"agents",title:"Agents"},{kind:"skills",title:"Skills"},{kind:"mcp",title:"MCP servers"}];function u9({on:e,disabled:i,onToggle:r}){return v.jsx("button",{role:"switch","aria-checked":e,disabled:i,onClick:r,className:xe("relative h-4 w-7 shrink-0 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-40",e?"bg-primary":"bg-foreground/20"),children:v.jsx("span",{className:xe("absolute top-0.5 h-3 w-3 rounded-full bg-background transition-all",e?"left-3.5":"left-0.5")})})}function l5({catalog:e,value:i,onChange:r}){const[s,l]=P.useState(""),f=P.useMemo(()=>new Set(e.filter(m=>m.kind==="plugins"&&m.scope==="user").map(m=>m.id)),[e]),p=m=>m.scope==="user"||m.scope==="plugin"&&!!(m.plugin&&f.has(m.plugin)),a=m=>{const c=i[m.kind];r({...i,[m.kind]:c.includes(m.id)?c.filter(_=>_!==m.id):[...c,m.id]})},h=(m,c,_)=>{const x=new Set(_.map(w=>w.id)),E=i[m].filter(w=>!x.has(w));r({...i,[m]:c?E:[...E,...x]})},d=s.trim().toLowerCase();return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(lg,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(pi,{value:s,onChange:m=>l(m.target.value),placeholder:"Filter",className:"pl-6"})]}),c9.map(({kind:m,title:c})=>{const _=e.filter(w=>w.kind===m);if(!_.length)return null;const x=d?_.filter(w=>`${w.label} ${w.description}`.toLowerCase().includes(d)):_,E=_.filter(w=>i[m].includes(w.id)||w.plugin&&i.plugins.includes(w.plugin)).length;return v.jsxs(bv,{title:c,badge:v.jsx(nt,{tone:E?"warning":"off",children:E?`${E} of ${_.length} off`:`${_.length} on`}),defaultOpen:!0,children:[v.jsxs("div",{className:"mb-1.5 flex gap-3 text-[11px] text-muted-foreground",children:[v.jsx("button",{className:"hover:text-foreground",onClick:()=>h(m,!0,x),children:"All on"}),v.jsx("button",{className:"hover:text-foreground",onClick:()=>h(m,!1,x),children:"All off"})]}),x.length?v.jsx("div",{className:"divide-y rounded-md border bg-background",children:x.map(w=>{const g=!!(w.plugin&&i.plugins.includes(w.plugin)),b=!g&&!i[m].includes(w.id);return v.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[v.jsx(u9,{on:b,disabled:g,onToggle:()=>a(w)}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] text-foreground",children:w.label}),p(w)&&v.jsx(ds,{})]}),w.description&&v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:w.description})]}),g?v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"off with its plugin"}):!w.leavesContext&&v.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",title:"Turning this off blocks its use; Claude may still see it listed.",children:"blocks use only"}),v.jsx("span",{className:"hidden w-16 shrink-0 text-right text-[10px] text-muted-foreground sm:block",children:w.scope})]},w.id)})}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"No match."})]},m)})]})}function gh(e){return e.agents.length+e.skills.length+e.mcp.length+e.plugins.length}const h9=(e,i)=>JSON.stringify(e)===JSON.stringify(i);function d9({sessionId:e,live:i,current:r}){const s=pn(),l=ut(()=>ve.toolsetCatalog(),[]),f=ut(()=>ve.presets(),["jobs"]),[p,a]=P.useState(r),h=P.useRef("");P.useEffect(()=>a(r),[JSON.stringify(r)]);const d=!h9(p,r),m=()=>s({title:i?"Apply and restart this session?":"Save this toolset?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Apply & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionToolset(e,p),ye.getState().notify(i?"Restarting with the new toolset.":"Saved.")}}),c=()=>(h.current="",s({title:"Save as a preset",description:"Reusable by jobs and new sessions.",body:v.jsx(pi,{autoFocus:!0,placeholder:"Preset name, e.g. Frontend only",onChange:_=>h.current=_.target.value}),confirmLabel:"Save preset",run:async()=>{await ve.savePreset({name:h.current,toolset:p}),ye.getState().notify("Preset saved."),f.reload()}}));return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[v.jsx("h2",{className:"text-sm font-semibold",children:"Toolset"}),v.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[gh(r)?`${gh(r)} turned off for this session.`:"Everything is on."," Applies at start-up."]})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.data&&f.data.length>0&&v.jsxs(ia,{value:"",onValueChange:_=>{var E;const x=(E=f.data)==null?void 0:E.find(w=>w.id===_);x&&a(x.toolset)},className:"w-40",children:[v.jsx(En,{value:"",children:"Use a preset..."}),f.data.map(_=>v.jsxs(En,{value:_.id,children:[_.name,_.isDefault?" (default)":""]},_.id))]}),v.jsx(_e,{onClick:()=>void c(),children:"Save as preset"}),d&&v.jsx(_e,{onClick:()=>a(r),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!d,onClick:()=>void m(),children:i?"Apply & restart":"Save"})]})]}),l.data?v.jsx(l5,{catalog:l.data,value:p,onChange:a}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})]})}var am={exports:{}},Zb;function f9(){return Zb||(Zb=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const f=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(f._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,f=l._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const p=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),c=h-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),_=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-p;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(c/f.css.cell.height))}}}})(),r})()))})(am)),am.exports}var p9=f9(),eh={exports:{}},m9=eh.exports,Jb;function g9(){return Jb||(Jb=1,(function(e,i){(function(r,s){e.exports=s()})(m9,(()=>(()=>{var r={433:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV11=void 0;const d=h(938),m=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],c=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],_=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],x=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let E;function w(g,b){let S,y=0,T=b.length-1;if(g<b[0][0]||g>b[T][1])return!1;for(;T>=y;)if(S=y+T>>1,g>b[S][1])y=S+1;else{if(!(g<b[S][0]))return!0;T=S-1}return!1}a.UnicodeV11=class{constructor(){if(this.version="11",!E){E=new Uint8Array(65536),E.fill(1),E[0]=0,E.fill(0,1,32),E.fill(0,127,160);for(let g=0;g<m.length;++g)E.fill(0,m[g][0],m[g][1]+1);for(let g=0;g<_.length;++g)E.fill(2,_[g][0],_[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?E[g]:w(g,c)?0:w(g,x)?2:1}charProperties(g,b){let S=this.wcwidth(g),y=S===0&&b!==0;if(y){const T=d.UnicodeService.extractWidth(b);T===0?y=!1:T>S&&(S=T)}return d.UnicodeService.createPropertyValue(0,S,y)}}},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const m=[];for(let c=0;c<this._listeners.length;c++)m.push(this._listeners[c]);for(let c=0;c<m.length;c++)m[c].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(h,d){return h((m=>d.fire(m)))},a.runAndSubscribe=function(h,d){return d(void 0),h((m=>d(m)))}},490:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=h(938),m=[[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]],c=[[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]];let _;a.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<m.length;++x)_.fill(0,m[x][0],m[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(E,w){let g,b=0,S=w.length-1;if(E<w[0][0]||E>w[S][1])return!1;for(;S>=b;)if(g=b+S>>1,E>w[g][1])b=g+1;else{if(!(E<w[g][0]))return!0;S=g-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,E){let w=this.wcwidth(x),g=w===0&&E!==0;if(g){const b=d.UnicodeService.extractWidth(E);b===0?g=!1:b>w&&(w=b)}return d.UnicodeService.createPropertyValue(0,w,g)}}},938:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=h(345),m=h(490);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,E,w=!1){return(16777215&x)<<3|(3&E)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new m.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let E=0,w=0;const g=x.length;for(let b=0;b<g;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=g)return E+this.wcwidth(S);const L=x.charCodeAt(b);56320<=L&&L<=57343?S=1024*(S-55296)+L-56320+65536:E+=this.wcwidth(L)}const y=this.charProperties(S,w);let T=c.extractWidth(y);c.extractShouldJoin(y)&&(T-=c.extractWidth(w)),E+=T,w=y}return E}charProperties(x,E){return this._activeProvider.charProperties(x,E)}}a.UnicodeService=c}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p](h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.Unicode11Addon=void 0;const a=l(433);p.Unicode11Addon=class{activate(h){h.unicode.register(new a.UnicodeV11)}dispose(){}}})(),f})()))})(eh)),eh.exports}var v9=g9(),lm={exports:{}},eS;function _9(){return eS||(eS=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(p,a)=>{function h(m){try{const c=new URL(m),_=c.password&&c.username?`${c.protocol}//${c.username}:${c.password}@${c.host}`:c.username?`${c.protocol}//${c.username}@${c.host}`:`${c.protocol}//${c.host}`;return m.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(m,c,_,x={}){this._terminal=m,this._regex=c,this._handler=_,this._options=x}provideLinks(m,c){const _=d.computeLink(m,this._regex,this._terminal,this._handler);c(this._addCallbacks(_))}_addCallbacks(m){return m.map((c=>(c.leave=this._options.leave,c.hover=(_,x)=>{if(this._options.hover){const{range:E}=c;this._options.hover(_,x,E)}},c)))}};class d{static computeLink(c,_,x,E){const w=new RegExp(_.source,(_.flags||"")+"g"),[g,b]=d._getWindowedLineStrings(c-1,x),S=g.join("");let y;const T=[];for(;y=w.exec(S);){const L=y[0];if(!h(L))continue;const[R,D]=d._mapStrIdx(x,b,0,y.index),[A,j]=d._mapStrIdx(x,R,D,L.length);if(R===-1||D===-1||A===-1||j===-1)continue;const M={start:{x:D+1,y:R+1},end:{x:j,y:A+1}};T.push({range:M,text:L,activate:E})}return T}static _getWindowedLineStrings(c,_){let x,E=c,w=c,g=0,b="";const S=[];if(x=_.buffer.active.getLine(c)){const y=x.translateToString(!0);if(x.isWrapped&&y[0]!==" "){for(g=0;(x=_.buffer.active.getLine(--E))&&g<2048&&(b=x.translateToString(!0),g+=b.length,S.push(b),x.isWrapped&&b.indexOf(" ")===-1););S.reverse()}for(S.push(y),g=0;(x=_.buffer.active.getLine(++w))&&x.isWrapped&&g<2048&&(b=x.translateToString(!0),g+=b.length,S.push(b),b.indexOf(" ")===-1););}return[S,E]}static _mapStrIdx(c,_,x,E){const w=c.buffer.active,g=w.getNullCell();let b=x;for(;E;){const S=w.getLine(_);if(!S)return[-1,-1];for(let y=b;y<S.length;++y){S.getCell(y,g);const T=g.getChars();if(g.getWidth()&&(E-=T.length||1,y===S.length-1&&T==="")){const L=w.getLine(_+1);L&&L.isWrapped&&(L.getCell(0,g),g.getWidth()===2&&(E+=1))}if(E<0)return[_,y]}_++,b=0}return[_,b]}}a.LinkComputer=d}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p](h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const a=l(6),h=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(m,c){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(m=d,c={}){this._handler=m,this._options=c}activate(m){this._terminal=m;const c=this._options,_=c.urlRegex||h;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,c))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),f})()))})(lm)),lm.exports}var x9=_9(),cm={exports:{}},tS;function y9(){return tS||(tS=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={965:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GlyphRenderer=void 0;const d=h(374),m=h(509),c=h(855),_=h(859),x=h(381),E=11,w=E*Float32Array.BYTES_PER_ELEMENT;let g,b=0,S=0,y=0;class T extends _.Disposable{constructor(R,D,A,j){super(),this._terminal=R,this._gl=D,this._dimensions=A,this._optionsService=j,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const M=this._gl;m.TextureAtlas.maxAtlasPages===void 0&&(m.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS))),m.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,x.createProgram)(M,`#version 300 es
543
543
  layout (location = 0) in vec2 a_unitquad;
544
544
  layout (location = 1) in vec2 a_cellpos;
545
545
  layout (location = 2) in vec2 a_offset;
@@ -596,7 +596,7 @@ out vec4 outColor;
596
596
 
597
597
  void main() {
598
598
  outColor = v_color;
599
- }`)),this.register((0,m.toDisposable)((()=>B.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(B.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=B.createVertexArray(),B.bindVertexArray(this._vertexArrayObject);const H=new Float32Array([0,0,1,0,0,1,1,1]),U=B.createBuffer();this.register((0,m.toDisposable)((()=>B.deleteBuffer(U)))),B.bindBuffer(B.ARRAY_BUFFER,U),B.bufferData(B.ARRAY_BUFFER,H,B.STATIC_DRAW),B.enableVertexAttribArray(3),B.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const W=new Uint8Array([0,1,2,3]),Y=B.createBuffer();this.register((0,m.toDisposable)((()=>B.deleteBuffer(Y)))),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,Y),B.bufferData(B.ELEMENT_ARRAY_BUFFER,W,B.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(B.createBuffer()),this.register((0,m.toDisposable)((()=>B.deleteBuffer(this._attributesBuffer)))),B.bindBuffer(B.ARRAY_BUFFER,this._attributesBuffer),B.enableVertexAttribArray(0),B.vertexAttribPointer(0,2,B.FLOAT,!1,x,0),B.vertexAttribDivisor(0,1),B.enableVertexAttribArray(1),B.vertexAttribPointer(1,2,B.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(1,1),B.enableVertexAttribArray(2),B.vertexAttribPointer(2,4,B.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors((Q=>{this._updateCachedColors(Q),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(A){const j=this._gl;j.useProgram(this._program),j.bindVertexArray(this._vertexArrayObject),j.uniformMatrix4fv(this._projectionLocation,!1,_.PROJECTION_MATRIX),j.bindBuffer(j.ARRAY_BUFFER,this._attributesBuffer),j.bufferData(j.ARRAY_BUFFER,A.attributes,j.DYNAMIC_DRAW),j.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,j.UNSIGNED_BYTE,0,A.count)}handleResize(){this._updateViewportRectangle()}setDimensions(A){this._dimensions=A}_updateCachedColors(A){this._bgFloat=this._colorToFloat32Array(A.background),this._cursorFloat=this._colorToFloat32Array(A.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(A){const j=this._terminal,M=this._vertices;let I,B,H,U,W,Y,Q,K,z,O,G,Z=1;for(I=0;I<j.rows;I++){for(H=-1,U=0,W=0,Y=!1,B=0;B<j.cols;B++)Q=(I*j.cols+B)*c.RENDER_MODEL_INDICIES_PER_CELL,K=A.cells[Q+c.RENDER_MODEL_BG_OFFSET],z=A.cells[Q+c.RENDER_MODEL_FG_OFFSET],O=!!(67108864&z),(K!==U||z!==W&&(Y||O))&&((U!==0||Y&&W!==0)&&(G=8*Z++,this._updateRectangle(M,G,W,U,H,B,I)),H=B,U=K,W=z,Y=O);(U!==0||Y&&W!==0)&&(G=8*Z++,this._updateRectangle(M,G,W,U,H,j.cols,I))}M.count=Z}updateCursor(A){const j=this._verticesCursor,M=A.cursor;if(!M||M.style==="block")return void(j.count=0);let I,B=0;M.style!=="bar"&&M.style!=="outline"||(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.style==="bar"?M.dpr*M.cursorWidth:M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),M.style!=="underline"&&M.style!=="outline"||(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,(M.y+1)*this._dimensions.device.cell.height-M.dpr,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat)),M.style==="outline"&&(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat),I=8*B++,this._addRectangleFloat(j.attributes,I,(M.x+M.width)*this._dimensions.device.cell.width-M.dpr,M.y*this._dimensions.device.cell.height,M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),j.count=B}_updateRectangle(A,j,M,I,B,H,U){if(67108864&M)switch(50331648&M){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&M].rgba;break;case 50331648:w=(16777215&M)<<8;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:w=(16777215&I)<<8;break;default:w=this._themeService.colors.background.rgba}A.attributes.length<j+4&&(A.attributes=(0,_.expandFloat32Array)(A.attributes,this._terminal.rows*this._terminal.cols*8)),g=B*this._dimensions.device.cell.width,b=U*this._dimensions.device.cell.height,S=(w>>24&255)/255,y=(w>>16&255)/255,T=(w>>8&255)/255,L=1,this._addRectangle(A.attributes,j,g,b,(H-B)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,S,y,T,L)}_addRectangle(A,j,M,I,B,H,U,W,Y,Q){A[j]=M/this._dimensions.device.canvas.width,A[j+1]=I/this._dimensions.device.canvas.height,A[j+2]=B/this._dimensions.device.canvas.width,A[j+3]=H/this._dimensions.device.canvas.height,A[j+4]=U,A[j+5]=W,A[j+6]=Y,A[j+7]=Q}_addRectangleFloat(A,j,M,I,B,H,U){A[j]=M/this._dimensions.device.canvas.width,A[j+1]=I/this._dimensions.device.canvas.height,A[j+2]=B/this._dimensions.device.canvas.width,A[j+3]=H/this._dimensions.device.canvas.height,A[j+4]=U[0],A[j+5]=U[1],A[j+6]=U[2],A[j+7]=U[3]}_colorToFloat32Array(A){return new Float32Array([(A.rgba>>24&255)/255,(A.rgba>>16&255)/255,(A.rgba>>8&255)/255,(255&A.rgba)/255])}}a.RectangleRenderer=R},310:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderModel=a.COMBINED_CHAR_BIT_MASK=a.RENDER_MODEL_EXT_OFFSET=a.RENDER_MODEL_FG_OFFSET=a.RENDER_MODEL_BG_OFFSET=a.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=h(296);a.RENDER_MODEL_INDICIES_PER_CELL=4,a.RENDER_MODEL_BG_OFFSET=1,a.RENDER_MODEL_FG_OFFSET=2,a.RENDER_MODEL_EXT_OFFSET=3,a.COMBINED_CHAR_BIT_MASK=2147483648,a.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(m,c){const _=m*c*a.RENDER_MODEL_INDICIES_PER_CELL;_!==this.cells.length&&(this.cells=new Uint32Array(_),this.lineLengths=new Uint32Array(c))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.JoinedCellData=a.WebglRenderer=void 0;const d=h(820),m=h(274),c=h(627),_=h(457),x=h(56),E=h(374),w=h(345),g=h(859),b=h(147),S=h(782),y=h(855),T=h(965),L=h(742),R=h(310),D=h(733);class A extends g.Disposable{constructor(B,H,U,W,Y,Q,K,z,O){super(),this._terminal=B,this._characterJoinerService=H,this._charSizeService=U,this._coreBrowserService=W,this._coreService=Y,this._decorationService=Q,this._optionsService=K,this._themeService=z,this._cursorBlinkStateManager=new g.MutableDisposable,this._charAtlasDisposable=this.register(new g.MutableDisposable),this._observerDisposable=this.register(new g.MutableDisposable),this._model=new R.RenderModel,this._workCell=new S.CellData,this._workCell2=new S.CellData,this._rectangleRenderer=this.register(new g.MutableDisposable),this._glyphRenderer=this.register(new g.MutableDisposable),this._onChangeTextureAtlas=this.register(new w.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new w.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new w.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new w.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new m.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new D.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,K,this._themeService)],this.dimensions=(0,E.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(K.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const G={antialias:!1,depth:!1,preserveDrawingBuffer:O};if(this._gl=this._canvas.getContext("webgl2",G),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(Z=>{console.log("webglcontextlost event received"),Z.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Z)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(Z=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,c.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((Z,F)=>this._setCanvasDevicePixelDimensions(Z,F))),this.register(this._coreBrowserService.onWindowChange((Z=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,Z,((F,V)=>this._setCanvasDevicePixelDimensions(F,V)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,g.toDisposable)((()=>{var Z;for(const F of this._renderLayers)F.dispose();(Z=this._canvas.parentElement)==null||Z.removeChild(this._canvas),(0,c.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var B;return(B=this._charAtlas)==null?void 0:B.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(B,H){var U,W,Y,Q;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const K of this._renderLayers)K.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(U=this._rectangleRenderer.value)==null||U.setDimensions(this.dimensions),(W=this._rectangleRenderer.value)==null||W.handleResize(),(Y=this._glyphRenderer.value)==null||Y.setDimensions(this.dimensions),(Q=this._glyphRenderer.value)==null||Q.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var B;for(const H of this._renderLayers)H.handleBlur(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.pause(),this._requestRedrawViewport()}handleFocus(){var B;for(const H of this._renderLayers)H.handleFocus(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.resume(),this._requestRedrawViewport()}handleSelectionChanged(B,H,U){for(const W of this._renderLayers)W.handleSelectionChanged(this._terminal,B,H,U);this._model.selection.update(this._core,B,H,U),this._requestRedrawViewport()}handleCursorMove(){var B;for(const H of this._renderLayers)H.handleCursorMove(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new L.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new T.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var H;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,g.getDisposeArrayDisposable)([(0,w.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,w.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(H=this._glyphRenderer.value)==null||H.setAtlas(this._charAtlas)}_clearModel(B){var H;this._model.clear(),B&&((H=this._glyphRenderer.value)==null||H.clear())}clearTextureAtlas(){var B;(B=this._charAtlas)==null||B.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var B;this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(B){return-1}deregisterCharacterJoiner(B){return!1}renderRows(B,H){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,B,H);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(B,H),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new _.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(B,H){const U=this._core;let W,Y,Q,K,z,O,G,Z,F,V,ne,le,X,$,oe=this._workCell;B=M(B,U.rows-1,0),H=M(H,U.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ue=ee-U.buffer.ydisp,he=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let we=-1;const Se=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Re=!1;for(Y=B;Y<=H;Y++)for(Q=Y+U.buffer.ydisp,K=U.buffer.lines.get(Q),this._model.lineLengths[Y]=0,z=this._characterJoinerService.getJoinedCharacters(Q),X=0;X<U.cols;X++)if(W=this._cellColorResolver.result.bg,K.loadCell(X,oe),X===0&&(W=this._cellColorResolver.result.bg),O=!1,G=X,z.length>0&&X===z[0][0]&&(O=!0,Z=z.shift(),oe=new j(oe,K.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),G=Z[1]-1),F=oe.getChars(),V=oe.getCode(),le=(Y*U.cols+X)*R.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(oe,X,Q,this.dimensions.device.cell.width),Se&&Q===ee&&(X===he&&(this._model.cursor={x:he,y:ue,width:oe.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},we=he+oe.getWidth()-1),X>=he&&X<=we&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),V!==y.NULL_CELL_CODE&&(this._model.lineLengths[Y]=X+1),(this._model.cells[le]!==V||this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Re=!0,F.length>1&&(V|=R.COMBINED_CHAR_BIT_MASK),this._model.cells[le]=V,this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ne=oe.getWidth(),this._glyphRenderer.value.updateCell(X,Y,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,F,ne,W),O))for(oe=this._workCell,X++;X<G;X++)$=(Y*U.cols+X)*R.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(X,Y,y.NULL_CELL_CODE,0,0,0,y.NULL_CELL_CHAR,0,0),this._model.cells[$]=y.NULL_CELL_CODE,this._model.cells[$+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[$+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[$+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Re&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(B,H){this._canvas.width===B&&this._canvas.height===H||(this._canvas.width=B,this._canvas.height=H,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const B=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:B,end:B})}}a.WebglRenderer=A;class j extends b.AttributeData{constructor(B,H,U){super(),this.content=0,this.combinedData="",this.fg=B.fg,this.bg=B.bg,this.combinedData=H,this._width=U}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(B){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function M(I,B,H=0){return Math.max(Math.min(I,B),H)}a.JoinedCellData=j},381:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GLTexture=a.expandFloat32Array=a.createShader=a.createProgram=a.PROJECTION_MATRIX=void 0;const d=h(374);function m(c,_,x){const E=(0,d.throwIfFalsy)(c.createShader(_));if(c.shaderSource(E,x),c.compileShader(E),c.getShaderParameter(E,c.COMPILE_STATUS))return E;console.error(c.getShaderInfoLog(E)),c.deleteShader(E)}a.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),a.createProgram=function(c,_,x){const E=(0,d.throwIfFalsy)(c.createProgram());if(c.attachShader(E,(0,d.throwIfFalsy)(m(c,c.VERTEX_SHADER,_))),c.attachShader(E,(0,d.throwIfFalsy)(m(c,c.FRAGMENT_SHADER,x))),c.linkProgram(E),c.getProgramParameter(E,c.LINK_STATUS))return E;console.error(c.getProgramInfoLog(E)),c.deleteProgram(E)},a.createShader=m,a.expandFloat32Array=function(c,_){const x=Math.min(2*c.length,_),E=new Float32Array(x);for(let w=0;w<c.length;w++)E[w]=c[w];return E},a.GLTexture=class{constructor(c){this.texture=c,this.version=-1}}},592:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BaseRenderLayer=void 0;const d=h(627),m=h(237),c=h(374),_=h(859);class x extends _.Disposable{constructor(w,g,b,S,y,T,L,R){super(),this._container=g,this._alpha=y,this._coreBrowserService=T,this._optionsService=L,this._themeService=R,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${b}-layer`),this._canvas.style.zIndex=S.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((D=>{this._refreshCharAtlas(w,D),this.reset(w)}))),this.register((0,_.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,c.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(w){}handleFocus(w){}handleCursorMove(w){}handleGridChanged(w,g,b){}handleSelectionChanged(w,g,b,S=!1){}_setTransparency(w,g){if(g===this._alpha)return;const b=this._canvas;this._alpha=g,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,b),this._refreshCharAtlas(w,this._themeService.colors),this.handleGridChanged(w,0,w.rows-1)}_refreshCharAtlas(w,g){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(w,this._optionsService.rawOptions,g,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(w,g){this._deviceCellWidth=g.device.cell.width,this._deviceCellHeight=g.device.cell.height,this._deviceCharWidth=g.device.char.width,this._deviceCharHeight=g.device.char.height,this._deviceCharLeft=g.device.char.left,this._deviceCharTop=g.device.char.top,this._canvas.width=g.device.canvas.width,this._canvas.height=g.device.canvas.height,this._canvas.style.width=`${g.css.canvas.width}px`,this._canvas.style.height=`${g.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(w,this._themeService.colors)}_fillBottomLineAtCells(w,g,b=1){this._ctx.fillRect(w*this._deviceCellWidth,(g+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,b*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(w,g,b,S){this._alpha?this._ctx.clearRect(w*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(w*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight))}_fillCharTrueColor(w,g,b,S){this._ctx.font=this._getFont(w,!1,!1),this._ctx.textBaseline=m.TEXT_BASELINE,this._clipCell(b,S,g.getWidth()),this._ctx.fillText(g.getChars(),b*this._deviceCellWidth+this._deviceCharLeft,S*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(w,g,b){this._ctx.beginPath(),this._ctx.rect(w*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(w,g,b){return`${b?"italic":""} ${g?w.options.fontWeightBold:w.options.fontWeight} ${w.options.fontSize*this._coreBrowserService.dpr}px ${w.options.fontFamily}`}}a.BaseRenderLayer=x},733:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkRenderLayer=void 0;const d=h(197),m=h(237),c=h(592);class _ extends c.BaseRenderLayer{constructor(E,w,g,b,S,y,T){super(g,E,"link",w,!0,S,y,T),this.register(b.onShowLinkUnderline((L=>this._handleShowLinkUnderline(L)))),this.register(b.onHideLinkUnderline((L=>this._handleHideLinkUnderline(L))))}resize(E,w){super.resize(E,w),this._state=void 0}reset(E){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(E){if(E.fg===m.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:E.fg!==void 0&&(0,d.is256Color)(E.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[E.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(let w=E.y1+1;w<E.y2;w++)this._fillBottomLineAtCells(0,w,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E}_handleHideLinkUnderline(E){this._clearCurrentLink()}}a.LinkRenderLayer=_},820:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(h,d,m,c){h.addEventListener(d,m,c);let _=!1;return{dispose:()=>{_||(_=!0,h.removeEventListener(d,m,c))}}}},274:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellColorResolver=void 0;const d=h(855),m=h(160),c=h(374);let _,x=0,E=0,w=!1,g=!1,b=!1,S=0;a.CellColorResolver=class{constructor(y,T,L,R,D,A){this._terminal=y,this._optionService=T,this._selectionRenderModel=L,this._decorationService=R,this._coreBrowserService=D,this._themeService=A,this.result={fg:0,bg:0,ext:0}}resolve(y,T,L,R){if(this.result.bg=y.bg,this.result.fg=y.fg,this.result.ext=268435456&y.bg?y.extended.ext:0,E=0,x=0,g=!1,w=!1,b=!1,_=this._themeService.colors,S=0,y.getCode()!==d.NULL_CELL_CODE&&y.extended.underlineStyle===4){const D=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));S=T*R%(2*Math.round(D))}if(this._decorationService.forEachDecorationAtCell(T,L,"bottom",(D=>{D.backgroundColorRGB&&(E=D.backgroundColorRGB.rgba>>8&16777215,g=!0),D.foregroundColorRGB&&(x=D.foregroundColorRGB.rgba>>8&16777215,w=!0)})),b=this._selectionRenderModel.isCellSelected(this._terminal,T,L),b){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:E=(16777215&this.result.fg)<<8|255;break;default:E=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:E=(16777215&this.result.bg)<<8|255}E=m.rgba.blend(E,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else E=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(g=!0,_.selectionForeground&&(x=_.selectionForeground.rgba>>8&16777215,w=!0),(0,c.treatGlyphAsBackgroundColor)(y.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=m.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}w=!0}}this._decorationService.forEachDecorationAtCell(T,L,"top",(D=>{D.backgroundColorRGB&&(E=D.backgroundColorRGB.rgba>>8&16777215,g=!0),D.foregroundColorRGB&&(x=D.foregroundColorRGB.rgba>>8&16777215,w=!0)})),g&&(E=b?-16777216&y.bg&-134217729|E|50331648:-16777216&y.bg|E|50331648),w&&(x=-16777216&y.fg&-67108865|x|50331648),67108864&this.result.fg&&(g&&!w&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&_.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,w=!0),!g&&w&&(E=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&_.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,g=!0)),_=void 0,this.result.bg=g?E:this.result.bg,this.result.fg=w?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=S<<29&3758096384}}},627:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeTerminalFromCache=a.acquireTextureAtlas=void 0;const d=h(509),m=h(197),c=[];a.acquireTextureAtlas=function(_,x,E,w,g,b,S,y){const T=(0,m.generateConfig)(w,g,b,S,x,E,y);for(let D=0;D<c.length;D++){const A=c[D],j=A.ownedBy.indexOf(_);if(j>=0){if((0,m.configEquals)(A.config,T))return A.atlas;A.ownedBy.length===1?(A.atlas.dispose(),c.splice(D,1)):A.ownedBy.splice(j,1);break}}for(let D=0;D<c.length;D++){const A=c[D];if((0,m.configEquals)(A.config,T))return A.ownedBy.push(_),A.atlas}const L=_._core,R={atlas:new d.TextureAtlas(document,T,L.unicodeService),config:T,ownedBy:[_]};return c.push(R),R.atlas},a.removeTerminalFromCache=function(_){for(let x=0;x<c.length;x++){const E=c[x].ownedBy.indexOf(_);if(E!==-1){c[x].ownedBy.length===1?(c[x].atlas.dispose(),c.splice(x,1)):c[x].ownedBy.splice(E,1);break}}}},197:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.is256Color=a.configEquals=a.generateConfig=void 0;const d=h(160);a.generateConfig=function(m,c,_,x,E,w,g){const b={foreground:w.foreground,background:w.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:w.ansi.slice(),contrastCache:w.contrastCache,halfContrastCache:w.halfContrastCache};return{customGlyphs:E.customGlyphs,devicePixelRatio:g,letterSpacing:E.letterSpacing,lineHeight:E.lineHeight,deviceCellWidth:m,deviceCellHeight:c,deviceCharWidth:_,deviceCharHeight:x,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,drawBoldTextInBrightColors:E.drawBoldTextInBrightColors,minimumContrastRatio:E.minimumContrastRatio,colors:b}},a.configEquals=function(m,c){for(let _=0;_<m.colors.ansi.length;_++)if(m.colors.ansi[_].rgba!==c.colors.ansi[_].rgba)return!1;return m.devicePixelRatio===c.devicePixelRatio&&m.customGlyphs===c.customGlyphs&&m.lineHeight===c.lineHeight&&m.letterSpacing===c.letterSpacing&&m.fontFamily===c.fontFamily&&m.fontSize===c.fontSize&&m.fontWeight===c.fontWeight&&m.fontWeightBold===c.fontWeightBold&&m.allowTransparency===c.allowTransparency&&m.deviceCharWidth===c.deviceCharWidth&&m.deviceCharHeight===c.deviceCharHeight&&m.drawBoldTextInBrightColors===c.drawBoldTextInBrightColors&&m.minimumContrastRatio===c.minimumContrastRatio&&m.colors.foreground.rgba===c.colors.foreground.rgba&&m.colors.background.rgba===c.colors.background.rgba},a.is256Color=function(m){return(50331648&m)==16777216||(50331648&m)==33554432}},237:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=h(399);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CursorBlinkStateManager=void 0,a.CursorBlinkStateManager=class{constructor(h,d){this._renderCallback=h,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(h=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),h)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tryDrawCustomChar=a.powerlineDefinitions=a.boxDrawingDefinitions=a.blockElementDefinitions=void 0;const d=h(374);a.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const m={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};a.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(w,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"║":{1:(w,g)=>`M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1`},"╒":{1:(w,g)=>`M.5,1 L.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╓":{1:(w,g)=>`M${.5-w},1 L${.5-w},.5 L1,.5 M${.5+w},.5 L${.5+w},1`},"╔":{1:(w,g)=>`M1,${.5-g} L${.5-w},${.5-g} L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1`},"╕":{1:(w,g)=>`M0,${.5-g} L.5,${.5-g} L.5,1 M0,${.5+g} L.5,${.5+g}`},"╖":{1:(w,g)=>`M${.5+w},1 L${.5+w},.5 L0,.5 M${.5-w},.5 L${.5-w},1`},"╗":{1:(w,g)=>`M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M0,${.5-g} L${.5+w},${.5-g} L${.5+w},1`},"╘":{1:(w,g)=>`M.5,0 L.5,${.5+g} L1,${.5+g} M.5,${.5-g} L1,${.5-g}`},"╙":{1:(w,g)=>`M1,.5 L${.5-w},.5 L${.5-w},0 M${.5+w},.5 L${.5+w},0`},"╚":{1:(w,g)=>`M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0 M1,${.5+g} L${.5-w},${.5+g} L${.5-w},0`},"╛":{1:(w,g)=>`M0,${.5+g} L.5,${.5+g} L.5,0 M0,${.5-g} L.5,${.5-g}`},"╜":{1:(w,g)=>`M0,.5 L${.5+w},.5 L${.5+w},0 M${.5-w},.5 L${.5-w},0`},"╝":{1:(w,g)=>`M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0 M0,${.5+g} L${.5+w},${.5+g} L${.5+w},0`},"╞":{1:(w,g)=>`M.5,0 L.5,1 M.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╟":{1:(w,g)=>`M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1 M${.5+w},.5 L1,.5`},"╠":{1:(w,g)=>`M${.5-w},0 L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1 M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0`},"╡":{1:(w,g)=>`M.5,0 L.5,1 M0,${.5-g} L.5,${.5-g} M0,${.5+g} L.5,${.5+g}`},"╢":{1:(w,g)=>`M0,.5 L${.5-w},.5 M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1`},"╣":{1:(w,g)=>`M${.5+w},0 L${.5+w},1 M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0`},"╤":{1:(w,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g} M.5,${.5+g} L.5,1`},"╥":{1:(w,g)=>`M0,.5 L1,.5 M${.5-w},.5 L${.5-w},1 M${.5+w},.5 L${.5+w},1`},"╦":{1:(w,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1`},"╧":{1:(w,g)=>`M.5,0 L.5,${.5-g} M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╨":{1:(w,g)=>`M0,.5 L1,.5 M${.5-w},.5 L${.5-w},0 M${.5+w},.5 L${.5+w},0`},"╩":{1:(w,g)=>`M0,${.5+g} L1,${.5+g} M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0 M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0`},"╪":{1:(w,g)=>`M.5,0 L.5,1 M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╫":{1:(w,g)=>`M0,.5 L1,.5 M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1`},"╬":{1:(w,g)=>`M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1 M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0 M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(w,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,1,.5`},"╮":{1:(w,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,0,.5`},"╯":{1:(w,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,0,.5`},"╰":{1:(w,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,1,.5`}},a.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.tryDrawCustomChar=function(w,g,b,S,y,T,L,R){const D=a.blockElementDefinitions[g];if(D)return(function(I,B,H,U,W,Y){for(let Q=0;Q<B.length;Q++){const K=B[Q],z=W/8,O=Y/8;I.fillRect(H+K.x*z,U+K.y*O,K.w*z,K.h*O)}})(w,D,b,S,y,T),!0;const A=m[g];if(A)return(function(I,B,H,U,W,Y){let Q=c.get(B);Q||(Q=new Map,c.set(B,Q));const K=I.fillStyle;if(typeof K!="string")throw new Error(`Unexpected fillStyle type "${K}"`);let z=Q.get(K);if(!z){const O=B[0].length,G=B.length,Z=I.canvas.ownerDocument.createElement("canvas");Z.width=O,Z.height=G;const F=(0,d.throwIfFalsy)(Z.getContext("2d")),V=new ImageData(O,G);let ne,le,X,$;if(K.startsWith("#"))ne=parseInt(K.slice(1,3),16),le=parseInt(K.slice(3,5),16),X=parseInt(K.slice(5,7),16),$=K.length>7&&parseInt(K.slice(7,9),16)||1;else{if(!K.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${K}" when drawing pattern glyph`);[ne,le,X,$]=K.substring(5,K.length-1).split(",").map((oe=>parseFloat(oe)))}for(let oe=0;oe<G;oe++)for(let ee=0;ee<O;ee++)V.data[4*(oe*O+ee)]=ne,V.data[4*(oe*O+ee)+1]=le,V.data[4*(oe*O+ee)+2]=X,V.data[4*(oe*O+ee)+3]=B[oe][ee]*(255*$);F.putImageData(V,0,0),z=(0,d.throwIfFalsy)(I.createPattern(Z,null)),Q.set(K,z)}I.fillStyle=z,I.fillRect(H,U,W,Y)})(w,A,b,S,y,T),!0;const j=a.boxDrawingDefinitions[g];if(j)return(function(I,B,H,U,W,Y,Q){I.strokeStyle=I.fillStyle;for(const[K,z]of Object.entries(B)){let O;I.beginPath(),I.lineWidth=Q*Number.parseInt(K),O=typeof z=="function"?z(.15,.15/Y*W):z;for(const G of O.split(" ")){const Z=G[0],F=x[Z];if(!F){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=G.substring(1).split(",");V[0]&&V[1]&&F(I,E(V,W,Y,H,U,!0,Q))}I.stroke(),I.closePath()}})(w,j,b,S,y,T,R),!0;const M=a.powerlineDefinitions[g];return!!M&&((function(I,B,H,U,W,Y,Q,K){const z=new Path2D;z.rect(H,U,W,Y),I.clip(z),I.beginPath();const O=Q/12;I.lineWidth=K*O;for(const G of B.d.split(" ")){const Z=G[0],F=x[Z];if(!F){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=G.substring(1).split(",");V[0]&&V[1]&&F(I,E(V,W,Y,H,U,!1,K,(B.leftPadding??0)*(O/2),(B.rightPadding??0)*(O/2)))}B.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(w,M,b,S,y,T,L,R),!0)};const c=new Map;function _(w,g,b=0){return Math.max(Math.min(w,g),b)}const x={C:(w,g)=>w.bezierCurveTo(g[0],g[1],g[2],g[3],g[4],g[5]),L:(w,g)=>w.lineTo(g[0],g[1]),M:(w,g)=>w.moveTo(g[0],g[1])};function E(w,g,b,S,y,T,L,R=0,D=0){const A=w.map((j=>parseFloat(j)||parseInt(j)));if(A.length<2)throw new Error("Too few arguments for instruction");for(let j=0;j<A.length;j+=2)A[j]*=g-R*L-D*L,T&&A[j]!==0&&(A[j]=_(Math.round(A[j]+.5)-.5,g,0)),A[j]+=S+R*L;for(let j=1;j<A.length;j+=2)A[j]*=b,T&&A[j]!==0&&(A[j]=_(Math.round(A[j]+.5)-.5,b,0)),A[j]+=y;return A}},56:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.observeDevicePixelDimensions=void 0;const d=h(859);a.observeDevicePixelDimensions=function(m,c,_){let x=new c.ResizeObserver((E=>{const w=E.find((S=>S.target===m));if(!w)return;if(!("devicePixelContentBoxSize"in w))return x==null||x.disconnect(),void(x=void 0);const g=w.devicePixelContentBoxSize[0].inlineSize,b=w.devicePixelContentBoxSize[0].blockSize;g>0&&b>0&&_(g,b)}));try{x.observe(m,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,d.toDisposable)((()=>x==null?void 0:x.disconnect()))}},374:(p,a)=>{function h(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=h,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=d,a.allowRescaling=function(m,c,_,x){return c===1&&_>Math.ceil(1.5*x)&&m!==void 0&&m>255&&!d(m)&&!h(m)&&!(function(E){return 57344<=E&&E<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return h(m)||(function(c){return 9472<=c&&c<=9631})(m)},a.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}}}},a.computeNextVariantOffset=function(m,c,_=0){return(m-(2*Math.round(c)-_))%(2*Math.round(c))}},296:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class h{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(m,c,_,x=!1){if(this.selectionStart=c,this.selectionEnd=_,!c||!_||c[0]===_[0]&&c[1]===_[1])return void this.clear();const E=m.buffers.active.ydisp,w=c[1]-E,g=_[1]-E,b=Math.max(w,0),S=Math.min(g,m.rows-1);b>=m.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=g,this.viewportCappedStartRow=b,this.viewportCappedEndRow=S,this.startCol=c[0],this.endCol=_[0])}isCellSelected(m,c,_){return!!this.hasSelection&&(_-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&_>=this.viewportCappedStartRow&&c<this.endCol&&_<=this.viewportCappedEndRow:c<this.startCol&&_>=this.viewportCappedStartRow&&c>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol)}}a.createSelectionRenderModel=function(){return new h}},509:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TextureAtlas=void 0;const d=h(237),m=h(860),c=h(374),_=h(160),x=h(345),E=h(485),w=h(385),g=h(147),b=h(855),S={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let y;class T{get pages(){return this._pages}constructor(j,M,I){this._document=j,this._config=M,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new E.FourKeyMap,this._cacheMapCombined=new E.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new g.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=D(j,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,c.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const j of this.pages)j.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const j=new w.IdleTaskQueue;for(let M=33;M<126;M++)j.enqueue((()=>{if(!this._cacheMap.get(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT)){const I=this._drawToCache(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT);this._cacheMap.set(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const j of this._pages)j.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(T.maxAtlasPages&&this._pages.length>=Math.max(4,T.maxAtlasPages)){const M=this._pages.filter((Q=>2*Q.canvas.width<=(T.maxTextureSize||4096))).sort(((Q,K)=>K.canvas.width!==Q.canvas.width?K.canvas.width-Q.canvas.width:K.percentageUsed-Q.percentageUsed));let I=-1,B=0;for(let Q=0;Q<M.length;Q++)if(M[Q].canvas.width!==B)I=Q,B=M[Q].canvas.width;else if(Q-I==3)break;const H=M.slice(I,I+4),U=H.map((Q=>Q.glyphs[0].texturePage)).sort(((Q,K)=>Q>K?1:-1)),W=this.pages.length-H.length,Y=this._mergePages(H,W);Y.version++;for(let Q=U.length-1;Q>=0;Q--)this._deletePage(U[Q]);this.pages.push(Y),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(Y.canvas)}const j=new L(this._document,this._textureSize);return this._pages.push(j),this._activePages.push(j),this._onAddTextureAtlasCanvas.fire(j.canvas),j}_mergePages(j,M){const I=2*j[0].canvas.width,B=new L(this._document,I,j);for(const[H,U]of j.entries()){const W=H*U.canvas.width%I,Y=Math.floor(H/2)*U.canvas.height;B.ctx.drawImage(U.canvas,W,Y);for(const K of U.glyphs)K.texturePage=M,K.sizeClipSpace.x=K.size.x/I,K.sizeClipSpace.y=K.size.y/I,K.texturePosition.x+=W,K.texturePosition.y+=Y,K.texturePositionClipSpace.x=K.texturePosition.x/I,K.texturePositionClipSpace.y=K.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const Q=this._activePages.indexOf(U);Q!==-1&&this._activePages.splice(Q,1)}return B}_deletePage(j){this._pages.splice(j,1);for(let M=j;M<this._pages.length;M++){const I=this._pages[M];for(const B of I.glyphs)B.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(j,M,I,B,H){return this._getFromCacheMap(this._cacheMapCombined,j,M,I,B,H)}getRasterizedGlyph(j,M,I,B,H){return this._getFromCacheMap(this._cacheMap,j,M,I,B,H)}_getFromCacheMap(j,M,I,B,H,U=!1){return y=j.get(M,I,B,H),y||(y=this._drawToCache(M,I,B,H,U),j.set(M,I,B,H,y)),y}_getColorFromAnsiIndex(j){if(j>=this._config.colors.ansi.length)throw new Error("No color found for idx "+j);return this._config.colors.ansi[j]}_getBackgroundColor(j,M,I,B){if(this._config.allowTransparency)return _.NULL_COLOR;let H;switch(j){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(M);break;case 50331648:const U=g.AttributeData.toColorRGB(M);H=_.channels.toColor(U[0],U[1],U[2]);break;default:H=I?_.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(j,M,I,B,H,U,W,Y,Q,K){const z=this._getMinimumContrastColor(j,M,I,B,H,U,W,Q,Y,K);if(z)return z;let O;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Q&&U<8&&(U+=8),O=this._getColorFromAnsiIndex(U);break;case 50331648:const G=g.AttributeData.toColorRGB(U);O=_.channels.toColor(G[0],G[1],G[2]);break;default:O=W?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=_.color.opaque(O)),Y&&(O=_.color.multiplyOpacity(O,d.DIM_OPACITY)),O}_resolveBackgroundRgba(j,M,I){switch(j){case 16777216:case 33554432:return this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(j,M,I,B){switch(j){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&B&&M<8&&(M+=8),this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(j,M,I,B,H,U,W,Y,Q,K){if(this._config.minimumContrastRatio===1||K)return;const z=this._getContrastCache(Q),O=z.getColor(j,B);if(O!==void 0)return O||void 0;const G=this._resolveBackgroundRgba(M,I,W),Z=this._resolveForegroundRgba(H,U,W,Y),F=_.rgba.ensureContrastRatio(G,Z,this._config.minimumContrastRatio/(Q?2:1));if(!F)return void z.setColor(j,B,null);const V=_.channels.toColor(F>>24&255,F>>16&255,F>>8&255);return z.setColor(j,B,V),V}_getContrastCache(j){return j?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(j,M,I,B,H=!1){const U=typeof j=="number"?String.fromCharCode(j):j,W=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width<W&&(this._tmpCanvas.width=W);const Y=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<Y&&(this._tmpCanvas.height=Y),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=M,this._workAttributeData.extended.ext=B,this._workAttributeData.isInvisible())return S;const Q=!!this._workAttributeData.isBold(),K=!!this._workAttributeData.isInverse(),z=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),G=!!this._workAttributeData.isUnderline(),Z=!!this._workAttributeData.isStrikethrough(),F=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),ne=this._workAttributeData.getFgColorMode(),le=this._workAttributeData.getBgColor(),X=this._workAttributeData.getBgColorMode();if(K){const Te=V;V=le,le=Te;const Ve=ne;ne=X,X=Ve}const $=this._getBackgroundColor(X,le,K,z);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const oe=Q?this._config.fontWeightBold:this._config.fontWeight,ee=O?"italic":"";this._tmpCtx.font=`${ee} ${oe} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ue=U.length===1&&(0,c.isPowerlineGlyph)(U.charCodeAt(0)),he=U.length===1&&(0,c.isRestrictedPowerlineGlyph)(U.charCodeAt(0)),we=this._getForegroundColor(M,X,le,I,ne,V,K,z,Q,(0,c.treatGlyphAsBackgroundColor)(U.charCodeAt(0)));this._tmpCtx.fillStyle=we.css;const Se=he?0:4;let Re=!1;this._config.customGlyphs!==!1&&(Re=(0,m.tryDrawCustomChar)(this._tmpCtx,U,Se,Se,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,ke=!ue;if(qe=typeof j=="number"?this._unicodeService.wcwidth(j):this._unicodeService.getStringCellWidth(j),G){this._tmpCtx.save();const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ve=Te%2==1?.5:0;if(this._tmpCtx.lineWidth=Te,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ke=!1,this._tmpCtx.strokeStyle=`rgb(${g.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ke=!1;let De=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&De<8&&(De+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(De).css}this._tmpCtx.beginPath();const gt=Se,st=Math.ceil(Se+this._config.deviceCharHeight)-Ve-(H?2*Te:0),fe=st+Te,ge=st+2*Te;let Le=this._workAttributeData.getUnderlineVariantOffset();for(let De=0;De<qe;De++){this._tmpCtx.save();const Fe=gt+De*this._config.deviceCellWidth,Me=gt+(De+1)*this._config.deviceCellWidth,Tt=Fe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st),this._tmpCtx.moveTo(Fe,ge),this._tmpCtx.lineTo(Me,ge);break;case 3:const qt=Te<=1?ge:Math.ceil(Se+this._config.deviceCharHeight-Te/2)-Ve,kn=Te<=1?st:Math.ceil(Se+this._config.deviceCharHeight+Te/2)-Ve,Jn=new Path2D;Jn.rect(Fe,st,this._config.deviceCellWidth,ge-st),this._tmpCtx.clip(Jn),this._tmpCtx.moveTo(Fe-this._config.deviceCellWidth/2,fe),this._tmpCtx.bezierCurveTo(Fe-this._config.deviceCellWidth/2,kn,Fe,kn,Fe,fe),this._tmpCtx.bezierCurveTo(Fe,qt,Tt,qt,Tt,fe),this._tmpCtx.bezierCurveTo(Tt,kn,Me,kn,Me,fe),this._tmpCtx.bezierCurveTo(Me,qt,Me+this._config.deviceCellWidth/2,qt,Me+this._config.deviceCellWidth/2,fe);break;case 4:const ei=Le===0?0:Le>=Te?2*Te-Le:Te-Le;Le>=Te||ei===0?(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe+ei,st),this._tmpCtx.lineTo(Me,st)):(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Fe+ei,st),this._tmpCtx.moveTo(Fe+ei+Te,st),this._tmpCtx.lineTo(Me,st)),Le=(0,c.computeNextVariantOffset)(Me-Fe,Te,Le);break;case 5:const eo=.6,Vt=.3,Wt=Me-Fe,ti=Math.floor(eo*Wt),_n=Math.floor(Vt*Wt),to=Wt-ti-_n;this._tmpCtx.setLineDash([ti,_n,to]),this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st);break;default:this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Re&&this._config.fontSize>=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const De=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in De&&De.actualBoundingBoxDescent>0){this._tmpCtx.save();const Fe=new Path2D;Fe.rect(gt,st-Math.ceil(Te/2),this._config.deviceCellWidth*qe,ge-st+Math.ceil(Te/2)),this._tmpCtx.clip(Fe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(U,Se,Se+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(F){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ve=Te%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Se,Se+Ve),this._tmpCtx.lineTo(Se+this._config.deviceCharWidth*qe,Se+Ve),this._tmpCtx.stroke()}if(Re||this._tmpCtx.fillText(U,Se,Se+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let Te=R(this._tmpCtx.getImageData(Se,Se,this._config.deviceCellWidth,this._config.deviceCellHeight),$,we,ke);if(Te)for(let Ve=1;Ve<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,Se,Se+this._config.deviceCharHeight-Ve),Te=R(this._tmpCtx.getImageData(Se,Se,this._config.deviceCellWidth,this._config.deviceCellHeight),$,we,ke),Te);Ve++);}if(Z){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ve=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Se,Se+Math.floor(this._config.deviceCharHeight/2)-Ve),this._tmpCtx.lineTo(Se+this._config.deviceCharWidth*qe,Se+Math.floor(this._config.deviceCharHeight/2)-Ve),this._tmpCtx.stroke()}this._tmpCtx.restore();const ze=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Mt;if(Mt=this._config.allowTransparency?(function(Te){for(let Ve=0;Ve<Te.data.length;Ve+=4)if(Te.data[Ve+3]>0)return!1;return!0})(ze):R(ze,$,we,ke),Mt)return S;const $e=this._findGlyphBoundingBox(ze,this._workBoundingBox,W,he,Re,Se);let Be,Ie;for(;;){if(this._activePages.length===0){const Te=this._createNewPage();Be=Te,Ie=Te.currentRow,Ie.height=$e.size.y;break}Be=this._activePages[this._activePages.length-1],Ie=Be.currentRow;for(const Te of this._activePages)$e.size.y<=Te.currentRow.height&&(Be=Te,Ie=Te.currentRow);for(let Te=this._activePages.length-1;Te>=0;Te--)for(const Ve of this._activePages[Te].fixedRows)Ve.height<=Ie.height&&$e.size.y<=Ve.height&&(Be=this._activePages[Te],Ie=Ve);if(Ie.y+$e.size.y>=Be.canvas.height||Ie.height>$e.size.y+2){let Te=!1;if(Be.currentRow.y+Be.currentRow.height+$e.size.y>=Be.canvas.height){let Ve;for(const gt of this._activePages)if(gt.currentRow.y+gt.currentRow.height+$e.size.y<gt.canvas.height){Ve=gt;break}if(Ve)Be=Ve;else if(T.maxAtlasPages&&this._pages.length>=T.maxAtlasPages&&Ie.y+$e.size.y<=Be.canvas.height&&Ie.height>=$e.size.y&&Ie.x+$e.size.x<=Be.canvas.width)Te=!0;else{const gt=this._createNewPage();Be=gt,Ie=gt.currentRow,Ie.height=$e.size.y,Te=!0}}Te||(Be.currentRow.height>0&&Be.fixedRows.push(Be.currentRow),Ie={x:0,y:Be.currentRow.y+Be.currentRow.height,height:$e.size.y},Be.fixedRows.push(Ie),Be.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+$e.size.x<=Be.canvas.width)break;Ie===Be.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Be.fixedRows.splice(Be.fixedRows.indexOf(Ie),1)}return $e.texturePage=this._pages.indexOf(Be),$e.texturePosition.x=Ie.x,$e.texturePosition.y=Ie.y,$e.texturePositionClipSpace.x=Ie.x/Be.canvas.width,$e.texturePositionClipSpace.y=Ie.y/Be.canvas.height,$e.sizeClipSpace.x/=Be.canvas.width,$e.sizeClipSpace.y/=Be.canvas.height,Ie.height=Math.max(Ie.height,$e.size.y),Ie.x+=$e.size.x,Be.ctx.putImageData(ze,$e.texturePosition.x-this._workBoundingBox.left,$e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$e.size.x,$e.size.y),Be.addGlyph($e),Be.version++,$e}_findGlyphBoundingBox(j,M,I,B,H,U){M.top=0;const W=B?this._config.deviceCellHeight:this._tmpCanvas.height,Y=B?this._config.deviceCellWidth:I;let Q=!1;for(let K=0;K<W;K++){for(let z=0;z<Y;z++){const O=K*this._tmpCanvas.width*4+4*z+3;if(j.data[O]!==0){M.top=K,Q=!0;break}}if(Q)break}M.left=0,Q=!1;for(let K=0;K<U+Y;K++){for(let z=0;z<W;z++){const O=z*this._tmpCanvas.width*4+4*K+3;if(j.data[O]!==0){M.left=K,Q=!0;break}}if(Q)break}M.right=Y,Q=!1;for(let K=U+Y-1;K>=U;K--){for(let z=0;z<W;z++){const O=z*this._tmpCanvas.width*4+4*K+3;if(j.data[O]!==0){M.right=K,Q=!0;break}}if(Q)break}M.bottom=W,Q=!1;for(let K=W-1;K>=0;K--){for(let z=0;z<Y;z++){const O=K*this._tmpCanvas.width*4+4*z+3;if(j.data[O]!==0){M.bottom=K,Q=!0;break}}if(Q)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:M.right-M.left+1,y:M.bottom-M.top+1},sizeClipSpace:{x:M.right-M.left+1,y:M.bottom-M.top+1},offset:{x:-M.left+U+(B||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-M.top+U+(B||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}a.TextureAtlas=T;class L{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(j){this._glyphs.push(j),this._usedPixels+=j.size.x*j.size.y}constructor(j,M,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const B of I)this._glyphs.push(...B.glyphs),this._usedPixels+=B._usedPixels;this.canvas=D(j,M,M),this.ctx=(0,c.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function R(A,j,M,I){const B=j.rgba>>>24,H=j.rgba>>>16&255,U=j.rgba>>>8&255,W=M.rgba>>>24,Y=M.rgba>>>16&255,Q=M.rgba>>>8&255,K=Math.floor((Math.abs(B-W)+Math.abs(H-Y)+Math.abs(U-Q))/12);let z=!0;for(let O=0;O<A.data.length;O+=4)A.data[O]===B&&A.data[O+1]===H&&A.data[O+2]===U||I&&Math.abs(A.data[O]-B)+Math.abs(A.data[O+1]-H)+Math.abs(A.data[O+2]-U)<K?A.data[O+3]=0:z=!1;return z}function D(A,j,M){const I=A.createElement("canvas");return I.width=j,I.height=M,I}},160:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let h=0,d=0,m=0,c=0;var _,x,E,w,g;function b(y){const T=y.toString(16);return T.length<2?"0"+T:T}function S(y,T){return y<T?(T+.05)/(y+.05):(y+.05)/(T+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(T,L,R,D){return D!==void 0?`#${b(T)}${b(L)}${b(R)}${b(D)}`:`#${b(T)}${b(L)}${b(R)}`},y.toRgba=function(T,L,R,D=255){return(T<<24|L<<16|R<<8|D)>>>0},y.toColor=function(T,L,R,D){return{css:y.toCss(T,L,R,D),rgba:y.toRgba(T,L,R,D)}}})(_||(a.channels=_={})),(function(y){function T(L,R){return c=Math.round(255*R),[h,d,m]=g.toChannels(L.rgba),{css:_.toCss(h,d,m,c),rgba:_.toRgba(h,d,m,c)}}y.blend=function(L,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,A=R.rgba>>16&255,j=R.rgba>>8&255,M=L.rgba>>24&255,I=L.rgba>>16&255,B=L.rgba>>8&255;return h=M+Math.round((D-M)*c),d=I+Math.round((A-I)*c),m=B+Math.round((j-B)*c),{css:_.toCss(h,d,m),rgba:_.toRgba(h,d,m)}},y.isOpaque=function(L){return(255&L.rgba)==255},y.ensureContrastRatio=function(L,R,D){const A=g.ensureContrastRatio(L.rgba,R.rgba,D);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},y.opaque=function(L){const R=(255|L.rgba)>>>0;return[h,d,m]=g.toChannels(R),{css:_.toCss(h,d,m),rgba:R}},y.opacity=T,y.multiplyOpacity=function(L,R){return c=255&L.rgba,T(L,c*R/255)},y.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(a.color=x={})),(function(y){let T,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(T=D,T.globalCompositeOperation="copy",L=T.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),_.toColor(h,d,m);case 5:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),_.toColor(h,d,m,c);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return h=parseInt(D[1]),d=parseInt(D[2]),m=parseInt(D[3]),c=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(h,d,m,c);if(!T||!L)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=L,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[h,d,m,c]=T.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(h,d,m,c),css:R}}})(E||(a.css=E={})),(function(y){function T(L,R,D){const A=L/255,j=R/255,M=D/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}y.relativeLuminance=function(L){return T(L>>16&255,L>>8&255,255&L)},y.relativeLuminance2=T})(w||(a.rgb=w={})),(function(y){function T(R,D,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=D>>24&255,H=D>>16&255,U=D>>8&255,W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));for(;W<A&&(B>0||H>0||U>0);)B-=Math.max(0,Math.ceil(.1*B)),H-=Math.max(0,Math.ceil(.1*H)),U-=Math.max(0,Math.ceil(.1*U)),W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));return(B<<24|H<<16|U<<8|255)>>>0}function L(R,D,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=D>>24&255,H=D>>16&255,U=D>>8&255,W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));for(;W<A&&(B<255||H<255||U<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),H=Math.min(255,H+Math.ceil(.1*(255-H))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));return(B<<24|H<<16|U<<8|255)>>>0}y.blend=function(R,D){if(c=(255&D)/255,c===1)return D;const A=D>>24&255,j=D>>16&255,M=D>>8&255,I=R>>24&255,B=R>>16&255,H=R>>8&255;return h=I+Math.round((A-I)*c),d=B+Math.round((j-B)*c),m=H+Math.round((M-H)*c),_.toRgba(h,d,m)},y.ensureContrastRatio=function(R,D,A){const j=w.relativeLuminance(R>>8),M=w.relativeLuminance(D>>8);if(S(j,M)<A){if(M<j){const H=T(R,D,A),U=S(j,w.relativeLuminance(H>>8));if(U<A){const W=L(R,D,A);return U>S(j,w.relativeLuminance(W>>8))?H:W}return H}const I=L(R,D,A),B=S(j,w.relativeLuminance(I>>8));if(B<A){const H=T(R,D,A);return B>S(j,w.relativeLuminance(H>>8))?I:H}return I}},y.reduceLuminance=T,y.increaseLuminance=L,y.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(g||(a.rgba=g={})),a.toPaddedHex=b,a.contrastRatio=S},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const m=[];for(let c=0;c<this._listeners.length;c++)m.push(this._listeners[c]);for(let c=0;c<m.length;c++)m[c].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(h,d){return h((m=>d.fire(m)))},a.runAndSubscribe=function(h,d){return d(void 0),h((m=>d(m)))}},859:(p,a)=>{function h(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=h,a.getDisposeArrayDisposable=function(d){return{dispose:()=>h(d)}}},485:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(m,c,_){this._data[m]||(this._data[m]={}),this._data[m][c]=_}get(m,c){return this._data[m]?this._data[m][c]:void 0}clear(){this._data={}}}a.TwoKeyMap=h,a.FourKeyMap=class{constructor(){this._data=new h}set(d,m,c,_,x){this._data.get(d,m)||this._data.set(d,m,new h),this._data.get(d,m).set(c,_,x)}get(d,m,c,_){var x;return(x=this._data.get(d,m))==null?void 0:x.get(c,_)}clear(){this._data.clear()}}},399:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const h=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=h.includes("Firefox"),a.isLegacyEdge=h.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(h),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=h.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(h)},385:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=h(399);class m{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let E=0,w=0,g=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),w=Math.max(E,w),b=x.timeRemaining(),1.5*w>b)return g-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-E))}ms`),void this._start();g=b}this.clear()}}class c extends m{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const E=Date.now()+x;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}a.PriorityTaskQueue=c,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:c,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},147:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new h;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}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}}a.AttributeData=h;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},782:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=h(133),m=h(855),c=h(147);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const w=new _;return w.setFromCharData(E),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(E[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(E[m.CHAR_DATA_CHAR_INDEX].length===2){const g=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const b=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(g-55296)+b-56320+65536|E[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=E[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},855:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},133:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},a.utf32ToString=function(h,d=0,m=h.length){let c="";for(let _=d;_<m;++_){let x=h[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const m=h.length;if(!m)return 0;let c=0,_=0;if(this._interim){const x=h.charCodeAt(_++);56320<=x&&x<=57343?d[c++]=1024*(this._interim-55296)+x-56320+65536:(d[c++]=this._interim,d[c++]=x),this._interim=0}for(let x=_;x<m;++x){const E=h.charCodeAt(x);if(55296<=E&&E<=56319){if(++x>=m)return this._interim=E,c;const w=h.charCodeAt(x);56320<=w&&w<=57343?d[c++]=1024*(E-55296)+w-56320+65536:(d[c++]=E,d[c++]=w)}else E!==65279&&(d[c++]=E)}return c}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,d){const m=h.length;if(!m)return 0;let c,_,x,E,w=0,g=0,b=0;if(this.interim[0]){let T=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)L<<=6,L|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-D;for(;b<j;){if(b>=m)return 0;if(R=h[b++],(192&R)!=128){b--,T=!0;break}this.interim[D++]=R,L<<=6,L|=63&R}T||(A===2?L<128?b--:d[w++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(d[w++]=L):L<65536||L>1114111||(d[w++]=L)),this.interim.fill(0)}const S=m-4;let y=b;for(;y<m;){for(;!(!(y<S)||128&(c=h[y])||128&(_=h[y+1])||128&(x=h[y+2])||128&(E=h[y+3]));)d[w++]=c,d[w++]=_,d[w++]=x,d[w++]=E,y+=4;if(c=h[y++],c<128)d[w++]=c;else if((224&c)==192){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(g=(31&c)<<6|63&_,g<128){y--;continue}d[w++]=g}else if((240&c)==224){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,w;if(x=h[y++],(192&x)!=128){y--;continue}if(g=(15&c)<<12|(63&_)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;d[w++]=g}else if((248&c)==240){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,w;if(x=h[y++],(192&x)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,w;if(E=h[y++],(192&E)!=128){y--;continue}if(g=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&E,g<65536||g>1114111)continue;d[w++]=g}}return w}}},776:function(p,a,h){var d=this&&this.__decorate||function(g,b,S,y){var T,L=arguments.length,R=L<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,y);else for(var D=g.length-1;D>=0;D--)(T=g[D])&&(R=(L<3?T(R):L>3?T(b,S,R):T(b,S))||R);return L>3&&R&&Object.defineProperty(b,S,R),R},m=this&&this.__param||function(g,b){return function(S,y){b(S,y,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const c=h(859),_=h(97),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let E,w=a.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let b=0;b<g.length;b++)typeof g[b]=="function"&&(g[b]=g[b]())}_log(g,b,S){this._evalLazyOptionalParams(S),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(g,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,g,b)}debug(g,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,g,b)}info(g,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,g,b)}warn(g,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,g,b)}error(g,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,g,b)}};a.LogService=w=d([m(0,_.IOptionsService)],w),a.setTraceLogger=function(g){E=g},a.traceCall=function(g,b,S){if(typeof S.value!="function")throw new Error("not supported");const y=S.value;S.value=function(...T){if(E.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,T);E.trace(`GlyphRenderer#${y.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const L=y.apply(this,T);return E.trace(`GlyphRenderer#${y.name} return`,L),L}}},726:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const h="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[d]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const c=function(_,x,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,g,b){g[h]===g?g[d].push({id:w,index:b}):(g[d]=[{id:w,index:b}],g[h]=g)})(c,_,E)};return c.toString=()=>m,a.serviceRegistry.set(m,c),c}},97:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=h(726);var m;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p].call(h.exports,h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.WebglAddon=void 0;const a=l(345),h=l(859),d=l(399),m=l(666),c=l(776);class _ extends h.Disposable{constructor(E){if(d.isSafari&&(0,d.getSafariVersion)()<16){const w={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",w))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=E,this._onChangeTextureAtlas=this.register(new a.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new a.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new a.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new a.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(E){const w=E._core;if(!E.element)return void this.register(w.onWillOpen((()=>this.activate(E))));this._terminal=E;const g=w.coreService,b=w.optionsService,S=w,y=S._renderService,T=S._characterJoinerService,L=S._charSizeService,R=S._coreBrowserService,D=S._decorationService,A=S._logService,j=S._themeService;(0,c.setTraceLogger)(A),this._renderer=this.register(new m.WebglRenderer(E,T,L,R,g,D,b,j,this._preserveDrawingBuffer)),this.register((0,a.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,a.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,a.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,a.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),y.setRenderer(this._renderer),this.register((0,h.toDisposable)((()=>{const M=this._terminal._core._renderService;M.setRenderer(this._terminal._core._createRenderer()),M.handleResize(E.cols,E.rows)})))}get textureAtlas(){var E;return(E=this._renderer)==null?void 0:E.textureAtlas}clearTextureAtlas(){var E;(E=this._renderer)==null||E.clearTextureAtlas()}}p.WebglAddon=_})(),f})()))})(cm)),cm.exports}var b9=y9(),um={exports:{}},nS;function S9(){return nS||(nS=1,(function(e,i){(function(r,s){e.exports=s()})(globalThis,(()=>(()=>{var r={4567:function(p,a,h){var d=this&&this.__decorate||function(S,y,T,L){var R,D=arguments.length,A=D<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,y,T,L);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(D<3?R(A):D>3?R(y,T,A):R(y,T))||A);return D>3&&A&&Object.defineProperty(y,T,A),A},m=this&&this.__param||function(S,y){return function(T,L){y(T,L,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const c=h(9042),_=h(9924),x=h(844),E=h(4725),w=h(2585),g=h(3656);let b=a.AccessibilityManager=class extends x.Disposable{constructor(S,y,T,L){super(),this._terminal=S,this._coreBrowserService=T,this._renderService=L,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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 _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
599
+ }`)),this.register((0,m.toDisposable)((()=>B.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(B.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=B.createVertexArray(),B.bindVertexArray(this._vertexArrayObject);const H=new Float32Array([0,0,1,0,0,1,1,1]),U=B.createBuffer();this.register((0,m.toDisposable)((()=>B.deleteBuffer(U)))),B.bindBuffer(B.ARRAY_BUFFER,U),B.bufferData(B.ARRAY_BUFFER,H,B.STATIC_DRAW),B.enableVertexAttribArray(3),B.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const W=new Uint8Array([0,1,2,3]),Y=B.createBuffer();this.register((0,m.toDisposable)((()=>B.deleteBuffer(Y)))),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,Y),B.bufferData(B.ELEMENT_ARRAY_BUFFER,W,B.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(B.createBuffer()),this.register((0,m.toDisposable)((()=>B.deleteBuffer(this._attributesBuffer)))),B.bindBuffer(B.ARRAY_BUFFER,this._attributesBuffer),B.enableVertexAttribArray(0),B.vertexAttribPointer(0,2,B.FLOAT,!1,x,0),B.vertexAttribDivisor(0,1),B.enableVertexAttribArray(1),B.vertexAttribPointer(1,2,B.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(1,1),B.enableVertexAttribArray(2),B.vertexAttribPointer(2,4,B.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors((Q=>{this._updateCachedColors(Q),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(A){const j=this._gl;j.useProgram(this._program),j.bindVertexArray(this._vertexArrayObject),j.uniformMatrix4fv(this._projectionLocation,!1,_.PROJECTION_MATRIX),j.bindBuffer(j.ARRAY_BUFFER,this._attributesBuffer),j.bufferData(j.ARRAY_BUFFER,A.attributes,j.DYNAMIC_DRAW),j.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,j.UNSIGNED_BYTE,0,A.count)}handleResize(){this._updateViewportRectangle()}setDimensions(A){this._dimensions=A}_updateCachedColors(A){this._bgFloat=this._colorToFloat32Array(A.background),this._cursorFloat=this._colorToFloat32Array(A.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(A){const j=this._terminal,M=this._vertices;let I,B,H,U,W,Y,Q,K,z,O,G,Z=1;for(I=0;I<j.rows;I++){for(H=-1,U=0,W=0,Y=!1,B=0;B<j.cols;B++)Q=(I*j.cols+B)*c.RENDER_MODEL_INDICIES_PER_CELL,K=A.cells[Q+c.RENDER_MODEL_BG_OFFSET],z=A.cells[Q+c.RENDER_MODEL_FG_OFFSET],O=!!(67108864&z),(K!==U||z!==W&&(Y||O))&&((U!==0||Y&&W!==0)&&(G=8*Z++,this._updateRectangle(M,G,W,U,H,B,I)),H=B,U=K,W=z,Y=O);(U!==0||Y&&W!==0)&&(G=8*Z++,this._updateRectangle(M,G,W,U,H,j.cols,I))}M.count=Z}updateCursor(A){const j=this._verticesCursor,M=A.cursor;if(!M||M.style==="block")return void(j.count=0);let I,B=0;M.style!=="bar"&&M.style!=="outline"||(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.style==="bar"?M.dpr*M.cursorWidth:M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),M.style!=="underline"&&M.style!=="outline"||(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,(M.y+1)*this._dimensions.device.cell.height-M.dpr,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat)),M.style==="outline"&&(I=8*B++,this._addRectangleFloat(j.attributes,I,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat),I=8*B++,this._addRectangleFloat(j.attributes,I,(M.x+M.width)*this._dimensions.device.cell.width-M.dpr,M.y*this._dimensions.device.cell.height,M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),j.count=B}_updateRectangle(A,j,M,I,B,H,U){if(67108864&M)switch(50331648&M){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&M].rgba;break;case 50331648:w=(16777215&M)<<8;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:w=(16777215&I)<<8;break;default:w=this._themeService.colors.background.rgba}A.attributes.length<j+4&&(A.attributes=(0,_.expandFloat32Array)(A.attributes,this._terminal.rows*this._terminal.cols*8)),g=B*this._dimensions.device.cell.width,b=U*this._dimensions.device.cell.height,S=(w>>24&255)/255,y=(w>>16&255)/255,T=(w>>8&255)/255,L=1,this._addRectangle(A.attributes,j,g,b,(H-B)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,S,y,T,L)}_addRectangle(A,j,M,I,B,H,U,W,Y,Q){A[j]=M/this._dimensions.device.canvas.width,A[j+1]=I/this._dimensions.device.canvas.height,A[j+2]=B/this._dimensions.device.canvas.width,A[j+3]=H/this._dimensions.device.canvas.height,A[j+4]=U,A[j+5]=W,A[j+6]=Y,A[j+7]=Q}_addRectangleFloat(A,j,M,I,B,H,U){A[j]=M/this._dimensions.device.canvas.width,A[j+1]=I/this._dimensions.device.canvas.height,A[j+2]=B/this._dimensions.device.canvas.width,A[j+3]=H/this._dimensions.device.canvas.height,A[j+4]=U[0],A[j+5]=U[1],A[j+6]=U[2],A[j+7]=U[3]}_colorToFloat32Array(A){return new Float32Array([(A.rgba>>24&255)/255,(A.rgba>>16&255)/255,(A.rgba>>8&255)/255,(255&A.rgba)/255])}}a.RectangleRenderer=R},310:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderModel=a.COMBINED_CHAR_BIT_MASK=a.RENDER_MODEL_EXT_OFFSET=a.RENDER_MODEL_FG_OFFSET=a.RENDER_MODEL_BG_OFFSET=a.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=h(296);a.RENDER_MODEL_INDICIES_PER_CELL=4,a.RENDER_MODEL_BG_OFFSET=1,a.RENDER_MODEL_FG_OFFSET=2,a.RENDER_MODEL_EXT_OFFSET=3,a.COMBINED_CHAR_BIT_MASK=2147483648,a.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(m,c){const _=m*c*a.RENDER_MODEL_INDICIES_PER_CELL;_!==this.cells.length&&(this.cells=new Uint32Array(_),this.lineLengths=new Uint32Array(c))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.JoinedCellData=a.WebglRenderer=void 0;const d=h(820),m=h(274),c=h(627),_=h(457),x=h(56),E=h(374),w=h(345),g=h(859),b=h(147),S=h(782),y=h(855),T=h(965),L=h(742),R=h(310),D=h(733);class A extends g.Disposable{constructor(B,H,U,W,Y,Q,K,z,O){super(),this._terminal=B,this._characterJoinerService=H,this._charSizeService=U,this._coreBrowserService=W,this._coreService=Y,this._decorationService=Q,this._optionsService=K,this._themeService=z,this._cursorBlinkStateManager=new g.MutableDisposable,this._charAtlasDisposable=this.register(new g.MutableDisposable),this._observerDisposable=this.register(new g.MutableDisposable),this._model=new R.RenderModel,this._workCell=new S.CellData,this._workCell2=new S.CellData,this._rectangleRenderer=this.register(new g.MutableDisposable),this._glyphRenderer=this.register(new g.MutableDisposable),this._onChangeTextureAtlas=this.register(new w.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new w.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new w.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new w.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new m.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new D.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,K,this._themeService)],this.dimensions=(0,E.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(K.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const G={antialias:!1,depth:!1,preserveDrawingBuffer:O};if(this._gl=this._canvas.getContext("webgl2",G),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(Z=>{console.log("webglcontextlost event received"),Z.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Z)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(Z=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,c.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((Z,F)=>this._setCanvasDevicePixelDimensions(Z,F))),this.register(this._coreBrowserService.onWindowChange((Z=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,Z,((F,V)=>this._setCanvasDevicePixelDimensions(F,V)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,g.toDisposable)((()=>{var Z;for(const F of this._renderLayers)F.dispose();(Z=this._canvas.parentElement)==null||Z.removeChild(this._canvas),(0,c.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var B;return(B=this._charAtlas)==null?void 0:B.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(B,H){var U,W,Y,Q;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const K of this._renderLayers)K.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(U=this._rectangleRenderer.value)==null||U.setDimensions(this.dimensions),(W=this._rectangleRenderer.value)==null||W.handleResize(),(Y=this._glyphRenderer.value)==null||Y.setDimensions(this.dimensions),(Q=this._glyphRenderer.value)==null||Q.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var B;for(const H of this._renderLayers)H.handleBlur(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.pause(),this._requestRedrawViewport()}handleFocus(){var B;for(const H of this._renderLayers)H.handleFocus(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.resume(),this._requestRedrawViewport()}handleSelectionChanged(B,H,U){for(const W of this._renderLayers)W.handleSelectionChanged(this._terminal,B,H,U);this._model.selection.update(this._core,B,H,U),this._requestRedrawViewport()}handleCursorMove(){var B;for(const H of this._renderLayers)H.handleCursorMove(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new L.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new T.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var H;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,g.getDisposeArrayDisposable)([(0,w.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,w.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(H=this._glyphRenderer.value)==null||H.setAtlas(this._charAtlas)}_clearModel(B){var H;this._model.clear(),B&&((H=this._glyphRenderer.value)==null||H.clear())}clearTextureAtlas(){var B;(B=this._charAtlas)==null||B.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var B;this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(B){return-1}deregisterCharacterJoiner(B){return!1}renderRows(B,H){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,B,H);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(B,H),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new _.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(B,H){const U=this._core;let W,Y,Q,K,z,O,G,Z,F,V,ne,le,X,$,oe=this._workCell;B=M(B,U.rows-1,0),H=M(H,U.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ue=ee-U.buffer.ydisp,he=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let we=-1;const Se=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Re=!1;for(Y=B;Y<=H;Y++)for(Q=Y+U.buffer.ydisp,K=U.buffer.lines.get(Q),this._model.lineLengths[Y]=0,z=this._characterJoinerService.getJoinedCharacters(Q),X=0;X<U.cols;X++)if(W=this._cellColorResolver.result.bg,K.loadCell(X,oe),X===0&&(W=this._cellColorResolver.result.bg),O=!1,G=X,z.length>0&&X===z[0][0]&&(O=!0,Z=z.shift(),oe=new j(oe,K.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),G=Z[1]-1),F=oe.getChars(),V=oe.getCode(),le=(Y*U.cols+X)*R.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(oe,X,Q,this.dimensions.device.cell.width),Se&&Q===ee&&(X===he&&(this._model.cursor={x:he,y:ue,width:oe.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},we=he+oe.getWidth()-1),X>=he&&X<=we&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),V!==y.NULL_CELL_CODE&&(this._model.lineLengths[Y]=X+1),(this._model.cells[le]!==V||this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Re=!0,F.length>1&&(V|=R.COMBINED_CHAR_BIT_MASK),this._model.cells[le]=V,this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ne=oe.getWidth(),this._glyphRenderer.value.updateCell(X,Y,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,F,ne,W),O))for(oe=this._workCell,X++;X<G;X++)$=(Y*U.cols+X)*R.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(X,Y,y.NULL_CELL_CODE,0,0,0,y.NULL_CELL_CHAR,0,0),this._model.cells[$]=y.NULL_CELL_CODE,this._model.cells[$+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[$+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[$+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Re&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(B,H){this._canvas.width===B&&this._canvas.height===H||(this._canvas.width=B,this._canvas.height=H,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const B=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:B,end:B})}}a.WebglRenderer=A;class j extends b.AttributeData{constructor(B,H,U){super(),this.content=0,this.combinedData="",this.fg=B.fg,this.bg=B.bg,this.combinedData=H,this._width=U}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(B){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function M(I,B,H=0){return Math.max(Math.min(I,B),H)}a.JoinedCellData=j},381:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GLTexture=a.expandFloat32Array=a.createShader=a.createProgram=a.PROJECTION_MATRIX=void 0;const d=h(374);function m(c,_,x){const E=(0,d.throwIfFalsy)(c.createShader(_));if(c.shaderSource(E,x),c.compileShader(E),c.getShaderParameter(E,c.COMPILE_STATUS))return E;console.error(c.getShaderInfoLog(E)),c.deleteShader(E)}a.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),a.createProgram=function(c,_,x){const E=(0,d.throwIfFalsy)(c.createProgram());if(c.attachShader(E,(0,d.throwIfFalsy)(m(c,c.VERTEX_SHADER,_))),c.attachShader(E,(0,d.throwIfFalsy)(m(c,c.FRAGMENT_SHADER,x))),c.linkProgram(E),c.getProgramParameter(E,c.LINK_STATUS))return E;console.error(c.getProgramInfoLog(E)),c.deleteProgram(E)},a.createShader=m,a.expandFloat32Array=function(c,_){const x=Math.min(2*c.length,_),E=new Float32Array(x);for(let w=0;w<c.length;w++)E[w]=c[w];return E},a.GLTexture=class{constructor(c){this.texture=c,this.version=-1}}},592:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BaseRenderLayer=void 0;const d=h(627),m=h(237),c=h(374),_=h(859);class x extends _.Disposable{constructor(w,g,b,S,y,T,L,R){super(),this._container=g,this._alpha=y,this._coreBrowserService=T,this._optionsService=L,this._themeService=R,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${b}-layer`),this._canvas.style.zIndex=S.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((D=>{this._refreshCharAtlas(w,D),this.reset(w)}))),this.register((0,_.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,c.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(w){}handleFocus(w){}handleCursorMove(w){}handleGridChanged(w,g,b){}handleSelectionChanged(w,g,b,S=!1){}_setTransparency(w,g){if(g===this._alpha)return;const b=this._canvas;this._alpha=g,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,b),this._refreshCharAtlas(w,this._themeService.colors),this.handleGridChanged(w,0,w.rows-1)}_refreshCharAtlas(w,g){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(w,this._optionsService.rawOptions,g,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(w,g){this._deviceCellWidth=g.device.cell.width,this._deviceCellHeight=g.device.cell.height,this._deviceCharWidth=g.device.char.width,this._deviceCharHeight=g.device.char.height,this._deviceCharLeft=g.device.char.left,this._deviceCharTop=g.device.char.top,this._canvas.width=g.device.canvas.width,this._canvas.height=g.device.canvas.height,this._canvas.style.width=`${g.css.canvas.width}px`,this._canvas.style.height=`${g.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(w,this._themeService.colors)}_fillBottomLineAtCells(w,g,b=1){this._ctx.fillRect(w*this._deviceCellWidth,(g+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,b*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(w,g,b,S){this._alpha?this._ctx.clearRect(w*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(w*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight))}_fillCharTrueColor(w,g,b,S){this._ctx.font=this._getFont(w,!1,!1),this._ctx.textBaseline=m.TEXT_BASELINE,this._clipCell(b,S,g.getWidth()),this._ctx.fillText(g.getChars(),b*this._deviceCellWidth+this._deviceCharLeft,S*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(w,g,b){this._ctx.beginPath(),this._ctx.rect(w*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(w,g,b){return`${b?"italic":""} ${g?w.options.fontWeightBold:w.options.fontWeight} ${w.options.fontSize*this._coreBrowserService.dpr}px ${w.options.fontFamily}`}}a.BaseRenderLayer=x},733:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkRenderLayer=void 0;const d=h(197),m=h(237),c=h(592);class _ extends c.BaseRenderLayer{constructor(E,w,g,b,S,y,T){super(g,E,"link",w,!0,S,y,T),this.register(b.onShowLinkUnderline((L=>this._handleShowLinkUnderline(L)))),this.register(b.onHideLinkUnderline((L=>this._handleHideLinkUnderline(L))))}resize(E,w){super.resize(E,w),this._state=void 0}reset(E){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(E){if(E.fg===m.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:E.fg!==void 0&&(0,d.is256Color)(E.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[E.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(let w=E.y1+1;w<E.y2;w++)this._fillBottomLineAtCells(0,w,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E}_handleHideLinkUnderline(E){this._clearCurrentLink()}}a.LinkRenderLayer=_},820:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(h,d,m,c){h.addEventListener(d,m,c);let _=!1;return{dispose:()=>{_||(_=!0,h.removeEventListener(d,m,c))}}}},274:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellColorResolver=void 0;const d=h(855),m=h(160),c=h(374);let _,x=0,E=0,w=!1,g=!1,b=!1,S=0;a.CellColorResolver=class{constructor(y,T,L,R,D,A){this._terminal=y,this._optionService=T,this._selectionRenderModel=L,this._decorationService=R,this._coreBrowserService=D,this._themeService=A,this.result={fg:0,bg:0,ext:0}}resolve(y,T,L,R){if(this.result.bg=y.bg,this.result.fg=y.fg,this.result.ext=268435456&y.bg?y.extended.ext:0,E=0,x=0,g=!1,w=!1,b=!1,_=this._themeService.colors,S=0,y.getCode()!==d.NULL_CELL_CODE&&y.extended.underlineStyle===4){const D=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));S=T*R%(2*Math.round(D))}if(this._decorationService.forEachDecorationAtCell(T,L,"bottom",(D=>{D.backgroundColorRGB&&(E=D.backgroundColorRGB.rgba>>8&16777215,g=!0),D.foregroundColorRGB&&(x=D.foregroundColorRGB.rgba>>8&16777215,w=!0)})),b=this._selectionRenderModel.isCellSelected(this._terminal,T,L),b){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:E=(16777215&this.result.fg)<<8|255;break;default:E=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:E=(16777215&this.result.bg)<<8|255}E=m.rgba.blend(E,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else E=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(g=!0,_.selectionForeground&&(x=_.selectionForeground.rgba>>8&16777215,w=!0),(0,c.treatGlyphAsBackgroundColor)(y.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=m.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}w=!0}}this._decorationService.forEachDecorationAtCell(T,L,"top",(D=>{D.backgroundColorRGB&&(E=D.backgroundColorRGB.rgba>>8&16777215,g=!0),D.foregroundColorRGB&&(x=D.foregroundColorRGB.rgba>>8&16777215,w=!0)})),g&&(E=b?-16777216&y.bg&-134217729|E|50331648:-16777216&y.bg|E|50331648),w&&(x=-16777216&y.fg&-67108865|x|50331648),67108864&this.result.fg&&(g&&!w&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&_.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,w=!0),!g&&w&&(E=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&_.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,g=!0)),_=void 0,this.result.bg=g?E:this.result.bg,this.result.fg=w?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=S<<29&3758096384}}},627:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeTerminalFromCache=a.acquireTextureAtlas=void 0;const d=h(509),m=h(197),c=[];a.acquireTextureAtlas=function(_,x,E,w,g,b,S,y){const T=(0,m.generateConfig)(w,g,b,S,x,E,y);for(let D=0;D<c.length;D++){const A=c[D],j=A.ownedBy.indexOf(_);if(j>=0){if((0,m.configEquals)(A.config,T))return A.atlas;A.ownedBy.length===1?(A.atlas.dispose(),c.splice(D,1)):A.ownedBy.splice(j,1);break}}for(let D=0;D<c.length;D++){const A=c[D];if((0,m.configEquals)(A.config,T))return A.ownedBy.push(_),A.atlas}const L=_._core,R={atlas:new d.TextureAtlas(document,T,L.unicodeService),config:T,ownedBy:[_]};return c.push(R),R.atlas},a.removeTerminalFromCache=function(_){for(let x=0;x<c.length;x++){const E=c[x].ownedBy.indexOf(_);if(E!==-1){c[x].ownedBy.length===1?(c[x].atlas.dispose(),c.splice(x,1)):c[x].ownedBy.splice(E,1);break}}}},197:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.is256Color=a.configEquals=a.generateConfig=void 0;const d=h(160);a.generateConfig=function(m,c,_,x,E,w,g){const b={foreground:w.foreground,background:w.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:w.ansi.slice(),contrastCache:w.contrastCache,halfContrastCache:w.halfContrastCache};return{customGlyphs:E.customGlyphs,devicePixelRatio:g,letterSpacing:E.letterSpacing,lineHeight:E.lineHeight,deviceCellWidth:m,deviceCellHeight:c,deviceCharWidth:_,deviceCharHeight:x,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,drawBoldTextInBrightColors:E.drawBoldTextInBrightColors,minimumContrastRatio:E.minimumContrastRatio,colors:b}},a.configEquals=function(m,c){for(let _=0;_<m.colors.ansi.length;_++)if(m.colors.ansi[_].rgba!==c.colors.ansi[_].rgba)return!1;return m.devicePixelRatio===c.devicePixelRatio&&m.customGlyphs===c.customGlyphs&&m.lineHeight===c.lineHeight&&m.letterSpacing===c.letterSpacing&&m.fontFamily===c.fontFamily&&m.fontSize===c.fontSize&&m.fontWeight===c.fontWeight&&m.fontWeightBold===c.fontWeightBold&&m.allowTransparency===c.allowTransparency&&m.deviceCharWidth===c.deviceCharWidth&&m.deviceCharHeight===c.deviceCharHeight&&m.drawBoldTextInBrightColors===c.drawBoldTextInBrightColors&&m.minimumContrastRatio===c.minimumContrastRatio&&m.colors.foreground.rgba===c.colors.foreground.rgba&&m.colors.background.rgba===c.colors.background.rgba},a.is256Color=function(m){return(50331648&m)==16777216||(50331648&m)==33554432}},237:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=h(399);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CursorBlinkStateManager=void 0,a.CursorBlinkStateManager=class{constructor(h,d){this._renderCallback=h,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(h=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),h)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tryDrawCustomChar=a.powerlineDefinitions=a.boxDrawingDefinitions=a.blockElementDefinitions=void 0;const d=h(374);a.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const m={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};a.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(w,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"║":{1:(w,g)=>`M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1`},"╒":{1:(w,g)=>`M.5,1 L.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╓":{1:(w,g)=>`M${.5-w},1 L${.5-w},.5 L1,.5 M${.5+w},.5 L${.5+w},1`},"╔":{1:(w,g)=>`M1,${.5-g} L${.5-w},${.5-g} L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1`},"╕":{1:(w,g)=>`M0,${.5-g} L.5,${.5-g} L.5,1 M0,${.5+g} L.5,${.5+g}`},"╖":{1:(w,g)=>`M${.5+w},1 L${.5+w},.5 L0,.5 M${.5-w},.5 L${.5-w},1`},"╗":{1:(w,g)=>`M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M0,${.5-g} L${.5+w},${.5-g} L${.5+w},1`},"╘":{1:(w,g)=>`M.5,0 L.5,${.5+g} L1,${.5+g} M.5,${.5-g} L1,${.5-g}`},"╙":{1:(w,g)=>`M1,.5 L${.5-w},.5 L${.5-w},0 M${.5+w},.5 L${.5+w},0`},"╚":{1:(w,g)=>`M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0 M1,${.5+g} L${.5-w},${.5+g} L${.5-w},0`},"╛":{1:(w,g)=>`M0,${.5+g} L.5,${.5+g} L.5,0 M0,${.5-g} L.5,${.5-g}`},"╜":{1:(w,g)=>`M0,.5 L${.5+w},.5 L${.5+w},0 M${.5-w},.5 L${.5-w},0`},"╝":{1:(w,g)=>`M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0 M0,${.5+g} L${.5+w},${.5+g} L${.5+w},0`},"╞":{1:(w,g)=>`M.5,0 L.5,1 M.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╟":{1:(w,g)=>`M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1 M${.5+w},.5 L1,.5`},"╠":{1:(w,g)=>`M${.5-w},0 L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1 M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0`},"╡":{1:(w,g)=>`M.5,0 L.5,1 M0,${.5-g} L.5,${.5-g} M0,${.5+g} L.5,${.5+g}`},"╢":{1:(w,g)=>`M0,.5 L${.5-w},.5 M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1`},"╣":{1:(w,g)=>`M${.5+w},0 L${.5+w},1 M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0`},"╤":{1:(w,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g} M.5,${.5+g} L.5,1`},"╥":{1:(w,g)=>`M0,.5 L1,.5 M${.5-w},.5 L${.5-w},1 M${.5+w},.5 L${.5+w},1`},"╦":{1:(w,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1`},"╧":{1:(w,g)=>`M.5,0 L.5,${.5-g} M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╨":{1:(w,g)=>`M0,.5 L1,.5 M${.5-w},.5 L${.5-w},0 M${.5+w},.5 L${.5+w},0`},"╩":{1:(w,g)=>`M0,${.5+g} L1,${.5+g} M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0 M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0`},"╪":{1:(w,g)=>`M.5,0 L.5,1 M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╫":{1:(w,g)=>`M0,.5 L1,.5 M${.5-w},0 L${.5-w},1 M${.5+w},0 L${.5+w},1`},"╬":{1:(w,g)=>`M0,${.5+g} L${.5-w},${.5+g} L${.5-w},1 M1,${.5+g} L${.5+w},${.5+g} L${.5+w},1 M0,${.5-g} L${.5-w},${.5-g} L${.5-w},0 M1,${.5-g} L${.5+w},${.5-g} L${.5+w},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(w,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,1,.5`},"╮":{1:(w,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,0,.5`},"╯":{1:(w,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,0,.5`},"╰":{1:(w,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,1,.5`}},a.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.tryDrawCustomChar=function(w,g,b,S,y,T,L,R){const D=a.blockElementDefinitions[g];if(D)return(function(I,B,H,U,W,Y){for(let Q=0;Q<B.length;Q++){const K=B[Q],z=W/8,O=Y/8;I.fillRect(H+K.x*z,U+K.y*O,K.w*z,K.h*O)}})(w,D,b,S,y,T),!0;const A=m[g];if(A)return(function(I,B,H,U,W,Y){let Q=c.get(B);Q||(Q=new Map,c.set(B,Q));const K=I.fillStyle;if(typeof K!="string")throw new Error(`Unexpected fillStyle type "${K}"`);let z=Q.get(K);if(!z){const O=B[0].length,G=B.length,Z=I.canvas.ownerDocument.createElement("canvas");Z.width=O,Z.height=G;const F=(0,d.throwIfFalsy)(Z.getContext("2d")),V=new ImageData(O,G);let ne,le,X,$;if(K.startsWith("#"))ne=parseInt(K.slice(1,3),16),le=parseInt(K.slice(3,5),16),X=parseInt(K.slice(5,7),16),$=K.length>7&&parseInt(K.slice(7,9),16)||1;else{if(!K.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${K}" when drawing pattern glyph`);[ne,le,X,$]=K.substring(5,K.length-1).split(",").map((oe=>parseFloat(oe)))}for(let oe=0;oe<G;oe++)for(let ee=0;ee<O;ee++)V.data[4*(oe*O+ee)]=ne,V.data[4*(oe*O+ee)+1]=le,V.data[4*(oe*O+ee)+2]=X,V.data[4*(oe*O+ee)+3]=B[oe][ee]*(255*$);F.putImageData(V,0,0),z=(0,d.throwIfFalsy)(I.createPattern(Z,null)),Q.set(K,z)}I.fillStyle=z,I.fillRect(H,U,W,Y)})(w,A,b,S,y,T),!0;const j=a.boxDrawingDefinitions[g];if(j)return(function(I,B,H,U,W,Y,Q){I.strokeStyle=I.fillStyle;for(const[K,z]of Object.entries(B)){let O;I.beginPath(),I.lineWidth=Q*Number.parseInt(K),O=typeof z=="function"?z(.15,.15/Y*W):z;for(const G of O.split(" ")){const Z=G[0],F=x[Z];if(!F){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=G.substring(1).split(",");V[0]&&V[1]&&F(I,E(V,W,Y,H,U,!0,Q))}I.stroke(),I.closePath()}})(w,j,b,S,y,T,R),!0;const M=a.powerlineDefinitions[g];return!!M&&((function(I,B,H,U,W,Y,Q,K){const z=new Path2D;z.rect(H,U,W,Y),I.clip(z),I.beginPath();const O=Q/12;I.lineWidth=K*O;for(const G of B.d.split(" ")){const Z=G[0],F=x[Z];if(!F){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=G.substring(1).split(",");V[0]&&V[1]&&F(I,E(V,W,Y,H,U,!1,K,(B.leftPadding??0)*(O/2),(B.rightPadding??0)*(O/2)))}B.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(w,M,b,S,y,T,L,R),!0)};const c=new Map;function _(w,g,b=0){return Math.max(Math.min(w,g),b)}const x={C:(w,g)=>w.bezierCurveTo(g[0],g[1],g[2],g[3],g[4],g[5]),L:(w,g)=>w.lineTo(g[0],g[1]),M:(w,g)=>w.moveTo(g[0],g[1])};function E(w,g,b,S,y,T,L,R=0,D=0){const A=w.map((j=>parseFloat(j)||parseInt(j)));if(A.length<2)throw new Error("Too few arguments for instruction");for(let j=0;j<A.length;j+=2)A[j]*=g-R*L-D*L,T&&A[j]!==0&&(A[j]=_(Math.round(A[j]+.5)-.5,g,0)),A[j]+=S+R*L;for(let j=1;j<A.length;j+=2)A[j]*=b,T&&A[j]!==0&&(A[j]=_(Math.round(A[j]+.5)-.5,b,0)),A[j]+=y;return A}},56:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.observeDevicePixelDimensions=void 0;const d=h(859);a.observeDevicePixelDimensions=function(m,c,_){let x=new c.ResizeObserver((E=>{const w=E.find((S=>S.target===m));if(!w)return;if(!("devicePixelContentBoxSize"in w))return x==null||x.disconnect(),void(x=void 0);const g=w.devicePixelContentBoxSize[0].inlineSize,b=w.devicePixelContentBoxSize[0].blockSize;g>0&&b>0&&_(g,b)}));try{x.observe(m,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,d.toDisposable)((()=>x==null?void 0:x.disconnect()))}},374:(p,a)=>{function h(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=h,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=d,a.allowRescaling=function(m,c,_,x){return c===1&&_>Math.ceil(1.5*x)&&m!==void 0&&m>255&&!d(m)&&!h(m)&&!(function(E){return 57344<=E&&E<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return h(m)||(function(c){return 9472<=c&&c<=9631})(m)},a.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}}}},a.computeNextVariantOffset=function(m,c,_=0){return(m-(2*Math.round(c)-_))%(2*Math.round(c))}},296:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class h{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(m,c,_,x=!1){if(this.selectionStart=c,this.selectionEnd=_,!c||!_||c[0]===_[0]&&c[1]===_[1])return void this.clear();const E=m.buffers.active.ydisp,w=c[1]-E,g=_[1]-E,b=Math.max(w,0),S=Math.min(g,m.rows-1);b>=m.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=g,this.viewportCappedStartRow=b,this.viewportCappedEndRow=S,this.startCol=c[0],this.endCol=_[0])}isCellSelected(m,c,_){return!!this.hasSelection&&(_-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&_>=this.viewportCappedStartRow&&c<this.endCol&&_<=this.viewportCappedEndRow:c<this.startCol&&_>=this.viewportCappedStartRow&&c>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol)}}a.createSelectionRenderModel=function(){return new h}},509:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TextureAtlas=void 0;const d=h(237),m=h(860),c=h(374),_=h(160),x=h(345),E=h(485),w=h(385),g=h(147),b=h(855),S={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let y;class T{get pages(){return this._pages}constructor(j,M,I){this._document=j,this._config=M,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new E.FourKeyMap,this._cacheMapCombined=new E.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new g.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=D(j,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,c.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const j of this.pages)j.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const j=new w.IdleTaskQueue;for(let M=33;M<126;M++)j.enqueue((()=>{if(!this._cacheMap.get(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT)){const I=this._drawToCache(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT);this._cacheMap.set(M,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const j of this._pages)j.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(T.maxAtlasPages&&this._pages.length>=Math.max(4,T.maxAtlasPages)){const M=this._pages.filter((Q=>2*Q.canvas.width<=(T.maxTextureSize||4096))).sort(((Q,K)=>K.canvas.width!==Q.canvas.width?K.canvas.width-Q.canvas.width:K.percentageUsed-Q.percentageUsed));let I=-1,B=0;for(let Q=0;Q<M.length;Q++)if(M[Q].canvas.width!==B)I=Q,B=M[Q].canvas.width;else if(Q-I==3)break;const H=M.slice(I,I+4),U=H.map((Q=>Q.glyphs[0].texturePage)).sort(((Q,K)=>Q>K?1:-1)),W=this.pages.length-H.length,Y=this._mergePages(H,W);Y.version++;for(let Q=U.length-1;Q>=0;Q--)this._deletePage(U[Q]);this.pages.push(Y),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(Y.canvas)}const j=new L(this._document,this._textureSize);return this._pages.push(j),this._activePages.push(j),this._onAddTextureAtlasCanvas.fire(j.canvas),j}_mergePages(j,M){const I=2*j[0].canvas.width,B=new L(this._document,I,j);for(const[H,U]of j.entries()){const W=H*U.canvas.width%I,Y=Math.floor(H/2)*U.canvas.height;B.ctx.drawImage(U.canvas,W,Y);for(const K of U.glyphs)K.texturePage=M,K.sizeClipSpace.x=K.size.x/I,K.sizeClipSpace.y=K.size.y/I,K.texturePosition.x+=W,K.texturePosition.y+=Y,K.texturePositionClipSpace.x=K.texturePosition.x/I,K.texturePositionClipSpace.y=K.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const Q=this._activePages.indexOf(U);Q!==-1&&this._activePages.splice(Q,1)}return B}_deletePage(j){this._pages.splice(j,1);for(let M=j;M<this._pages.length;M++){const I=this._pages[M];for(const B of I.glyphs)B.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(j,M,I,B,H){return this._getFromCacheMap(this._cacheMapCombined,j,M,I,B,H)}getRasterizedGlyph(j,M,I,B,H){return this._getFromCacheMap(this._cacheMap,j,M,I,B,H)}_getFromCacheMap(j,M,I,B,H,U=!1){return y=j.get(M,I,B,H),y||(y=this._drawToCache(M,I,B,H,U),j.set(M,I,B,H,y)),y}_getColorFromAnsiIndex(j){if(j>=this._config.colors.ansi.length)throw new Error("No color found for idx "+j);return this._config.colors.ansi[j]}_getBackgroundColor(j,M,I,B){if(this._config.allowTransparency)return _.NULL_COLOR;let H;switch(j){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(M);break;case 50331648:const U=g.AttributeData.toColorRGB(M);H=_.channels.toColor(U[0],U[1],U[2]);break;default:H=I?_.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(j,M,I,B,H,U,W,Y,Q,K){const z=this._getMinimumContrastColor(j,M,I,B,H,U,W,Q,Y,K);if(z)return z;let O;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Q&&U<8&&(U+=8),O=this._getColorFromAnsiIndex(U);break;case 50331648:const G=g.AttributeData.toColorRGB(U);O=_.channels.toColor(G[0],G[1],G[2]);break;default:O=W?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=_.color.opaque(O)),Y&&(O=_.color.multiplyOpacity(O,d.DIM_OPACITY)),O}_resolveBackgroundRgba(j,M,I){switch(j){case 16777216:case 33554432:return this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(j,M,I,B){switch(j){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&B&&M<8&&(M+=8),this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(j,M,I,B,H,U,W,Y,Q,K){if(this._config.minimumContrastRatio===1||K)return;const z=this._getContrastCache(Q),O=z.getColor(j,B);if(O!==void 0)return O||void 0;const G=this._resolveBackgroundRgba(M,I,W),Z=this._resolveForegroundRgba(H,U,W,Y),F=_.rgba.ensureContrastRatio(G,Z,this._config.minimumContrastRatio/(Q?2:1));if(!F)return void z.setColor(j,B,null);const V=_.channels.toColor(F>>24&255,F>>16&255,F>>8&255);return z.setColor(j,B,V),V}_getContrastCache(j){return j?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(j,M,I,B,H=!1){const U=typeof j=="number"?String.fromCharCode(j):j,W=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width<W&&(this._tmpCanvas.width=W);const Y=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<Y&&(this._tmpCanvas.height=Y),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=M,this._workAttributeData.extended.ext=B,this._workAttributeData.isInvisible())return S;const Q=!!this._workAttributeData.isBold(),K=!!this._workAttributeData.isInverse(),z=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),G=!!this._workAttributeData.isUnderline(),Z=!!this._workAttributeData.isStrikethrough(),F=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),ne=this._workAttributeData.getFgColorMode(),le=this._workAttributeData.getBgColor(),X=this._workAttributeData.getBgColorMode();if(K){const Te=V;V=le,le=Te;const Ve=ne;ne=X,X=Ve}const $=this._getBackgroundColor(X,le,K,z);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const oe=Q?this._config.fontWeightBold:this._config.fontWeight,ee=O?"italic":"";this._tmpCtx.font=`${ee} ${oe} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ue=U.length===1&&(0,c.isPowerlineGlyph)(U.charCodeAt(0)),he=U.length===1&&(0,c.isRestrictedPowerlineGlyph)(U.charCodeAt(0)),we=this._getForegroundColor(M,X,le,I,ne,V,K,z,Q,(0,c.treatGlyphAsBackgroundColor)(U.charCodeAt(0)));this._tmpCtx.fillStyle=we.css;const Se=he?0:4;let Re=!1;this._config.customGlyphs!==!1&&(Re=(0,m.tryDrawCustomChar)(this._tmpCtx,U,Se,Se,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,ke=!ue;if(qe=typeof j=="number"?this._unicodeService.wcwidth(j):this._unicodeService.getStringCellWidth(j),G){this._tmpCtx.save();const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ve=Te%2==1?.5:0;if(this._tmpCtx.lineWidth=Te,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ke=!1,this._tmpCtx.strokeStyle=`rgb(${g.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ke=!1;let De=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&De<8&&(De+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(De).css}this._tmpCtx.beginPath();const gt=Se,st=Math.ceil(Se+this._config.deviceCharHeight)-Ve-(H?2*Te:0),fe=st+Te,ge=st+2*Te;let Le=this._workAttributeData.getUnderlineVariantOffset();for(let De=0;De<qe;De++){this._tmpCtx.save();const Fe=gt+De*this._config.deviceCellWidth,Me=gt+(De+1)*this._config.deviceCellWidth,Tt=Fe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st),this._tmpCtx.moveTo(Fe,ge),this._tmpCtx.lineTo(Me,ge);break;case 3:const qt=Te<=1?ge:Math.ceil(Se+this._config.deviceCharHeight-Te/2)-Ve,kn=Te<=1?st:Math.ceil(Se+this._config.deviceCharHeight+Te/2)-Ve,Jn=new Path2D;Jn.rect(Fe,st,this._config.deviceCellWidth,ge-st),this._tmpCtx.clip(Jn),this._tmpCtx.moveTo(Fe-this._config.deviceCellWidth/2,fe),this._tmpCtx.bezierCurveTo(Fe-this._config.deviceCellWidth/2,kn,Fe,kn,Fe,fe),this._tmpCtx.bezierCurveTo(Fe,qt,Tt,qt,Tt,fe),this._tmpCtx.bezierCurveTo(Tt,kn,Me,kn,Me,fe),this._tmpCtx.bezierCurveTo(Me,qt,Me+this._config.deviceCellWidth/2,qt,Me+this._config.deviceCellWidth/2,fe);break;case 4:const ei=Le===0?0:Le>=Te?2*Te-Le:Te-Le;Le>=Te||ei===0?(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe+ei,st),this._tmpCtx.lineTo(Me,st)):(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Fe+ei,st),this._tmpCtx.moveTo(Fe+ei+Te,st),this._tmpCtx.lineTo(Me,st)),Le=(0,c.computeNextVariantOffset)(Me-Fe,Te,Le);break;case 5:const to=.6,Vt=.3,Wt=Me-Fe,ti=Math.floor(to*Wt),xn=Math.floor(Vt*Wt),no=Wt-ti-xn;this._tmpCtx.setLineDash([ti,xn,no]),this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st);break;default:this._tmpCtx.moveTo(Fe,st),this._tmpCtx.lineTo(Me,st)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Re&&this._config.fontSize>=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const De=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in De&&De.actualBoundingBoxDescent>0){this._tmpCtx.save();const Fe=new Path2D;Fe.rect(gt,st-Math.ceil(Te/2),this._config.deviceCellWidth*qe,ge-st+Math.ceil(Te/2)),this._tmpCtx.clip(Fe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(U,Se,Se+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(F){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ve=Te%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Se,Se+Ve),this._tmpCtx.lineTo(Se+this._config.deviceCharWidth*qe,Se+Ve),this._tmpCtx.stroke()}if(Re||this._tmpCtx.fillText(U,Se,Se+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let Te=R(this._tmpCtx.getImageData(Se,Se,this._config.deviceCellWidth,this._config.deviceCellHeight),$,we,ke);if(Te)for(let Ve=1;Ve<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,Se,Se+this._config.deviceCharHeight-Ve),Te=R(this._tmpCtx.getImageData(Se,Se,this._config.deviceCellWidth,this._config.deviceCellHeight),$,we,ke),Te);Ve++);}if(Z){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ve=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Se,Se+Math.floor(this._config.deviceCharHeight/2)-Ve),this._tmpCtx.lineTo(Se+this._config.deviceCharWidth*qe,Se+Math.floor(this._config.deviceCharHeight/2)-Ve),this._tmpCtx.stroke()}this._tmpCtx.restore();const ze=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Mt;if(Mt=this._config.allowTransparency?(function(Te){for(let Ve=0;Ve<Te.data.length;Ve+=4)if(Te.data[Ve+3]>0)return!1;return!0})(ze):R(ze,$,we,ke),Mt)return S;const $e=this._findGlyphBoundingBox(ze,this._workBoundingBox,W,he,Re,Se);let Be,Ie;for(;;){if(this._activePages.length===0){const Te=this._createNewPage();Be=Te,Ie=Te.currentRow,Ie.height=$e.size.y;break}Be=this._activePages[this._activePages.length-1],Ie=Be.currentRow;for(const Te of this._activePages)$e.size.y<=Te.currentRow.height&&(Be=Te,Ie=Te.currentRow);for(let Te=this._activePages.length-1;Te>=0;Te--)for(const Ve of this._activePages[Te].fixedRows)Ve.height<=Ie.height&&$e.size.y<=Ve.height&&(Be=this._activePages[Te],Ie=Ve);if(Ie.y+$e.size.y>=Be.canvas.height||Ie.height>$e.size.y+2){let Te=!1;if(Be.currentRow.y+Be.currentRow.height+$e.size.y>=Be.canvas.height){let Ve;for(const gt of this._activePages)if(gt.currentRow.y+gt.currentRow.height+$e.size.y<gt.canvas.height){Ve=gt;break}if(Ve)Be=Ve;else if(T.maxAtlasPages&&this._pages.length>=T.maxAtlasPages&&Ie.y+$e.size.y<=Be.canvas.height&&Ie.height>=$e.size.y&&Ie.x+$e.size.x<=Be.canvas.width)Te=!0;else{const gt=this._createNewPage();Be=gt,Ie=gt.currentRow,Ie.height=$e.size.y,Te=!0}}Te||(Be.currentRow.height>0&&Be.fixedRows.push(Be.currentRow),Ie={x:0,y:Be.currentRow.y+Be.currentRow.height,height:$e.size.y},Be.fixedRows.push(Ie),Be.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+$e.size.x<=Be.canvas.width)break;Ie===Be.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Be.fixedRows.splice(Be.fixedRows.indexOf(Ie),1)}return $e.texturePage=this._pages.indexOf(Be),$e.texturePosition.x=Ie.x,$e.texturePosition.y=Ie.y,$e.texturePositionClipSpace.x=Ie.x/Be.canvas.width,$e.texturePositionClipSpace.y=Ie.y/Be.canvas.height,$e.sizeClipSpace.x/=Be.canvas.width,$e.sizeClipSpace.y/=Be.canvas.height,Ie.height=Math.max(Ie.height,$e.size.y),Ie.x+=$e.size.x,Be.ctx.putImageData(ze,$e.texturePosition.x-this._workBoundingBox.left,$e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$e.size.x,$e.size.y),Be.addGlyph($e),Be.version++,$e}_findGlyphBoundingBox(j,M,I,B,H,U){M.top=0;const W=B?this._config.deviceCellHeight:this._tmpCanvas.height,Y=B?this._config.deviceCellWidth:I;let Q=!1;for(let K=0;K<W;K++){for(let z=0;z<Y;z++){const O=K*this._tmpCanvas.width*4+4*z+3;if(j.data[O]!==0){M.top=K,Q=!0;break}}if(Q)break}M.left=0,Q=!1;for(let K=0;K<U+Y;K++){for(let z=0;z<W;z++){const O=z*this._tmpCanvas.width*4+4*K+3;if(j.data[O]!==0){M.left=K,Q=!0;break}}if(Q)break}M.right=Y,Q=!1;for(let K=U+Y-1;K>=U;K--){for(let z=0;z<W;z++){const O=z*this._tmpCanvas.width*4+4*K+3;if(j.data[O]!==0){M.right=K,Q=!0;break}}if(Q)break}M.bottom=W,Q=!1;for(let K=W-1;K>=0;K--){for(let z=0;z<Y;z++){const O=K*this._tmpCanvas.width*4+4*z+3;if(j.data[O]!==0){M.bottom=K,Q=!0;break}}if(Q)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:M.right-M.left+1,y:M.bottom-M.top+1},sizeClipSpace:{x:M.right-M.left+1,y:M.bottom-M.top+1},offset:{x:-M.left+U+(B||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-M.top+U+(B||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}a.TextureAtlas=T;class L{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(j){this._glyphs.push(j),this._usedPixels+=j.size.x*j.size.y}constructor(j,M,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const B of I)this._glyphs.push(...B.glyphs),this._usedPixels+=B._usedPixels;this.canvas=D(j,M,M),this.ctx=(0,c.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function R(A,j,M,I){const B=j.rgba>>>24,H=j.rgba>>>16&255,U=j.rgba>>>8&255,W=M.rgba>>>24,Y=M.rgba>>>16&255,Q=M.rgba>>>8&255,K=Math.floor((Math.abs(B-W)+Math.abs(H-Y)+Math.abs(U-Q))/12);let z=!0;for(let O=0;O<A.data.length;O+=4)A.data[O]===B&&A.data[O+1]===H&&A.data[O+2]===U||I&&Math.abs(A.data[O]-B)+Math.abs(A.data[O+1]-H)+Math.abs(A.data[O+2]-U)<K?A.data[O+3]=0:z=!1;return z}function D(A,j,M){const I=A.createElement("canvas");return I.width=j,I.height=M,I}},160:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let h=0,d=0,m=0,c=0;var _,x,E,w,g;function b(y){const T=y.toString(16);return T.length<2?"0"+T:T}function S(y,T){return y<T?(T+.05)/(y+.05):(y+.05)/(T+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(T,L,R,D){return D!==void 0?`#${b(T)}${b(L)}${b(R)}${b(D)}`:`#${b(T)}${b(L)}${b(R)}`},y.toRgba=function(T,L,R,D=255){return(T<<24|L<<16|R<<8|D)>>>0},y.toColor=function(T,L,R,D){return{css:y.toCss(T,L,R,D),rgba:y.toRgba(T,L,R,D)}}})(_||(a.channels=_={})),(function(y){function T(L,R){return c=Math.round(255*R),[h,d,m]=g.toChannels(L.rgba),{css:_.toCss(h,d,m,c),rgba:_.toRgba(h,d,m,c)}}y.blend=function(L,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,A=R.rgba>>16&255,j=R.rgba>>8&255,M=L.rgba>>24&255,I=L.rgba>>16&255,B=L.rgba>>8&255;return h=M+Math.round((D-M)*c),d=I+Math.round((A-I)*c),m=B+Math.round((j-B)*c),{css:_.toCss(h,d,m),rgba:_.toRgba(h,d,m)}},y.isOpaque=function(L){return(255&L.rgba)==255},y.ensureContrastRatio=function(L,R,D){const A=g.ensureContrastRatio(L.rgba,R.rgba,D);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},y.opaque=function(L){const R=(255|L.rgba)>>>0;return[h,d,m]=g.toChannels(R),{css:_.toCss(h,d,m),rgba:R}},y.opacity=T,y.multiplyOpacity=function(L,R){return c=255&L.rgba,T(L,c*R/255)},y.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(a.color=x={})),(function(y){let T,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(T=D,T.globalCompositeOperation="copy",L=T.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),_.toColor(h,d,m);case 5:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),_.toColor(h,d,m,c);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return h=parseInt(D[1]),d=parseInt(D[2]),m=parseInt(D[3]),c=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(h,d,m,c);if(!T||!L)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=L,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[h,d,m,c]=T.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(h,d,m,c),css:R}}})(E||(a.css=E={})),(function(y){function T(L,R,D){const A=L/255,j=R/255,M=D/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}y.relativeLuminance=function(L){return T(L>>16&255,L>>8&255,255&L)},y.relativeLuminance2=T})(w||(a.rgb=w={})),(function(y){function T(R,D,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=D>>24&255,H=D>>16&255,U=D>>8&255,W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));for(;W<A&&(B>0||H>0||U>0);)B-=Math.max(0,Math.ceil(.1*B)),H-=Math.max(0,Math.ceil(.1*H)),U-=Math.max(0,Math.ceil(.1*U)),W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));return(B<<24|H<<16|U<<8|255)>>>0}function L(R,D,A){const j=R>>24&255,M=R>>16&255,I=R>>8&255;let B=D>>24&255,H=D>>16&255,U=D>>8&255,W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));for(;W<A&&(B<255||H<255||U<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),H=Math.min(255,H+Math.ceil(.1*(255-H))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=S(w.relativeLuminance2(B,H,U),w.relativeLuminance2(j,M,I));return(B<<24|H<<16|U<<8|255)>>>0}y.blend=function(R,D){if(c=(255&D)/255,c===1)return D;const A=D>>24&255,j=D>>16&255,M=D>>8&255,I=R>>24&255,B=R>>16&255,H=R>>8&255;return h=I+Math.round((A-I)*c),d=B+Math.round((j-B)*c),m=H+Math.round((M-H)*c),_.toRgba(h,d,m)},y.ensureContrastRatio=function(R,D,A){const j=w.relativeLuminance(R>>8),M=w.relativeLuminance(D>>8);if(S(j,M)<A){if(M<j){const H=T(R,D,A),U=S(j,w.relativeLuminance(H>>8));if(U<A){const W=L(R,D,A);return U>S(j,w.relativeLuminance(W>>8))?H:W}return H}const I=L(R,D,A),B=S(j,w.relativeLuminance(I>>8));if(B<A){const H=T(R,D,A);return B>S(j,w.relativeLuminance(H>>8))?I:H}return I}},y.reduceLuminance=T,y.increaseLuminance=L,y.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(g||(a.rgba=g={})),a.toPaddedHex=b,a.contrastRatio=S},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const m=[];for(let c=0;c<this._listeners.length;c++)m.push(this._listeners[c]);for(let c=0;c<m.length;c++)m[c].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(h,d){return h((m=>d.fire(m)))},a.runAndSubscribe=function(h,d){return d(void 0),h((m=>d(m)))}},859:(p,a)=>{function h(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=h,a.getDisposeArrayDisposable=function(d){return{dispose:()=>h(d)}}},485:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(m,c,_){this._data[m]||(this._data[m]={}),this._data[m][c]=_}get(m,c){return this._data[m]?this._data[m][c]:void 0}clear(){this._data={}}}a.TwoKeyMap=h,a.FourKeyMap=class{constructor(){this._data=new h}set(d,m,c,_,x){this._data.get(d,m)||this._data.set(d,m,new h),this._data.get(d,m).set(c,_,x)}get(d,m,c,_){var x;return(x=this._data.get(d,m))==null?void 0:x.get(c,_)}clear(){this._data.clear()}}},399:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const h=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=h.includes("Firefox"),a.isLegacyEdge=h.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(h),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=h.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(h)},385:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=h(399);class m{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let E=0,w=0,g=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),w=Math.max(E,w),b=x.timeRemaining(),1.5*w>b)return g-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-E))}ms`),void this._start();g=b}this.clear()}}class c extends m{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const E=Date.now()+x;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}a.PriorityTaskQueue=c,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:c,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},147:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new h;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}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}}a.AttributeData=h;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},782:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=h(133),m=h(855),c=h(147);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const w=new _;return w.setFromCharData(E),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(E[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(E[m.CHAR_DATA_CHAR_INDEX].length===2){const g=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const b=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(g-55296)+b-56320+65536|E[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=E[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=E[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},855:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},133:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},a.utf32ToString=function(h,d=0,m=h.length){let c="";for(let _=d;_<m;++_){let x=h[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const m=h.length;if(!m)return 0;let c=0,_=0;if(this._interim){const x=h.charCodeAt(_++);56320<=x&&x<=57343?d[c++]=1024*(this._interim-55296)+x-56320+65536:(d[c++]=this._interim,d[c++]=x),this._interim=0}for(let x=_;x<m;++x){const E=h.charCodeAt(x);if(55296<=E&&E<=56319){if(++x>=m)return this._interim=E,c;const w=h.charCodeAt(x);56320<=w&&w<=57343?d[c++]=1024*(E-55296)+w-56320+65536:(d[c++]=E,d[c++]=w)}else E!==65279&&(d[c++]=E)}return c}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,d){const m=h.length;if(!m)return 0;let c,_,x,E,w=0,g=0,b=0;if(this.interim[0]){let T=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)L<<=6,L|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-D;for(;b<j;){if(b>=m)return 0;if(R=h[b++],(192&R)!=128){b--,T=!0;break}this.interim[D++]=R,L<<=6,L|=63&R}T||(A===2?L<128?b--:d[w++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(d[w++]=L):L<65536||L>1114111||(d[w++]=L)),this.interim.fill(0)}const S=m-4;let y=b;for(;y<m;){for(;!(!(y<S)||128&(c=h[y])||128&(_=h[y+1])||128&(x=h[y+2])||128&(E=h[y+3]));)d[w++]=c,d[w++]=_,d[w++]=x,d[w++]=E,y+=4;if(c=h[y++],c<128)d[w++]=c;else if((224&c)==192){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(g=(31&c)<<6|63&_,g<128){y--;continue}d[w++]=g}else if((240&c)==224){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,w;if(x=h[y++],(192&x)!=128){y--;continue}if(g=(15&c)<<12|(63&_)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;d[w++]=g}else if((248&c)==240){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,w;if(x=h[y++],(192&x)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,w;if(E=h[y++],(192&E)!=128){y--;continue}if(g=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&E,g<65536||g>1114111)continue;d[w++]=g}}return w}}},776:function(p,a,h){var d=this&&this.__decorate||function(g,b,S,y){var T,L=arguments.length,R=L<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,y);else for(var D=g.length-1;D>=0;D--)(T=g[D])&&(R=(L<3?T(R):L>3?T(b,S,R):T(b,S))||R);return L>3&&R&&Object.defineProperty(b,S,R),R},m=this&&this.__param||function(g,b){return function(S,y){b(S,y,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const c=h(859),_=h(97),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let E,w=a.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let b=0;b<g.length;b++)typeof g[b]=="function"&&(g[b]=g[b]())}_log(g,b,S){this._evalLazyOptionalParams(S),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(g,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,g,b)}debug(g,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,g,b)}info(g,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,g,b)}warn(g,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,g,b)}error(g,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,g,b)}};a.LogService=w=d([m(0,_.IOptionsService)],w),a.setTraceLogger=function(g){E=g},a.traceCall=function(g,b,S){if(typeof S.value!="function")throw new Error("not supported");const y=S.value;S.value=function(...T){if(E.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,T);E.trace(`GlyphRenderer#${y.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const L=y.apply(this,T);return E.trace(`GlyphRenderer#${y.name} return`,L),L}}},726:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const h="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[d]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const c=function(_,x,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,g,b){g[h]===g?g[d].push({id:w,index:b}):(g[d]=[{id:w,index:b}],g[h]=g)})(c,_,E)};return c.toString=()=>m,a.serviceRegistry.set(m,c),c}},97:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=h(726);var m;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p].call(h.exports,h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.WebglAddon=void 0;const a=l(345),h=l(859),d=l(399),m=l(666),c=l(776);class _ extends h.Disposable{constructor(E){if(d.isSafari&&(0,d.getSafariVersion)()<16){const w={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",w))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=E,this._onChangeTextureAtlas=this.register(new a.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new a.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new a.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new a.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(E){const w=E._core;if(!E.element)return void this.register(w.onWillOpen((()=>this.activate(E))));this._terminal=E;const g=w.coreService,b=w.optionsService,S=w,y=S._renderService,T=S._characterJoinerService,L=S._charSizeService,R=S._coreBrowserService,D=S._decorationService,A=S._logService,j=S._themeService;(0,c.setTraceLogger)(A),this._renderer=this.register(new m.WebglRenderer(E,T,L,R,g,D,b,j,this._preserveDrawingBuffer)),this.register((0,a.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,a.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,a.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,a.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),y.setRenderer(this._renderer),this.register((0,h.toDisposable)((()=>{const M=this._terminal._core._renderService;M.setRenderer(this._terminal._core._createRenderer()),M.handleResize(E.cols,E.rows)})))}get textureAtlas(){var E;return(E=this._renderer)==null?void 0:E.textureAtlas}clearTextureAtlas(){var E;(E=this._renderer)==null||E.clearTextureAtlas()}}p.WebglAddon=_})(),f})()))})(cm)),cm.exports}var b9=y9(),um={exports:{}},nS;function S9(){return nS||(nS=1,(function(e,i){(function(r,s){e.exports=s()})(globalThis,(()=>(()=>{var r={4567:function(p,a,h){var d=this&&this.__decorate||function(S,y,T,L){var R,D=arguments.length,A=D<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,y,T,L);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(D<3?R(A):D>3?R(y,T,A):R(y,T))||A);return D>3&&A&&Object.defineProperty(y,T,A),A},m=this&&this.__param||function(S,y){return function(T,L){y(T,L,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const c=h(9042),_=h(9924),x=h(844),E=h(4725),w=h(2585),g=h(3656);let b=a.AccessibilityManager=class extends x.Disposable{constructor(S,y,T,L){super(),this._terminal=S,this._coreBrowserService=T,this._renderService=L,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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 _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
600
600
  `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(S){for(let y=0;y<S;y++)this._handleChar(" ")}_handleChar(S){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==S&&(this._charsToAnnounce+=S):this._charsToAnnounce+=S,S===`
601
601
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(S){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(S)||this._charsToConsume.push(S)}_refreshRows(S,y){this._liveRegionDebouncer.refresh(S,y,this._terminal.rows)}_renderRows(S,y){const T=this._terminal.buffer,L=T.lines.length.toString();for(let R=S;R<=y;R++){const D=T.lines.get(T.ydisp+R),A=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,A))||"",M=(T.ydisp+R+1).toString(),I=this._rowElements[R];I&&(j.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=j,this._rowColumns.set(I,A)),I.setAttribute("aria-posinset",M),I.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(S,y){const T=S.target,L=this._rowElements[y===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||S.relatedTarget!==L)return;let R,D;if(y===0?(R=T,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=T,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),S.preventDefault(),S.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const S=document.getSelection();if(!S)return;if(S.isCollapsed)return void(this._rowContainer.contains(S.anchorNode)&&this._terminal.clearSelection());if(!S.anchorNode||!S.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:S.anchorNode,offset:S.anchorOffset},T={node:S.focusNode,offset:S.focusOffset};if((y.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===T.node&&y.offset>T.offset)&&([y,T]=[T,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const L=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:L,offset:((j=L.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(T.node))return;const R=({node:M,offset:I})=>{const B=M instanceof Text?M.parentNode:M;let H=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(B);if(!U)return console.warn("columns is null. Race condition?"),null;let W=I<U.length?U[I]:U.slice(-1)[0]+1;return W>=this._terminal.cols&&(++H,W=0),{row:H,column:W}},D=R(y),A=R(T);if(D&&A){if(D.row>A.row||D.row===A.row&&D.column>=A.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(A.row-D.row)*this._terminal.cols-D.column+A.column)}}_handleResize(S){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>S;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const S=this._coreBrowserService.mainDocument.createElement("div");return S.setAttribute("role","listitem"),S.tabIndex=-1,this._refreshRowDimensions(S),S}_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 S=0;S<this._terminal.rows;S++)this._refreshRowDimensions(this._rowElements[S])}}_refreshRowDimensions(S){S.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=b=d([m(1,w.IInstantiationService),m(2,E.ICoreBrowserService),m(3,E.IRenderService)],b)},3614:(p,a)=>{function h(_){return _.replace(/\r?\n/g,"\r")}function d(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function m(_,x,E,w){_=d(_=h(_),E.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(_,!0),x.value=""}function c(_,x,E){const w=E.getBoundingClientRect(),g=_.clientX-w.left-10,b=_.clientY-w.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${g}px`,x.style.top=`${b}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=h,a.bracketTextForPaste=d,a.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,x,E,w){_.stopPropagation(),_.clipboardData&&m(_.clipboardData.getData("text/plain"),x,E,w)},a.paste=m,a.moveTextAreaUnderMouseCursor=c,a.rightClickHandler=function(_,x,E,w,g){c(_,x,E),g&&w.rightClickSelect(_),x.value=w.selectionText,x.select()}},7239:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=h(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,c,_){this._css.set(m,c,_)}getCss(m,c){return this._css.get(m,c)}setColor(m,c,_){this._color.set(m,c,_)}getColor(m,c){return this._color.get(m,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(h,d,m,c){h.addEventListener(d,m,c);let _=!1;return{dispose:()=>{_||(_=!0,h.removeEventListener(d,m,c))}}}},3551:function(p,a,h){var d=this&&this.__decorate||function(b,S,y,T){var L,R=arguments.length,D=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,S,y,T);else for(var A=b.length-1;A>=0;A--)(L=b[A])&&(D=(R<3?L(D):R>3?L(S,y,D):L(S,y))||D);return R>3&&D&&Object.defineProperty(S,y,D),D},m=this&&this.__param||function(b,S){return function(y,T){S(y,T,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const c=h(3656),_=h(8460),x=h(844),E=h(2585),w=h(4725);let g=a.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(b,S,y,T,L){super(),this._element=b,this._mouseService=S,this._renderService=y,this._bufferService=T,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,c.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const S=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!S)return;this._isMouseOut=!1;const y=b.composedPath();for(let T=0;T<y.length;T++){const L=y[T];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&S.x===this._lastBufferCell.x&&S.y===this._lastBufferCell.y||(this._handleHover(S),this._lastBufferCell=S)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,S){var T,L;this._activeProviderReplies&&S||((T=this._activeProviderReplies)==null||T.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())S?(L=this._activeProviderReplies)!=null&&L.get(R)&&(y=this._checkLinkProviderResult(R,b,y)):D.provideLinks(b.y,(A=>{var M,I;if(this._isMouseOut)return;const j=A==null?void 0:A.map((B=>({link:B})));(M=this._activeProviderReplies)==null||M.set(R,j),y=this._checkLinkProviderResult(R,b,y),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,S){const y=new Set;for(let T=0;T<S.size;T++){const L=S.get(T);if(L)for(let R=0;R<L.length;R++){const D=L[R],A=D.link.range.start.y<b?0:D.link.range.start.x,j=D.link.range.end.y>b?this._bufferService.cols:D.link.range.end.x;for(let M=A;M<=j;M++){if(y.has(M)){L.splice(R--,1);break}y.add(M)}}}}_checkLinkProviderResult(b,S,y){var R;if(!this._activeProviderReplies)return y;const T=this._activeProviderReplies.get(b);let L=!1;for(let D=0;D<b;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(L=!0);if(!L&&T){const D=T.find((A=>this._linkAtPosition(A.link,S)));D&&(y=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let D=0;D<this._activeProviderReplies.size;D++){const A=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((j=>this._linkAtPosition(j.link,S)));if(A){y=!0,this._handleNewLink(A);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const S=this._positionFromMouseEvent(b,this._element,this._mouseService);S&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,S)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,S){this._currentLink&&this._lastMouseEvent&&(!b||!S||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=S)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._linkAtPosition(b.link,S)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,T;return(T=(y=this._currentLink)==null?void 0:y.state)==null?void 0:T.decorations.pointerCursor},set:y=>{var T;(T=this._currentLink)!=null&&T.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,T;return(T=(y=this._currentLink)==null?void 0:y.state)==null?void 0:T.decorations.underline},set:y=>{var T,L,R;(T=this._currentLink)!=null&&T.state&&((R=(L=this._currentLink)==null?void 0:L.state)==null?void 0:R.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const T=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(T,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(b,S,y){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),S.hover&&S.hover(y,S.text)}_fireUnderlineEvent(b,S){const y=b.range,T=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-T-1,y.end.x,y.end.y-T-1,void 0);(S?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(b,S,y){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),S.leave&&S.leave(y,S.text)}_linkAtPosition(b,S){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,T=b.range.end.y*this._bufferService.cols+b.range.end.x,L=S.y*this._bufferService.cols+S.x;return y<=L&&L<=T}_positionFromMouseEvent(b,S,y){const T=y.getCoords(b,S,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,S,y,T,L){return{x1:b,y1:S,x2:y,y2:T,cols:this._bufferService.cols,fg:L}}};a.Linkifier=g=d([m(1,w.IMouseService),m(2,w.IRenderService),m(3,E.IBufferService),m(4,w.ILinkProviderService)],g)},9042:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(p,a,h){var d=this&&this.__decorate||function(w,g,b,S){var y,T=arguments.length,L=T<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(w,g,b,S);else for(var R=w.length-1;R>=0;R--)(y=w[R])&&(L=(T<3?y(L):T>3?y(g,b,L):y(g,b))||L);return T>3&&L&&Object.defineProperty(g,b,L),L},m=this&&this.__param||function(w,g){return function(b,S){g(b,S,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const c=h(511),_=h(2585);let x=a.OscLinkProvider=class{constructor(w,g,b){this._bufferService=w,this._optionsService=g,this._oscLinkService=b}provideLinks(w,g){var j;const b=this._bufferService.buffer.lines.get(w-1);if(!b)return void g(void 0);const S=[],y=this._optionsService.rawOptions.linkHandler,T=new c.CellData,L=b.getTrimmedLength();let R=-1,D=-1,A=!1;for(let M=0;M<L;M++)if(D!==-1||b.hasContent(M)){if(b.loadCell(M,T),T.hasExtendedAttrs()&&T.extended.urlId){if(D===-1){D=M,R=T.extended.urlId;continue}A=T.extended.urlId!==R}else D!==-1&&(A=!0);if(A||D!==-1&&M===L-1){const I=(j=this._oscLinkService.getLinkData(R))==null?void 0:j.uri;if(I){const B={start:{x:D+1,y:w},end:{x:M+(A||M!==L-1?0:1),y:w}};let H=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const U=new URL(I);["http:","https:"].includes(U.protocol)||(H=!0)}catch{H=!0}H||S.push({text:I,range:B,activate:(U,W)=>y?y.activate(U,W,B):E(0,W),hover:(U,W)=>{var Y;return(Y=y==null?void 0:y.hover)==null?void 0:Y.call(y,U,W,B)},leave:(U,W)=>{var Y;return(Y=y==null?void 0:y.leave)==null?void 0:Y.call(y,U,W,B)}})}A=!1,T.hasExtendedAttrs()&&T.extended.urlId?(D=M,R=T.extended.urlId):(D=-1,R=-1)}}g(S)}};function E(w,g){if(confirm(`Do you want to navigate to ${g}?
602
602
 
@@ -606,4 +606,4 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
606
606
  `,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""})(h||(a.C0=h={})),(function(c){c.PAD="€",c.HOP="",c.BPH="‚",c.NBH="ƒ",c.IND="„",c.NEL="…",c.SSA="†",c.ESA="‡",c.HTS="ˆ",c.HTJ="‰",c.VTS="Š",c.PLD="‹",c.PLU="Œ",c.RI="",c.SS2="Ž",c.SS3="",c.DCS="",c.PU1="‘",c.PU2="’",c.STS="“",c.CCH="”",c.MW="•",c.SPA="–",c.EPA="—",c.SOS="˜",c.SGCI="™",c.SCI="š",c.CSI="›",c.ST="œ",c.OSC="",c.PM="ž",c.APC="Ÿ"})(d||(a.C1=d={})),(function(c){c.ST=`${h.ESC}\\`})(m||(a.C1_ESCAPED=m={}))},7399:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=h(2584),m={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:["'",'"']};a.evaluateKeyboardEvent=function(c,_,x,E){const w={type:0,cancel:!1,key:void 0},g=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?w.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?w.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?w.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(w.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=c.ctrlKey?"\b":d.C0.DEL,c.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(c.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=c.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,c.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(c.metaKey)break;g?(w.key=d.C0.ESC+"[1;"+(g+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(x?"b":"[1;5D"))):w.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(c.metaKey)break;g?(w.key=d.C0.ESC+"[1;"+(g+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(x?"f":"[1;5C"))):w.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(c.metaKey)break;g?(w.key=d.C0.ESC+"[1;"+(g+1)+"A",x||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(c.metaKey)break;g?(w.key=d.C0.ESC+"[1;"+(g+1)+"B",x||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=g?d.C0.ESC+"[3;"+(g+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=g?d.C0.ESC+"[1;"+(g+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=g?d.C0.ESC+"[1;"+(g+1)+"F":_?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:c.shiftKey?w.type=2:c.ctrlKey?w.key=d.C0.ESC+"[5;"+(g+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:c.shiftKey?w.type=3:c.ctrlKey?w.key=d.C0.ESC+"[6;"+(g+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=g?d.C0.ESC+"[1;"+(g+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=g?d.C0.ESC+"[1;"+(g+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=g?d.C0.ESC+"[1;"+(g+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=g?d.C0.ESC+"[1;"+(g+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=g?d.C0.ESC+"[15;"+(g+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=g?d.C0.ESC+"[17;"+(g+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=g?d.C0.ESC+"[18;"+(g+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=g?d.C0.ESC+"[19;"+(g+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=g?d.C0.ESC+"[20;"+(g+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=g?d.C0.ESC+"[21;"+(g+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=g?d.C0.ESC+"[23;"+(g+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=g?d.C0.ESC+"[24;"+(g+1)+"~":d.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(x&&!E||!c.altKey||c.metaKey)!x||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?w.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(w.key=d.C0.US),c.key==="@"&&(w.key=d.C0.NUL)):c.keyCode===65&&(w.type=1);else{const b=m[c.keyCode],S=b==null?void 0:b[c.shiftKey?1:0];if(S)w.key=d.C0.ESC+S;else if(c.keyCode>=65&&c.keyCode<=90){const y=c.ctrlKey?c.keyCode-64:c.keyCode+32;let T=String.fromCharCode(y);c.shiftKey&&(T=T.toUpperCase()),w.key=d.C0.ESC+T}else if(c.keyCode===32)w.key=d.C0.ESC+(c.ctrlKey?d.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let y=c.code.slice(3,4);c.shiftKey||(y=y.toLowerCase()),w.key=d.C0.ESC+y,w.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?w.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?w.key=d.C0.NUL:c.keyCode>=51&&c.keyCode<=55?w.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?w.key=d.C0.DEL:c.keyCode===219?w.key=d.C0.ESC:c.keyCode===220?w.key=d.C0.FS:c.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},a.utf32ToString=function(h,d=0,m=h.length){let c="";for(let _=d;_<m;++_){let x=h[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const m=h.length;if(!m)return 0;let c=0,_=0;if(this._interim){const x=h.charCodeAt(_++);56320<=x&&x<=57343?d[c++]=1024*(this._interim-55296)+x-56320+65536:(d[c++]=this._interim,d[c++]=x),this._interim=0}for(let x=_;x<m;++x){const E=h.charCodeAt(x);if(55296<=E&&E<=56319){if(++x>=m)return this._interim=E,c;const w=h.charCodeAt(x);56320<=w&&w<=57343?d[c++]=1024*(E-55296)+w-56320+65536:(d[c++]=E,d[c++]=w)}else E!==65279&&(d[c++]=E)}return c}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,d){const m=h.length;if(!m)return 0;let c,_,x,E,w=0,g=0,b=0;if(this.interim[0]){let T=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)L<<=6,L|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-D;for(;b<j;){if(b>=m)return 0;if(R=h[b++],(192&R)!=128){b--,T=!0;break}this.interim[D++]=R,L<<=6,L|=63&R}T||(A===2?L<128?b--:d[w++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(d[w++]=L):L<65536||L>1114111||(d[w++]=L)),this.interim.fill(0)}const S=m-4;let y=b;for(;y<m;){for(;!(!(y<S)||128&(c=h[y])||128&(_=h[y+1])||128&(x=h[y+2])||128&(E=h[y+3]));)d[w++]=c,d[w++]=_,d[w++]=x,d[w++]=E,y+=4;if(c=h[y++],c<128)d[w++]=c;else if((224&c)==192){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(g=(31&c)<<6|63&_,g<128){y--;continue}d[w++]=g}else if((240&c)==224){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,w;if(x=h[y++],(192&x)!=128){y--;continue}if(g=(15&c)<<12|(63&_)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;d[w++]=g}else if((248&c)==240){if(y>=m)return this.interim[0]=c,w;if(_=h[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,w;if(x=h[y++],(192&x)!=128){y--;continue}if(y>=m)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,w;if(E=h[y++],(192&E)!=128){y--;continue}if(g=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&E,g<65536||g>1114111)continue;d[w++]=g}}return w}}},225:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=h(1480),m=[[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]],c=[[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]];let _;a.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<m.length;++x)_.fill(0,m[x][0],m[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(E,w){let g,b=0,S=w.length-1;if(E<w[0][0]||E>w[S][1])return!1;for(;S>=b;)if(g=b+S>>1,E>w[g][1])b=g+1;else{if(!(E<w[g][0]))return!0;S=g-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,E){let w=this.wcwidth(x),g=w===0&&E!==0;if(g){const b=d.UnicodeService.extractWidth(E);b===0?g=!1:b>w&&(w=b)}return d.UnicodeService.createPropertyValue(0,w,g)}}},5981:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=h(8460),m=h(844);class c extends m.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,E){if(this._pendingData>5e7)throw new 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+=x.length,this._writeBuffer.push(x),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(E)}_innerWrite(x=0,E=!0){const w=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],b=this._action(g,E);if(b){const y=T=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(w,T);return void b.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(y)}const S=this._callbacks[this._bufferOffset];if(S&&S(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-w>=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()}}a.WriteBuffer=c},5941:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const h=/^([\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})$/,d=/^[\da-f]+$/;function m(c,_){const x=c.toString(16),E=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}a.parseColor=function(c){if(!c)return;let _=c.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=h.exec(_);if(x){const E=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/E*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/E*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/E*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,E=[0,0,0];for(let w=0;w<3;++w){const g=parseInt(_.slice(x*w,x*w+x),16);E[w]=x===1?g<<4:x===2?g:x===3?g>>4:g>>8}return E}},a.toRgbString=function(c,_=16){const[x,E,w]=c;return`rgb:${m(x,_)}/${m(E,_)}/${m(w,_)}`}},5770:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=h(482),m=h(8742),c=h(5770),_=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(E,w){this._handlers[E]===void 0&&(this._handlers[E]=[]);const g=this._handlers[E];return g.push(w),{dispose:()=>{const b=g.indexOf(w);b!==-1&&g.splice(b,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=_,this._ident=0}hook(E,w){if(this.reset(),this._ident=E,this._active=this._handlers[E]||_,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(E,w,g){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(E,w,g);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(E,w,g))}unhook(E,w=!0){if(this._active.length){let g=!1,b=this._active.length-1,S=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,g=w,S=this._stack.fallThrough,this._stack.paused=!1),!S&&g===!1){for(;b>=0&&(g=this._active[b].unhook(E),g!==!0);b--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,g;b--}for(;b>=0;b--)if(g=this._active[b].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",E);this._active=_,this._ident=0}};const x=new m.Params;x.addParam(0),a.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=x,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():x,this._data="",this._hitLimit=!1}put(E,w,g){this._hitLimit||(this._data+=(0,d.utf32ToString)(E,w,g),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let w=!1;if(this._hitLimit)w=!1;else if(E&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((g=>(this._params=x,this._data="",this._hitLimit=!1,g)));return this._params=x,this._data="",this._hitLimit=!1,w}}},2015:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=h(844),m=h(8742),c=h(6242),_=h(6351);class x{constructor(b){this.table=new Uint8Array(b)}setDefault(b,S){this.table.fill(b<<4|S)}add(b,S,y,T){this.table[S<<8|b]=y<<4|T}addMany(b,S,y,T){for(let L=0;L<b.length;L++)this.table[S<<8|b[L]]=y<<4|T}}a.TransitionTable=x;const E=160;a.VT500_TRANSITION_TABLE=(function(){const g=new x(4095),b=Array.apply(null,Array(256)).map(((D,A)=>A)),S=(D,A)=>b.slice(D,A),y=S(32,127),T=S(0,24);T.push(25),T.push.apply(T,S(28,32));const L=S(0,14);let R;for(R in g.setDefault(1,0),g.addMany(y,0,2,0),L)g.addMany([24,26,153,154],R,3,0),g.addMany(S(128,144),R,3,0),g.addMany(S(144,152),R,3,0),g.add(156,R,0,0),g.add(27,R,11,1),g.add(157,R,4,8),g.addMany([152,158,159],R,0,7),g.add(155,R,11,3),g.add(144,R,11,9);return g.addMany(T,0,3,0),g.addMany(T,1,3,1),g.add(127,1,0,1),g.addMany(T,8,0,8),g.addMany(T,3,3,3),g.add(127,3,0,3),g.addMany(T,4,3,4),g.add(127,4,0,4),g.addMany(T,6,3,6),g.addMany(T,5,3,5),g.add(127,5,0,5),g.addMany(T,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(y,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(S(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(y,7,0,7),g.addMany(T,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(S(64,127),3,7,0),g.addMany(S(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(S(48,60),4,8,4),g.addMany(S(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(S(32,64),6,0,6),g.add(127,6,0,6),g.addMany(S(64,127),6,0,0),g.addMany(S(32,48),3,9,5),g.addMany(S(32,48),5,9,5),g.addMany(S(48,64),5,0,6),g.addMany(S(64,127),5,7,0),g.addMany(S(32,48),4,9,5),g.addMany(S(32,48),1,9,2),g.addMany(S(32,48),2,9,2),g.addMany(S(48,127),2,10,0),g.addMany(S(48,80),1,10,0),g.addMany(S(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(S(96,127),1,10,0),g.add(80,1,11,9),g.addMany(T,9,0,9),g.add(127,9,0,9),g.addMany(S(28,32),9,0,9),g.addMany(S(32,48),9,9,12),g.addMany(S(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(T,11,0,11),g.addMany(S(32,128),11,0,11),g.addMany(S(28,32),11,0,11),g.addMany(T,10,0,10),g.add(127,10,0,10),g.addMany(S(28,32),10,0,10),g.addMany(S(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(S(32,48),10,9,12),g.addMany(T,12,0,12),g.add(127,12,0,12),g.addMany(S(28,32),12,0,12),g.addMany(S(32,48),12,9,12),g.addMany(S(48,64),12,0,11),g.addMany(S(64,127),12,12,13),g.addMany(S(64,127),10,12,13),g.addMany(S(64,127),9,12,13),g.addMany(T,13,13,13),g.addMany(y,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(E,0,2,0),g.add(E,8,5,8),g.add(E,6,0,6),g.add(E,11,0,11),g.add(E,13,13,13),g})();class w extends d.Disposable{constructor(b=a.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(S,y,T)=>{},this._executeHandlerFb=S=>{},this._csiHandlerFb=(S,y)=>{},this._escHandlerFb=S=>{},this._errorHandlerFb=S=>S,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,S=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<b.intermediates.length;++L){const R=b.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=R}}if(b.final.length!==1)throw new Error("final must be a single byte");const T=b.final.charCodeAt(0);if(S[0]>T||T>S[1])throw new Error(`final must be in range ${S[0]} .. ${S[1]}`);return y<<=8,y|=T,y}identToString(b){const S=[];for(;b;)S.push(String.fromCharCode(255&b)),b>>=8;return S.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,S){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const T=this._escHandlers[y];return T.push(S),{dispose:()=>{const L=T.indexOf(S);L!==-1&&T.splice(L,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,S){this._executeHandlers[b.charCodeAt(0)]=S}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,S){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const T=this._csiHandlers[y];return T.push(S),{dispose:()=>{const L=T.indexOf(S);L!==-1&&T.splice(L,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,S){return this._dcsParser.registerHandler(this._identifier(b),S)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,S){return this._oscParser.registerHandler(b,S)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,S,y,T,L){this._parseStack.state=b,this._parseStack.handlers=S,this._parseStack.handlerPos=y,this._parseStack.transition=T,this._parseStack.chunkPos=L}parse(b,S,y){let T,L=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&j>-1){for(;j>=0&&(T=A[j](this._params),T!==!0);j--)if(T instanceof Promise)return this._parseStack.handlerPos=j,T}this._parseStack.handlers=[];break;case 4:if(y===!1&&j>-1){for(;j>=0&&(T=A[j](),T!==!0);j--)if(T instanceof Promise)return this._parseStack.handlerPos=j,T}this._parseStack.handlers=[];break;case 6:if(L=b[this._parseStack.chunkPos],T=this._dcsParser.unhook(L!==24&&L!==26,y),T)return T;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=b[this._parseStack.chunkPos],T=this._oscParser.end(L!==24&&L!==26,y),T)return T;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=D;A<S;++A){switch(L=b[A],R=this._transitions.table[this.currentState<<8|(L<160?L:E)],R>>4){case 2:for(let H=A+1;;++H){if(H>=S||(L=b[H])<32||L>126&&L<E){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(L=b[H])<32||L>126&&L<E){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(L=b[H])<32||L>126&&L<E){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(L=b[H])<32||L>126&&L<E){this._printHandler(b,A,H),A=H-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|L];let M=j?j.length-1:-1;for(;M>=0&&(T=j[M](this._params),T!==!0);M--)if(T instanceof Promise)return this._preserveStack(3,j,M,R,A),T;M<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++A<S&&(L=b[A])>47&&L<60);A--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const I=this._escHandlers[this._collect<<8|L];let B=I?I.length-1:-1;for(;B>=0&&(T=I[B](),T!==!0);B--)if(T instanceof Promise)return this._preserveStack(4,I,B,R,A),T;B<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let H=A+1;;++H)if(H>=S||(L=b[H])===24||L===26||L===27||L>127&&L<E){this._dcsParser.put(b,A,H),A=H-1;break}break;case 14:if(T=this._dcsParser.unhook(L!==24&&L!==26),T)return this._preserveStack(6,[],0,R,A),T;L===27&&(R|=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 H=A+1;;H++)if(H>=S||(L=b[H])<32||L>127&&L<E){this._oscParser.put(b,A,H),A=H-1;break}break;case 6:if(T=this._oscParser.end(L!==24&&L!==26),T)return this._preserveStack(5,[],0,R,A),T;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=w},6242:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=h(5770),m=h(482),c=[];a.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const E=this._handlers[_];return E.push(x),{dispose:()=>{const w=E.indexOf(x);w!==-1&&E.splice(w,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,E){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(_,x,E);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(_,x,E))}start(){this.reset(),this._state=1}put(_,x,E){if(this._state!==3){if(this._state===1)for(;x<E;){const w=_[x++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&E-x>0&&this._put(_,x,E)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,w=this._active.length-1,g=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,E=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&E===!1){for(;w>=0&&(E=this._active[w].end(_),E!==!0);w--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,E;w--}for(;w>=0;w--)if(E=this._active[w].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",_);this._active=c,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,E){this._hitLimit||(this._data+=(0,m.utf32ToString)(_,x,E),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,x}}},8742:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const h=2147483647;class d{static fromArray(c){const _=new d;if(!c.length)return _;for(let x=Array.isArray(c[0])?1:0;x<c.length;++x){const E=c[x];if(Array.isArray(E))for(let w=0;w<E.length;++w)_.addSubParam(E[w]);else _.addParam(E)}return _}constructor(c=32,_=32){if(this.maxLength=c,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new d(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let _=0;_<this.length;++_){c.push(this.params[_]);const x=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];E-x>0&&c.push(Array.prototype.slice.call(this._subParams,x,E))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>h?h:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>h?h:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const _=this._subParamsIdx[c]>>8,x=255&this._subParamsIdx[c];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const c={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];E-x>0&&(c[_]=this._subParams.slice(x,E))}return c}addDigit(c){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,E=x[_-1];x[_-1]=~E?Math.min(10*E+c,h):c}}a.Params=d},5741:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let d=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===h){d=m;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(d,1)}}},8771:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=h(3785),m=h(511);a.BufferApiView=class{constructor(c,_){this._buffer=c,this.type=_}init(c){return this._buffer=c,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(c){const _=this._buffer.lines.get(c);if(_)return new d.BufferLineApiView(_)}getNullCell(){return new m.CellData}}},3785:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=h(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,c){if(!(m<0||m>=this._line.length))return c?(this._line.loadCell(m,c),c):this._line.loadCell(m,new d.CellData)}translateToString(m,c,_){return this._line.translateToString(m,c,_)}}},8285:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=h(8771),m=h(8460),c=h(844);class _ extends c.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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 new 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)}}a.BufferNamespaceApi=_},7975:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,d){return this._core.registerCsiHandler(h,(m=>d(m.toArray())))}addCsiHandler(h,d){return this.registerCsiHandler(h,d)}registerDcsHandler(h,d){return this._core.registerDcsHandler(h,((m,c)=>d(m,c.toArray())))}addDcsHandler(h,d){return this.registerDcsHandler(h,d)}registerEscHandler(h,d){return this._core.registerEscHandler(h,d)}addEscHandler(h,d){return this.registerEscHandler(h,d)}registerOscHandler(h,d){return this._core.registerOscHandler(h,d)}addOscHandler(h,d){return this.registerOscHandler(h,d)}}},7090:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(p,a,h){var d=this&&this.__decorate||function(g,b,S,y){var T,L=arguments.length,R=L<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,y);else for(var D=g.length-1;D>=0;D--)(T=g[D])&&(R=(L<3?T(R):L>3?T(b,S,R):T(b,S))||R);return L>3&&R&&Object.defineProperty(b,S,R),R},m=this&&this.__param||function(g,b){return function(S,y){b(S,y,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const c=h(8460),_=h(844),x=h(5295),E=h(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let w=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(g){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(g.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(g,this))}resize(g,b){this.cols=g,this.rows=b,this.buffers.resize(g,b),this._onResize.fire({cols:g,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,b=!1){const S=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===g.fg&&y.getBg(0)===g.bg||(y=S.getBlankLine(g,b),this._cachedBlankLine=y),y.isWrapped=b;const T=S.ybase+S.scrollTop,L=S.ybase+S.scrollBottom;if(S.scrollTop===0){const R=S.lines.isFull;L===S.lines.length-1?R?S.lines.recycle().copyFrom(y):S.lines.push(y.clone()):S.lines.splice(L+1,0,y.clone()),R?this.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this.isUserScrolling||S.ydisp++)}else{const R=L-T+1;S.lines.shiftElements(T+1,R-1,-1),S.lines.set(L,y.clone())}this.isUserScrolling||(S.ydisp=S.ybase),this._onScroll.fire(S.ydisp)}scrollLines(g,b,S){const y=this.buffer;if(g<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else g+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+g,y.ybase),0),T!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};a.BufferService=w=d([m(0,E.IOptionsService)],w)},7994:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,d){this._charsets[h]=d,this.glevel===h&&(this.charset=d)}}},1753:function(p,a,h){var d=this&&this.__decorate||function(y,T,L,R){var D,A=arguments.length,j=A<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,T,L,R);else for(var M=y.length-1;M>=0;M--)(D=y[M])&&(j=(A<3?D(j):A>3?D(T,L,j):D(T,L))||j);return A>3&&j&&Object.defineProperty(T,L,j),j},m=this&&this.__param||function(y,T){return function(L,R){T(L,R,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const c=h(2585),_=h(8460),x=h(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function w(y,T){let L=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(L|=64,L|=y.action):(L|=3&y.button,4&y.button&&(L|=64),8&y.button&&(L|=128),y.action===32?L|=32:y.action!==0||T||(L|=3)),L}const g=String.fromCharCode,b={DEFAULT:y=>{const T=[w(y,!1)+32,y.col+32,y.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${g(T[0])}${g(T[1])}${g(T[2])}`},SGR:y=>{const T=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${w(y,!0)};${y.col};${y.row}${T}`},SGR_PIXELS:y=>{const T=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${w(y,!0)};${y.x};${y.y}${T}`}};let S=a.CoreMouseService=class extends x.Disposable{constructor(y,T){super(),this._bufferService=y,this._coreService=T,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(E))this.addProtocol(L,E[L]);for(const L of Object.keys(b))this.addEncoding(L,b[L]);this.reset()}addProtocol(y,T){this._protocols[y]=T}addEncoding(y,T){this._encodings[y]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const T=this._encodings[this._activeEncoding](y);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,T,L){if(L){if(y.x!==T.x||y.y!==T.y)return!1}else if(y.col!==T.col||y.row!==T.row)return!1;return y.button===T.button&&y.action===T.action&&y.ctrl===T.ctrl&&y.alt===T.alt&&y.shift===T.shift}};a.CoreMouseService=S=d([m(0,c.IBufferService),m(1,c.ICoreService)],S)},6975:function(p,a,h){var d=this&&this.__decorate||function(S,y,T,L){var R,D=arguments.length,A=D<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,y,T,L);else for(var j=S.length-1;j>=0;j--)(R=S[j])&&(A=(D<3?R(A):D>3?R(y,T,A):R(y,T))||A);return D>3&&A&&Object.defineProperty(y,T,A),A},m=this&&this.__param||function(S,y){return function(T,L){y(T,L,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const c=h(1439),_=h(8460),x=h(844),E=h(2585),w=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=a.CoreService=class extends x.Disposable{constructor(S,y,T){super(),this._bufferService=S,this._logService=y,this._optionsService=T,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,c.clone)(w),this.decPrivateModes=(0,c.clone)(g)}reset(){this.modes=(0,c.clone)(w),this.decPrivateModes=(0,c.clone)(g)}triggerDataEvent(S,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${S}"`,(()=>S.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(S)}triggerBinaryEvent(S){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${S}"`,(()=>S.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(S))}};a.CoreService=b=d([m(0,E.IBufferService),m(1,E.ILogService),m(2,E.IOptionsService)],b)},9074:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=h(8055),m=h(8460),c=h(844),_=h(6106);let x=0,E=0;class w extends c.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((S=>S==null?void 0:S.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,c.toDisposable)((()=>this.reset())))}registerDecoration(S){if(S.marker.isDisposed)return;const y=new g(S);if(y){const T=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),T.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const S of this._decorations.values())S.dispose();this._decorations.clear()}*getDecorationsAtCell(S,y,T){let L=0,R=0;for(const D of this._decorations.getKeyIterator(y))L=D.options.x??0,R=L+(D.options.width??1),S>=L&&S<R&&(!T||(D.options.layer??"bottom")===T)&&(yield D)}forEachDecorationAtCell(S,y,T,L){this._decorations.forEachByKey(y,(R=>{x=R.options.x??0,E=x+(R.options.width??1),S>=x&&S<E&&(!T||(R.options.layer??"bottom")===T)&&L(R)}))}}a.DecorationService=w;class g extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(S){super(),this.options=S,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=S.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=h(2585),m=h(8343);class c{constructor(...x){this._entries=new Map;for(const[E,w]of x)this.set(E,w)}set(x,E){const w=this._entries.get(x);return this._entries.set(x,E),w}forEach(x){for(const[E,w]of this._entries.entries())x(E,w)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}a.ServiceCollection=c,a.InstantiationService=class{constructor(){this._services=new c,this._services.set(d.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const E=(0,m.getServiceDependencies)(_).sort(((b,S)=>b.index-S.index)),w=[];for(const b of E){const S=this._services.get(b.id);if(!S)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${b.id}.`);w.push(S)}const g=E.length>0?E[0].index:x.length;if(x.length!==g)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${g+1} conflicts with ${x.length} static arguments`);return new _(...x,...w)}}},7866:function(p,a,h){var d=this&&this.__decorate||function(g,b,S,y){var T,L=arguments.length,R=L<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,y);else for(var D=g.length-1;D>=0;D--)(T=g[D])&&(R=(L<3?T(R):L>3?T(b,S,R):T(b,S))||R);return L>3&&R&&Object.defineProperty(b,S,R),R},m=this&&this.__param||function(g,b){return function(S,y){b(S,y,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const c=h(844),_=h(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let E,w=a.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let b=0;b<g.length;b++)typeof g[b]=="function"&&(g[b]=g[b]())}_log(g,b,S){this._evalLazyOptionalParams(S),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(g,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,g,b)}debug(g,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,g,b)}info(g,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,g,b)}warn(g,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,g,b)}error(g,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,g,b)}};a.LogService=w=d([m(0,_.IOptionsService)],w),a.setTraceLogger=function(g){E=g},a.traceCall=function(g,b,S){if(typeof S.value!="function")throw new Error("not supported");const y=S.value;S.value=function(...T){if(E.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,T);E.trace(`GlyphRenderer#${y.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const L=y.apply(this,T);return E.trace(`GlyphRenderer#${y.name} return`,L),L}}},7302:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=h(8460),m=h(844),c=h(6114);a.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:c.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends m.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...a.DEFAULT_OPTIONS};for(const b in w)if(b in g)try{const S=w[b];g[b]=this._sanitizeAndValidateOption(b,S)}catch(S){console.error(S)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,g){return this.onOptionChange((b=>{b===w&&g(this.rawOptions[w])}))}onMultipleOptionChange(w,g){return this.onOptionChange((b=>{w.indexOf(b)!==-1&&g()}))}_setupOptions(){const w=b=>{if(!(b in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},g=(b,S)=>{if(!(b in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);S=this._sanitizeAndValidateOption(b,S),this.rawOptions[b]!==S&&(this.rawOptions[b]=S,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const S={get:w.bind(this,b),set:g.bind(this,b)};Object.defineProperty(this.options,b,S)}}_sanitizeAndValidateOption(w,g){switch(w){case"cursorStyle":if(g||(g=a.DEFAULT_OPTIONS[w]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${w}`);break;case"wordSeparator":g||(g=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=_.includes(g)?g:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${w} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${w} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}a.OptionsService=x},2660:function(p,a,h){var d=this&&this.__decorate||function(x,E,w,g){var b,S=arguments.length,y=S<3?E:g===null?g=Object.getOwnPropertyDescriptor(E,w):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(x,E,w,g);else for(var T=x.length-1;T>=0;T--)(b=x[T])&&(y=(S<3?b(y):S>3?b(E,w,y):b(E,w))||y);return S>3&&y&&Object.defineProperty(E,w,y),y},m=this&&this.__param||function(x,E){return function(w,g){E(w,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const c=h(2585);let _=a.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const E=this._bufferService.buffer;if(x.id===void 0){const T=E.addMarker(E.ybase+E.y),L={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(L,T))),this._dataByLinkId.set(L.id,L),L.id}const w=x,g=this._getEntryIdKey(w),b=this._entriesWithId.get(g);if(b)return this.addLineToLink(b.id,E.ybase+E.y),b.id;const S=E.addMarker(E.ybase+E.y),y={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(y,S))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(x,E){const w=this._dataByLinkId.get(x);if(w&&w.lines.every((g=>g.line!==E))){const g=this._bufferService.buffer.addMarker(E);w.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(w,g)))}}getLinkData(x){var E;return(E=this._dataByLinkId.get(x))==null?void 0:E.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,E){const w=x.lines.indexOf(E);w!==-1&&(x.lines.splice(w,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};a.OscLinkService=_=d([m(0,c.IBufferService)],_)},8343:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const h="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[d]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const c=function(_,x,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,g,b){g[h]===g?g[d].push({id:w,index:b}):(g[d]=[{id:w,index:b}],g[h]=g)})(c,_,E)};return c.toString=()=>m,a.serviceRegistry.set(m,c),c}},2585:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=h(8343);var m;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(p,a,h)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=h(8460),m=h(225);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,E,w=!1){return(16777215&x)<<3|(3&E)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new m.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let E=0,w=0;const g=x.length;for(let b=0;b<g;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=g)return E+this.wcwidth(S);const L=x.charCodeAt(b);56320<=L&&L<=57343?S=1024*(S-55296)+L-56320+65536:E+=this.wcwidth(L)}const y=this.charProperties(S,w);let T=c.extractWidth(y);c.extractShouldJoin(y)&&(T-=c.extractWidth(w)),E+=T,w=y}return E}charProperties(x,E){return this._activeProvider.charProperties(x,E)}}a.UnicodeService=c}},s={};function l(p){var a=s[p];if(a!==void 0)return a.exports;var h=s[p]={exports:{}};return r[p].call(h.exports,h,h.exports,l),h.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.Terminal=void 0;const a=l(9042),h=l(3236),d=l(844),m=l(5741),c=l(8285),_=l(7975),x=l(7090),E=["cols","rows"];class w extends d.Disposable{constructor(b){super(),this._core=this.register(new h.Terminal(b)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const S=T=>this._core.options[T],y=(T,L)=>{this._checkReadonlyOptions(T),this._core.options[T]=L};for(const T in this._core.options){const L={get:S.bind(this,T),set:y.bind(this,T)};Object.defineProperty(this._publicOptions,T,L)}}_checkReadonlyOptions(b){if(E.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new 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||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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._buffer=this.register(new c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let S="none";switch(this._core.coreMouseService.activeProtocol){case"X10":S="x10";break;case"VT200":S="vt200";break;case"DRAG":S="drag";break;case"ANY":S="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:S,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const S in b)this._publicOptions[S]=b[S]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,S=!0){this._core.input(b,S)}resize(b,S){this._verifyIntegers(b,S),this._core.resize(b,S)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,S,y){this._verifyIntegers(b,S,y),this._core.select(b,S,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,S){this._verifyIntegers(b,S),this._core.selectLines(b,S)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,S){this._core.write(b,S)}writeln(b,S){this._core.write(b),this._core.write(`\r
607
607
  `,S)}paste(b){this._core.paste(b)}refresh(b,S){this._verifyIntegers(b,S),this._core.refresh(b,S)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return a}_verifyIntegers(...b){for(const S of b)if(S===1/0||isNaN(S)||S%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const S of b)if(S&&(S===1/0||isNaN(S)||S%1!=0||S<0))throw new Error("This API only accepts positive integers")}}p.Terminal=w})(),f})()))})(um)),um.exports}var w9=S9();const C9=/(?:[A-Za-z]:[\\/]|\.{1,2}[\\/]|[\\/])?(?:[\w.@-]+[\\/])+[\w.@-]+\.[A-Za-z0-9]{1,10}(?::\d+(?::\d+)?)?/g;function Xh(e){var s;let i=e;if(/^file:/i.test(i))try{i=decodeURIComponent(new URL(i).pathname).replace(/^\/([A-Za-z]:)/,"$1")}catch{return null}i=i.replace(/\\/g,"/").replace(/:\d+(?::\d+)?$/,"");const r=(s=ye.getState().health)==null?void 0:s.projectRoot.replace(/\\/g,"/").replace(/\/$/,"");if(/^([A-Za-z]:)?\//.test(i)){if(!r||!i.toLowerCase().startsWith(`${r.toLowerCase()}/`))return null;i=i.slice(r.length+1)}return i=i.replace(/^(\.\/)+/,""),i&&!i.startsWith("../")?i:null}function Sv(e){if(Xh(e))return null;const i=e.replace(/:\d+(?::\d+)?$/,"");return/^([A-Za-z]:[\\/]|\/)/.test(i)?i:null}const iS=new Map;function E9(e){const i=Xh(e),r=i?null:Sv(e),s=i??r;if(!s)return Promise.resolve(!1);const l=iS.get(s);if(l&&Date.now()-l.at<3e4)return l.exists;const f=(i?Xt.stat(i):fetch(`/api/local-file/stat?path=${encodeURIComponent(r)}`).then(p=>p.json())).then(p=>p.exists,()=>!1);return iS.set(s,{at:Date.now(),exists:f}),f}function k9(e,i){var d;const r=e.buffer.active,s=m=>{var c;return((c=r.getLine(m))==null?void 0:c.translateToString(!0))??""},l=m=>{const c=r.getLine(m+1);return!!(c&&(c.isWrapped||s(m).length>=e.cols-2&&/^ {1,4}\S/.test(s(m+1))))};let f=i;for(;f>0&&l(f-1);)f-=1;let p=i;for(;p<r.length-1&&l(p);)p+=1;let a="";const h=[];for(let m=f;m<=p;m+=1){const c=s(m),_=m>f?((d=/^ {1,4}(?=\S)/.exec(c))==null?void 0:d[0].length)??0:0;for(let x=_;x<c.length;x+=1)h.push({x:x+1,y:m+1});a+=c.slice(_)}return{text:a,cells:h}}function T9(e){var l;const i=[],r=(l=ye.getState().health)==null?void 0:l.projectRoot.replace(/\\/g,"/").replace(/\/$/,"").toLowerCase(),s=e.replace(/\\/g,"/").toLowerCase();for(let f=r?s.indexOf(`${r}/`):-1;r&&f!==-1;f=s.indexOf(`${r}/`,f+1)){const p=/^[^\s:*?"<>|()]+(?::\d+(?::\d+)?)?/.exec(e.slice(f+r.length+1));p&&i.push({index:f,text:e.slice(f,f+r.length+1+p[0].length)})}for(const f of e.matchAll(C9)){const p=f.index;i.some(a=>p<a.index+a.text.length&&a.index<p+f[0].length)||/[a-z][\w+.-]*:\/{1,2}\S*$/i.test(e.slice(0,p))||i.push({index:p,text:f[0]})}return i}function rS(e,i,r){if(!e.ctrlKey&&!e.metaKey)return!1;const s=Xh(i),l=s?null:Sv(i);if(l)return window.open(`/api/local-file?path=${encodeURIComponent(l)}`,"_blank","noopener"),!0;if(!s)return!1;const{sessions:f,go:p}=ye.getState(),a=f.find(h=>h.terminalId===r);return a&&U4(s,a.id),Bn.getState().pin(s),p({kind:"file",path:s}),!0}function R9({terminalId:e,onExit:i}){const r=P.useRef(null),[s,l]=P.useState("connecting");return P.useEffect(()=>{if(!r.current)return;const f=new w9.Terminal({cursorBlink:!0,fontFamily:'ui-monospace, "Cascadia Mono", Consolas, SFMono-Regular, Menlo, monospace',fontSize:13,scrollback:1e4,allowProposedApi:!0,rescaleOverlappingGlyphs:!0,linkHandler:{allowNonHttpProtocols:!0,activate:(x,E)=>{/^https?:/i.test(E)?window.open(E,"_blank","noopener"):rS(x,E,e)}},theme:{background:"#141413",foreground:"#f5f4ee",cursor:"#d77757",selectionBackground:"#d7775755"}}),p=new p9.FitAddon;f.loadAddon(p),f.loadAddon(new x9.WebLinksAddon);const a=f.registerLinkProvider({provideLinks:(x,E)=>{const{text:w,cells:g}=k9(f,x-1),b=T9(w).filter(S=>(Xh(S.text)||Sv(S.text))&&g.slice(S.index,S.index+S.text.length).some(y=>y.y===x));if(!b.length)return E(void 0);Promise.all(b.map(S=>E9(S.text))).then(S=>{const y=b.filter((T,L)=>S[L]).map(T=>({text:T.text,range:{start:g[T.index],end:g[T.index+T.text.length-1]},activate:(L,R)=>void rS(L,R,e)}));E(y.length?y:void 0)})}});f.loadAddon(new v9.Unicode11Addon),f.unicode.activeVersion="11",f.open(r.current);try{const x=new b9.WebglAddon;x.onContextLoss(()=>x.dispose()),f.loadAddon(x)}catch{}p.fit(),f.attachCustomKeyEventHandler(x=>!(x.type==="keydown"&&x.ctrlKey&&!x.altKey&&!x.metaKey&&x.code==="KeyV"));const h=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api/terminals/${e}`),d=x=>h.readyState===WebSocket.OPEN&&h.send(JSON.stringify(x)),m=()=>d({type:"resize",cols:f.cols,rows:f.rows});h.onopen=()=>{l("open"),m(),f.focus()},h.onmessage=x=>{const E=JSON.parse(x.data);E.type==="output"&&E.data&&f.write(E.data),E.type==="exit"&&(f.write(`\r
608
608
  \x1B[2m[session ended, exit code ${E.code}]\x1B[0m\r
609
- `),i==null||i())},h.onclose=()=>l("closed");const c=f.onData(x=>d({type:"input",data:x})),_=new ResizeObserver(()=>{try{p.fit(),m()}catch{}});return _.observe(r.current),()=>{_.disconnect(),a.dispose(),c.dispose(),h.close(),f.dispose()}},[e]),v.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden rounded-lg border bg-[#141413]",children:[v.jsx("div",{ref:r,className:"terminal-host h-full w-full",onContextMenu:f=>f.preventDefault()}),s==="connecting"&&v.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"connecting..."}),s==="closed"&&v.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"detached"})]})}function u5({trigger:e,title:i,icon:r,badge:s,description:l,open:f,onOpenChange:p,children:a}){return v.jsxs(Tw,{open:f,onOpenChange:p,children:[v.jsx(yR,{asChild:!0,children:e}),v.jsxs(Lw,{children:[v.jsx(Dw,{className:"fixed inset-0 z-50 bg-foreground/30 animate-in fade-in-0"}),v.jsxs(Mw,{className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l bg-card shadow-xl focus:outline-none animate-in slide-in-from-right",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-3",children:[r,s,v.jsx(Ow,{className:"min-w-0 truncate text-sm font-semibold",children:i}),v.jsx(Nw,{className:"sr-only",children:l}),v.jsx(Bw,{asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto","aria-label":"Close",children:v.jsx(En,{size:15})})})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:a})]})]})]})}function h5({id:e}){const i=ye(y=>y.sessions.find(T=>T.id===e)),r=ye(y=>y.transcriptTicks[e]??0),s=ye(y=>y.ticks.interactions),[l,f]=P.useState(null),[p,a]=P.useState("terminal"),[h,d]=P.useState(!1),m=ye(y=>y.windowed),c=pn(),_=$h(),[x,E]=P.useState("idle"),w=P.useRef(!1);if(P.useEffect(()=>{w.current||!i||(w.current=!0,!i.live&&(E("starting"),ve.resumeSession(e).then(()=>E("idle"),y=>{E("failed"),ye.getState().notify(y.message,"error")})))},[e,i]),P.useEffect(()=>{f(null),d(!1),a("terminal")},[e]),P.useEffect(()=>{let y=!1;return ve.session(e).then(T=>!y&&f(T),()=>!y&&d(!0)),()=>{y=!0}},[e,r,s,i==null?void 0:i.status,i==null?void 0:i.terminalId]),!i&&h)return v.jsx(nn,{title:"This session is gone.",hint:"Its transcript may have been cleaned up by Claude Code.",className:"m-6"});if(!i)return v.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Loading..."});const g=((l==null?void 0:l.interactions)??[]).filter(y=>y.status==="open"),b=()=>rt(()=>ve.resumeSession(e)),S=()=>c({title:"Stop this session?",description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(e),Uh([e])}});return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("header",{className:"flex items-center gap-3 border-b px-3 py-3 sm:px-5",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Wh,{session:i}),v.jsx("h1",{className:"truncate text-sm font-semibold",children:i.title})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground",children:[v.jsx(nt,{tone:i.status==="waiting"?"warning":i.status==="running"?"success":i.status==="done"?"on":"off",children:i.status}),v.jsx(nt,{tone:"off",children:i.origin==="external"?"started in a terminal":`from ${i.origin}`}),i.category&&v.jsxs(nt,{tone:"off",children:["category: ",i.category]}),i.purpose&&v.jsxs(nt,{tone:"on",icon:Gl,children:["hub task: ",i.purpose.title]}),v.jsx("span",{children:Vs(i.startedAt)}),i.tokens&&v.jsxs("span",{children:["· ",On(os(i.tokens))," tokens"]}),v.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1 font-mono",title:"Claude Code session id",children:[v.jsx("span",{className:"truncate",children:i.id}),v.jsx(Nl,{text:i.id})]})]})]}),v.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[v.jsx(_e,{variant:"ghost",size:"icon",title:"Rename","aria-label":"Rename",onClick:()=>void _.rename(i),children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:i.live?"Stop and delete permanently":"Delete permanently","aria-label":"Delete permanently",onClick:()=>void _.remove(i),children:v.jsx(yr,{size:13})}),!m&&v.jsxs(_e,{variant:"ghost",title:"Open in a window of its own","aria-label":"New window",onClick:()=>dg({kind:"session",id:e}),children:[v.jsx(ma,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"New window"})]}),i.live?v.jsxs(_e,{variant:"muted",title:"Stop","aria-label":"Stop",onClick:()=>void S(),children:[v.jsx(bh,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Stop"})]}):v.jsxs(_e,{variant:"primary",title:"Resume here","aria-label":"Resume here",onClick:()=>void b(),children:[v.jsx(ua,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Resume here"})]})]})]}),v.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b px-2 sm:px-4",children:[["terminal","Terminal"],["setup","Setup"],["activity","Activity"],["toolset","Toolset"],["interactions",`Interactions${l!=null&&l.interactions.length?` (${l.interactions.length})`:""}`]].map(([y,T])=>v.jsx("button",{onClick:()=>a(y),className:xe("shrink-0 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",p===y?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:T},y))}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[v.jsxs("div",{className:xe("relative h-full p-2 sm:p-3",p!=="terminal"&&"hidden"),children:[v.jsxs("div",{className:"absolute right-4 top-4 z-10 flex gap-1.5 sm:right-5 sm:top-5",children:[v.jsx(L9,{items:g}),i.purpose&&(l==null?void 0:l.purposeNote)&&v.jsx(A9,{title:i.purpose.title,note:l.purposeNote})]}),i.terminalId?v.jsx(R9,{terminalId:i.terminalId},i.terminalId):v.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 rounded-lg border border-dashed",children:[x==="starting"?v.jsx("div",{className:"text-xs text-muted-foreground",children:"Starting the terminal..."}):v.jsxs(_e,{variant:"primary",size:"md",onClick:()=>void b(),children:[v.jsx(ua,{size:13})," Start the terminal again"]}),i.done&&v.jsxs("div",{className:"card max-w-lg p-3 text-xs",children:[v.jsx("div",{className:"font-medium",children:i.done.summary}),Object.entries(i.done.deliverables??{}).map(([y,T])=>v.jsxs("div",{className:"mt-1 text-[11px]",children:[v.jsxs("span",{className:"font-medium",children:[y,": "]}),v.jsx("span",{className:"break-all text-muted-foreground",children:typeof T=="string"?T:JSON.stringify(T)})]},y))]})]})]}),p==="activity"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(o9,{data:l}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="setup"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(l9,{sessionId:e,live:i.live,current:l.setup}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="toolset"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(d9,{sessionId:e,live:i.live,current:l.toolset}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="interactions"&&v.jsx("div",{className:"h-full space-y-2 overflow-y-auto p-4",children:l!=null&&l.interactions.length?l.interactions.map(y=>v.jsx(Hl,{interaction:y},y.id)):v.jsx(nn,{title:"Nothing asked yet.",hint:"Permission requests, questions, ends of turns and MCP suggestions from this session land here and on every channel."})})]})]})}function A9({title:e,note:i}){return v.jsx(u5,{title:e,icon:v.jsx(Gl,{size:14,className:"shrink-0 text-primary"}),badge:v.jsx(nt,{tone:"on",children:"hub task"}),description:"Parameters, samples and API of this hub task.",trigger:v.jsxs(_e,{variant:"primary",className:"shadow-md",title:"What this hub task is for: parameters, samples, API",children:[v.jsx(E3,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Params & samples"})]}),children:v.jsx(pv,{className:"text-xs",children:i.replace(/^# .*\n+/,"")})})}function L9({items:e}){const[i,r]=P.useState(!1);return P.useEffect(()=>{i&&!e.length&&r(!1)},[i,e.length]),e.length?v.jsx(u5,{open:i,onOpenChange:r,title:`${e.length} waiting on you`,icon:v.jsx(ls,{size:14,className:"shrink-0 text-severity-warning"}),description:"Questions and requests this session is waiting on.",trigger:v.jsxs(_e,{className:"bg-severity-warning text-background shadow-md hover:bg-severity-warning/90",title:"What this session is waiting on",children:[v.jsx(ls,{size:12,className:"animate-status-pulse"})," ",e.length," ",v.jsx("span",{className:"hidden sm:inline",children:"waiting"})]}),children:v.jsx("div",{className:"space-y-2",children:e.map(s=>v.jsx(Hl,{interaction:s},s.id))})}):null}function d5(){const[e,i]=P.useState(null),[r,s]=P.useState(!1),[l,f]=P.useState(!1);P.useEffect(()=>{let m=!0;return ve.hub().then(c=>m&&i(c.claudeStatus)).catch(()=>{}),()=>{m=!1}},[]);const p=async()=>{s(!0);try{i(await ve.checkClaude())}catch{}finally{s(!1)}},a=(e==null?void 0:e.problem)??null,h=e===null;if(P.useEffect(()=>{if(!a&&!h)return;const m=setInterval(()=>void(a?p():ve.hub().then(c=>i(c.claudeStatus)).catch(()=>{})),a?3e4:5e3);return()=>clearInterval(m)},[a,h]),!(e!=null&&e.problem))return null;const d=()=>{var m;(m=navigator.clipboard)==null||m.writeText(e.fix??"").then(()=>{f(!0),setTimeout(()=>f(!1),1500)})};return v.jsxs("div",{role:"alert",className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b bg-destructive/15 px-5 py-2 text-xs",children:[v.jsx(AS,{size:14,className:"shrink-0 text-destructive"}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("b",{children:e.message})," Sessions, runs and chat commands cannot start until then."]}),e.fix&&v.jsxs("span",{className:"flex items-center gap-1",children:["Run",v.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:e.fix}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:d,title:l?"Copied":"Copy","aria-label":"Copy the command",children:v.jsx(xh,{size:12})}),e.problem==="missing"?"in a terminal, then sign in with":"in a terminal on this machine.",e.problem==="missing"&&v.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:"claude auth login"})]}),v.jsxs(_e,{variant:"muted",onClick:()=>void p(),disabled:r,className:"ml-auto",children:[v.jsx(yh,{size:12,className:r?"animate-spin":void 0}),r?"Checking...":"Check again"]})]})}const hm=[{page:"overview",label:"Projects",icon:H3},{page:"inbox",label:"Inbox",icon:P3},{page:"channels",label:"Channels",icon:Wl}];let sS=null;function D9(){return sS??(sS=ve.folders().then(e=>e.home,()=>null)),sS}function oS(e,i){var r;(r=navigator.clipboard)==null||r.writeText(e).then(()=>ye.getState().notify(`Copied the ${i}.`),()=>ye.getState().notify("The browser did not allow copying.","error"))}function wv({project:e,x:i,y:r,onClose:s}){const l=ye(m=>m.openProject),f=pn(),p=()=>rt(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),a=()=>f({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),ye.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}});P.useEffect(()=>{const m=()=>s(),c=_=>_.key==="Escape"&&s();return window.addEventListener("pointerdown",m),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),window.addEventListener("keydown",c),()=>{window.removeEventListener("pointerdown",m),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m),window.removeEventListener("keydown",c)}},[s]);const h=async()=>{const m=await D9(),c=e.root,_=c.includes("\\")?"\\":"/",x=m&&c.toLowerCase().startsWith(`${m.replace(/[\\/]$/,"").toLowerCase()}${_}`);oS(x?`~${_}${c.slice(m.replace(/[\\/]$/,"").length+1)}`:c,"relative path")},d=(m,c,_,x={})=>{const E=c;return v.jsxs("button",{title:x.hint,onPointerDown:w=>{w.stopPropagation(),s(),_()},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",x.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(E,{size:13}),m]})};return v.jsxs("div",{role:"menu",className:"fixed z-50 w-56 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-232),top:Math.min(r,window.innerHeight-290)},onPointerDown:m=>m.stopPropagation(),children:[d("Open",Ul,()=>l(e.id)),v.jsx("div",{className:"my-1 border-t"}),e.paused?d("Allow notifications",ls,()=>void rt(()=>ve.pauseNotificationsIn(e.id,!1),`Notifications from ${e.name} are back on.`)):d("Do not disturb",la,()=>void rt(()=>ve.pauseNotificationsIn(e.id,!0),`No channel hears from ${e.name} now.`),{hint:"Pauses every channel of this project, and the global ones for it; questions still wait in the inbox"}),d(e.muted?"Hear on global channels":"Mute on global channels",e.muted?Wl:e4,()=>void p(),{hint:"Only the global channels; the project's own channels are not changed"}),v.jsx("div",{className:"my-1 border-t"}),d("Copy Path",Rl,()=>oS(e.root,"path")),d("Copy Relative Path",Rl,()=>void h(),{hint:"From your home folder, as ~/..."}),d("Reveal in File Explorer",ca,()=>void rt(()=>ve.revealIn(e.id))),v.jsx("div",{className:"my-1 border-t"}),d("Remove from the hub",yr,()=>void a(),{danger:!0,hint:"The folder and its saved settings stay"})]})}function M9({project:e}){const i=ye(a=>a.openProject),r=pn(),s=()=>rt(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),l=()=>r({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),ye.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}}),[f,p]=P.useState(null);return v.jsxs("div",{className:"card flex min-w-0 flex-col gap-2 p-3",onContextMenu:a=>{a.preventDefault(),p({x:a.clientX,y:a.clientY})},children:[f&&v.jsx(wv,{project:e,...f,onClose:()=>p(null)}),v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("button",{onClick:()=>i(e.id),className:"min-w-0 flex-1 text-left",title:e.root,children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-sm font-semibold hover:underline",children:e.name}),e.paused&&v.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-severity-warning/15 px-1 text-[9px] font-medium text-severity-warning",title:"Do not disturb: no channel hears from it",children:[v.jsx(la,{size:9})," DND"]})]}),v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:e.root})]}),v.jsx("button",{onClick:()=>void s(),title:e.muted?"Muted on the global channels: click to hear from it again":"Heard on the global channels: click to mute","aria-label":e.muted?`Unmute ${e.name}`:`Mute ${e.name}`,className:xe("shrink-0 rounded p-1 hover:bg-muted",e.muted?"text-muted-foreground":"text-foreground"),children:e.muted?v.jsx(la,{size:13}):v.jsx(ls,{size:13})}),v.jsx("button",{onClick:()=>void l(),title:"Remove from the hub","aria-label":`Remove ${e.name}`,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(En,{size:13})})]}),v.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px]",children:[v.jsxs("span",{className:xe(e.waiting?"font-semibold text-severity-warning":"text-muted-foreground"),children:["⏳ ",e.waiting," waiting"]}),v.jsxs("span",{className:"text-muted-foreground",children:["▶️ ",e.running," running"]}),v.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:e.runningRun?`Running: ${e.runningRun}`:void 0,children:[v.jsx(F3,{size:11})," ",e.runningRun?"1 running, ":"",e.queued," queued"]})]}),v.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[v.jsxs("span",{className:"flex min-w-0 max-w-full items-center gap-1 truncate",title:e.nextCron?`${e.nextCron.name}: ${Vs(e.nextCron.at)}`:void 0,children:[v.jsx(_h,{size:11,className:"shrink-0"})," ",v.jsx("span",{className:"truncate",children:e.nextCron?`${e.nextCron.name} · ${Vs(e.nextCron.at)}`:"no cron job"})]}),v.jsxs("span",{title:"Sent and written in the sessions active today, cache reads left out",children:[e.activeToday," active today · ",On(e.tokensToday)," tokens"]})]})]})}function f5({children:e}){return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsx("div",{className:"mx-auto max-w-6xl space-y-4 p-5",children:e})})}function j9(){var s;const[e,i]=P.useState(!1),r=ut(()=>ve.globalOverview(),["projects","sessions","interactions","runs","jobs","channels"]);return v.jsxs(f5,{children:[v.jsx(Er,{group:"Global",title:"Projects",description:"Every project in the hub, most recently opened first. The bell says whether the global channels hear from it.",action:v.jsxs(_e,{variant:"primary",onClick:()=>i(!0),children:[v.jsx(Qn,{size:12})," Open folder..."]})}),v.jsx(s5,{open:e,onOpenChange:i}),(s=r.data)!=null&&s.length?v.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",children:r.data.map(l=>v.jsx(M9,{project:l},l.id))}):v.jsx(nn,{variant:"inline",title:r.data?"No projects yet.":"Loading..."})]})}function O9(){var i;const e=ut(()=>ve.globalInbox(),["projects","interactions"]);return v.jsxs(f5,{children:[v.jsx(Er,{group:"Global",title:"Inbox",description:"Everything waiting on you, in every project."}),(i=e.data)!=null&&i.length?v.jsx("div",{className:"space-y-2",children:e.data.map(r=>v.jsx(Hl,{interaction:r,project:r.project,showSession:!0},`${r.project.id}:${r.id}`))}):v.jsx(nn,{icon:ls,title:e.data?"Nothing is waiting on you.":"Loading..."})]})}function aS({width:e,collapsed:i,onToggle:r,drawer:s=!1}){var S;const l=ye(y=>y.view),f=ye(y=>y.go),p=ye(y=>y.openProject),a=ye(y=>y.sessions),h=ut(()=>ve.projects(),["projects"]),d=ut(()=>ve.globalOverview(),["projects","channels"]),[m,c]=P.useState(null),[_,x]=P.useState(!1),w=((S=ut(()=>ve.globalInbox(),["projects","interactions"]).data)==null?void 0:S.length)??0,g=a.filter(y=>y.origin!=="external"||y.live).slice(0,10),b=y=>l.kind==="page"&&(l.page===y||y==="overview"&&!hm.some(T=>T.page===l.page));return i?v.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[v.jsx(da,{className:"mb-2"}),hm.map(y=>v.jsx(ur,{content:`Global · ${y.label}`,side:"right",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon",className:xe(b(y.page)&&"bg-muted text-foreground"),onClick:()=>f({kind:"page",page:y.page}),children:v.jsx(y.icon,{size:15})})},y.page)),v.jsx("div",{className:"flex-1"}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:v.jsx(vS,{size:15})})]}):v.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[v.jsx(da,{}),v.jsxs("div",{className:"min-w-0",children:[v.jsx(Yh,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:"Global"}),v.jsx(yv,{})]})]}),v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":s?"Close menu":"Collapse sidebar",children:s?v.jsx(En,{size:15}):v.jsx(gS,{size:15})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:[v.jsx("nav",{className:"px-2",children:hm.map(y=>v.jsxs("button",{onClick:()=>f({kind:"page",page:y.page}),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",b(y.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(y.icon,{size:14}),y.label,y.page==="inbox"&&w>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:w})]},y.page))}),v.jsxs("div",{className:"mt-2 px-2",children:[v.jsxs("div",{className:"flex items-center px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Projects",v.jsx("button",{onClick:()=>x(!0),title:"Open folder...","aria-label":"Add a project",className:"ml-auto rounded p-0.5 hover:bg-muted hover:text-foreground",children:v.jsx(Qn,{size:12})})]}),m&&v.jsx(wv,{project:m.project,x:m.x,y:m.y,onClose:()=>c(null)}),(h.data??[]).map(y=>v.jsxs("button",{disabled:!y.exists,onClick:()=>p(y.id),onContextMenu:T=>{var R;T.preventDefault();const L=(R=d.data)==null?void 0:R.find(D=>D.id===y.id);c({project:{id:y.id,name:y.name,root:y.root,muted:L==null?void 0:L.muted,paused:L==null?void 0:L.paused},x:T.clientX,y:T.clientY})},title:y.root,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground disabled:opacity-50",children:[v.jsx(bS,{size:14,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.name}),y.waiting>0&&v.jsx("span",{className:"rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:y.waiting}),y.running>0&&v.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px]",title:`${y.running} running`,children:[v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success"})," ",y.running]})]},y.id)),h.data&&!h.data.length&&v.jsx("div",{className:"px-2 py-1 text-[11px] text-muted-foreground",children:"No projects yet."})]}),g.length>0&&v.jsxs("div",{className:"mt-2 px-2",children:[v.jsx("div",{className:"px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub tasks"}),g.map(y=>v.jsxs("button",{onClick:()=>f({kind:"session",id:y.id}),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors",l.kind==="session"&&l.id===y.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(Gl,{size:13,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.title}),v.jsx(Wh,{session:y})]},y.id))]})]}),v.jsxs("div",{className:"border-t px-2 py-2",children:[v.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>x(!0),children:[v.jsx(Qn,{size:13})," Open folder..."]}),v.jsx(s5,{open:_,onOpenChange:x})]})]})}const lS="clauder-hub:global-sidebar-collapsed";function N9(){const e=ye(m=>m.view),i=ph("clauder-hub:sidebar-width",280,{min:220,max:480}),r=ph("clauder-hub:live-panel-width",260,{min:200,max:420}),s=Gh(m=>m.open),l=P2("(min-width: 768px)"),[f,p]=P.useState(!1),[a,h]=P.useState(()=>{try{return localStorage.getItem(lS)==="1"}catch{return!1}});P.useEffect(()=>{document.title="Clauder Hub · Global"},[]),P.useEffect(()=>{try{localStorage.setItem(lS,a?"1":"0")}catch{}},[a]),P.useEffect(()=>p(!1),[e,l]);const d=e.kind==="session"?v.jsx(h5,{id:e.id},e.id):e.kind==="page"&&e.page==="inbox"?v.jsx(O9,{}):e.kind==="page"&&e.page==="channels"?v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsx("div",{className:"mx-auto max-w-6xl p-5",children:v.jsx(lC,{global:!0})})}):v.jsx(j9,{});return v.jsxs("div",{className:"flex h-screen overflow-hidden",children:[l&&v.jsx(aS,{width:i.width,collapsed:a,onToggle:()=>h(!a)}),l&&!a&&v.jsx(mh,{onDrag:i.resizeBy,onReset:i.reset}),!l&&v.jsxs(v.Fragment,{children:[f&&v.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>p(!1)}),v.jsx("div",{inert:!f,className:xe("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",f?"translate-x-0 shadow-xl":"-translate-x-full"),children:v.jsx(aS,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>p(!1),drawer:!0})})]}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[v.jsx(_e,{variant:"ghost",size:"icon",onClick:()=>p(!0),"aria-label":"Open menu",title:"Menu",children:v.jsx(SS,{size:16})}),v.jsx(da,{}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(Yh,{}),v.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Global"})]})]}),v.jsx(d5,{}),v.jsx("div",{className:"min-h-0 flex-1",children:d})]}),l&&s&&v.jsx(mh,{onDrag:m=>r.resizeBy(-m),onReset:r.reset}),l&&s&&v.jsx(r5,{width:r.width})]})}function B9(){const e=ye(s=>s.open),r=(ut(()=>ve.interactions(),["interactions"]).data??[]).filter(s=>s.status!=="open").slice(0,60);return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),v.jsx("h1",{className:"text-base font-semibold",children:"Inbox"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What sessions are waiting on. The first answer wins, from anywhere.",children:"What sessions are waiting on. The first answer wins, from anywhere."})]}),e.length?v.jsx("div",{className:"space-y-2",children:e.map(s=>v.jsx(Hl,{interaction:s,showSession:!0},s.id))}):v.jsx(nn,{icon:ls,title:"Nothing is waiting on you."}),r.length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("h2",{className:"pt-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Recent"}),r.map(s=>v.jsx(Hl,{interaction:s,showSession:!0,compact:!0},s.id))]})]})})}function P9(){var p;const e=ut(()=>ve.suggestions(),["mcp"]),i=ut(()=>ve.mcpSuggestionsEnabled(),["mcp"]),r=!!((p=i.data)!=null&&p.enabled),s=ye(a=>a.go),l=(e.data??[]).filter(a=>a.status==="suggested"),f=(e.data??[]).filter(a=>a.status!=="suggested");return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Settings",title:"MCP suggestions",description:"Servers that blocked sessions asked for. Nothing installs without you.",action:v.jsxs(_e,{onClick:()=>s({kind:"page",page:"mcp-servers"}),children:[v.jsx(Vl,{size:12})," Configured servers"]})}),v.jsx(Dt,{title:"Suggest MCP servers",description:"When on, sessions are told they may stop and ask for a missing MCP server. Off: that part of the system prompt is left out. Applies to sessions started from now on.",action:v.jsx("button",{role:"switch","aria-checked":r,"aria-label":"Suggest MCP servers",disabled:!i.data,onClick:()=>void rt(()=>ve.setMcpSuggestionsEnabled(!r),r?"MCP suggestions off.":"MCP suggestions on."),className:xe("relative h-5 w-9 shrink-0 rounded-full transition-colors",r?"bg-primary":"bg-foreground/20"),children:v.jsx("span",{className:xe("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",r?"left-[18px]":"left-0.5")})}),children:null}),v.jsx(Dt,{title:`Waiting (${l.length})`,children:l.length?v.jsx("div",{className:"space-y-2",children:l.map(a=>v.jsx(cS,{suggestion:a},a.id))}):v.jsx(nn,{variant:"inline",title:"No session is waiting on an MCP server."})}),f.length>0&&v.jsx(Dt,{title:"History",children:v.jsx("div",{className:"space-y-2",children:f.map(a=>v.jsx(cS,{suggestion:a},a.id))})})]})})}function cS({suggestion:e}){const i=ye(a=>a.go),r=pn(),s=e.status==="installed"?"success":e.status==="failed"?"critical":e.status==="suggested"?"warning":"off",l=()=>r({title:`Install '${e.name}'?`,description:"Adds it to this project's .mcp.json.",body:v.jsxs("div",{className:"space-y-2",children:[v.jsx("pre",{className:"whitespace-pre-wrap rounded bg-muted p-3 font-mono text-[11px]",children:e.runs}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"If it succeeds, the session that asked is restarted on the same conversation so the server loads, and is told to continue."})]}),confirmLabel:"Run it",run:async()=>{const a=await ve.installSuggestion(e.id);ye.getState().notify(a.status==="installed"?"Installed; the session is resuming.":"The install failed; see its output.",a.status==="installed"?"info":"error")}}),f=()=>r({title:`Carry on without '${e.name}'?`,description:"The session continues without it.",confirmLabel:"Skip it",run:()=>ve.skipSuggestion(e.id)}),p=()=>r({title:"Remove this suggestion from the history?",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteSuggestion(e.id)});return v.jsxs("div",{className:"rounded-md border p-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx(Vl,{size:14,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 break-all text-xs font-semibold",children:e.name}),v.jsx(nt,{tone:s,children:e.status}),v.jsxs("button",{className:"text-[11px] text-muted-foreground hover:underline",onClick:()=>i({kind:"session",id:e.sessionId}),children:["from session ",e.sessionId.slice(0,8)]}),v.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:va(e.createdAt)})]}),v.jsx("div",{className:"mt-1.5 break-words text-xs text-muted-foreground",children:e.reason}),v.jsx("pre",{className:"mt-1.5 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 font-mono text-[11px]",children:e.runs??e.command}),e.refused&&v.jsx("div",{className:"mt-1 text-[11px] text-severity-critical",children:e.refused}),e.output&&v.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap rounded border p-2 font-mono text-[10px] text-muted-foreground",children:e.output}),v.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e.status==="suggested"&&v.jsxs(v.Fragment,{children:[v.jsxs(_e,{variant:"primary",disabled:!e.runs,onClick:()=>void l(),children:[v.jsx(L3,{size:12})," Install & resume"]}),v.jsxs(_e,{onClick:()=>void f(),children:[v.jsx(En,{size:12})," Skip"]})]}),e.docs&&v.jsx("a",{href:e.docs,target:"_blank",rel:"noreferrer",children:v.jsxs(_e,{variant:"ghost",children:[v.jsx(ma,{size:12})," Docs"]})}),e.status!=="suggested"&&v.jsx(_e,{variant:"ghost",className:"ml-auto",onClick:()=>void p(),children:v.jsx(yr,{size:12})})]})]})}function I9(){const e=ut(()=>ve.stats(),["sessions","transcript"]),i=ut(()=>ve.inventory(),["sessions"]),r=ye(l=>l.sessions),s=e.data;return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Operation",title:"Overview",description:"Stats from this project's Claude Code transcripts."}),v.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[v.jsx(ss,{label:"Sessions",value:String((s==null?void 0:s.sessions)??"-")}),v.jsx(ss,{label:"Live now",value:String(r.filter(l=>l.live).length)}),v.jsx(ss,{label:"Waiting on you",value:String(r.filter(l=>l.status==="waiting").length)}),v.jsx(ss,{label:"Tool calls",value:s?On(Object.values(s.tools).reduce((l,f)=>l+f.count,0)):"-"})]}),s&&v.jsx(oC,{tokens:s.tokens}),s&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[v.jsx(Dt,{title:"Output tokens per day",className:"lg:col-span-2",children:v.jsx(u6,{days:s.byDay,valueOf:l=>l.output,label:"output tokens"})}),v.jsx(Dt,{title:"Tokens by model",children:v.jsx(as,{rows:Object.entries(s.byModel).filter(([,l])=>os(l)>0).map(([l,f])=>({key:l,label:l,value:os(f)}))})})]}),v.jsx(o5,{tools:s.tools}),v.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[v.jsx(Dt,{title:"Subagents by type",description:"How often each was spawned, with its own tokens.",children:v.jsx(as,{rows:Object.entries(s.agents).map(([l,f])=>({key:l,label:l,value:f.count,sublabel:`${On(os(f.tokens))} tok`})),format:String,empty:"No subagents yet."})}),v.jsx(Dt,{title:"Skills & commands",children:v.jsx(as,{rows:Object.entries(s.skills).map(([l,f])=>({key:l,label:l,value:f})),format:String,empty:"No skills used yet."})})]})]}),e.error&&v.jsx("div",{className:"text-xs text-severity-critical",children:e.error}),i.data&&v.jsx(H9,{inventory:i.data})]})})}const z9=[{page:"agents",label:"Agents",count:e=>e.agents.length},{page:"skills",label:"Skills",count:e=>e.skills.length},{page:"commands",label:"Commands",count:e=>e.commands.length},{page:"mcp-servers",label:"MCP servers",count:e=>e.mcpServers.length},{page:"hooks",label:"Hooks",count:e=>e.hooks.length},{page:"plugins",label:"Plugins",count:e=>e.plugins.filter(i=>i.enabled).length}];function H9({inventory:e}){const i=ye(r=>r.go);return v.jsx(Dt,{title:"What sessions can reach for",description:"All scopes together: this project, your user config and enabled plugins. Open one under Project.",children:v.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-6",children:z9.map(r=>v.jsxs("button",{onClick:()=>i({kind:"page",page:r.page}),className:"rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted",children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:r.label}),v.jsx("div",{className:"text-lg font-semibold tabular-nums",children:r.count(e)})]},r.page))})})}const F9={name:"",toolset:{agents:[],skills:[],mcp:[],plugins:[]},isDefault:!1};function U9(){const e=ut(()=>ve.presets(),["jobs"]),i=ut(()=>ve.toolsetCatalog(),[]),{starting:r,start:s}=Qs(),[l,f]=P.useState(null),[p,a]=P.useState(!1),h=_=>{f(_),a(_!==null)},d=e.data??[],m=l==="new"?null:d.find(_=>_.id===l)??d[0]??null,c=l==="new"||!d.length&&e.data!==null;return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Settings",title:"Toolset presets",description:"Named sets of agents, skills, MCP servers and plugins to turn off.",action:v.jsxs(_e,{variant:"primary",disabled:r,onClick:()=>void s("create-preset"),title:"Opens a Claude session to describe the preset",children:[v.jsx(Qn,{size:12})," New preset"]})})}),v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:xe("w-full shrink-0 space-y-0.5 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",p&&"hidden"),children:[d.map(_=>v.jsxs("button",{onClick:()=>h(_.id),className:xe("block w-full rounded-md px-2 py-1.5 text-left text-foreground",(m==null?void 0:m.id)===_.id&&!c?"bg-muted":"hover:bg-muted/60"),children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ag,{size:12,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate text-xs",children:_.name}),_.isDefault&&v.jsx(nt,{tone:"on",children:"default"})]}),v.jsx("div",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:gh(_.toolset)?`${gh(_.toolset)} turned off`:"everything on"})]},_.id)),!d.length&&v.jsx(nn,{variant:"inline",title:"No presets yet."})]}),v.jsxs("div",{className:xe("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!p&&"hidden"),children:[v.jsx(Ig,{onClick:()=>a(!1)}),i.data&&(c||m)?v.jsx($9,{preset:c?F9:m,catalog:i.data,onSaved:_=>{e.reload(),f(_)},onDeleted:()=>{e.reload(),h(null)}},c?"new":m.id):null]})]})]})}function $9({preset:e,catalog:i,onSaved:r,onDeleted:s}){const l=pn(),{starting:f,start:p}=Qs(),[a,h]=P.useState(e);P.useEffect(()=>h(e),[e]);const d=JSON.stringify(a)!==JSON.stringify(e),m=async()=>{const _=await rt(()=>ve.savePreset(a),"Saved.");_&&r(_.id)},c=()=>l({title:`Delete the preset '${e.name}'?`,description:"Jobs using it fall back to the default.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deletePreset(e.id),ye.getState().notify("Deleted."),s()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"flex min-w-0 flex-1 basis-48 items-center gap-3",children:[v.jsx(pi,{value:a.name,onChange:_=>h({...a,name:_.target.value}),placeholder:"Preset name",className:"max-w-xs",size:"md"}),v.jsx(Fh,{label:"Default for new sessions and jobs",checked:a.isDefault,onCheckedChange:_=>h({...a,isDefault:_})})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.id&&v.jsxs(_e,{variant:"ghost",disabled:f,onClick:()=>void p("edit-preset",e.id),title:"Describe the change to Claude instead of flipping switches",children:[v.jsx(cg,{size:12})," Edit with Claude"]}),e.id&&v.jsxs(_e,{variant:"ghost",onClick:()=>void c(),children:[v.jsx(yr,{size:12})," Delete"]}),d&&e.id&&v.jsx(_e,{onClick:()=>h(e),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!a.name.trim()||!d&&!!e.id,onClick:()=>void m(),children:"Save"})]})]}),v.jsx(l5,{catalog:i,value:a.toolset,onChange:_=>h({...a,toolset:_})})]})}function q9(e){if(e.params.length){const i=e.params.filter(r=>r.required).map(r=>r.name);return{icon:I3,text:i.length?`Needs ${i.join(", ")}`:"Optional settings"}}return e.auth==="oauth"?{icon:$3,text:"Sign in after adding"}:{icon:$l,text:"Nothing to set up"}}function V9(){var s;const e=ut(()=>ve.mcpCatalog(),["mcp"]),{starting:i,start:r}=Qs();return(s=e.data)!=null&&s.length?v.jsx(Dt,{title:"Recommended",description:"Common servers. Adding one opens a hub task that asks for what it needs.",action:v.jsxs(_e,{disabled:i,onClick:()=>void r("add-mcp"),title:"Opens a hub task to add any MCP server",children:[v.jsx(cg,{size:12})," Add another server"]}),children:v.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:e.data.map(l=>{const f=q9(l);return v.jsxs("div",{className:"flex flex-col rounded-md border p-3",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate text-xs font-semibold",children:l.name}),v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.vendor})]}),v.jsx(nt,{tone:"off",children:l.category})]}),v.jsx("p",{className:"mt-1.5 line-clamp-2 flex-1 text-[11px] text-muted-foreground",title:l.description,children:l.description}),v.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[v.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1 truncate text-[10px] text-muted-foreground",title:f.text,children:[v.jsx(f.icon,{size:11,className:"shrink-0"})," ",v.jsx("span",{className:"truncate",children:f.text})]}),v.jsx("a",{href:l.docs,target:"_blank",rel:"noreferrer",title:"Docs",className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(ma,{size:12})}),l.installed?v.jsx(nt,{tone:"success",icon:$l,children:"added"}):v.jsxs(_e,{className:"shrink-0 bg-white text-neutral-900 hover:bg-white/85",disabled:i,onClick:()=>void r("add-mcp",l.id),children:[v.jsx(Qn,{size:12})," Add"]})]})]},l.id)})})}):null}const W9=["user","project","local","plugin","built-in"],p5={project:"This project (shared, in the repo)",local:"This project (local, only on this machine)",user:"You (every project)",plugin:"Plugins","built-in":"Built into Claude Code"};function vh(e,i){var r;return e.scope==="user"?!0:e.scope==="plugin"&&((r=i.find(s=>s.id===e.plugin))==null?void 0:r.scope)==="user"}function Kh(){return ut(()=>ve.inventory(),["sessions"])}function Cv(){var l;const e=ut(()=>ve.presets(),["jobs"]),i=ut(()=>ve.toolsetCatalog(),["sessions"]);return!e.data||!i.data?null:{off:((l=e.data.find(f=>f.isDefault))==null?void 0:l.toolset)??{agents:[],skills:[],mcp:[],plugins:[]},mcpId:f=>{var p;return(p=i.data.find(a=>a.kind==="mcp"&&a.label===f))==null?void 0:p.id}}}function Ev({defaults:e,kind:i,id:r,plugin:s}){if(!e||!r)return null;const l=!!(s&&e.off.plugins.includes(s));return v.jsx(Fh,{ariaLabel:`${r} in new sessions`,title:l?`Off with its plugin ${s}`:"On in new sessions (default preset)",disabled:l,checked:!l&&!e.off[i].includes(r),onCheckedChange:f=>void rt(()=>ve.setDefaultItem(i,r,f),`${r} ${f?"on":"off"} in new sessions.`)})}function m5(e){return W9.map(i=>[i,e.filter(r=>r.scope===i)]).filter(([,i])=>i.length)}function g5({items:e,keyOf:i,render:r,detail:s,searchText:l,empty:f,leading:p}){var g;const[a,h]=P.useState(""),[d,m]=P.useState(null),[c,_]=P.useState(!1),x=P.useMemo(()=>{const b=a.trim().toLowerCase();return b?e.filter(S=>l(S).toLowerCase().includes(b)):e},[e,a,l]),E=m5(x),w=e.find(b=>i(b)===d)??((g=E[0])==null?void 0:g[1][0])??null;return e.length?v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:xe("w-full shrink-0 overflow-y-auto p-3 md:block md:w-60 md:border-r lg:w-80",c&&"hidden"),children:[v.jsxs("div",{className:"relative mb-2",children:[v.jsx(lg,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(pi,{value:a,onChange:b=>h(b.target.value),placeholder:`Filter ${e.length}`,className:"pl-6"})]}),v.jsx("div",{className:"space-y-1.5",children:E.map(([b,S])=>v.jsx(bv,{title:p5[b],badge:v.jsx(nt,{tone:"off",children:S.length}),defaultOpen:!0,children:S.map(y=>v.jsxs("div",{className:xe("flex items-center gap-1 rounded-md",p&&"pl-2",w&&i(w)===i(y)?"bg-muted":"hover:bg-muted/60"),children:[p==null?void 0:p(y),v.jsx("button",{onClick:()=>{m(i(y)),_(!0)},className:"block min-w-0 flex-1 px-2 py-1.5 text-left text-foreground",children:r(y)})]},i(y)))},b))}),!E.length&&v.jsx("div",{className:"px-1 text-xs text-muted-foreground",children:"No match."})]}),v.jsxs("div",{className:xe("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!c&&"hidden"),children:[v.jsx(Ig,{onClick:()=>_(!1)}),w?s(w):null]})]}):v.jsx(nn,{title:f,className:"m-5"})}function ic({title:e,description:i,children:r}){return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Project",title:e,description:i})}),r]})}const uS={memory:"CLAUDE.md",rules:"Rule","auto-memory":"Auto memory"};function G9(){const e=ut(()=>ve.memory(),[]),i=(e.data??[]).filter(r=>r.group in uS);return v.jsx(ic,{title:"Instructions",description:"CLAUDE.md, rules and memory that every session loads.",children:e.data&&v.jsx(g5,{items:i,keyOf:r=>r.path,searchText:r=>r.label,empty:"No instruction files.",render:r=>v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(M3,{size:12,className:"shrink-0"}),v.jsx("span",{className:xe("min-w-0 truncate font-mono text-[11px]",!r.exists&&"opacity-50"),children:r.label}),r.scope==="user"&&v.jsx(ds,{}),v.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground",children:r.exists?uS[r.group]:"new"})]}),detail:r=>v.jsx(O2,{path:r.path,title:r.label,badge:r.scope==="user"?v.jsx(ds,{}):null,onSaved:e.reload},r.path)})})}const Y9={agents:{title:"Agents",description:"Subagents Claude can delegate to. Ticked ones are on in new sessions.",empty:"No agents defined. Claude still has its built-in ones (Explore, Plan, general-purpose)."},skills:{title:"Skills",description:"Instructions Claude loads when a task matches. Ticked ones are on in new sessions.",empty:"No skills installed."},commands:{title:"Commands",description:"Slash commands, typed as /name.",empty:"No custom commands."}};function dm({kind:e}){const i=Kh(),r=Cv(),s=Y9[e];return v.jsx(ic,{title:s.title,description:s.description,children:i.data&&v.jsx(g5,{items:i.data[e],keyOf:l=>l.path||`${l.scope}:${l.name}`,searchText:l=>`${l.name} ${l.description}`,empty:s.empty,leading:e==="commands"?void 0:l=>v.jsx(Ev,{defaults:r,kind:e,id:l.name,plugin:l.plugin}),render:l=>v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e==="commands"?`/${l.name}`:l.name}),vh(l,i.data.plugins)&&v.jsx(ds,{})]}),l.description&&v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.description})]}),detail:l=>v.jsxs("div",{className:"space-y-3",children:[l.description&&v.jsx("p",{className:"text-xs text-muted-foreground",children:l.description}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.jsx(nt,{tone:"off",children:l.scope}),l.plugin&&v.jsx(nt,{tone:"off",children:l.plugin}),l.model&&v.jsxs(nt,{tone:"off",children:["model: ",l.model]})]}),l.scope==="built-in"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("h2",{className:"font-mono text-sm font-semibold",children:l.name}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Built into Claude Code, so there is no file to show or edit. It can be turned off per session in its Toolset tab, or in a preset."})]}):v.jsx(O2,{path:l.path,title:e==="commands"?`/${l.name}`:l.name,badge:vh(l,i.data.plugins)?v.jsx(ds,{}):null,subtitle:l.path,onSaved:i.reload},l.path)]})})})}function v5({items:e,row:i,empty:r,footer:s}){return v.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-5",children:[!e.length&&v.jsx(nn,{title:r}),m5(e).map(([l,f])=>v.jsx(bv,{title:p5[l],badge:v.jsx(nt,{tone:"off",children:f.length}),defaultOpen:!0,children:v.jsx("div",{className:"divide-y rounded-md border bg-background",children:f.map((p,a)=>i(p,a))})},l)),s]})}function X9(){const e=Kh(),i=Cv();return v.jsx(ic,{title:"MCP servers",description:"Servers configured in files. claude.ai connectors are not listed.",children:e.data&&v.jsx(v5,{items:e.data.mcpServers,empty:"No MCP servers configured in files.",footer:v.jsx(V9,{}),row:r=>v.jsxs("div",{className:xe("flex items-center gap-2 px-3 py-2",r.disabled&&"opacity-50"),children:[v.jsx(Ev,{defaults:i,kind:"mcp",id:i==null?void 0:i.mcpId(r.name),plugin:r.plugin}),v.jsx(Vl,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:r.name}),vh(r,e.data.plugins)&&v.jsx(ds,{}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-muted-foreground",title:r.target,children:r.target}),r.disabled&&v.jsx(nt,{tone:"off",children:"disabled"}),v.jsx(nt,{tone:"off",children:r.transport})]},`${r.scope}:${r.name}`)})})}function K9(){const e=Kh();return v.jsx(ic,{title:"Hooks",description:"Your hooks, from settings files and plugins.",children:e.data&&v.jsx(v5,{items:e.data.hooks,empty:"No hooks configured.",row:(i,r)=>v.jsxs("div",{className:"px-3 py-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:[v.jsx("span",{className:"font-mono",children:i.event}),vh(i,e.data.plugins)&&v.jsx(ds,{}),i.matcher&&v.jsx(nt,{tone:"off",children:i.matcher}),v.jsx(nt,{tone:"off",children:i.type}),i.plugin&&v.jsx("span",{className:"text-muted-foreground",children:i.plugin.split("@")[0]})]}),v.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:i.summary,children:i.summary})]},r)})})}function Q9(){var l;const e=Kh(),i=Cv(),r=((l=e.data)==null?void 0:l.plugins)??[],s=f=>{const p=d=>d.filter(m=>m.plugin===f).length,a=e.data;return[[p(a.agents),"agents"],[p(a.skills),"skills"],[p(a.commands),"commands"],[a.mcpServers.filter(d=>d.plugin===f).length,"MCP"],[a.hooks.filter(d=>d.plugin===f).length,"hooks"]].filter(([d])=>d).map(([d,m])=>`${d} ${m}`).join(" · ")};return v.jsx(ic,{title:"Plugins",description:"Installed plugins and what each adds.",children:e.data&&v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:r.length?v.jsx("div",{className:"divide-y rounded-md border",children:r.map(f=>v.jsxs("div",{className:xe("px-3 py-2",!f.enabled&&"opacity-50"),children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[f.enabled&&v.jsx(Ev,{defaults:i,kind:"plugins",id:f.id}),v.jsx("span",{className:"min-w-0 break-all font-mono text-[11px]",children:f.id}),f.scope==="user"&&v.jsx(ds,{}),v.jsxs(nt,{tone:"off",children:["v",f.version]}),v.jsx(nt,{tone:f.enabled?"success":"off",children:f.enabled?"enabled":"disabled"}),v.jsx(nt,{tone:"off",children:f.scope})]}),v.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:s(f.id)||"Nothing this hub can list."})]},f.id))}):v.jsx(nn,{title:"No plugins installed."})})})}function _5(){const e=pn();return async i=>{if(!i.length)return;const{drafts:r,drop:s}=en.getState(),l=i.filter(_=>rs(r[_]));if(l.length&&!await e({title:l.length===1?`Close ${l[0].split("/").pop()} without saving?`:`Close ${l.length} files without saving?`,description:"Their unsaved edits are lost.",body:l.length>1?v.jsx("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:l.map(x=>v.jsx("div",{children:x},x))}):void 0,confirmLabel:"Discard and close",tone:"destructive"}))return;for(const _ of i)s(_);const{view:f,go:p,sessions:a}=ye.getState(),h=f.kind==="file"?f.path:null,d=new Map(i.map(_=>[_,$4(_)])),m=Bn.getState().close(i,h);if(!h||m===h)return;const c=d.get(h);if(c&&a.some(_=>_.id===c))return p({kind:"session",id:c});p(m?{kind:"file",path:m}:{kind:"page",page:"overview"})}}function Z9({path:e,x:i,y:r,onClose:s}){const l=Bn(h=>h.tabs),f=_5();P.useEffect(()=>{const h=()=>s(),d=m=>m.key==="Escape"&&s();return window.addEventListener("pointerdown",h),window.addEventListener("keydown",d),()=>{window.removeEventListener("pointerdown",h),window.removeEventListener("keydown",d)}},[s]);const p=l.findIndex(h=>h.path===e),a=[["Close",En,()=>void f([e])],["Close Others",$s,()=>void f(l.filter(h=>h.path!==e).map(h=>h.path)),l.length<2],["Close to the Right",$s,()=>void f(l.slice(p+1).map(h=>h.path)),p===l.length-1],["Close All",$s,()=>void f(l.map(h=>h.path))],["Copy Relative Path",xh,()=>{var h;return void((h=navigator.clipboard)==null?void 0:h.writeText(e))}],["Reveal in File Explorer",ca,()=>void rt(()=>Xt.reveal(e))]];return v.jsx("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-230)},onPointerDown:h=>h.stopPropagation(),children:a.map(([h,d,m,c],_)=>v.jsxs("button",{disabled:c,onClick:()=>{s(),m()},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",_===4&&"mt-1 border-t pt-2"),children:[v.jsx(d,{size:13}),h]},h))})}function J9({active:e}){const i=Bn(x=>x.tabs),{pin:r,reorder:s}=Bn.getState(),l=en(x=>x.drafts),f=ye(x=>x.go),p=_5(),[a,h]=P.useState(null),[d,m]=P.useState(null),c=P.useRef(null);if(P.useEffect(()=>{var x,E;e&&((E=(x=c.current)==null?void 0:x.querySelector(`[data-path="${CSS.escape(e)}"]`))==null||E.scrollIntoView({block:"nearest",inline:"nearest"}))},[e,i.length]),!i.length)return null;const _=i.map(x=>x.path.split("/").pop()??x.path);return v.jsxs("div",{ref:c,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[a&&v.jsx(Z9,{...a,onClose:()=>h(null)}),i.map((x,E)=>{const w=_[E],g=_.filter(T=>T===w).length>1,b=x.path.includes("/")?x.path.slice(0,x.path.lastIndexOf("/")):"",S=rs(l[x.path]),y=x.path===e;return v.jsxs("div",{"data-path":x.path,draggable:!0,title:x.path,onClick:()=>f({kind:"file",path:x.path}),onDoubleClick:()=>r(x.path),onAuxClick:T=>{T.button===1&&(T.preventDefault(),p([x.path]))},onContextMenu:T=>{T.preventDefault(),h({path:x.path,x:T.clientX,y:T.clientY})},onDragStart:T=>{m(x.path),T.dataTransfer.effectAllowed="move"},onDragOver:T=>{!d||d===x.path||(T.preventDefault(),s(d,x.path))},onDragEnd:()=>m(null),className:xe("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",y?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground",d===x.path&&"opacity-50"),children:[v.jsx(z2,{name:w,size:13}),v.jsx("span",{className:xe("truncate",x.preview&&"italic"),children:w}),g&&b&&v.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b}),v.jsx("button",{"aria-label":`Close ${w}`,title:"Close",onClick:T=>{T.stopPropagation(),p([x.path])},className:xe("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!S&&!y&&"invisible group-hover:visible"),children:S?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"h-2 w-2 rounded-full bg-foreground group-hover:hidden"}),v.jsx(En,{size:12,className:"hidden group-hover:block"})]}):v.jsx(En,{size:12})})]},x.path)})]})}const hS="clauder-hub:sidebar-collapsed";function dS({text:e,failed:i}){const r=i?AS:_S;return v.jsxs("div",{role:i?"alert":"status",className:xe("fixed bottom-4 left-1/2 z-[60] flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-xl px-3.5 py-2.5 text-xs opacity-85 shadow-lg shadow-black/25 transition-opacity animate-in fade-in-0 slide-in-from-bottom-2 hover:opacity-100 sm:max-w-lg",i?"bg-primary text-primary-foreground":"bg-success text-success-foreground"),children:[v.jsx(r,{size:15,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 break-words",children:e})]})}const eB={overview:()=>v.jsx(I9,{}),inbox:()=>v.jsx(B9,{}),automation:()=>v.jsx(s6,{}),instructions:()=>v.jsx(G9,{}),agents:()=>v.jsx(dm,{kind:"agents"},"agents"),skills:()=>v.jsx(dm,{kind:"skills"},"skills"),commands:()=>v.jsx(dm,{kind:"commands"},"commands"),"mcp-servers":()=>v.jsx(X9,{}),hooks:()=>v.jsx(K9,{}),plugins:()=>v.jsx(Q9,{}),channels:()=>v.jsx(lC,{}),"hub-prompts":()=>v.jsx(f8,{}),"claude-settings":()=>v.jsx(uL,{}),"mcp-suggestions":()=>v.jsx(P9,{}),presets:()=>v.jsx(U9,{}),categories:()=>v.jsx(d6,{})};function tB(){const{boot:e,view:i,toast:r,health:s,windowed:l,projectId:f}=ye(),[p,a]=P.useState(null),h=ph("clauder-hub:sidebar-width",280,{min:220,max:480}),d=ph("clauder-hub:live-panel-width",260,{min:200,max:420}),m=Gh(T=>T.open),c=P2("(min-width: 768px)"),[_,x]=P.useState(!1),[E,w]=P.useState(()=>{try{return localStorage.getItem(hS)==="1"}catch{return!1}});P.useEffect(()=>{try{localStorage.setItem(hS,E?"1":"0")}catch{}},[E]),P.useEffect(()=>x(!1),[i,c]);const g=ye(T=>T.sessions.some(L=>L.live)),b=Bn(T=>T.tabs.length>0),S=g||b;if(P.useEffect(()=>{if(!S)return;const T=L=>{L.preventDefault(),L.returnValue=""};return window.addEventListener("beforeunload",T),()=>window.removeEventListener("beforeunload",T)},[S]),P.useEffect(()=>{if(l)return;const T=L=>{!L.ctrlKey||L.altKey||L.metaKey||L.code!=="Backquote"||(L.preventDefault(),L.stopPropagation(),w(!1),c||x(!0),window.setTimeout(()=>window.dispatchEvent(new Event(tg)),30))};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[l,c]),P.useEffect(()=>{if(!_)return;const T=L=>L.key==="Escape"&&x(!1);return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[_]),P.useEffect(()=>{e().catch(T=>a(T.message))},[e]),P.useEffect(()=>{s&&(document.title=s.project)},[s]),!s)return v.jsx("div",{className:"grid h-screen place-items-center text-xs text-muted-foreground",children:"Opening the project..."});if(f===hr)return v.jsxs(Ty,{children:[v.jsx(N9,{}),(p||r)&&v.jsx(dS,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]});const y=i.kind==="session"?v.jsx(h5,{id:i.id},i.id):i.kind==="file"?v.jsx(u8,{path:i.path},i.path):eB[i.page]();return v.jsx(Ty,{children:v.jsxs("div",{className:"flex h-screen overflow-hidden",children:[!l&&c&&v.jsx(Xb,{width:h.width,collapsed:E,onToggle:()=>w(!E)}),!l&&c&&!E&&v.jsx(mh,{onDrag:h.resizeBy,onReset:h.reset}),!l&&!c&&v.jsxs(v.Fragment,{children:[_&&v.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>x(!1)}),v.jsx("div",{inert:!_,className:xe("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",_?"translate-x-0 shadow-xl":"-translate-x-full"),children:v.jsx(Xb,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>x(!1),drawer:!0})})]}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&!c&&v.jsx(Q8,{onMenu:()=>x(!0)}),v.jsx(d5,{}),!l&&v.jsx(J8,{}),!l&&v.jsx(J9,{active:i.kind==="file"?i.path:null}),v.jsx("div",{className:"min-h-0 flex-1",children:y})]}),!l&&c&&m&&v.jsx(mh,{onDrag:T=>d.resizeBy(-T),onReset:d.reset}),!l&&c&&m&&v.jsx(r5,{width:d.width}),(p||r)&&v.jsx(dS,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]},f)})}y3.createRoot(document.getElementById("root")).render(v.jsx(Tl.StrictMode,{children:v.jsx(tB,{})}));export{Tl as W,mL as _,Xt as f,ng as g,v as j,P as r,ye as u};
609
+ `),i==null||i())},h.onclose=()=>l("closed");const c=f.onData(x=>d({type:"input",data:x})),_=new ResizeObserver(()=>{try{p.fit(),m()}catch{}});return _.observe(r.current),()=>{_.disconnect(),a.dispose(),c.dispose(),h.close(),f.dispose()}},[e]),v.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden rounded-lg border bg-[#141413]",children:[v.jsx("div",{ref:r,className:"terminal-host h-full w-full",onContextMenu:f=>f.preventDefault()}),s==="connecting"&&v.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"connecting..."}),s==="closed"&&v.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"detached"})]})}function u5({trigger:e,title:i,icon:r,badge:s,description:l,open:f,onOpenChange:p,children:a}){return v.jsxs(Tw,{open:f,onOpenChange:p,children:[v.jsx(yR,{asChild:!0,children:e}),v.jsxs(Lw,{children:[v.jsx(Dw,{className:"fixed inset-0 z-50 bg-foreground/30 animate-in fade-in-0"}),v.jsxs(Mw,{className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l bg-card shadow-xl focus:outline-none animate-in slide-in-from-right",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-3",children:[r,s,v.jsx(Ow,{className:"min-w-0 truncate text-sm font-semibold",children:i}),v.jsx(Nw,{className:"sr-only",children:l}),v.jsx(Bw,{asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto","aria-label":"Close",children:v.jsx(vn,{size:15})})})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:a})]})]})]})}function h5({id:e}){const i=ye(y=>y.sessions.find(T=>T.id===e)),r=ye(y=>y.transcriptTicks[e]??0),s=ye(y=>y.ticks.interactions),[l,f]=P.useState(null),[p,a]=P.useState("terminal"),[h,d]=P.useState(!1),m=ye(y=>y.windowed),c=pn(),_=$h(),[x,E]=P.useState("idle"),w=P.useRef(!1);if(P.useEffect(()=>{w.current||!i||(w.current=!0,!i.live&&(E("starting"),ve.resumeSession(e).then(()=>E("idle"),y=>{E("failed"),ye.getState().notify(y.message,"error")})))},[e,i]),P.useEffect(()=>{f(null),d(!1),a("terminal")},[e]),P.useEffect(()=>{let y=!1;return ve.session(e).then(T=>!y&&f(T),()=>!y&&d(!0)),()=>{y=!0}},[e,r,s,i==null?void 0:i.status,i==null?void 0:i.terminalId]),!i&&h)return v.jsx(nn,{title:"This session is gone.",hint:"Its transcript may have been cleaned up by Claude Code.",className:"m-6"});if(!i)return v.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Loading..."});const g=((l==null?void 0:l.interactions)??[]).filter(y=>y.status==="open"),b=()=>rt(()=>ve.resumeSession(e)),S=()=>c({title:"Stop this session?",description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(e),Uh([e])}});return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("header",{className:"flex items-center gap-3 border-b px-3 py-3 sm:px-5",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Wh,{session:i}),v.jsx("h1",{className:"truncate text-sm font-semibold",children:i.title})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground",children:[v.jsx(nt,{tone:i.status==="waiting"?"warning":i.status==="running"?"success":i.status==="done"?"on":"off",children:i.status}),v.jsx(nt,{tone:"off",children:i.origin==="external"?"started in a terminal":`from ${i.origin}`}),i.category&&v.jsxs(nt,{tone:"off",children:["category: ",i.category]}),i.purpose&&v.jsxs(nt,{tone:"on",icon:Gl,children:["hub task: ",i.purpose.title]}),v.jsx("span",{children:Ws(i.startedAt)}),i.tokens&&v.jsxs("span",{children:["· ",On(os(i.tokens))," tokens"]}),v.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1 font-mono",title:"Claude Code session id",children:[v.jsx("span",{className:"truncate",children:i.id}),v.jsx(Nl,{text:i.id})]})]})]}),v.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[v.jsx(_e,{variant:"ghost",size:"icon",title:"Rename","aria-label":"Rename",onClick:()=>void _.rename(i),children:v.jsx(Vi,{size:13})}),v.jsx(_e,{variant:"ghost",size:"icon",title:i.live?"Stop and delete permanently":"Delete permanently","aria-label":"Delete permanently",onClick:()=>void _.remove(i),children:v.jsx(yr,{size:13})}),!m&&v.jsxs(_e,{variant:"ghost",title:"Open in a window of its own","aria-label":"New window",onClick:()=>dg({kind:"session",id:e}),children:[v.jsx(ma,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"New window"})]}),i.live?v.jsxs(_e,{variant:"muted",title:"Stop","aria-label":"Stop",onClick:()=>void S(),children:[v.jsx(bh,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Stop"})]}):v.jsxs(_e,{variant:"primary",title:"Resume here","aria-label":"Resume here",onClick:()=>void b(),children:[v.jsx(ua,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Resume here"})]})]})]}),v.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b px-2 sm:px-4",children:[["terminal","Terminal"],["setup","Setup"],["activity","Activity"],["toolset","Toolset"],["interactions",`Interactions${l!=null&&l.interactions.length?` (${l.interactions.length})`:""}`]].map(([y,T])=>v.jsx("button",{onClick:()=>a(y),className:xe("shrink-0 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",p===y?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:T},y))}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[v.jsxs("div",{className:xe("relative h-full p-2 sm:p-3",p!=="terminal"&&"hidden"),children:[v.jsxs("div",{className:"absolute right-4 top-4 z-10 flex gap-1.5 sm:right-5 sm:top-5",children:[v.jsx(L9,{items:g}),i.purpose&&(l==null?void 0:l.purposeNote)&&v.jsx(A9,{title:i.purpose.title,note:l.purposeNote})]}),i.terminalId?v.jsx(R9,{terminalId:i.terminalId},i.terminalId):v.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 rounded-lg border border-dashed",children:[x==="starting"?v.jsx("div",{className:"text-xs text-muted-foreground",children:"Starting the terminal..."}):v.jsxs(_e,{variant:"primary",size:"md",onClick:()=>void b(),children:[v.jsx(ua,{size:13})," Start the terminal again"]}),i.done&&v.jsxs("div",{className:"card max-w-lg p-3 text-xs",children:[v.jsx("div",{className:"font-medium",children:i.done.summary}),Object.entries(i.done.deliverables??{}).map(([y,T])=>v.jsxs("div",{className:"mt-1 text-[11px]",children:[v.jsxs("span",{className:"font-medium",children:[y,": "]}),v.jsx("span",{className:"break-all text-muted-foreground",children:typeof T=="string"?T:JSON.stringify(T)})]},y))]})]})]}),p==="activity"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(o9,{data:l}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="setup"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(l9,{sessionId:e,live:i.live,current:l.setup}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="toolset"&&v.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?v.jsx(d9,{sessionId:e,live:i.live,current:l.toolset}):v.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="interactions"&&v.jsx("div",{className:"h-full space-y-2 overflow-y-auto p-4",children:l!=null&&l.interactions.length?l.interactions.map(y=>v.jsx(Hl,{interaction:y},y.id)):v.jsx(nn,{title:"Nothing asked yet.",hint:"Permission requests, questions, ends of turns and MCP suggestions from this session land here and on every channel."})})]})]})}function A9({title:e,note:i}){return v.jsx(u5,{title:e,icon:v.jsx(Gl,{size:14,className:"shrink-0 text-primary"}),badge:v.jsx(nt,{tone:"on",children:"hub task"}),description:"Parameters, samples and API of this hub task.",trigger:v.jsxs(_e,{variant:"primary",className:"shadow-md",title:"What this hub task is for: parameters, samples, API",children:[v.jsx(E3,{size:12})," ",v.jsx("span",{className:"hidden sm:inline",children:"Params & samples"})]}),children:v.jsx(pv,{className:"text-xs",children:i.replace(/^# .*\n+/,"")})})}function L9({items:e}){const[i,r]=P.useState(!1);return P.useEffect(()=>{i&&!e.length&&r(!1)},[i,e.length]),e.length?v.jsx(u5,{open:i,onOpenChange:r,title:`${e.length} waiting on you`,icon:v.jsx(ls,{size:14,className:"shrink-0 text-severity-warning"}),description:"Questions and requests this session is waiting on.",trigger:v.jsxs(_e,{className:"bg-severity-warning text-background shadow-md hover:bg-severity-warning/90",title:"What this session is waiting on",children:[v.jsx(ls,{size:12,className:"animate-status-pulse"})," ",e.length," ",v.jsx("span",{className:"hidden sm:inline",children:"waiting"})]}),children:v.jsx("div",{className:"space-y-2",children:e.map(s=>v.jsx(Hl,{interaction:s},s.id))})}):null}function d5(){const[e,i]=P.useState(null),[r,s]=P.useState(!1),[l,f]=P.useState(!1);P.useEffect(()=>{let m=!0;return ve.hub().then(c=>m&&i(c.claudeStatus)).catch(()=>{}),()=>{m=!1}},[]);const p=async()=>{s(!0);try{i(await ve.checkClaude())}catch{}finally{s(!1)}},a=(e==null?void 0:e.problem)??null,h=e===null;if(P.useEffect(()=>{if(!a&&!h)return;const m=setInterval(()=>void(a?p():ve.hub().then(c=>i(c.claudeStatus)).catch(()=>{})),a?3e4:5e3);return()=>clearInterval(m)},[a,h]),!(e!=null&&e.problem))return null;const d=()=>{var m;(m=navigator.clipboard)==null||m.writeText(e.fix??"").then(()=>{f(!0),setTimeout(()=>f(!1),1500)})};return v.jsxs("div",{role:"alert",className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b bg-destructive/15 px-5 py-2 text-xs",children:[v.jsx(AS,{size:14,className:"shrink-0 text-destructive"}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("b",{children:e.message})," Sessions, runs and chat commands cannot start until then."]}),e.fix&&v.jsxs("span",{className:"flex items-center gap-1",children:["Run",v.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:e.fix}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:d,title:l?"Copied":"Copy","aria-label":"Copy the command",children:v.jsx(xh,{size:12})}),e.problem==="missing"?"in a terminal, then sign in with":"in a terminal on this machine.",e.problem==="missing"&&v.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:"claude auth login"})]}),v.jsxs(_e,{variant:"muted",onClick:()=>void p(),disabled:r,className:"ml-auto",children:[v.jsx(yh,{size:12,className:r?"animate-spin":void 0}),r?"Checking...":"Check again"]})]})}const hm=[{page:"overview",label:"Projects",icon:H3},{page:"inbox",label:"Inbox",icon:P3},{page:"channels",label:"Channels",icon:Wl}];let sS=null;function D9(){return sS??(sS=ve.folders().then(e=>e.home,()=>null)),sS}function oS(e,i){var r;(r=navigator.clipboard)==null||r.writeText(e).then(()=>ye.getState().notify(`Copied the ${i}.`),()=>ye.getState().notify("The browser did not allow copying.","error"))}function wv({project:e,x:i,y:r,onClose:s}){const l=ye(m=>m.openProject),f=pn(),p=()=>rt(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),a=()=>f({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),ye.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}});P.useEffect(()=>{const m=()=>s(),c=_=>_.key==="Escape"&&s();return window.addEventListener("pointerdown",m),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),window.addEventListener("keydown",c),()=>{window.removeEventListener("pointerdown",m),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m),window.removeEventListener("keydown",c)}},[s]);const h=async()=>{const m=await D9(),c=e.root,_=c.includes("\\")?"\\":"/",x=m&&c.toLowerCase().startsWith(`${m.replace(/[\\/]$/,"").toLowerCase()}${_}`);oS(x?`~${_}${c.slice(m.replace(/[\\/]$/,"").length+1)}`:c,"relative path")},d=(m,c,_,x={})=>{const E=c;return v.jsxs("button",{title:x.hint,onPointerDown:w=>{w.stopPropagation(),s(),_()},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",x.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[v.jsx(E,{size:13}),m]})};return v.jsxs("div",{role:"menu",className:"fixed z-50 w-56 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-232),top:Math.min(r,window.innerHeight-290)},onPointerDown:m=>m.stopPropagation(),children:[d("Open",Ul,()=>l(e.id)),v.jsx("div",{className:"my-1 border-t"}),e.paused?d("Allow notifications",ls,()=>void rt(()=>ve.pauseNotificationsIn(e.id,!1),`Notifications from ${e.name} are back on.`)):d("Do not disturb",la,()=>void rt(()=>ve.pauseNotificationsIn(e.id,!0),`No channel hears from ${e.name} now.`),{hint:"Pauses every channel of this project, and the global ones for it; questions still wait in the inbox"}),d(e.muted?"Hear on global channels":"Mute on global channels",e.muted?Wl:e4,()=>void p(),{hint:"Only the global channels; the project's own channels are not changed"}),v.jsx("div",{className:"my-1 border-t"}),d("Copy Path",Rl,()=>oS(e.root,"path")),d("Copy Relative Path",Rl,()=>void h(),{hint:"From your home folder, as ~/..."}),d("Reveal in File Explorer",ca,()=>void rt(()=>ve.revealIn(e.id))),v.jsx("div",{className:"my-1 border-t"}),d("Remove from the hub",yr,()=>void a(),{danger:!0,hint:"The folder and its saved settings stay"})]})}function M9({project:e}){const i=ye(a=>a.openProject),r=pn(),s=()=>rt(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),l=()=>r({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),ye.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}}),[f,p]=P.useState(null);return v.jsxs("div",{className:"card flex min-w-0 flex-col gap-2 p-3",onContextMenu:a=>{a.preventDefault(),p({x:a.clientX,y:a.clientY})},children:[f&&v.jsx(wv,{project:e,...f,onClose:()=>p(null)}),v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("button",{onClick:()=>i(e.id),className:"min-w-0 flex-1 text-left",title:e.root,children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-sm font-semibold hover:underline",children:e.name}),e.paused&&v.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-severity-warning/15 px-1 text-[9px] font-medium text-severity-warning",title:"Do not disturb: no channel hears from it",children:[v.jsx(la,{size:9})," DND"]})]}),v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:e.root})]}),v.jsx("button",{onClick:()=>void s(),title:e.muted?"Muted on the global channels: click to hear from it again":"Heard on the global channels: click to mute","aria-label":e.muted?`Unmute ${e.name}`:`Mute ${e.name}`,className:xe("shrink-0 rounded p-1 hover:bg-muted",e.muted?"text-muted-foreground":"text-foreground"),children:e.muted?v.jsx(la,{size:13}):v.jsx(ls,{size:13})}),v.jsx("button",{onClick:()=>void l(),title:"Remove from the hub","aria-label":`Remove ${e.name}`,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(vn,{size:13})})]}),v.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px]",children:[v.jsxs("span",{className:xe(e.waiting?"font-semibold text-severity-warning":"text-muted-foreground"),children:["⏳ ",e.waiting," waiting"]}),v.jsxs("span",{className:"text-muted-foreground",children:["▶️ ",e.running," running"]}),v.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:e.runningRun?`Running: ${e.runningRun}`:void 0,children:[v.jsx(F3,{size:11})," ",e.runningRun?"1 running, ":"",e.queued," queued"]})]}),v.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[v.jsxs("span",{className:"flex min-w-0 max-w-full items-center gap-1 truncate",title:e.nextCron?`${e.nextCron.name}: ${Ws(e.nextCron.at)}`:void 0,children:[v.jsx(_h,{size:11,className:"shrink-0"})," ",v.jsx("span",{className:"truncate",children:e.nextCron?`${e.nextCron.name} · ${Ws(e.nextCron.at)}`:"no cron job"})]}),v.jsxs("span",{title:"Sent and written in the sessions active today, cache reads left out",children:[e.activeToday," active today · ",On(e.tokensToday)," tokens"]})]})]})}function f5({children:e}){return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsx("div",{className:"mx-auto max-w-6xl space-y-4 p-5",children:e})})}function j9(){var s;const[e,i]=P.useState(!1),r=ut(()=>ve.globalOverview(),["projects","sessions","interactions","runs","jobs","channels"]);return v.jsxs(f5,{children:[v.jsx(Er,{group:"Global",title:"Projects",description:"Every project in the hub, most recently opened first. The bell says whether the global channels hear from it.",action:v.jsxs(_e,{variant:"primary",onClick:()=>i(!0),children:[v.jsx(Qn,{size:12})," Open folder..."]})}),v.jsx(s5,{open:e,onOpenChange:i}),(s=r.data)!=null&&s.length?v.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",children:r.data.map(l=>v.jsx(M9,{project:l},l.id))}):v.jsx(nn,{variant:"inline",title:r.data?"No projects yet.":"Loading..."})]})}function O9(){var i;const e=ut(()=>ve.globalInbox(),["projects","interactions"]);return v.jsxs(f5,{children:[v.jsx(Er,{group:"Global",title:"Inbox",description:"Everything waiting on you, in every project."}),(i=e.data)!=null&&i.length?v.jsx("div",{className:"space-y-2",children:e.data.map(r=>v.jsx(Hl,{interaction:r,project:r.project,showSession:!0},`${r.project.id}:${r.id}`))}):v.jsx(nn,{icon:ls,title:e.data?"Nothing is waiting on you.":"Loading..."})]})}function aS({width:e,collapsed:i,onToggle:r,drawer:s=!1}){var S;const l=ye(y=>y.view),f=ye(y=>y.go),p=ye(y=>y.openProject),a=ye(y=>y.sessions),h=ut(()=>ve.projects(),["projects"]),d=ut(()=>ve.globalOverview(),["projects","channels"]),[m,c]=P.useState(null),[_,x]=P.useState(!1),w=((S=ut(()=>ve.globalInbox(),["projects","interactions"]).data)==null?void 0:S.length)??0,g=a.filter(y=>y.origin!=="external"||y.live).slice(0,10),b=y=>l.kind==="page"&&(l.page===y||y==="overview"&&!hm.some(T=>T.page===l.page));return i?v.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[v.jsx(da,{className:"mb-2"}),hm.map(y=>v.jsx(ur,{content:`Global · ${y.label}`,side:"right",asChild:!0,children:v.jsx(_e,{variant:"ghost",size:"icon",className:xe(b(y.page)&&"bg-muted text-foreground"),onClick:()=>f({kind:"page",page:y.page}),children:v.jsx(y.icon,{size:15})})},y.page)),v.jsx("div",{className:"flex-1"}),v.jsx(_e,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:v.jsx(vS,{size:15})})]}):v.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[v.jsx(da,{}),v.jsxs("div",{className:"min-w-0",children:[v.jsx(Yh,{}),v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:"Global"}),v.jsx(yv,{})]})]}),v.jsx(_e,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":s?"Close menu":"Collapse sidebar",children:s?v.jsx(vn,{size:15}):v.jsx(gS,{size:15})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:[v.jsx("nav",{className:"px-2",children:hm.map(y=>v.jsxs("button",{onClick:()=>f({kind:"page",page:y.page}),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",b(y.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(y.icon,{size:14}),y.label,y.page==="inbox"&&w>0&&v.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:w})]},y.page))}),v.jsxs("div",{className:"mt-2 px-2",children:[v.jsxs("div",{className:"flex items-center px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Projects",v.jsx("button",{onClick:()=>x(!0),title:"Open folder...","aria-label":"Add a project",className:"ml-auto rounded p-0.5 hover:bg-muted hover:text-foreground",children:v.jsx(Qn,{size:12})})]}),m&&v.jsx(wv,{project:m.project,x:m.x,y:m.y,onClose:()=>c(null)}),(h.data??[]).map(y=>v.jsxs("button",{disabled:!y.exists,onClick:()=>p(y.id),onContextMenu:T=>{var R;T.preventDefault();const L=(R=d.data)==null?void 0:R.find(D=>D.id===y.id);c({project:{id:y.id,name:y.name,root:y.root,muted:L==null?void 0:L.muted,paused:L==null?void 0:L.paused},x:T.clientX,y:T.clientY})},title:y.root,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground disabled:opacity-50",children:[v.jsx(bS,{size:14,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.name}),y.waiting>0&&v.jsx("span",{className:"rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:y.waiting}),y.running>0&&v.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px]",title:`${y.running} running`,children:[v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success"})," ",y.running]})]},y.id)),h.data&&!h.data.length&&v.jsx("div",{className:"px-2 py-1 text-[11px] text-muted-foreground",children:"No projects yet."})]}),g.length>0&&v.jsxs("div",{className:"mt-2 px-2",children:[v.jsx("div",{className:"px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub tasks"}),g.map(y=>v.jsxs("button",{onClick:()=>f({kind:"session",id:y.id}),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors",l.kind==="session"&&l.id===y.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[v.jsx(Gl,{size:13,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.title}),v.jsx(Wh,{session:y})]},y.id))]})]}),v.jsxs("div",{className:"border-t px-2 py-2",children:[v.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>x(!0),children:[v.jsx(Qn,{size:13})," Open folder..."]}),v.jsx(s5,{open:_,onOpenChange:x})]})]})}const lS="clauder-hub:global-sidebar-collapsed";function N9(){const e=ye(m=>m.view),i=ph("clauder-hub:sidebar-width",280,{min:220,max:480}),r=ph("clauder-hub:live-panel-width",260,{min:200,max:420}),s=Gh(m=>m.open),l=P2("(min-width: 768px)"),[f,p]=P.useState(!1),[a,h]=P.useState(()=>{try{return localStorage.getItem(lS)==="1"}catch{return!1}});P.useEffect(()=>{document.title="Clauder Hub · Global"},[]),P.useEffect(()=>{try{localStorage.setItem(lS,a?"1":"0")}catch{}},[a]),P.useEffect(()=>p(!1),[e,l]);const d=e.kind==="session"?v.jsx(h5,{id:e.id},e.id):e.kind==="page"&&e.page==="inbox"?v.jsx(O9,{}):e.kind==="page"&&e.page==="channels"?v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsx("div",{className:"mx-auto max-w-6xl p-5",children:v.jsx(lC,{global:!0})})}):v.jsx(j9,{});return v.jsxs("div",{className:"flex h-screen overflow-hidden",children:[l&&v.jsx(aS,{width:i.width,collapsed:a,onToggle:()=>h(!a)}),l&&!a&&v.jsx(mh,{onDrag:i.resizeBy,onReset:i.reset}),!l&&v.jsxs(v.Fragment,{children:[f&&v.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>p(!1)}),v.jsx("div",{inert:!f,className:xe("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",f?"translate-x-0 shadow-xl":"-translate-x-full"),children:v.jsx(aS,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>p(!1),drawer:!0})})]}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[v.jsx(_e,{variant:"ghost",size:"icon",onClick:()=>p(!0),"aria-label":"Open menu",title:"Menu",children:v.jsx(SS,{size:16})}),v.jsx(da,{}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(Yh,{}),v.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Global"})]})]}),v.jsx(d5,{}),v.jsx("div",{className:"min-h-0 flex-1",children:d})]}),l&&s&&v.jsx(mh,{onDrag:m=>r.resizeBy(-m),onReset:r.reset}),l&&s&&v.jsx(r5,{width:r.width})]})}function B9(){const e=ye(s=>s.open),r=(ut(()=>ve.interactions(),["interactions"]).data??[]).filter(s=>s.status!=="open").slice(0,60);return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),v.jsx("h1",{className:"text-base font-semibold",children:"Inbox"}),v.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What sessions are waiting on. The first answer wins, from anywhere.",children:"What sessions are waiting on. The first answer wins, from anywhere."})]}),e.length?v.jsx("div",{className:"space-y-2",children:e.map(s=>v.jsx(Hl,{interaction:s,showSession:!0},s.id))}):v.jsx(nn,{icon:ls,title:"Nothing is waiting on you."}),r.length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("h2",{className:"pt-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Recent"}),r.map(s=>v.jsx(Hl,{interaction:s,showSession:!0,compact:!0},s.id))]})]})})}function P9(){var p;const e=ut(()=>ve.suggestions(),["mcp"]),i=ut(()=>ve.mcpSuggestionsEnabled(),["mcp"]),r=!!((p=i.data)!=null&&p.enabled),s=ye(a=>a.go),l=(e.data??[]).filter(a=>a.status==="suggested"),f=(e.data??[]).filter(a=>a.status!=="suggested");return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Settings",title:"MCP suggestions",description:"Servers that blocked sessions asked for. Nothing installs without you.",action:v.jsxs(_e,{onClick:()=>s({kind:"page",page:"mcp-servers"}),children:[v.jsx(Vl,{size:12})," Configured servers"]})}),v.jsx(Dt,{title:"Suggest MCP servers",description:"When on, sessions are told they may stop and ask for a missing MCP server. Off: that part of the system prompt is left out. Applies to sessions started from now on.",action:v.jsx("button",{role:"switch","aria-checked":r,"aria-label":"Suggest MCP servers",disabled:!i.data,onClick:()=>void rt(()=>ve.setMcpSuggestionsEnabled(!r),r?"MCP suggestions off.":"MCP suggestions on."),className:xe("relative h-5 w-9 shrink-0 rounded-full transition-colors",r?"bg-primary":"bg-foreground/20"),children:v.jsx("span",{className:xe("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",r?"left-[18px]":"left-0.5")})}),children:null}),v.jsx(Dt,{title:`Waiting (${l.length})`,children:l.length?v.jsx("div",{className:"space-y-2",children:l.map(a=>v.jsx(cS,{suggestion:a},a.id))}):v.jsx(nn,{variant:"inline",title:"No session is waiting on an MCP server."})}),f.length>0&&v.jsx(Dt,{title:"History",children:v.jsx("div",{className:"space-y-2",children:f.map(a=>v.jsx(cS,{suggestion:a},a.id))})})]})})}function cS({suggestion:e}){const i=ye(a=>a.go),r=pn(),s=e.status==="installed"?"success":e.status==="failed"?"critical":e.status==="suggested"?"warning":"off",l=()=>r({title:`Install '${e.name}'?`,description:"Adds it to this project's .mcp.json.",body:v.jsxs("div",{className:"space-y-2",children:[v.jsx("pre",{className:"whitespace-pre-wrap rounded bg-muted p-3 font-mono text-[11px]",children:e.runs}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"If it succeeds, the session that asked is restarted on the same conversation so the server loads, and is told to continue."})]}),confirmLabel:"Run it",run:async()=>{const a=await ve.installSuggestion(e.id);ye.getState().notify(a.status==="installed"?"Installed; the session is resuming.":"The install failed; see its output.",a.status==="installed"?"info":"error")}}),f=()=>r({title:`Carry on without '${e.name}'?`,description:"The session continues without it.",confirmLabel:"Skip it",run:()=>ve.skipSuggestion(e.id)}),p=()=>r({title:"Remove this suggestion from the history?",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteSuggestion(e.id)});return v.jsxs("div",{className:"rounded-md border p-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx(Vl,{size:14,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 break-all text-xs font-semibold",children:e.name}),v.jsx(nt,{tone:s,children:e.status}),v.jsxs("button",{className:"text-[11px] text-muted-foreground hover:underline",onClick:()=>i({kind:"session",id:e.sessionId}),children:["from session ",e.sessionId.slice(0,8)]}),v.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:va(e.createdAt)})]}),v.jsx("div",{className:"mt-1.5 break-words text-xs text-muted-foreground",children:e.reason}),v.jsx("pre",{className:"mt-1.5 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 font-mono text-[11px]",children:e.runs??e.command}),e.refused&&v.jsx("div",{className:"mt-1 text-[11px] text-severity-critical",children:e.refused}),e.output&&v.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap rounded border p-2 font-mono text-[10px] text-muted-foreground",children:e.output}),v.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e.status==="suggested"&&v.jsxs(v.Fragment,{children:[v.jsxs(_e,{variant:"primary",disabled:!e.runs,onClick:()=>void l(),children:[v.jsx(L3,{size:12})," Install & resume"]}),v.jsxs(_e,{onClick:()=>void f(),children:[v.jsx(vn,{size:12})," Skip"]})]}),e.docs&&v.jsx("a",{href:e.docs,target:"_blank",rel:"noreferrer",children:v.jsxs(_e,{variant:"ghost",children:[v.jsx(ma,{size:12})," Docs"]})}),e.status!=="suggested"&&v.jsx(_e,{variant:"ghost",className:"ml-auto",onClick:()=>void p(),children:v.jsx(yr,{size:12})})]})]})}function I9(){const e=ut(()=>ve.stats(),["sessions","transcript"]),i=ut(()=>ve.inventory(),["sessions"]),r=ye(l=>l.sessions),s=e.data;return v.jsx("div",{className:"h-full overflow-y-auto",children:v.jsxs("div",{className:"space-y-4 p-5",children:[v.jsx(Er,{group:"Operation",title:"Overview",description:"Stats from this project's Claude Code transcripts."}),v.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[v.jsx(ss,{label:"Sessions",value:String((s==null?void 0:s.sessions)??"-")}),v.jsx(ss,{label:"Live now",value:String(r.filter(l=>l.live).length)}),v.jsx(ss,{label:"Waiting on you",value:String(r.filter(l=>l.status==="waiting").length)}),v.jsx(ss,{label:"Tool calls",value:s?On(Object.values(s.tools).reduce((l,f)=>l+f.count,0)):"-"})]}),s&&v.jsx(oC,{tokens:s.tokens}),s&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[v.jsx(Dt,{title:"Output tokens per day",className:"lg:col-span-2",children:v.jsx(u6,{days:s.byDay,valueOf:l=>l.output,label:"output tokens"})}),v.jsx(Dt,{title:"Tokens by model",children:v.jsx(as,{rows:Object.entries(s.byModel).filter(([,l])=>os(l)>0).map(([l,f])=>({key:l,label:l,value:os(f)}))})})]}),v.jsx(o5,{tools:s.tools}),v.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[v.jsx(Dt,{title:"Subagents by type",description:"How often each was spawned, with its own tokens.",children:v.jsx(as,{rows:Object.entries(s.agents).map(([l,f])=>({key:l,label:l,value:f.count,sublabel:`${On(os(f.tokens))} tok`})),format:String,empty:"No subagents yet."})}),v.jsx(Dt,{title:"Skills & commands",children:v.jsx(as,{rows:Object.entries(s.skills).map(([l,f])=>({key:l,label:l,value:f})),format:String,empty:"No skills used yet."})})]})]}),e.error&&v.jsx("div",{className:"text-xs text-severity-critical",children:e.error}),i.data&&v.jsx(H9,{inventory:i.data})]})})}const z9=[{page:"agents",label:"Agents",count:e=>e.agents.length},{page:"skills",label:"Skills",count:e=>e.skills.length},{page:"commands",label:"Commands",count:e=>e.commands.length},{page:"mcp-servers",label:"MCP servers",count:e=>e.mcpServers.length},{page:"hooks",label:"Hooks",count:e=>e.hooks.length},{page:"plugins",label:"Plugins",count:e=>e.plugins.filter(i=>i.enabled).length}];function H9({inventory:e}){const i=ye(r=>r.go);return v.jsx(Dt,{title:"What sessions can reach for",description:"All scopes together: this project, your user config and enabled plugins. Open one under Project.",children:v.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-6",children:z9.map(r=>v.jsxs("button",{onClick:()=>i({kind:"page",page:r.page}),className:"rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted",children:[v.jsx("div",{className:"text-[11px] text-muted-foreground",children:r.label}),v.jsx("div",{className:"text-lg font-semibold tabular-nums",children:r.count(e)})]},r.page))})})}const F9={name:"",toolset:{agents:[],skills:[],mcp:[],plugins:[]},isDefault:!1};function U9(){const e=ut(()=>ve.presets(),["jobs"]),i=ut(()=>ve.toolsetCatalog(),[]),{starting:r,start:s}=Zs(),[l,f]=P.useState(null),[p,a]=P.useState(!1),h=_=>{f(_),a(_!==null)},d=e.data??[],m=l==="new"?null:d.find(_=>_.id===l)??d[0]??null,c=l==="new"||!d.length&&e.data!==null;return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Settings",title:"Toolset presets",description:"Named sets of agents, skills, MCP servers and plugins to turn off.",action:v.jsxs(_e,{variant:"primary",disabled:r,onClick:()=>void s("create-preset"),title:"Opens a Claude session to describe the preset",children:[v.jsx(Qn,{size:12})," New preset"]})})}),v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:xe("w-full shrink-0 space-y-0.5 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",p&&"hidden"),children:[d.map(_=>v.jsxs("button",{onClick:()=>h(_.id),className:xe("block w-full rounded-md px-2 py-1.5 text-left text-foreground",(m==null?void 0:m.id)===_.id&&!c?"bg-muted":"hover:bg-muted/60"),children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ag,{size:12,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate text-xs",children:_.name}),_.isDefault&&v.jsx(nt,{tone:"on",children:"default"})]}),v.jsx("div",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:gh(_.toolset)?`${gh(_.toolset)} turned off`:"everything on"})]},_.id)),!d.length&&v.jsx(nn,{variant:"inline",title:"No presets yet."})]}),v.jsxs("div",{className:xe("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!p&&"hidden"),children:[v.jsx(Ig,{onClick:()=>a(!1)}),i.data&&(c||m)?v.jsx($9,{preset:c?F9:m,catalog:i.data,onSaved:_=>{e.reload(),f(_)},onDeleted:()=>{e.reload(),h(null)}},c?"new":m.id):null]})]})]})}function $9({preset:e,catalog:i,onSaved:r,onDeleted:s}){const l=pn(),{starting:f,start:p}=Zs(),[a,h]=P.useState(e);P.useEffect(()=>h(e),[e]);const d=JSON.stringify(a)!==JSON.stringify(e),m=async()=>{const _=await rt(()=>ve.savePreset(a),"Saved.");_&&r(_.id)},c=()=>l({title:`Delete the preset '${e.name}'?`,description:"Jobs using it fall back to the default.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deletePreset(e.id),ye.getState().notify("Deleted."),s()}});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[v.jsxs("div",{className:"flex min-w-0 flex-1 basis-48 items-center gap-3",children:[v.jsx(pi,{value:a.name,onChange:_=>h({...a,name:_.target.value}),placeholder:"Preset name",className:"max-w-xs",size:"md"}),v.jsx(Fh,{label:"Default for new sessions and jobs",checked:a.isDefault,onCheckedChange:_=>h({...a,isDefault:_})})]}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.id&&v.jsxs(_e,{variant:"ghost",disabled:f,onClick:()=>void p("edit-preset",e.id),title:"Describe the change to Claude instead of flipping switches",children:[v.jsx(cg,{size:12})," Edit with Claude"]}),e.id&&v.jsxs(_e,{variant:"ghost",onClick:()=>void c(),children:[v.jsx(yr,{size:12})," Delete"]}),d&&e.id&&v.jsx(_e,{onClick:()=>h(e),children:"Discard"}),v.jsx(_e,{variant:"primary",disabled:!a.name.trim()||!d&&!!e.id,onClick:()=>void m(),children:"Save"})]})]}),v.jsx(l5,{catalog:i,value:a.toolset,onChange:_=>h({...a,toolset:_})})]})}function q9(e){if(e.params.length){const i=e.params.filter(r=>r.required).map(r=>r.name);return{icon:I3,text:i.length?`Needs ${i.join(", ")}`:"Optional settings"}}return e.auth==="oauth"?{icon:$3,text:"Sign in after adding"}:{icon:$l,text:"Nothing to set up"}}function V9(){var s;const e=ut(()=>ve.mcpCatalog(),["mcp"]),{starting:i,start:r}=Zs();return(s=e.data)!=null&&s.length?v.jsx(Dt,{title:"Recommended",description:"Common servers. Adding one opens a hub task that asks for what it needs.",action:v.jsxs(_e,{disabled:i,onClick:()=>void r("add-mcp"),title:"Opens a hub task to add any MCP server",children:[v.jsx(cg,{size:12})," Add another server"]}),children:v.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:e.data.map(l=>{const f=q9(l);return v.jsxs("div",{className:"flex flex-col rounded-md border p-3",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate text-xs font-semibold",children:l.name}),v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.vendor})]}),v.jsx(nt,{tone:"off",children:l.category})]}),v.jsx("p",{className:"mt-1.5 line-clamp-2 flex-1 text-[11px] text-muted-foreground",title:l.description,children:l.description}),v.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[v.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1 truncate text-[10px] text-muted-foreground",title:f.text,children:[v.jsx(f.icon,{size:11,className:"shrink-0"})," ",v.jsx("span",{className:"truncate",children:f.text})]}),v.jsx("a",{href:l.docs,target:"_blank",rel:"noreferrer",title:"Docs",className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:v.jsx(ma,{size:12})}),l.installed?v.jsx(nt,{tone:"success",icon:$l,children:"added"}):v.jsxs(_e,{className:"shrink-0 bg-white text-neutral-900 hover:bg-white/85",disabled:i,onClick:()=>void r("add-mcp",l.id),children:[v.jsx(Qn,{size:12})," Add"]})]})]},l.id)})})}):null}const W9=["user","project","local","plugin","built-in"],p5={project:"This project (shared, in the repo)",local:"This project (local, only on this machine)",user:"You (every project)",plugin:"Plugins","built-in":"Built into Claude Code"};function vh(e,i){var r;return e.scope==="user"?!0:e.scope==="plugin"&&((r=i.find(s=>s.id===e.plugin))==null?void 0:r.scope)==="user"}function Kh(){return ut(()=>ve.inventory(),["sessions"])}function Cv(){var l;const e=ut(()=>ve.presets(),["jobs"]),i=ut(()=>ve.toolsetCatalog(),["sessions"]);return!e.data||!i.data?null:{off:((l=e.data.find(f=>f.isDefault))==null?void 0:l.toolset)??{agents:[],skills:[],mcp:[],plugins:[]},mcpId:f=>{var p;return(p=i.data.find(a=>a.kind==="mcp"&&a.label===f))==null?void 0:p.id}}}function Ev({defaults:e,kind:i,id:r,plugin:s}){if(!e||!r)return null;const l=!!(s&&e.off.plugins.includes(s));return v.jsx(Fh,{ariaLabel:`${r} in new sessions`,title:l?`Off with its plugin ${s}`:"On in new sessions (default preset)",disabled:l,checked:!l&&!e.off[i].includes(r),onCheckedChange:f=>void rt(()=>ve.setDefaultItem(i,r,f),`${r} ${f?"on":"off"} in new sessions.`)})}function m5(e){return W9.map(i=>[i,e.filter(r=>r.scope===i)]).filter(([,i])=>i.length)}function g5({items:e,keyOf:i,render:r,detail:s,searchText:l,empty:f,leading:p}){var g;const[a,h]=P.useState(""),[d,m]=P.useState(null),[c,_]=P.useState(!1),x=P.useMemo(()=>{const b=a.trim().toLowerCase();return b?e.filter(S=>l(S).toLowerCase().includes(b)):e},[e,a,l]),E=m5(x),w=e.find(b=>i(b)===d)??((g=E[0])==null?void 0:g[1][0])??null;return e.length?v.jsxs("div",{className:"flex min-h-0 flex-1",children:[v.jsxs("div",{className:xe("w-full shrink-0 overflow-y-auto p-3 md:block md:w-60 md:border-r lg:w-80",c&&"hidden"),children:[v.jsxs("div",{className:"relative mb-2",children:[v.jsx(lg,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(pi,{value:a,onChange:b=>h(b.target.value),placeholder:`Filter ${e.length}`,className:"pl-6"})]}),v.jsx("div",{className:"space-y-1.5",children:E.map(([b,S])=>v.jsx(bv,{title:p5[b],badge:v.jsx(nt,{tone:"off",children:S.length}),defaultOpen:!0,children:S.map(y=>v.jsxs("div",{className:xe("flex items-center gap-1 rounded-md",p&&"pl-2",w&&i(w)===i(y)?"bg-muted":"hover:bg-muted/60"),children:[p==null?void 0:p(y),v.jsx("button",{onClick:()=>{m(i(y)),_(!0)},className:"block min-w-0 flex-1 px-2 py-1.5 text-left text-foreground",children:r(y)})]},i(y)))},b))}),!E.length&&v.jsx("div",{className:"px-1 text-xs text-muted-foreground",children:"No match."})]}),v.jsxs("div",{className:xe("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!c&&"hidden"),children:[v.jsx(Ig,{onClick:()=>_(!1)}),w?s(w):null]})]}):v.jsx(nn,{title:f,className:"m-5"})}function ic({title:e,description:i,children:r}){return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsx("div",{className:"border-b px-5 py-4",children:v.jsx(Er,{group:"Project",title:e,description:i})}),r]})}const uS={memory:"CLAUDE.md",rules:"Rule","auto-memory":"Auto memory"};function G9(){const e=ut(()=>ve.memory(),[]),i=(e.data??[]).filter(r=>r.group in uS);return v.jsx(ic,{title:"Instructions",description:"CLAUDE.md, rules and memory that every session loads.",children:e.data&&v.jsx(g5,{items:i,keyOf:r=>r.path,searchText:r=>r.label,empty:"No instruction files.",render:r=>v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(M3,{size:12,className:"shrink-0"}),v.jsx("span",{className:xe("min-w-0 truncate font-mono text-[11px]",!r.exists&&"opacity-50"),children:r.label}),r.scope==="user"&&v.jsx(ds,{}),v.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground",children:r.exists?uS[r.group]:"new"})]}),detail:r=>v.jsx(O2,{path:r.path,title:r.label,badge:r.scope==="user"?v.jsx(ds,{}):null,onSaved:e.reload},r.path)})})}const Y9={agents:{title:"Agents",description:"Subagents Claude can delegate to. Ticked ones are on in new sessions.",empty:"No agents defined. Claude still has its built-in ones (Explore, Plan, general-purpose)."},skills:{title:"Skills",description:"Instructions Claude loads when a task matches. Ticked ones are on in new sessions.",empty:"No skills installed."},commands:{title:"Commands",description:"Slash commands, typed as /name.",empty:"No custom commands."}};function dm({kind:e}){const i=Kh(),r=Cv(),s=Y9[e];return v.jsx(ic,{title:s.title,description:s.description,children:i.data&&v.jsx(g5,{items:i.data[e],keyOf:l=>l.path||`${l.scope}:${l.name}`,searchText:l=>`${l.name} ${l.description}`,empty:s.empty,leading:e==="commands"?void 0:l=>v.jsx(Ev,{defaults:r,kind:e,id:l.name,plugin:l.plugin}),render:l=>v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e==="commands"?`/${l.name}`:l.name}),vh(l,i.data.plugins)&&v.jsx(ds,{})]}),l.description&&v.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.description})]}),detail:l=>v.jsxs("div",{className:"space-y-3",children:[l.description&&v.jsx("p",{className:"text-xs text-muted-foreground",children:l.description}),v.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.jsx(nt,{tone:"off",children:l.scope}),l.plugin&&v.jsx(nt,{tone:"off",children:l.plugin}),l.model&&v.jsxs(nt,{tone:"off",children:["model: ",l.model]})]}),l.scope==="built-in"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("h2",{className:"font-mono text-sm font-semibold",children:l.name}),v.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Built into Claude Code, so there is no file to show or edit. It can be turned off per session in its Toolset tab, or in a preset."})]}):v.jsx(O2,{path:l.path,title:e==="commands"?`/${l.name}`:l.name,badge:vh(l,i.data.plugins)?v.jsx(ds,{}):null,subtitle:l.path,onSaved:i.reload},l.path)]})})})}function v5({items:e,row:i,empty:r,footer:s}){return v.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-5",children:[!e.length&&v.jsx(nn,{title:r}),m5(e).map(([l,f])=>v.jsx(bv,{title:p5[l],badge:v.jsx(nt,{tone:"off",children:f.length}),defaultOpen:!0,children:v.jsx("div",{className:"divide-y rounded-md border bg-background",children:f.map((p,a)=>i(p,a))})},l)),s]})}function X9(){const e=Kh(),i=Cv();return v.jsx(ic,{title:"MCP servers",description:"Servers configured in files. claude.ai connectors are not listed.",children:e.data&&v.jsx(v5,{items:e.data.mcpServers,empty:"No MCP servers configured in files.",footer:v.jsx(V9,{}),row:r=>v.jsxs("div",{className:xe("flex items-center gap-2 px-3 py-2",r.disabled&&"opacity-50"),children:[v.jsx(Ev,{defaults:i,kind:"mcp",id:i==null?void 0:i.mcpId(r.name),plugin:r.plugin}),v.jsx(Vl,{size:13,className:"shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:r.name}),vh(r,e.data.plugins)&&v.jsx(ds,{}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-muted-foreground",title:r.target,children:r.target}),r.disabled&&v.jsx(nt,{tone:"off",children:"disabled"}),v.jsx(nt,{tone:"off",children:r.transport})]},`${r.scope}:${r.name}`)})})}function K9(){const e=Kh();return v.jsx(ic,{title:"Hooks",description:"Your hooks, from settings files and plugins.",children:e.data&&v.jsx(v5,{items:e.data.hooks,empty:"No hooks configured.",row:(i,r)=>v.jsxs("div",{className:"px-3 py-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:[v.jsx("span",{className:"font-mono",children:i.event}),vh(i,e.data.plugins)&&v.jsx(ds,{}),i.matcher&&v.jsx(nt,{tone:"off",children:i.matcher}),v.jsx(nt,{tone:"off",children:i.type}),i.plugin&&v.jsx("span",{className:"text-muted-foreground",children:i.plugin.split("@")[0]})]}),v.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:i.summary,children:i.summary})]},r)})})}function Q9(){var l;const e=Kh(),i=Cv(),r=((l=e.data)==null?void 0:l.plugins)??[],s=f=>{const p=d=>d.filter(m=>m.plugin===f).length,a=e.data;return[[p(a.agents),"agents"],[p(a.skills),"skills"],[p(a.commands),"commands"],[a.mcpServers.filter(d=>d.plugin===f).length,"MCP"],[a.hooks.filter(d=>d.plugin===f).length,"hooks"]].filter(([d])=>d).map(([d,m])=>`${d} ${m}`).join(" · ")};return v.jsx(ic,{title:"Plugins",description:"Installed plugins and what each adds.",children:e.data&&v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:r.length?v.jsx("div",{className:"divide-y rounded-md border",children:r.map(f=>v.jsxs("div",{className:xe("px-3 py-2",!f.enabled&&"opacity-50"),children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[f.enabled&&v.jsx(Ev,{defaults:i,kind:"plugins",id:f.id}),v.jsx("span",{className:"min-w-0 break-all font-mono text-[11px]",children:f.id}),f.scope==="user"&&v.jsx(ds,{}),v.jsxs(nt,{tone:"off",children:["v",f.version]}),v.jsx(nt,{tone:f.enabled?"success":"off",children:f.enabled?"enabled":"disabled"}),v.jsx(nt,{tone:"off",children:f.scope})]}),v.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:s(f.id)||"Nothing this hub can list."})]},f.id))}):v.jsx(nn,{title:"No plugins installed."})})})}function _5(){const e=pn();return async i=>{if(!i.length)return;const{drafts:r,drop:s}=en.getState(),l=i.filter(_=>rs(r[_]));if(l.length&&!await e({title:l.length===1?`Close ${l[0].split("/").pop()} without saving?`:`Close ${l.length} files without saving?`,description:"Their unsaved edits are lost.",body:l.length>1?v.jsx("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:l.map(x=>v.jsx("div",{children:x},x))}):void 0,confirmLabel:"Discard and close",tone:"destructive"}))return;for(const _ of i)s(_);const{view:f,go:p,sessions:a}=ye.getState(),h=f.kind==="file"?f.path:null,d=new Map(i.map(_=>[_,$4(_)])),m=Bn.getState().close(i,h);if(!h||m===h)return;const c=d.get(h);if(c&&a.some(_=>_.id===c))return p({kind:"session",id:c});p(m?{kind:"file",path:m}:{kind:"page",page:"overview"})}}function Z9({path:e,x:i,y:r,onClose:s}){const l=Bn(h=>h.tabs),f=_5();P.useEffect(()=>{const h=()=>s(),d=m=>m.key==="Escape"&&s();return window.addEventListener("pointerdown",h),window.addEventListener("keydown",d),()=>{window.removeEventListener("pointerdown",h),window.removeEventListener("keydown",d)}},[s]);const p=l.findIndex(h=>h.path===e),a=[["Close",vn,()=>void f([e])],["Close Others",qs,()=>void f(l.filter(h=>h.path!==e).map(h=>h.path)),l.length<2],["Close to the Right",qs,()=>void f(l.slice(p+1).map(h=>h.path)),p===l.length-1],["Close All",qs,()=>void f(l.map(h=>h.path))],["Copy Relative Path",xh,()=>{var h;return void((h=navigator.clipboard)==null?void 0:h.writeText(e))}],["Reveal in File Explorer",ca,()=>void rt(()=>Xt.reveal(e))]];return v.jsx("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-230)},onPointerDown:h=>h.stopPropagation(),children:a.map(([h,d,m,c],_)=>v.jsxs("button",{disabled:c,onClick:()=>{s(),m()},className:xe("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",_===4&&"mt-1 border-t pt-2"),children:[v.jsx(d,{size:13}),h]},h))})}function J9({active:e}){const i=Bn(x=>x.tabs),{pin:r,reorder:s}=Bn.getState(),l=en(x=>x.drafts),f=ye(x=>x.go),p=_5(),[a,h]=P.useState(null),[d,m]=P.useState(null),c=P.useRef(null);if(P.useEffect(()=>{var x,E;e&&((E=(x=c.current)==null?void 0:x.querySelector(`[data-path="${CSS.escape(e)}"]`))==null||E.scrollIntoView({block:"nearest",inline:"nearest"}))},[e,i.length]),!i.length)return null;const _=i.map(x=>x.path.split("/").pop()??x.path);return v.jsxs("div",{ref:c,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[a&&v.jsx(Z9,{...a,onClose:()=>h(null)}),i.map((x,E)=>{const w=_[E],g=_.filter(T=>T===w).length>1,b=x.path.includes("/")?x.path.slice(0,x.path.lastIndexOf("/")):"",S=rs(l[x.path]),y=x.path===e;return v.jsxs("div",{"data-path":x.path,draggable:!0,title:x.path,onClick:()=>f({kind:"file",path:x.path}),onDoubleClick:()=>r(x.path),onAuxClick:T=>{T.button===1&&(T.preventDefault(),p([x.path]))},onContextMenu:T=>{T.preventDefault(),h({path:x.path,x:T.clientX,y:T.clientY})},onDragStart:T=>{m(x.path),T.dataTransfer.effectAllowed="move"},onDragOver:T=>{!d||d===x.path||(T.preventDefault(),s(d,x.path))},onDragEnd:()=>m(null),className:xe("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",y?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground",d===x.path&&"opacity-50"),children:[v.jsx(z2,{name:w,size:13}),v.jsx("span",{className:xe("truncate",x.preview&&"italic"),children:w}),g&&b&&v.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b}),v.jsx("button",{"aria-label":`Close ${w}`,title:"Close",onClick:T=>{T.stopPropagation(),p([x.path])},className:xe("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!S&&!y&&"invisible group-hover:visible"),children:S?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"h-2 w-2 rounded-full bg-foreground group-hover:hidden"}),v.jsx(vn,{size:12,className:"hidden group-hover:block"})]}):v.jsx(vn,{size:12})})]},x.path)})]})}const hS="clauder-hub:sidebar-collapsed";function dS({text:e,failed:i}){const r=i?AS:_S;return v.jsxs("div",{role:i?"alert":"status",className:xe("fixed bottom-4 left-1/2 z-[60] flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-xl px-3.5 py-2.5 text-xs opacity-85 shadow-lg shadow-black/25 transition-opacity animate-in fade-in-0 slide-in-from-bottom-2 hover:opacity-100 sm:max-w-lg",i?"bg-primary text-primary-foreground":"bg-success text-success-foreground"),children:[v.jsx(r,{size:15,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 break-words",children:e})]})}const eB={overview:()=>v.jsx(I9,{}),inbox:()=>v.jsx(B9,{}),automation:()=>v.jsx(s6,{}),instructions:()=>v.jsx(G9,{}),agents:()=>v.jsx(dm,{kind:"agents"},"agents"),skills:()=>v.jsx(dm,{kind:"skills"},"skills"),commands:()=>v.jsx(dm,{kind:"commands"},"commands"),"mcp-servers":()=>v.jsx(X9,{}),hooks:()=>v.jsx(K9,{}),plugins:()=>v.jsx(Q9,{}),channels:()=>v.jsx(lC,{}),"hub-prompts":()=>v.jsx(f8,{}),"claude-settings":()=>v.jsx(uL,{}),"mcp-suggestions":()=>v.jsx(P9,{}),presets:()=>v.jsx(U9,{}),categories:()=>v.jsx(d6,{})};function tB(){const{boot:e,view:i,toast:r,health:s,windowed:l,projectId:f}=ye(),[p,a]=P.useState(null),h=ph("clauder-hub:sidebar-width",280,{min:220,max:480}),d=ph("clauder-hub:live-panel-width",260,{min:200,max:420}),m=Gh(T=>T.open),c=P2("(min-width: 768px)"),[_,x]=P.useState(!1),[E,w]=P.useState(()=>{try{return localStorage.getItem(hS)==="1"}catch{return!1}});P.useEffect(()=>{try{localStorage.setItem(hS,E?"1":"0")}catch{}},[E]),P.useEffect(()=>x(!1),[i,c]);const g=ye(T=>T.sessions.some(L=>L.live)),b=Bn(T=>T.tabs.length>0),S=g||b;if(P.useEffect(()=>{if(!S)return;const T=L=>{L.preventDefault(),L.returnValue=""};return window.addEventListener("beforeunload",T),()=>window.removeEventListener("beforeunload",T)},[S]),P.useEffect(()=>{if(l)return;const T=L=>{!L.ctrlKey||L.altKey||L.metaKey||L.code!=="Backquote"||(L.preventDefault(),L.stopPropagation(),w(!1),c||x(!0),window.setTimeout(()=>window.dispatchEvent(new Event(tg)),30))};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[l,c]),P.useEffect(()=>{if(!_)return;const T=L=>L.key==="Escape"&&x(!1);return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[_]),P.useEffect(()=>{e().catch(T=>a(T.message))},[e]),P.useEffect(()=>{s&&(document.title=s.project)},[s]),!s)return v.jsx("div",{className:"grid h-screen place-items-center text-xs text-muted-foreground",children:"Opening the project..."});if(f===hr)return v.jsxs(Ty,{children:[v.jsx(N9,{}),(p||r)&&v.jsx(dS,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]});const y=i.kind==="session"?v.jsx(h5,{id:i.id},i.id):i.kind==="file"?v.jsx(u8,{path:i.path},i.path):eB[i.page]();return v.jsx(Ty,{children:v.jsxs("div",{className:"flex h-screen overflow-hidden",children:[!l&&c&&v.jsx(Xb,{width:h.width,collapsed:E,onToggle:()=>w(!E)}),!l&&c&&!E&&v.jsx(mh,{onDrag:h.resizeBy,onReset:h.reset}),!l&&!c&&v.jsxs(v.Fragment,{children:[_&&v.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>x(!1)}),v.jsx("div",{inert:!_,className:xe("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",_?"translate-x-0 shadow-xl":"-translate-x-full"),children:v.jsx(Xb,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>x(!1),drawer:!0})})]}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&!c&&v.jsx(Q8,{onMenu:()=>x(!0)}),v.jsx(d5,{}),!l&&v.jsx(J8,{}),!l&&v.jsx(J9,{active:i.kind==="file"?i.path:null}),v.jsx("div",{className:"min-h-0 flex-1",children:y})]}),!l&&c&&m&&v.jsx(mh,{onDrag:T=>d.resizeBy(-T),onReset:d.reset}),!l&&c&&m&&v.jsx(r5,{width:d.width}),(p||r)&&v.jsx(dS,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]},f)})}y3.createRoot(document.getElementById("root")).render(v.jsx(Tl.StrictMode,{children:v.jsx(tB,{})}));export{Tl as W,mL as _,Xt as f,ng as g,v as j,P as r,ye as u};