codekin 0.5.5 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-BvKzbtKg.css +1 -0
- package/dist/assets/index-D59Xr9pK.js +182 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/server/dist/approval-manager.js +1 -1
- package/server/dist/claude-process.d.ts +8 -5
- package/server/dist/claude-process.js +21 -63
- package/server/dist/claude-process.js.map +1 -1
- package/server/dist/coding-process.d.ts +83 -0
- package/server/dist/coding-process.js +32 -0
- package/server/dist/coding-process.js.map +1 -0
- package/server/dist/commit-event-handler.js +1 -0
- package/server/dist/commit-event-handler.js.map +1 -1
- package/server/dist/docs-routes.js +22 -1
- package/server/dist/docs-routes.js.map +1 -1
- package/server/dist/native-permissions.js +2 -1
- package/server/dist/native-permissions.js.map +1 -1
- package/server/dist/opencode-process.d.ts +104 -0
- package/server/dist/opencode-process.js +657 -0
- package/server/dist/opencode-process.js.map +1 -0
- package/server/dist/orchestrator-children.d.ts +9 -0
- package/server/dist/orchestrator-children.js +28 -1
- package/server/dist/orchestrator-children.js.map +1 -1
- package/server/dist/orchestrator-manager.js +17 -0
- package/server/dist/orchestrator-manager.js.map +1 -1
- package/server/dist/orchestrator-routes.js +8 -1
- package/server/dist/orchestrator-routes.js.map +1 -1
- package/server/dist/prompt-router.d.ts +2 -2
- package/server/dist/prompt-router.js +12 -0
- package/server/dist/prompt-router.js.map +1 -1
- package/server/dist/session-lifecycle.d.ts +4 -4
- package/server/dist/session-lifecycle.js +42 -21
- package/server/dist/session-lifecycle.js.map +1 -1
- package/server/dist/session-manager.d.ts +9 -0
- package/server/dist/session-manager.js +87 -45
- package/server/dist/session-manager.js.map +1 -1
- package/server/dist/session-persistence.d.ts +1 -0
- package/server/dist/session-persistence.js +3 -1
- package/server/dist/session-persistence.js.map +1 -1
- package/server/dist/session-routes.js +15 -1
- package/server/dist/session-routes.js.map +1 -1
- package/server/dist/stepflow-handler.d.ts +2 -2
- package/server/dist/stepflow-handler.js +4 -4
- package/server/dist/stepflow-handler.js.map +1 -1
- package/server/dist/tool-labels.d.ts +8 -0
- package/server/dist/tool-labels.js +51 -0
- package/server/dist/tool-labels.js.map +1 -0
- package/server/dist/tsconfig.tsbuildinfo +1 -1
- package/server/dist/types.d.ts +25 -10
- package/server/dist/types.js +4 -1
- package/server/dist/types.js.map +1 -1
- package/server/dist/webhook-dedup.d.ts +11 -0
- package/server/dist/webhook-dedup.js +23 -0
- package/server/dist/webhook-dedup.js.map +1 -1
- package/server/dist/webhook-handler.d.ts +20 -4
- package/server/dist/webhook-handler.js +256 -20
- package/server/dist/webhook-handler.js.map +1 -1
- package/server/dist/webhook-pr-cache.d.ts +57 -0
- package/server/dist/webhook-pr-cache.js +95 -0
- package/server/dist/webhook-pr-cache.js.map +1 -0
- package/server/dist/webhook-pr-github.d.ts +68 -0
- package/server/dist/webhook-pr-github.js +202 -0
- package/server/dist/webhook-pr-github.js.map +1 -0
- package/server/dist/webhook-pr-prompt.d.ts +27 -0
- package/server/dist/webhook-pr-prompt.js +251 -0
- package/server/dist/webhook-pr-prompt.js.map +1 -0
- package/server/dist/webhook-types.d.ts +70 -1
- package/server/dist/webhook-workspace.js +20 -1
- package/server/dist/webhook-workspace.js.map +1 -1
- package/server/dist/workflow-config.d.ts +2 -0
- package/server/dist/workflow-config.js.map +1 -1
- package/server/dist/workflow-loader.js +3 -0
- package/server/dist/workflow-loader.js.map +1 -1
- package/server/dist/workflow-routes.js +6 -2
- package/server/dist/workflow-routes.js.map +1 -1
- package/server/dist/ws-message-handler.js +22 -3
- package/server/dist/ws-message-handler.js.map +1 -1
- package/server/dist/ws-server.js +4 -2
- package/server/dist/ws-server.js.map +1 -1
- package/dist/assets/index-BFkKlY3O.js +0 -182
- package/dist/assets/index-CjEQkT2b.css +0 -1
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},R=[],te=-1;function z(e){return{current:e}}function B(e){0>te||(e.current=R[te],R[te]=null,te--)}function V(e,t){te++,R[te]=e.current,e.current=t}var ne=z(null),re=z(null),ie=z(null),ae=z(null);function oe(e,t){switch(V(ie,t),V(re,e),V(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(ne),V(ne,e)}function se(){B(ne),B(re),B(ie)}function ce(e){e.memoizedState!==null&&V(ae,e);var t=ne.current,n=Ud(t,e.type);t!==n&&(V(re,e),V(ne,n))}function le(e){re.current===e&&(B(ne),B(re)),ae.current===e&&(B(ae),Qf._currentValue=ee)}var ue,de;function fe(e){if(ue===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ue=t&&t[1]||``,de=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+ue+e+de}var pe=!1;function me(e,t){if(!e||pe)return``;pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?fe(n):``}function he(e,t){switch(e.tag){case 26:case 27:case 5:return fe(e.type);case 16:return fe(`Lazy`);case 13:return e.child!==t&&t!==null?fe(`Suspense Fallback`):fe(`Suspense`);case 19:return fe(`SuspenseList`);case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return fe(`Activity`);default:return``}}function ge(e){try{var t=``,n=null;do t+=he(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var _e=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,Se=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Pe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=L.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function tt(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,H=`__reactProps$`+nt,it=`__reactContainer$`+nt,at=`__reactEvents$`+nt,ot=`__reactListeners$`+nt,st=`__reactHandles$`+nt,ct=`__reactResources$`+nt,lt=`__reactMarker$`+nt;function ut(e){delete e[rt],delete e[H],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[rt])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[rt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=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]*$`),xt={},St={};function Ct(e){return _e.call(St,e)?!0:_e.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Tt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Et(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Dt(s):e.removeAttribute(`name`)}function It(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Dt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=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 Ut(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Kt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[H]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[H]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(yu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[H]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,`passive`,{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return un=i.slice(e,1<r?1-r:void 0)}function U(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=m({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=m({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(m({},Sn,{dataTransfer:0})),Tn=mn(m({},_n,{relatedTarget:0})),En=mn(m({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(m({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(m({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(m({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=U(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?U(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?U(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(m({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(m({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(m({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(m({},Sn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),zn=mn(m({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=an&&`CompositionEvent`in window,Hn=null;an&&`documentMode`in document&&(Hn=document.documentMode);var Un=an&&`TextEvent`in window&&!Hn,Wn=an&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function W(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return W(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function G(e,t){if(Jn)return e===`compositionend`||!Vn&&qn(e,t)?(e=dn(),un=ln=cn=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Xn={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 Zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Xn[e.type]:t===`textarea`}function Qn(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Ed(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var $n=null,er=null;function tr(e){yd(e,0)}function nr(e){if(jt(pt(e)))return e}function rr(e,t){if(e===`change`)return t}var ir=!1;if(an){var ar;if(an){var or=`oninput`in document;if(!or){var sr=document.createElement(`div`);sr.setAttribute(`oninput`,`return;`),or=typeof sr.oninput==`function`}ar=or}else ar=!1;ir=ar&&(!document.documentMode||9<document.documentMode)}function cr(){$n&&($n.detachEvent(`onpropertychange`,lr),er=$n=null)}function lr(e){if(e.propertyName===`value`&&nr(er)){var t=[];Qn(t,er,e,Zt(e)),nn(tr,t)}}function ur(e,t,n){e===`focusin`?(cr(),$n=t,er=n,$n.attachEvent(`onpropertychange`,lr)):e===`focusout`&&cr()}function dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return nr(er)}function fr(e,t){if(e===`click`)return nr(t)}function pr(e,t){if(e===`input`||e===`change`)return nr(t)}function mr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var hr=typeof Object.is==`function`?Object.is:mr;function gr(e,t){if(hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!_e.call(t,i)||!hr(e[i],t[i]))return!1}return!0}function _r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vr(e,t){var n=_r(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=_r(n)}}function yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mt(e.document)}return t}function xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Sr=an&&`documentMode`in document&&11>=document.documentMode,Cr=null,wr=null,Tr=null,Er=!1;function Dr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Er||Cr==null||Cr!==Mt(r)||(r=Cr,`selectionStart`in r&&xr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Tr&&gr(Tr,r)||(Tr=r,r=Ed(wr,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function Or(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var kr={animationend:Or(`Animation`,`AnimationEnd`),animationiteration:Or(`Animation`,`AnimationIteration`),animationstart:Or(`Animation`,`AnimationStart`),transitionrun:Or(`Transition`,`TransitionRun`),transitionstart:Or(`Transition`,`TransitionStart`),transitioncancel:Or(`Transition`,`TransitionCancel`),transitionend:Or(`Transition`,`TransitionEnd`)},Ar={},jr={};an&&(jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),`TransitionEvent`in window||delete kr.transitionend.transition);function Mr(e){if(Ar[e])return Ar[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jr)return Ar[e]=t[n];return e}var Nr=Mr(`animationend`),Pr=Mr(`animationiteration`),Fr=Mr(`animationstart`),Ir=Mr(`transitionrun`),Lr=Mr(`transitionstart`),Rr=Mr(`transitioncancel`),zr=Mr(`transitionend`),Br=new Map,Vr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),vt(t,[e])}var Ur=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ii(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ne.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:ge(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:ge(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Pe(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,K=null,Di=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Fi(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function q(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[H]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Bt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||ji(e,!0)}function Mi(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ei=Ei.return}}function J(e){if(e!==Ei)return!1;if(!Di)return Mi(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Wd(e.type,e.memoizedProps)),n=!n),n&&K&&ji(e),Mi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));K=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));K=df(e)}else t===27?(t=K,Qd(e.type)?(e=uf,uf=null,K=e):K=t):K=Ei?lf(e.stateNode.nextSibling):null;return!0}function Ni(){K=Ei=null,Di=!1}function Pi(){var e=Oi;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Oi=null),e}function Fi(e){Oi===null?Oi=[e]:Oi.push(e)}var Ii=z(null),Y=null,Li=null;function Ri(e,t,n){V(Ii,t._currentValue),t._currentValue=n}function zi(e){e._currentValue=Ii.current,B(Ii)}function Bi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Vi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Bi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Bi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Hi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Vi(t,e,n,r),t.flags|=262144}function Ui(e){for(e=e.firstContext;e!==null;){if(!hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wi(e){Y=e,Li=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gi(e){return qi(Y,e)}function Ki(e,t){return Y===null&&Wi(e),qi(e,t)}function qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Li===null){if(e===null)throw Error(i(308));Li=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Li=Li.next=t;return n}var Ji=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Yi=t.unstable_scheduleCallback,Xi=t.unstable_NormalPriority,Zi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qi(){return{controller:new Ji,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&Yi(Xi,function(){e.controller.abort()})}var ea=null,ta=0,na=0,ra=null;function ia(e,t){if(ea===null){var n=ea=[];ta=0,na=dd(),ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ta++,t.then(aa,aa),t}function aa(){if(--ta===0&&ea!==null){ra!==null&&(ra.status=`fulfilled`);var e=ea;ea=null,na=0,ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var sa=I.S;I.S=function(e,t){$l=Se(),typeof t==`object`&&t&&typeof t.then==`function`&&ia(e,t),sa!==null&&sa(e,t)};var ca=z(null);function la(){var e=ca.current;return e===null?Fl.pooledCache:e}function ua(e,t){t===null?V(ca,ca.current):V(ca,t.pool)}function da(){var e=la();return e===null?null:{parent:Zi._currentValue,pool:e}}var fa=Error(i(460)),pa=Error(i(474)),ma=Error(i(542)),ha={then:function(){}};function ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function _a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e}throw ya=t,fa}}function va(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ya=e,fa):e}}var ya=null;function ba(){if(ya===null)throw Error(i(459));var e=ya;return ya=null,e}function xa(e){if(e===fa||e===ma)throw Error(i(483))}var Sa=null,Ca=0;function wa(e){var t=Ca;return Ca+=1,Sa===null&&(Sa=[]),_a(Sa,e,t)}function Ta(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ea(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Da(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&va(i)===t.type)?(t=a(t,n.props),Ta(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),Ta(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=oi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),Ta(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=va(t),f(e,t,n)}if(F(t)||M(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,wa(t),n);if(t.$$typeof===C)return f(e,Ki(e,t),n);Ea(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=va(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,wa(n),r);if(n.$$typeof===C)return p(e,t,Ki(e,n),r);Ea(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=va(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,wa(r),i);if(r.$$typeof===C)return m(e,t,n,Ki(t,r),i);Ea(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Di&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Di&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Di&&xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Di&&xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Di&&xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Di&&xi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&va(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ta(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),Ta(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=va(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,wa(o),c);if(o.$$typeof===C)return b(e,r,Ki(e,o),c);Ea(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ca=0;var i=b(e,t,n,r);return Sa=null,i}catch(t){if(t===fa||t===ma)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Oa=Da(!0),ka=Da(!1),Aa=!1;function ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ma(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function Fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Ia(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var La=!1;function Ra(){if(La){var e=ra;if(e!==null)throw e}}function za(e,t,n,r){La=!1;var i=e.updateQueue;Aa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Il&f)===f:(r&f)===f){f!==0&&f===na&&(La=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Aa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ba(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Va(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ba(n[e],t)}var Ha=z(null),Ua=z(0);function Wa(e,t){e=Hl,V(Ua,e),V(Ha,t),Hl=e|t.baseLanes}function Ga(){V(Ua,Hl),V(Ha,Ha.current)}function Ka(){Hl=Ua.current,B(Ha),B(Ua)}var qa=z(null),Ja=null;function Ya(e){var t=e.alternate;V(eo,eo.current&1),V(qa,e),Ja===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Ja=e)}function Xa(e){V(eo,eo.current),V(qa,e),Ja===null&&(Ja=e)}function Za(e){e.tag===22?(V(eo,eo.current),V(qa,e),Ja===null&&(Ja=e)):Qa(e)}function Qa(){V(eo,eo.current),V(qa,qa.current)}function $a(e){B(qa),Ja===e&&(Ja=null),B(eo)}var eo=z(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var no=0,X=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(i(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return no=a,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){I.H=js;var t=ro!==null&&ro.next!==null;if(no=0,io=ro=X=null,ao=!1,lo=0,uo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Ui(e)&&(Xs=!0))}function _o(e,t,n,r){X=e;var a=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=a)throw Error(i(301));if(a+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Ps,o=t(n,r)}while(oo);return o}function vo(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(X.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}no=0,io=ro=X=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?X.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?X.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw X.alternate===null?Error(i(467)):Error(i(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?X.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=_a(uo,e,t),t=X,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ms:Ns),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===C)return Gi(e)}throw Error(i(438,String(e)))}function Do(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=wo(),X.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(no&f)===f:(Il&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===na&&(d=!0);else if((no&p)===p){u=u.next,p===na&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,X.lanes|=p,Wl|=p;f=u.action,so&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,X.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!hr(o,e.memoizedState)&&(Xs=!0,d&&(n=ra,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function jo(e){var t=Co(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);hr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=X,a=Co(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!hr((ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Fo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||no&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=wo(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hr(e,n)}catch{return!0}}function Lo(e){var t=Xr(e,2);t!==null&&mu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,a){if(Os(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Wo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Wo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Uo(e,t,n)},function(n){return Wo(e,t,n)}):Uo(e,t,n)}function Uo(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Wo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(Di){var n=Fl.formState;if(n!==null){a:{var r=X;if(Di){if(K){b:{for(var i=K,a=ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){K=lf(i.nextSibling),r=i.data===`F!`;break a}}ji(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ts.bind(null,X,r),r.dispatch=n,r=Ro(!1),a=Ds.bind(null,X,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,X,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(Co(),ro,e)}function Yo(e,t,n){if(t=Ao(e,t,Ko)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===fa?ma:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(X.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=Co(),n=ro;if(n!==null)return Yo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=wo(),X.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function $o(){return Co().memoizedState}function es(e,t,n,r){var i=So();X.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(X.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=wo(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=Co().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||no&1073741824&&!(Il&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),X.lanes|=e,Wl|=e,n)}function ms(e,t,n,r){return hr(n,t)?n:Ha.current===null?!(no&42)||no&1073741824&&!(Il&261930)?(Xs=!0,e.memoizedState=n):(e=pu(),X.lanes|=e,Wl|=e,t):(e=ps(e,n,r),hr(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Ds(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,oa(c,r),fu(e)):Es(e,t,r,fu(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,ee,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},fu())}function bs(){return Gi(Qf)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Na(n);var r=Pa(t,e,n);r!==null&&(mu(r,t,n),Fa(r,t,n)),t={cache:Qi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Yr(e,t,n,r),n!==null&&(mu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,fu())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,hr(s,o))return Jr(e,t,i,0),Fl===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return mu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&mu(t,e,2)}function Os(e){var t=e.alternate;return e===X||t!==null&&t===X}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var js={readContext:Gi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Gi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Gi,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){Ne(!0);try{n(t)}finally{Ne(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ws.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,X,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,a=So();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Il&127||No(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(Di){var n=bi,r=yi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ds.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Cs.bind(null,X)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:ko,useRef:$o,useState:function(){return ko(Oo)},useDebugValue:us,useDeferredValue:function(e,t){return ms(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:jo,useRef:$o,useState:function(){return jo(Oo)},useDebugValue:us,useDeferredValue:function(e,t){var n=Co();return ro===null?ps(n,e,t):ms(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Na(r);i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(mu(t,e,r),Fa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Na(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(mu(t,e,r),Fa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Na(n);r.tag=2,t!=null&&(r.callback=t),t=Pa(e,r,n),t!==null&&(mu(t,e,n),Fa(t,e,n))}};function Ls(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!gr(n,r)||!gr(i,a):!0}function Rs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Is.enqueueReplaceState(t,t.state,null)}function zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Ur(e)}function Vs(e){console.error(e)}function Hs(e){Ur(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){return n=Na(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Na(e),e.tag=3,e}function qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Hi(t,n,a,!0),n=qa.current,n!==null){switch(n.tag){case 31:case 13:return Ja===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Eu(),!1}if(Di)return t=qa.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Fi(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Gs(e.stateNode,r,a),Ia(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Fi(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ia(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Ia(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?ka(t,null,n,r):Oa(t,e.child,n,r)}function Qs(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Wi(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Di&&s&&Ci(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?gr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(gr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ua(t,a===null?null:a.cachePool),a===null?Ga():Wa(t,a),Za(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ua(t,null),Ga(),Qa(t)):(ua(t,a.cachePool),Wa(t,a),Qa(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=la();return a=a===null?null:{parent:Zi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ua(t,null),Ga(),Za(t),e!==null&&Hi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Oa(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,$a(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Xa(t),(e=K)?(e=af(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,K=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Xa(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Hi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),mu(r,e,s),Ys;Eu(),t=ac(e,t,n)}else e=o.treeContext,K=lf(s.nextSibling),Ei=t,Di=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=ic(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Wi(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Di&&r&&Ci(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Wi(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),Sc(e,t,a)):(Di&&r&&Ci(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Wi(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=Gi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ja(t),o=n.contextType,a.context=typeof o==`object`&&o?Gi(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Is.enqueueReplaceState(a,a.state,null),za(t,r,a,i),Ra(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=Gi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Rs(t,a,r,o),Aa=!1;var f=t.memoizedState;a.state=f,za(t,r,a,i),Ra(),l=t.memoizedState,s||f!==l||Aa?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Aa||Ls(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ma(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=Gi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Rs(t,a,r,c),Aa=!1,f=t.memoizedState,a.state=f,za(t,r,a,i),Ra();var p=t.memoizedState;o!==d||f!==p||Aa||e!==null&&e.dependencies!==null&&Ui(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Aa||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ui(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,sc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Oa(t,e.child,null,i),t.child=Oa(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Ni(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:da()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(eo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Di){if(a?Ya(t):Qa(t),(e=K)?(e=af(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,K=null)):e=null,e===null)throw ji(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Qa(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Ya(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ya(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(Qa(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Oa(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(Qa(t),t.child=e.child,t.flags|=128,t=null);else if(Ya(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Fi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Hi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),mu(s,e,r),Ys;of(c)||Eu(),t=vc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,K=lf(c.nextSibling),Ei=t,Di=!0,Oi=null,ki=!1,e!==null&&Ti(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(Qa(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=da():(l=Zi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Ya(t),n=e.child,e=n.sibling,n=ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Oa(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bi(e.return,t,n)}function bc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=eo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,V(eo,o),Zs(e,t,r,n),r=Di?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&to(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&to(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ui(e))):!0}function wc(e,t,n){switch(t.tag){case 3:oe(t,t.stateNode.containerInfo),Ri(t,Zi,e.memoizedState.cache),Ni();break;case 27:case 5:ce(t);break;case 4:oe(t,t.stateNode.containerInfo);break;case 10:Ri(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ya(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Ya(t),t.flags|=128,null);Ya(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Hi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),V(eo,eo.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ri(t,Zi,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,Di&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=va(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ma(e,t),za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ri(t,Zi,r),r!==o.cache&&Vi(t,[Zi],n,!0),Ra(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=dc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Fi(a),t=dc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(K=lf(e.firstChild),Ei=t,Di=!0,Oi=null,ki=!0,n=ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ni(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Vd(ie.current).createElement(n),r[rt]=t,r[H]=e,Fd(r,n,e),ht(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Di&&(r=t.stateNode=pf(t.type,t.pendingProps,ie.current),Ei=t,ki=!0,a=K,Qd(t.type)?(uf=a,K=lf(r.firstChild)):K=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=K)&&(r=nf(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ei=t,K=lf(r.firstChild),ki=!1,a=!0)),a||ji(t)),ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ho(e,t,vo,null,null,n),Qf._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=K)&&(n=rf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ei=t,K=null,e=!0)),e||ji(t)),null;case 13:return hc(e,t,n);case 4:return oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oa(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ri(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Wi(t),a=Gi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Wi(t),r=Gi(Zi),e===null?(a=la(),a===null&&(a=Fl,o=Qi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ja(t),Ri(t,Zi,a)):((e.lanes&n)!==0&&(Ma(e,t),za(t,null,null,n),Ra()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ri(t,Zi,r),r!==a.cache&&Vi(t,[Zi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ri(t,Zi,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw ya=ha,pa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Cu())e.flags|=8192;else throw ya=ha,pa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Jl|=t)}function Ac(e,t){if(!Di)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mc(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zi(Zi),se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(J(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pi())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(le(t),n=ie.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=ne.current,J(t)?q(t,e):(e=pf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(le(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=ne.current,J(t))q(t,o);else{var s=Vd(ie.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[rt]=t,o[H]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ie.current,J(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||ji(t,!0)}else e=Vd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=J(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[rt]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($a(t),t):($a(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=J(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[rt]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?($a(t),t):($a(t),null)}return $a(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return se(),e===null&&Sd(t.stateNode.containerInfo),jc(t),null;case 10:return zi(t.type),jc(t),null;case 19:if(B(eo),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=to(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return V(eo,eo.current&1|2),Di&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Se()>eu&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=to(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return jc(t),null}else 2*Se()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Se(),e.sibling=null,n=eo.current,V(eo,a?n&1|2:n&1),Di&&xi(t,r.treeForkCount),e);case 22:case 23:return $a(t),Ka(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&B(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zi(Zi),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Zi),se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return le(t),null;case 31:if(t.memoizedState!==null){if($a(t),t.alternate===null)throw Error(i(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($a(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(eo),null;case 4:return se(),null;case 10:return zi(t.type),null;case 22:case 23:return $a(t),Ka(),e!==null&&B(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Zi),null;case 25:return null;default:return null}}function Pc(e,t){switch(wi(t),t.tag){case 3:zi(Zi),se();break;case 26:case 27:case 5:le(t);break;case 4:se();break;case 31:t.memoizedState!==null&&$a(t);break;case 13:$a(t);break;case 19:B(eo);break;case 10:zi(t.type);break;case 22:case 23:$a(t),Ka(),e!==null&&B(ca);break;case 24:zi(Zi)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Wu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Va(t,n)}catch(t){Wu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Wu(e,t,n)}else n.current=null}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Wu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[H]=t}catch(t){Wu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yt));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[rt]=e,t[H]=n}catch(t){Wu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,zd=sp,e=br(e),xr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},sp=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Wu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Wu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Wu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Va(e,t)}catch(e){Wu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Qd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),mf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Wu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Wu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):$d(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Wu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Wu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[rt]=e,ht(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[rt]=e,ht(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=Lf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):Lf(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Wu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Wu(e,e.return,t)}}break;case 3:if(Bf=null,a=dl,dl=_f(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Wu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=_f(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=Se()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Wu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Wu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){Wu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Wu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:mf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Wu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ba(c[i],s)}catch(e){Wu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&$i(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Wu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Gf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=_f(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:$i(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Gi(Zi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Gi(Zi).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Z=null,Il=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Pl&2&&Il!==0?Il&-Il:I.T===null?et():dd()}function pu(){if(ql===0)if(!(Il&536870912)||Di){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),ql=e}else ql=536870912;return e=qa.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Fl&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Il,ql,!1)),qe(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Gl|=n),Ul===4&&vu(e,Il,ql,!1)),rd(e))}function hu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-Se(),10<a)){if(vu(r,t,ql,!zl),He(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=qd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);rd(e)}function gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yt},El(t,a,d);var m=(a&62914560)===a?Ql-Se():(a&4194048)===a?$l-Se():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function yu(){return Pl&6?!0:(id(0,!1),!1)}function bu(){if(Z!==null){if(Ll===0)var e=Z.return;else e=Z,Li=Y=null,xo(e),Sa=null,Ca=0,e=Z;for(;e!==null;)Pc(e.alternate,e),e=e.return;Z=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Fl=e,Z=n=ri(e.current,null),Il=t,Ll=0,Rl=null,zl=!1,Bl=Ue(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,qr(),n}function Su(e,t){X=null,I.H=js,t===fa||t===ma?(t=ba(),Ll=3):t===pa?(t=ba(),Ll=4):Ll=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Z===null&&(Ul=1,Us(e,di(t,e.current)))}function Cu(){var e=qa.current;return e===null?!0:(Il&4194048)===Il?Ja===null:(Il&62914560)===Il||Il&536870912?e===Ja:!1}function wu(){var e=I.H;return I.H=js,e===null?js:e}function Tu(){var e=I.A;return I.A=Ml,e}function Eu(){Ul=4,zl||(Il&4194048)!==Il&&qa.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Fl===null||vu(Fl,Il,ql,!1)}function Du(e,t,n){var r=Pl;Pl|=2;var i=wu(),a=Tu();(Fl!==e||Il!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Ll!==0&&Z!==null){var s=Z,c=Rl;switch(Ll){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:qa.current===null&&(t=!0);var l=Ll;if(Ll=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Ll,Ll=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Li=Y=null,Pl=r,I.H=i,I.A=a,Z===null&&(Fl=null,Il=0,qr()),o}function Ou(){for(;Z!==null;)ju(Z)}function ku(e,t){var n=Pl;Pl|=2;var r=wu(),a=Tu();Fl!==e||Il!==t?(tu=null,eu=Se()+500,xu(e,t)):Bl=Ue(e,t);a:do try{if(Ll!==0&&Z!==null){t=Z;var o=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(ga(o)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Fl!==e||(Ll=7),rd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:ga(o)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Ll=0,Rl=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Pu(u))}break b}}Ll=0,Rl=null,Nu(e,t,o,5);break;case 6:Ll=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Li=Y=null,I.H=r,I.A=a,Pl=n,Z===null?(Fl=null,Il=0,qr(),Ul):0}function Au(){for(;Z!==null&&!be();)ju(Z)}function ju(e){var t=Tc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Z=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Il);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Il);break;case 5:xo(t);default:Pc(n,t),t=Z=ii(t,Hl),t=Tc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Z=t}function Nu(e,t,n,r){Li=Y=null,xo(t),Sa=null,Ca=0;var i=t.return;try{if(Js(e,i,t,n,Il)){Ul=1,Us(e,di(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Ul=1,Us(e,di(n,e.current)),Z=null;return}t.flags&32768?(Di||r===1?e=!0:Bl||Il&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Mc(t.alternate,t,Hl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Ul=6,Z=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Je(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Il=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ee,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,L.p=a,I.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=Bd,o=br(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&yr(s.ownerDocument.documentElement,s)){if(c!==null&&xr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=vr(s,h),v=vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!zd,Bd=zd=null}finally{Pl=i,L.p=r,I.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,L.p=r,I.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,xe();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),$e(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}ou&3&&Vu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,id(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=$e(ou),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,id(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{L.p=a,I.T=r,Bu(e,t)}}function Uu(e,t,n){t=di(n,t),t=Gs(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(qe(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=di(n,e),n=Ks(2),r=Pa(t,n,2),r!==null&&(qs(n,r,t,e),qe(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Il&n)===n&&(Ul===4||Ul===3&&(Il&62914560)===Il&&300>Se()-Ql?!(Pl&2)&&xu(e,0):Kl|=n,Jl===Il&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=Ge()),e=Xr(e,t),e!==null&&(qe(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return ve(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Il,a=He(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Kd()&&(e=nd);for(var t=Se(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Il,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ye(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ye(r),$e(n)){case 2:case 8:n=Te;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=cd.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Il;return r=He(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),sd(e,Se()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Vu())return null;hu(e,t,!0)}function ud(){Xd(function(){Pl&6?ve(we,ad):od()})}function dd(){if(nd===0){var e=na;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[H]||null).action),o=r.submitter;o&&(t=(t=o[H]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);_s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),_s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Vr.length;hd++){var gd=Vr[hd];Hr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Hr(Nr,`onAnimationEnd`),Hr(Pr,`onAnimationIteration`),Hr(Fr,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Ir,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!on||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(U(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Nr:case Pr:case Fr:l=En;break;case zr:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=rn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=rr;else if(Zn(c))if(ir)v=pr;else{v=dr;var y=ur}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=rr):v=fr;if(v&&=v(e,r)){Qn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:(Zn(y)||y.contentEditable===`true`)&&(Cr=y,wr=r,Tr=null);break;case`focusout`:Tr=wr=Cr=null;break;case`mousedown`:Er=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Er=!1,Dr(s,n,i);break;case`selectionchange`:if(Sr)break;case`keydown`:case`keyup`:Dr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Jn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Jn=!0)),y=Ed(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=W(n),b!==null&&(x.data=b)))),(b=Un?Yn(e,n):G(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=rn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
|
|
9
|
-
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Jt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Kt.get(n)||n,wt(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[H]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}Bt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}zt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Nd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Nd(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body);n=i}while(n);Np(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=L.d;L.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=yu();return e||t}function bf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?ys(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=mt(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);ht(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=mt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=hf.get(i))&&$(e,t),a=n.createElement(`script`),ht(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=mt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&$(e,t),a=n.createElement(`script`),ht(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=ie.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=mt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=mt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+Pt(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),ht(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Pt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,ht(a),a):(r=n,(a=hf.get(o))&&(r=m({},n),$(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[lt]||a[rt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=Qi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ja(a),e}function tp(e){return e?(e=$r,e):$r}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Na(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Pa(e,r,t),n!==null&&(mu(n,e,t),Fa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=Qe(t);var n=Xr(e,t);n!==null&&mu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,up(e,t,n,r)}finally{L.p=a,I.T=i}}function lp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,up(e,t,n,r)}finally{L.p=a,I.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Pl&6)&&(eu=Se()+500,id(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&mu(s,a,2),yu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=Zt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ft(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,_s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[H]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[H]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,fu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),yu(),t[it]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.4`)throw Error(i(527,Lp,`19.2.4`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{je=zp.inject(Rp),Me=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[it]=t.current,Sd(e),new Fp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=`codekin-settings`,x={token:``,fontSize:16,theme:`dark`};function S(){try{let e=localStorage.getItem(b),t=e?JSON.parse(e):null,n={...x,token:t?.token??x.token,theme:t?.theme===`light`?`light`:`dark`},r=new URL(window.location.href),i=r.searchParams.get(`token`);return i&&(n.token=i,localStorage.setItem(b,JSON.stringify(n)),r.searchParams.delete(`token`),window.history.replaceState({},``,r.pathname+r.search+r.hash)),n}catch{return x}}function C(e){localStorage.setItem(b,JSON.stringify(e))}function w(){let[e,t]=(0,v.useState)(S);return{settings:e,updateSettings:(0,v.useCallback)(e=>{t(t=>{let n={...t,...e};return C(n),n})},[])}}function T(e){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!0),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),p=t.flatMap(e=>e.repos),[m,h]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let t={};e&&(t.Authorization=`Bearer ${e}`),fetch(`/cc/api/repos`,{headers:t}).then(e=>{if(!e.ok)throw Error(`Failed to load repos: ${e.status}`);return e.json()}).then(e=>{n(e.groups),i(e.globalSkills??[]),o(e.globalModules??[]),f(e.ghMissing??!1),u(null)}).catch(e=>u(e.message)).finally(()=>c(!1))},[e,m]),{groups:t,repos:p,globalSkills:r,globalModules:a,loading:s,error:l,ghMissing:d,refresh:(0,v.useCallback)(()=>h(e=>e+1),[])}}var E=`/cc`,D=`/authelia/login`;function O(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${e}`}}var k=!1;function A(){k||(k=!0,window.location.href=D)}function j(e){if(e.redirected&&e.url.includes(`/authelia`))return!0;if(e.status>=502&&e.status<=504)return!1;let t=e.headers.get(`content-type`)||``;return t.includes(`application/json`)?!1:!!(e.status===401||e.status===403||e.ok&&t.includes(`text/html`))}async function M(){try{let e=await fetch(`${E}/auth-verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:``}),redirect:`manual`});return e.type===`opaqueredirect`?!1:e.status>=502&&e.status<=504?!0:!(e.headers.get(`content-type`)||``).includes(`text/html`)}catch{return!0}}async function N(e,t){let n=t?await fetch(e,t):await fetch(e);if(j(n))throw A(),Error(`Session expired`);return n}async function P(e){let t=await N(`${E}/auth-verify`,{method:`POST`,headers:O(e),body:JSON.stringify({token:e})});return t.ok?(await t.json()).valid===!0:!1}async function F(e){let t=await N(`${E}/api/sessions/list`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to list sessions: ${t.status}`);return(await t.json()).sessions??[]}async function I(e,t,n){let r=await N(`${E}/api/sessions/create`,{method:`POST`,headers:O(e),body:JSON.stringify({name:t,workingDir:n})});if(!r.ok)throw Error(`Failed to create session: ${r.status}`);return r.json()}async function L(e,t,n){let r=await N(`${E}/api/sessions/${t}/rename`,{method:`PATCH`,headers:O(e),body:JSON.stringify({name:n})});if(!r.ok)throw Error(`Failed to rename session: ${r.status}`)}async function ee(e,t){let n=await N(`${E}/api/sessions/${t}`,{method:`DELETE`,headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw Error(`Failed to delete session: ${n.status}`)}async function R(e){let t=await N(`${E}/api/orchestrator/start`,{method:`POST`,headers:O(e)});if(!t.ok)throw Error(`Failed to start orchestrator: ${t.status}`);return t.json()}async function te(e,t){let n=new FormData;n.append(`file`,t);let r=await N(`${E}/api/upload`,{method:`POST`,headers:{Authorization:`Bearer ${e}`},body:n});if(!r.ok)throw Error(`Upload failed: ${r.status}`);return(await r.json()).path}async function z(e,t,n){let r=`[Attached files: ${(await Promise.all(t.map(t=>te(e,t)))).join(`, `)}]`;return n.trim()?`${r}\n${n}`:r}async function B(e,t){let n=await N(`${E}/api/approvals?${new URLSearchParams({path:t})}`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw Error(`Failed to fetch approvals: ${n.status}`);return n.json()}async function V(e,t,n){let r=await N(`${E}/api/approvals?${new URLSearchParams({path:t})}`,{method:`DELETE`,headers:O(e),body:JSON.stringify(n)});if(!r.ok)throw Error(`Failed to remove approval: ${r.status}`)}async function ne(e,t,n){let r=await N(`${E}/api/approvals?${new URLSearchParams({path:t})}`,{method:`DELETE`,headers:O(e),body:JSON.stringify({items:n})});if(!r.ok)throw Error(`Failed to bulk remove approvals: ${r.status}`)}async function re(e,t){let n=new URLSearchParams;t&&n.set(`workingDir`,t);let r=n.toString(),i=await N(`${E}/api/sessions/archived${r?`?${r}`:``}`,{headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw Error(`Failed to list archived sessions: ${i.status}`);return(await i.json()).sessions??[]}async function ie(e,t){let n=await N(`${E}/api/sessions/archived/${t}`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw Error(`Failed to get archived session: ${n.status}`);return n.json()}async function ae(e,t){let n=await N(`${E}/api/sessions/archived/${t}`,{method:`DELETE`,headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw Error(`Failed to delete archived session: ${n.status}`)}async function oe(e){let t=await N(`${E}/api/settings/retention`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get retention settings: ${t.status}`);return(await t.json()).days}async function se(e,t){let n=await N(`${E}/api/settings/retention`,{method:`PUT`,headers:O(e),body:JSON.stringify({days:t})});if(!n.ok)throw Error(`Failed to update retention settings: ${n.status}`);return(await n.json()).days}async function ce(e){let t=await N(`${E}/api/settings/repos-path`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get repos path: ${t.status}`);return(await t.json()).path}async function le(e,t){let n=await N(`${E}/api/settings/repos-path`,{method:`PUT`,headers:O(e),body:JSON.stringify({path:t})});if(!n.ok){let e=await n.json().catch(()=>({error:`Failed to save repos path`}));throw Error(e.error||`Failed to set repos path: ${n.status}`)}return(await n.json()).path}async function ue(e){let t=await N(`${E}/api/settings/queue-messages`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get queue messages setting: ${t.status}`);return(await t.json()).enabled}async function de(e,t){let n=await N(`${E}/api/settings/queue-messages`,{method:`PUT`,headers:O(e),body:JSON.stringify({enabled:t})});if(!n.ok)throw Error(`Failed to update queue messages setting: ${n.status}`);return(await n.json()).enabled}async function fe(e){let t=await N(`${E}/api/settings/worktree-prefix`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get worktree prefix: ${t.status}`);return(await t.json()).prefix}async function pe(e,t){let n=await N(`${E}/api/settings/worktree-prefix`,{method:`PUT`,headers:O(e),body:JSON.stringify({prefix:t})});if(!n.ok){let e=await n.json().catch(()=>({error:`Failed to save worktree prefix`}));throw Error(e.error||`Failed to set worktree prefix: ${n.status}`)}return(await n.json()).prefix}async function me(e){let t=await N(`${E}/api/settings/agent-name`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get agent name: ${t.status}`);return(await t.json()).name}async function he(e,t){let n=await N(`${E}/api/settings/agent-name`,{method:`PUT`,headers:O(e),body:JSON.stringify({name:t})});if(!n.ok){let e=await n.json().catch(()=>({error:`Failed to save agent name`}));throw Error(e.error||`Failed to set agent name: ${n.status}`)}return(await n.json()).name}async function ge(e,t){let n=await N(`${E}/api/browse-dirs${t?`?path=${encodeURIComponent(t)}`:``}`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok){let e=await n.json().catch(()=>({error:`Failed to browse directory`}));throw Error(e.error||`Failed to browse: ${n.status}`)}return n.json()}async function _e(e){let t=await N(`${E}/api/webhooks/config`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get webhook config: ${t.status}`);return(await t.json()).config}async function ve(e){let t=await N(`${E}/api/webhooks/events`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to get webhook events: ${t.status}`);return(await t.json()).events??[]}function ye(){return`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}/cc/`}function be(e){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useCallback)(async()=>{if(e)try{n(await F(e)),o(null)}catch(e){o(e instanceof Error?e.message:`Failed to load sessions`)}},[e]),l=(0,v.useCallback)(async(t,n)=>{if(!e)return null;i(!0);try{let r=await I(e,t,n);return await c(),r.sessionId}catch(e){return o(e instanceof Error?e.message:`Failed to create session`),null}finally{i(!1)}},[e,c]),u=(0,v.useCallback)(async(t,n)=>{if(e)try{await L(e,t,n),await c()}catch(e){o(e instanceof Error?e.message:`Failed to rename session`)}},[e,c]),d=(0,v.useCallback)(async t=>{if(e)try{await ee(e,t),await c()}catch(e){o(e instanceof Error?e.message:`Failed to delete session`)}},[e,c]);return(0,v.useEffect)(()=>{if(e)return c(),s.current=setInterval(()=>void c(),1e4),()=>{s.current&&clearInterval(s.current)}},[e,c]),{sessions:t,loading:r,error:a,refresh:c,create:l,rename:u,remove:d}}function xe(){let[e,t]=(0,v.useState)(new Map),n=(0,v.useCallback)((e,n)=>{let r=e.requestId??crypto?.randomUUID?.()??`local-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,i={requestId:r,options:e.options,question:e.question||null,multiSelect:e.multiSelect??!1,promptType:e.promptType??null,questions:e.questions,approvePattern:e.approvePattern};t(e=>{let t=new Map(e),a=new Map(e.get(n)??new Map);return a.set(r,i),t.set(n,a),t})},[]),r=(0,v.useCallback)(e=>{t(t=>{if(e){for(let[n,r]of t)if(r.has(e)){let i=new Map(t),a=new Map(r);return a.delete(e),a.size===0?i.delete(n):i.set(n,a),i}return t}return t})},[]),i=(0,v.useCallback)(e=>{t(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=(0,v.useCallback)(()=>{t(e=>e.size===0?e:new Map)},[]);return{getActive:(0,v.useCallback)(t=>{if(!t)return null;let n=e.get(t);return!n||n.size===0?null:n.values().next().value??null},[e]),getQueueSize:(0,v.useCallback)(t=>t?e.get(t)?.size??0:0,[e]),waitingSessions:(0,v.useMemo)(()=>{let t={};for(let[n,r]of e)r.size>0&&(t[n]=!0);return t},[e]),enqueue:n,dismiss:r,clearForSession:i,clearAll:a}}var Se=6e4;function Ce({token:e,onMessageRef:t,onDisconnect:n,onHealthPong:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(`disconnected`),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(1e3),u=(0,v.useRef)(!1),d=(0,v.useRef)(()=>{}),f=(0,v.useRef)(!1),p=(0,v.useRef)(!1),m=(0,v.useRef)(null),h=(0,v.useRef)(n),g=(0,v.useRef)(r);(0,v.useEffect)(()=>{h.current=n},[n]),(0,v.useEffect)(()=>{g.current=r},[r]);let _=(0,v.useCallback)(()=>{c.current&&=(clearInterval(c.current),null),s.current&&=(clearTimeout(s.current),null),m.current&&=(clearTimeout(m.current),null)},[]),y=(0,v.useCallback)(e=>{let t=i.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]),b=(0,v.useCallback)(()=>{if(!e)return;_(),o(`connecting`);let n=new WebSocket(ye());i.current=n,n.onopen=()=>{n.send(JSON.stringify({type:`auth`,token:e})),o(`connected`),l.current=1e3,c.current=setInterval(()=>{y({type:`ping`})},3e4)},n.onmessage=e=>{let n;try{n=JSON.parse(e.data)}catch{return}n.type===`pong`&&p.current&&(p.current=!1,m.current&&=(clearTimeout(m.current),null),g.current?.(y)),t.current?.(n)},n.onclose=e=>{if(o(`disconnected`),_(),i.current=null,h.current?.(),e.code===4001){A();return}u.current||M().then(e=>{if(!e){A();return}s.current=setTimeout(()=>{l.current=Math.min(l.current*2,3e4),d.current()},l.current)}).catch(()=>{s.current=setTimeout(d.current,l.current)})},n.onerror=()=>{}},[e,_,y,t]);(0,v.useEffect)(()=>{d.current=b},[b]);let x=(0,v.useCallback)(()=>{u.current=!0,_(),i.current?.close(),i.current=null,o(`disconnected`)},[_]),S=(0,v.useCallback)(()=>{if(f.current)return;f.current=!0,setTimeout(()=>{f.current=!1},3e3);let e=i.current;if(e&&e.readyState===WebSocket.OPEN){p.current=!0,m.current=setTimeout(()=>{p.current=!1,m.current=null,l.current=1e3,e.close()},2e3),y({type:`ping`});return}e&&e.readyState===WebSocket.CONNECTING||M().then(e=>{if(!e){A();return}l.current=1e3,s.current&&=(clearTimeout(s.current),null),b()}).catch(()=>{s.current=setTimeout(d.current,l.current)})},[y,b]);return(0,v.useEffect)(()=>(e&&(u.current=!1,b()),()=>{x()}),[e]),(0,v.useEffect)(()=>{if(!e)return;let t=setInterval(async()=>{await M()||A()},Se);return()=>clearInterval(t)},[e]),{connState:a,send:y,disconnect:x,restoreSession:S,reconnect:b}}var we=500,Te=0;function Ee(){return`m${++Te}`}function De(e,t){let n=e.length>0?e[e.length-1]:void 0;switch(t.type){case`output`:return n&&n.type===`assistant`&&!n.complete?n.text+=t.data:e.push({type:`assistant`,text:t.data,complete:!1,ts:Date.now(),key:Ee()}),!0;case`result`:return n&&n.type===`assistant`&&!n.complete?(n.complete=!0,!0):!1;case`system_message`:return e.push({type:`system`,subtype:t.subtype,text:t.text,model:t.model,key:Ee()}),!0;case`user_echo`:return e.push({type:`user`,text:t.text,ts:Date.now(),key:Ee()}),!0;case`claude_started`:return e.push({type:`system`,subtype:`init`,text:`Session started`,key:Ee()}),!0;case`tool_active`:return n&&n.type===`tool_group`?n.tools.push({name:t.toolName,active:!0}):e.push({type:`tool_group`,tools:[{name:t.toolName,active:!0}],key:Ee()}),!0;case`tool_done`:if(n&&n.type===`tool_group`){for(let e=n.tools.length-1;e>=0;e--)if(n.tools[e].name===t.toolName&&n.tools[e].active){n.tools[e]={name:t.toolName,summary:t.summary,active:!1};break}return!0}return!1;case`tool_output`:return e.push({type:`tool_output`,content:t.content,isError:t.isError,key:Ee()}),!0;case`image`:return e.push({type:`image`,base64:t.base64,mediaType:t.mediaType,key:Ee()}),!0;case`planning_mode`:return e.push({type:`planning_mode`,active:t.active,key:Ee()}),!0;default:return!1}}function Oe(e,t){let n=[...e],r=n.length-1;if(r>=0){let e=n[r];e.type===`assistant`&&!e.complete?n[r]={...e}:e.type===`tool_group`&&(n[r]={...e,tools:[...e.tools]})}return De(n,t)?n:e}function ke(e){return e.length<=we?e:[{type:`system`,subtype:`trim`,text:`Older messages trimmed`,key:Ee()},...e.slice(-we+1)]}function Ae(e){let t=[];for(let n of e)De(t,n);return t}function je({token:e,onSessionCreated:t,onSessionJoined:n,onSessionRenamed:r,onSessionsUpdated:i,onError:a,onRawMessage:o}){let s=(0,v.useRef)({onSessionCreated:t,onSessionJoined:n,onSessionRenamed:r,onSessionsUpdated:i,onError:a,onRawMessage:o});(0,v.useEffect)(()=>{s.current={onSessionCreated:t,onSessionJoined:n,onSessionRenamed:r,onSessionsUpdated:i,onError:a,onRawMessage:o}});let[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)([]),[g,_]=(0,v.useState)(()=>localStorage.getItem(`claude-model`)??null),[y,b]=(0,v.useState)(()=>localStorage.getItem(`claude-permission-mode`)||`acceptEdits`),[x,S]=(0,v.useState)(null),C=xe(),w=(0,v.useRef)(null),[T,E]=(0,v.useState)(null),D=C.getActive(T),O=C.getQueueSize(T),k=(0,v.useRef)(``),A=(0,v.useRef)(null),j=(0,v.useCallback)(()=>{A.current=null;let e=k.current;e&&(k.current=``,l(t=>{let n=t[t.length-1];if(n&&n.type===`assistant`&&!n.complete){let r=[...t];return r[r.length-1]={...n,text:n.text+e},ke(r)}return ke([...t,{type:`assistant`,text:e,complete:!1,ts:Date.now(),key:Ee()}])}))},[]),M=(0,v.useCallback)(()=>{k.current&&(A.current&&=(cancelAnimationFrame(A.current),null),j())},[j]),N=(0,v.useCallback)(e=>{switch(s.current.onRawMessage?.(e),e.type){case`thinking`:S(e.summary),p(!0);break;case`output`:S(null),p(!0),k.current+=e.data,A.current||=requestAnimationFrame(j);break;case`result`:p(!1),S(null),M(),l(t=>ke(Oe(t,e)));break;case`system_message`:e.subtype===`init`&&e.model&&(_(e.model),localStorage.setItem(`claude-model`,e.model)),M(),l(t=>ke(Oe(t,e)));break;case`user_echo`:M(),l(t=>ke(Oe(t,e)));break;case`tool_active`:S(null),p(!0),M(),l(t=>ke(Oe(t,e)));break;case`tool_done`:M(),l(t=>ke(Oe(t,e)));break;case`tool_output`:M(),l(t=>ke(Oe(t,e)));break;case`image`:M(),l(t=>ke(Oe(t,e)));break;case`planning_mode`:d(e.active),l(t=>ke(Oe(t,e)));break;case`todo_update`:h(e.tasks);break;case`prompt`:{let t=e.sessionId??w.current;if(!t)break;C.enqueue(e,t),t===w.current&&(p(!1),S(null));break}case`prompt_dismiss`:C.dismiss(e.requestId);break;case`session_created`:w.current=e.sessionId,E(e.sessionId),l([]),h([]),p(!1),S(null),s.current.onSessionCreated?.(e.sessionId);break;case`session_joined`:{w.current=e.sessionId,E(e.sessionId),p(!1),S(null),e.model&&(_(e.model),localStorage.setItem(`claude-model`,e.model)),e.permissionMode&&(b(e.permissionMode),localStorage.setItem(`claude-permission-mode`,e.permissionMode));let t=[],n=!1,r=[];if(e.outputBuffer?.length){t=Ae(e.outputBuffer);for(let t of e.outputBuffer)t.type===`planning_mode`&&(n=t.active),t.type===`todo_update`&&(r=t.tasks)}d(n),h(r),l(ke(t)),s.current.onSessionJoined?.(e.sessionId);break}case`claude_started`:l(t=>ke(Oe(t,e)));break;case`claude_stopped`:case`exit`:{p(!1),S(null);let e=w.current;e&&C.clearForSession(e);break}case`error`:s.current.onError?.(e.message);break;case`session_deleted`:l(e=>ke([...e,{type:`system`,subtype:`error`,text:`Session was deleted`,key:Ee()}]));break;case`connected`:case`pong`:break;case`session_name_update`:s.current.onSessionRenamed?.(e.sessionId,e.name);break;case`sessions_updated`:s.current.onSessionsUpdated?.();break;case`worktree_created`:s.current.onSessionsUpdated?.();break;case`info`:break}},[j,M,C]),P=(0,v.useRef)(N);(0,v.useEffect)(()=>{P.current=N},[N]);let{connState:F,send:I,disconnect:L,restoreSession:ee,reconnect:R}=Ce({token:e,onMessageRef:P,onDisconnect:(0,v.useCallback)(()=>{p(!1),S(null),A.current&&=(cancelAnimationFrame(A.current),null)},[]),onHealthPong:(0,v.useCallback)(e=>{let t=w.current;t&&e({type:`join_session`,sessionId:t})},[])}),te=(0,v.useCallback)(e=>{I({type:`join_session`,sessionId:e})},[I]),z=(0,v.useCallback)((e,t,n,r)=>{I({type:`create_session`,name:e,workingDir:t,useWorktree:n,permissionMode:r})},[I]),B=(0,v.useCallback)((e,t)=>{I({type:`input`,data:e,...t?{displayText:t}:{}}),p(!0);let n=w.current;n&&C.clearForSession(n)},[I,C]),V=(0,v.useCallback)(e=>{let t=D?.requestId;I({type:`prompt_response`,value:e,requestId:t}),t&&C.dismiss(t),p(!0)},[I,D?.requestId,C]),ne=(0,v.useCallback)(()=>{I({type:`leave_session`}),w.current=null,E(null),p(!1),S(null)},[I]),re=(0,v.useCallback)(()=>{l([])},[]),ie=(0,v.useCallback)((e,t=`notification`)=>{l(n=>ke([...n,{type:`system`,subtype:t,text:e,key:Ee()}]))},[]),ae=(0,v.useCallback)(e=>{I({type:`set_model`,model:e}),_(e),localStorage.setItem(`claude-model`,e)},[I]),oe=(0,v.useCallback)(()=>{I({type:`move_to_worktree`})},[I]),se=(0,v.useCallback)(e=>{I({type:`set_permission_mode`,permissionMode:e}),b(e),localStorage.setItem(`claude-permission-mode`,e)},[I]);return{connState:F,messages:c,tasks:m,planningMode:u,isProcessing:f,thinkingSummary:x,waitingSessions:C.waitingSessions,activePrompt:D,promptQueueSize:O,currentModel:g,send:I,joinSession:te,createSession:z,sendInput:B,sendPromptResponse:V,leaveSession:ne,clearMessages:re,addSystemMessage:ie,disconnect:L,reconnect:R,restoreSession:ee,setModel:ae,currentPermissionMode:y,setPermissionMode:se,moveToWorktree:oe}}function Me(e){let t=(0,v.useRef)(e);(0,v.useEffect)(()=>{t.current=e}),(0,v.useEffect)(()=>{function e(){document.visibilityState===`visible`&&t.current()}return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}function Ne(e){if(e===`/joe`||e===`/joe/`||e===`/orchestrator`||e===`/orchestrator/`)return{path:e,sessionId:null,view:`orchestrator`};if(e===`/workflows`||e===`/workflows/`)return{path:e,sessionId:null,view:`workflows`};let t=e.match(/^\/s\/([a-f0-9-]+)\/?$/);return{path:e,sessionId:t?t[1]:null,view:`chat`}}function Pe(){let[e,t]=(0,v.useState)(()=>Ne(window.location.pathname));(0,v.useEffect)(()=>{function e(){t(Ne(window.location.pathname))}return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let n=(0,v.useCallback)((e,n=!1)=>{e!==window.location.pathname&&(n?history.replaceState(null,``,e):history.pushState(null,``,e),t(Ne(e)))},[]);return{...e,navigate:n}}var Fe=`codekin-tentative-`;function Ie(e,t){let n=`${Fe}${e}`;t.length===0?localStorage.removeItem(n):localStorage.setItem(n,JSON.stringify(t.map(e=>e.text)))}function Le(e){try{let t=localStorage.getItem(`${Fe}${e}`);if(t)return JSON.parse(t).map(e=>({text:e,files:[]}))}catch{}return[]}function Re(){let e={};try{for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(Fe)){let t=n.slice(18),r=Le(t);r.length>0&&(e[t]=r)}}}catch{}return e}function ze(){let[e,t]=(0,v.useState)(Re);return{queues:e,addToQueue:(0,v.useCallback)((e,n,r=[])=>{t(t=>{let i={...t,[e]:[...t[e]??[],{text:n,files:r}]};return Ie(e,i[e]),i})},[]),clearQueue:(0,v.useCallback)(e=>{t(t=>{if(!t[e])return t;let n=Object.fromEntries(Object.entries(t).filter(([t])=>t!==e));return Ie(e,[]),n})},[])}}function Be(e){return e.groupDir??e.workingDir}function Ve({sessions:e,repos:t,activeSessionId:n,setActiveSessionId:r,joinSession:i,leaveSession:a,clearMessages:o,wsCreateSession:s,removeSession:c,pendingContextRef:l,useWorktreeRef:u,permissionModeRef:d}){let f=n?e.find(e=>e.id===n)??null:null,p=f?Be(f):null;return{activeSession:f,activeWorkingDir:p,handleOpenSession:(0,v.useCallback)(t=>{let n=e.filter(e=>Be(e)===t.workingDir);if(n.length>0){let e=n[n.length-1];o(),a(),i(e.id);return}o(),a(),s(`hub:${t.id}`,t.workingDir,u.current,d.current)},[e,i,s,a,o,u,d]),handleSelectSession:(0,v.useCallback)(e=>{e!==n&&(o(),a(),i(e))},[n,a,i,o]),handleDeleteSession:(0,v.useCallback)(async t=>{if(t===n){o(),a();let n=e.find(e=>e.id===t),s=e.filter(e=>e.id!==t);if(s.length>0){let e=n?s.filter(e=>Be(e)===Be(n)):[];i((e.length>0?e[0]:s[0]).id)}else r(null)}await c(t)},[n,e,o,a,i,r,c]),handleSelectRepo:(0,v.useCallback)(t=>{if(t===p)return;let n=e.filter(e=>Be(e)===t);if(n.length>0){let e=n[n.length-1];o(),a(),i(e.id)}},[p,e,o,a,i]),handleDeleteRepo:(0,v.useCallback)(async t=>{let s=e.filter(e=>Be(e)===t);if(s.some(e=>e.id===n)){o(),a();let n=e.filter(e=>Be(e)!==t);n.length>0?i(n[0].id):r(null)}for(let e of s)await c(e.id)},[e,n,o,a,i,r,c]),handleNewSessionForRepo:(0,v.useCallback)(()=>{if(!p)return;let e=t.find(e=>e.workingDir===p),n=e?.workingDir??p,r=e?.id??n.split(`/`).pop()??`session`;o(),a(),s(`hub:${r}`,n,u.current,d.current)},[p,t,o,a,s,d,u]),handleNewSessionFromArchive:(0,v.useCallback)((e,n)=>{let r=t.find(t=>t.workingDir===e);r&&(l.current=n,o(),a(),s(`hub:${r.id}`,r.workingDir,u.current,d.current))},[t,o,a,s,l,d,u])}}var He=`/cc`,Ue=`codekin-starred-docs`;function We(){try{return JSON.parse(localStorage.getItem(Ue)||`{}`)}catch{return{}}}function Ge(e){localStorage.setItem(Ue,JSON.stringify(e))}function Ke(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)([]),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(We),C=(0,v.useCallback)(async(e,t)=>{b(e),p(!0),_(!0),h([]);try{let n=new URLSearchParams({repo:e}),r=await fetch(`${He}/api/docs?${n}`,{headers:{Authorization:`Bearer ${t}`}});if(!r.ok)throw Error(`Failed to list docs: ${r.status}`);h((await r.json()).files??[])}catch{h([])}finally{_(!1)}},[]),w=(0,v.useCallback)(()=>{p(!1)},[]),T=(0,v.useCallback)(async(e,n,i)=>{d(e),t(n),r(null),s(null),a(!0),l(!1),p(!1);try{let t=new URLSearchParams({repo:e,file:n}),a=await fetch(`${He}/api/docs/file?${t}`,{headers:{Authorization:`Bearer ${i}`}});if(!a.ok)throw Error(`Failed to load file: ${a.status}`);r((await a.json()).content)}catch(e){s(e instanceof Error?e.message:`Failed to load file`)}finally{a(!1)}},[]),E=(0,v.useCallback)(()=>{t(null),r(null),s(null),a(!1),l(!1),d(null)},[]),D=(0,v.useCallback)(()=>{l(e=>!e)},[]),O=u?x[u]??[]:[],k=e!==null&&O.includes(e),A=(0,v.useCallback)(()=>{!u||!e||S(t=>{let n=t[u]??[],r=n.includes(e)?n.filter(t=>t!==e):[...n,e],i={...t,[u]:r};return Ge(i),i})},[u,e]),j=y?x[y]??[]:[];return{isOpen:e!==null,selectedFile:e,content:n,loading:i,error:o,rawMode:c,toggleRawMode:D,openFile:T,close:E,repoWorkingDir:u,pickerOpen:f,pickerFiles:m,pickerLoading:g,openPicker:C,closePicker:w,pickerRepoDir:y,starredDocs:j,isCurrentFileStarred:k,toggleStarCurrentFile:A}}var qe=1024;function Je(e=qe){let[t,n]=(0,v.useState)(()=>typeof window<`u`?window.innerWidth<e:!1);return(0,v.useEffect)(()=>{let t=window.matchMedia(`(max-width: ${e-1}px)`),r=e=>n(e.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var Ye=[{command:`/clear`,name:`Clear session`,description:`Clear conversation and start fresh`,category:`builtin`,aliases:[`/reset`,`/new`]},{command:`/compact`,name:`Compact`,description:`Compact conversation to save context`,category:`builtin`},{command:`/model`,name:`Model`,description:`Change the active model`,category:`builtin`},{command:`/help`,name:`Help`,description:`Show available commands`,category:`builtin`},{command:`/cost`,name:`Cost`,description:`Show session cost info`,category:`builtin`},{command:`/status`,name:`Status`,description:`Show session status`,category:`builtin`}],Xe=new Map;for(let e of Ye){Xe.set(e.command,e.command);for(let t of e.aliases??[])Xe.set(t,e.command)}function Ze(e){return Xe.get(e)}var Qe=[{command:`/commit`,name:`Commit`,description:`Create a git commit`,category:`bundled`},{command:`/simplify`,name:`Simplify`,description:`Review and simplify changed code`,category:`bundled`},{command:`/loop`,name:`Loop`,description:`Run a command on a recurring interval`,category:`bundled`},{command:`/debug`,name:`Debug`,description:`Debug an issue step by step`,category:`bundled`},{command:`/claude-api`,name:`Claude API`,description:`Help with Anthropic SDK usage`,category:`bundled`}];function $e(e){let t=new Set,n=[];for(let r of e)t.has(r.command)||(t.add(r.command),n.push({command:r.command,name:r.name,description:r.description,category:`skill`,content:r.content}));for(let e of Qe)t.has(e.command)||(t.add(e.command),n.push(e));for(let e of Ye)if(!t.has(e.command)){t.add(e.command);for(let n of e.aliases??[])t.add(n);n.push(e)}return n}var et=new Set(Qe.map(e=>e.command));function tt({token:e,activeSessionId:t,activeWorkingDir:n,sessions:r,allSkills:i,sendInput:a,onBuiltinCommand:o,tentativeQueues:s,addToQueue:c,clearQueue:l,docsContext:u,queueEnabled:d}){let[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)({}),g=(0,v.useMemo)(()=>t?m[t]??[]:[],[t,m]),_=(0,v.useCallback)(e=>{t&&h(n=>({...n,[t]:[...n[t]??[],...e]}))},[t]),y=(0,v.useCallback)(e=>{t&&h(n=>({...n,[t]:(n[t]??[]).filter((t,n)=>n!==e)}))},[t]),b=(0,v.useCallback)(e=>{let t=e.trim();if(!t.startsWith(`/`))return{expanded:e,handled:!1};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),a=n===-1?``:t.slice(n+1).trim(),s=Ze(r);if(s)return o(s,a),{expanded:e,handled:!0};let c=i.find(e=>e.command===r);if(c?.content){let t=c.content.replace(/\$ARGUMENTS/g,a||`(no arguments provided)`),n=[`[Skill: ${c.name}]`,``,t];return a&&n.push(``,`User instructions: ${a}`),{expanded:n.join(`
|
|
10
|
-
`),displayText:e,handled:!1}}return et.has(r)?{expanded:e,displayText:e,handled:!1}:{expanded:e,handled:!1}},[i,o]),x=(0,v.useCallback)(async i=>{if(!e)return;let{expanded:o,displayText:l,handled:f}=b(i);if(f)return;let m=u.isOpen&&u.selectedFile&&u.repoWorkingDir?`[Viewing doc: ${u.selectedFile} in ${u.repoWorkingDir}]\n\n`:``,_=(s[t??``]?.length??0)>0,v=!!n&&r.some(e=>Be(e)===n&&e.isProcessing&&e.id!==t);if(d&&t&&(_||v)){if(g.length>0){h(e=>({...e,[t]:[]})),p(`Uploading files...`);try{c(t,await z(e,g,m+o)),p(null)}catch(e){c(t,m+o),p(`Upload failed: ${e instanceof Error?e.message:`unknown error`}`),setTimeout(()=>p(null),3e3)}}else c(t,m+o);return}let y=g;if(y.length===0){a(m+o,l);return}p(`Uploading files...`);try{let n=await z(e,y,m+o);t&&h(e=>({...e,[t]:[]})),p(null),a(n)}catch(e){p(`Upload failed: ${e instanceof Error?e.message:`unknown error`}`),setTimeout(()=>p(null),3e3)}},[e,t,n,r,s,c,g,b,a,u.isOpen,u.selectedFile,u.repoWorkingDir,d]),S=(0,v.useCallback)(async t=>{let n=s[t]??[];l(t);for(let t=0;t<n.length;t++){let r=n[t];if(t>0&&await new Promise(e=>setTimeout(e,100)),r.files.length>0&&e)try{a(await z(e,r.files,r.text))}catch{a(r.text)}else a(r.text)}},[s,l,a,e]),C=(0,v.useCallback)(e=>{l(e)},[l]);return(0,v.useEffect)(()=>{for(let[e,n]of Object.entries(s)){if(n.length===0)continue;let i=r.find(t=>t.id===e);if(!i)continue;let a=Be(i);r.filter(t=>Be(t)===a&&t.isProcessing&&t.id!==e).length===0&&e===t&&(S(e),setTimeout(()=>{p(`Session finished — starting queued session.`),setTimeout(()=>p(null),3e3)},0))}},[r,t,s,S]),{handleSend:x,handleExecuteTentative:S,handleDiscardTentative:C,tentativeMessages:t?(s[t]??[]).map((e,t)=>({type:`tentative`,text:e.files.length>0?`${e.text}\n📎 ${e.files.length} file${e.files.length>1?`s`:``} attached`:e.text,index:t,key:`tentative-${t}`})):[],activeTentativeCount:t?s[t]?.length??0:0,pendingFiles:g,addFiles:_,removeFile:y,uploadStatus:f}}function nt(e,t,n){let r=e[e.length-1];if(r&&r.type===`assistant`&&!r.complete)return`Writing...`;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`tool_group`){let e=n.tools.find(e=>e.active);if(e)return`Running ${e.name}...`;break}if(n.type!==`planning_mode`&&n.type!==`tool_output`)break}if(t)return n?`Thinking: ${n}`:`Thinking...`}var rt={outline:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},filled:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`,stroke:`none`}},H=(e,t,n,r)=>{let i=(0,v.forwardRef)(({color:n=`currentColor`,size:i=24,stroke:a=2,title:o,className:s,children:c,...l},u)=>(0,v.createElement)(`svg`,{ref:u,...rt[e],width:i,height:i,className:[`tabler-icon`,`tabler-icon-${t}`,s].join(` `),...e===`filled`?{fill:n}:{strokeWidth:a,stroke:n},...l},[o&&(0,v.createElement)(`title`,{key:`svg-title`},o),...r.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]]));return i.displayName=`${n}`,i},it=H(`outline`,`alert-triangle`,`AlertTriangle`,[[`path`,{d:`M12 9v4`,key:`svg-0`}],[`path`,{d:`M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),at=H(`outline`,`archive`,`Archive`,[[`path`,{d:`M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2`,key:`svg-0`}],[`path`,{d:`M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10`,key:`svg-1`}],[`path`,{d:`M10 12l4 0`,key:`svg-2`}]]),ot=H(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),st=H(`outline`,`arrow-left`,`ArrowLeft`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M5 12l6 6`,key:`svg-1`}],[`path`,{d:`M5 12l6 -6`,key:`svg-2`}]]),ct=H(`outline`,`arrow-right`,`ArrowRight`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M13 18l6 -6`,key:`svg-1`}],[`path`,{d:`M13 6l6 6`,key:`svg-2`}]]),lt=H(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),ut=H(`outline`,`bell`,`Bell`,[[`path`,{d:`M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6`,key:`svg-0`}],[`path`,{d:`M9 17v1a3 3 0 0 0 6 0v-1`,key:`svg-1`}]]),dt=H(`outline`,`book`,`Book`,[[`path`,{d:`M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0`,key:`svg-0`}],[`path`,{d:`M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0`,key:`svg-1`}],[`path`,{d:`M3 6l0 13`,key:`svg-2`}],[`path`,{d:`M12 6l0 13`,key:`svg-3`}],[`path`,{d:`M21 6l0 13`,key:`svg-4`}]]),ft=H(`outline`,`brand-github`,`BrandGithub`,[[`path`,{d:`M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5`,key:`svg-0`}]]),pt=H(`outline`,`calendar-event`,`CalendarEvent`,[[`path`,{d:`M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M16 3l0 4`,key:`svg-1`}],[`path`,{d:`M8 3l0 4`,key:`svg-2`}],[`path`,{d:`M4 11l16 0`,key:`svg-3`}],[`path`,{d:`M8 15h2v2h-2l0 -2`,key:`svg-4`}]]),mt=H(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),ht=H(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]),gt=H(`outline`,`chevron-left`,`ChevronLeft`,[[`path`,{d:`M15 6l-6 6l6 6`,key:`svg-0`}]]),_t=H(`outline`,`chevron-right`,`ChevronRight`,[[`path`,{d:`M9 6l6 6l-6 6`,key:`svg-0`}]]),vt=H(`outline`,`chevron-up`,`ChevronUp`,[[`path`,{d:`M6 15l6 -6l6 6`,key:`svg-0`}]]),yt=H(`outline`,`circle`,`Circle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}]]),bt=H(`outline`,`clock`,`Clock`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 7v5l3 3`,key:`svg-1`}]]),xt=H(`outline`,`cloud`,`Cloud`,[[`path`,{d:`M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878`,key:`svg-0`}]]),St=H(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),Ct=H(`outline`,`dots`,`Dots`,[[`path`,{d:`M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),wt=H(`outline`,`external-link`,`ExternalLink`,[[`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 13l9 -9`,key:`svg-1`}],[`path`,{d:`M15 4h5v5`,key:`svg-2`}]]),Tt=H(`outline`,`eye`,`Eye`,[[`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6`,key:`svg-1`}]]),Et=H(`outline`,`file-code`,`FileCode`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}],[`path`,{d:`M10 13l-1 2l1 2`,key:`svg-2`}],[`path`,{d:`M14 13l1 2l-1 2`,key:`svg-3`}]]),Dt=H(`outline`,`file-text`,`FileText`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}],[`path`,{d:`M9 9l1 0`,key:`svg-2`}],[`path`,{d:`M9 13l6 0`,key:`svg-3`}],[`path`,{d:`M9 17l6 0`,key:`svg-4`}]]),Ot=H(`outline`,`file`,`File`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}]]),kt=H(`outline`,`folder-open`,`FolderOpen`,[[`path`,{d:`M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2`,key:`svg-0`}]]),At=H(`outline`,`folder`,`Folder`,[[`path`,{d:`M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2`,key:`svg-0`}]]),jt=H(`outline`,`git-branch`,`GitBranch`,[[`path`,{d:`M5 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M5 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M15 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M7 8l0 8`,key:`svg-3`}],[`path`,{d:`M9 18h6a2 2 0 0 0 2 -2v-5`,key:`svg-4`}],[`path`,{d:`M14 14l3 -3l3 3`,key:`svg-5`}]]),Mt=H(`outline`,`key`,`Key`,[[`path`,{d:`M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0`,key:`svg-0`}],[`path`,{d:`M15 9h.01`,key:`svg-1`}]]),Nt=H(`outline`,`loader-2`,`Loader2`,[[`path`,{d:`M12 3a9 9 0 1 0 9 9`,key:`svg-0`}]]),Pt=H(`outline`,`logout`,`Logout`,[[`path`,{d:`M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M9 12h12l-3 -3`,key:`svg-1`}],[`path`,{d:`M18 15l3 -3`,key:`svg-2`}]]),Ft=H(`outline`,`map-2`,`Map2`,[[`path`,{d:`M12 18.5l-3 -1.5l-6 3v-13l6 -3l6 3l6 -3v7.5`,key:`svg-0`}],[`path`,{d:`M9 4v13`,key:`svg-1`}],[`path`,{d:`M15 7v5.5`,key:`svg-2`}],[`path`,{d:`M21.121 20.121a3 3 0 1 0 -4.242 0c.418 .419 1.125 1.045 2.121 1.879c1.051 -.89 1.759 -1.516 2.121 -1.879`,key:`svg-3`}],[`path`,{d:`M19 18v.01`,key:`svg-4`}]]),It=H(`outline`,`menu-2`,`Menu2`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l16 0`,key:`svg-2`}]]),Lt=H(`outline`,`message-plus`,`MessagePlus`,[[`path`,{d:`M8 9h8`,key:`svg-0`}],[`path`,{d:`M8 13h6`,key:`svg-1`}],[`path`,{d:`M12.01 18.594l-4.01 2.406v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5`,key:`svg-2`}],[`path`,{d:`M16 19h6`,key:`svg-3`}],[`path`,{d:`M19 16v6`,key:`svg-4`}]]),Rt=H(`outline`,`minus`,`Minus`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}]]),zt=H(`outline`,`moon`,`Moon`,[[`path`,{d:`M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008`,key:`svg-0`}]]),Bt=H(`outline`,`palette`,`Palette`,[[`path`,{d:`M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25`,key:`svg-0`}],[`path`,{d:`M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}]]),Vt=H(`outline`,`paperclip`,`Paperclip`,[[`path`,{d:`M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5`,key:`svg-0`}]]),Ht=H(`outline`,`pencil`,`Pencil`,[[`path`,{d:`M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4`,key:`svg-0`}],[`path`,{d:`M13.5 6.5l4 4`,key:`svg-1`}]]),Ut=H(`outline`,`player-pause`,`PlayerPause`,[[`path`,{d:`M6 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12`,key:`svg-0`}],[`path`,{d:`M14 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12`,key:`svg-1`}]]),Wt=H(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),Gt=H(`outline`,`player-stop`,`PlayerStop`,[[`path`,{d:`M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10`,key:`svg-0`}]]),Kt=H(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]),qt=H(`outline`,`refresh`,`Refresh`,[[`path`,{d:`M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4`,key:`svg-0`}],[`path`,{d:`M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,key:`svg-1`}]]),Jt=H(`outline`,`robot-face`,`RobotFace`,[[`path`,{d:`M6 5h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M9 16c1 .667 2 1 3 1s2 -.333 3 -1`,key:`svg-1`}],[`path`,{d:`M9 7l-1 -4`,key:`svg-2`}],[`path`,{d:`M15 7l1 -4`,key:`svg-3`}],[`path`,{d:`M9 12v-1`,key:`svg-4`}],[`path`,{d:`M15 12v-1`,key:`svg-5`}]]),Yt=H(`outline`,`robot`,`Robot`,[[`path`,{d:`M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4`,key:`svg-0`}],[`path`,{d:`M12 2v2`,key:`svg-1`}],[`path`,{d:`M9 12v9`,key:`svg-2`}],[`path`,{d:`M15 12v9`,key:`svg-3`}],[`path`,{d:`M5 16l4 -2`,key:`svg-4`}],[`path`,{d:`M15 14l4 2`,key:`svg-5`}],[`path`,{d:`M9 18h6`,key:`svg-6`}],[`path`,{d:`M10 8v.01`,key:`svg-7`}],[`path`,{d:`M14 8v.01`,key:`svg-8`}]]),Xt=H(`outline`,`send`,`Send`,[[`path`,{d:`M10 14l11 -11`,key:`svg-0`}],[`path`,{d:`M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5`,key:`svg-1`}]]),Zt=H(`outline`,`settings`,`Settings`,[[`path`,{d:`M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065`,key:`svg-0`}],[`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`,key:`svg-1`}]]),Qt=H(`outline`,`shield-check`,`ShieldCheck`,[[`path`,{d:`M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06`,key:`svg-0`}],[`path`,{d:`M15 19l2 2l4 -4`,key:`svg-1`}]]),$t=H(`outline`,`sparkles`,`Sparkles`,[[`path`,{d:`M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6`,key:`svg-0`}]]),en=H(`outline`,`star`,`Star`,[[`path`,{d:`M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245`,key:`svg-0`}]]),tn=H(`outline`,`sun`,`Sun`,[[`path`,{d:`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7`,key:`svg-1`}]]),nn=H(`outline`,`terminal-2`,`Terminal2`,[[`path`,{d:`M8 9l3 3l-3 3`,key:`svg-0`}],[`path`,{d:`M13 15l3 0`,key:`svg-1`}],[`path`,{d:`M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12`,key:`svg-2`}]]),rn=H(`outline`,`timeline`,`Timeline`,[[`path`,{d:`M4 16l6 -7l5 5l5 -6`,key:`svg-0`}],[`path`,{d:`M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}]]),an=H(`outline`,`trash`,`Trash`,[[`path`,{d:`M4 7l16 0`,key:`svg-0`}],[`path`,{d:`M10 11l0 6`,key:`svg-1`}],[`path`,{d:`M14 11l0 6`,key:`svg-2`}],[`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`,key:`svg-3`}],[`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`,key:`svg-4`}]]),on=H(`outline`,`upload`,`Upload`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 9l5 -5l5 5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),sn=H(`outline`,`x`,`X`,[[`path`,{d:`M18 6l-12 12`,key:`svg-0`}],[`path`,{d:`M6 6l12 12`,key:`svg-1`}]]),cn=H(`filled`,`circle-check-filled`,`CircleCheckFilled`,[[`path`,{d:`M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z`,key:`svg-0`}]]),ln=H(`filled`,`circle-x-filled`,`CircleXFilled`,[[`path`,{d:`M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-6.489 5.8a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z`,key:`svg-0`}]]),un=H(`filled`,`star-filled`,`StarFilled`,[[`path`,{d:`M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z`,key:`svg-0`}]]),dn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),U=o(((e,t)=>{t.exports=dn()}))();function fn({value:e,token:t,placeholder:n=`~/repos (default)`,helpText:r,onSave:i,inputClass:a}){let[o,s]=(0,v.useState)(e),[c,l]=(0,v.useState)(e),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)([]),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(null),T=(0,v.useRef)(null);(0,v.useEffect)(()=>{s(e),l(e)},[e]),(0,v.useEffect)(()=>{if(!m)return;function e(e){T.current&&!T.current.contains(e.target)&&h(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);async function E(){if(!(!t||o===c)){d(!0),p(null);try{await i(o),l(o)}catch(e){p(e instanceof Error?e.message:`Failed to save path`)}finally{d(!1)}}}async function D(e){if(t){S(!0),w(null);try{let n=await ge(t,e);_(n.path),b(n.dirs),h(!0)}catch(e){w(e instanceof Error?e.message:`Failed to browse directory`)}finally{S(!1)}}}function O(){g&&D(g.replace(/\/[^/]+\/?$/,``)||`/`)}function k(e){D(g===`/`?`/${e}`:`${g}/${e}`)}function A(){g&&(s(g),h(!1))}return(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`label`,{className:`mb-1.5 block text-neutral-5`,style:{fontSize:a?void 0:`13px`},children:(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(At,{size:13,className:`text-neutral-6`}),`Repositories Path`]})}),(0,U.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,U.jsx)(`input`,{type:`text`,value:o,onChange:e=>{s(e.target.value),p(null)},onBlur:()=>void E(),onKeyDown:e=>{e.key===`Enter`&&E()},placeholder:n,disabled:u,className:`flex-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 ${a??`text-[13px]`} font-mono text-neutral-3 outline-none focus:border-primary-7 disabled:opacity-50`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>m?h(!1):void D(o||void 0),disabled:!t||x,className:`flex items-center gap-1 rounded border border-neutral-9 bg-neutral-10 px-2.5 py-2 text-[13px] text-neutral-4 hover:border-neutral-7 hover:text-neutral-3 disabled:opacity-50`,title:`Browse folders`,children:x?(0,U.jsx)(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-neutral-6 border-t-transparent`}):(0,U.jsx)(kt,{size:16})})]}),(f||C)&&(0,U.jsx)(`p`,{className:`mt-1 text-[12px] text-red-400`,children:f||C}),r&&!f&&!C&&(0,U.jsx)(`p`,{className:`mt-1 text-[12px] text-neutral-6`,children:r}),m&&g!==null&&(0,U.jsxs)(`div`,{ref:T,className:`absolute z-50 mt-1 w-full rounded-lg border border-neutral-8 bg-neutral-10 shadow-lg`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-neutral-8 px-3 py-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:O,className:`rounded p-0.5 text-neutral-5 hover:bg-neutral-8 hover:text-neutral-3`,title:`Go up`,children:(0,U.jsx)(lt,{size:14})}),(0,U.jsx)(`span`,{className:`flex-1 truncate font-mono text-[12px] text-neutral-4`,children:g}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>h(!1),className:`rounded p-0.5 text-neutral-5 hover:bg-neutral-8 hover:text-neutral-3`,children:(0,U.jsx)(sn,{size:14})})]}),(0,U.jsx)(`div`,{className:`max-h-48 overflow-y-auto py-1`,children:y.length===0?(0,U.jsx)(`p`,{className:`px-3 py-2 text-[12px] text-neutral-6`,children:`No subdirectories`}):y.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>k(e),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-neutral-3 hover:bg-neutral-8`,children:[(0,U.jsx)(At,{size:14,className:`shrink-0 text-neutral-5`}),(0,U.jsx)(`span`,{className:`truncate`,children:e}),(0,U.jsx)(_t,{size:12,className:`ml-auto shrink-0 text-neutral-6`})]},e))}),(0,U.jsx)(`div`,{className:`border-t border-neutral-8 px-3 py-2`,children:(0,U.jsx)(`button`,{type:`button`,onClick:A,className:`w-full rounded bg-primary-7 px-3 py-1.5 text-[13px] font-medium text-white hover:bg-primary-6`,children:`Select this folder`})})]})]})}function pn({icon:e,title:t,children:n}){return(0,U.jsxs)(`section`,{className:`settings-section-card rounded-lg border border-neutral-9/60 bg-neutral-10/30`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-neutral-9/40`,children:[(0,U.jsx)(`span`,{className:`text-neutral-5`,children:e}),(0,U.jsx)(`h3`,{className:`text-[13px] font-semibold uppercase tracking-wide text-neutral-5`,children:t})]}),(0,U.jsx)(`div`,{className:`px-4 py-4`,children:n})]})}function mn({text:e}){let[t,n]=(0,v.useState)(!1);return(0,U.jsx)(`button`,{onClick:(0,v.useCallback)(()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},[e]),className:`rounded p-1.5 text-neutral-5 hover:bg-neutral-9 hover:text-neutral-2 transition-colors`,title:`Copy to clipboard`,children:t?(0,U.jsx)(mt,{size:14,className:`text-success-6`}):(0,U.jsx)(St,{size:14})})}function hn({status:e}){let t={completed:`bg-success-9/30 text-success-5`,session_created:`bg-primary-9/30 text-primary-5`,processing:`bg-yellow-900/30 text-yellow-500`,error:`bg-error-9/30 text-error-5`,filtered:`bg-neutral-9/50 text-neutral-5`,duplicate:`bg-neutral-9/50 text-neutral-5`,received:`bg-neutral-9/50 text-neutral-4`};return(0,U.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${t[e]||t.received}`,children:e.replace(`_`,` `)})}function gn({open:e,onClose:t,settings:n,onUpdate:r,isMobile:i=!1,autoWorktree:a=!1,onAutoWorktreeChange:o,agentName:s=`Joe`,onAgentNameChange:c}){let[l,u]=(0,v.useState)(n.token),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(`idle`),[h,g]=(0,v.useState)(7),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(`wt/`),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)([]),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{u(n.token),m(`idle`),T(null)},[n.token,e]),(0,v.useEffect)(()=>{!e||!n.token||(oe(n.token).then(g).catch(()=>{}),ce(n.token).then(y).catch(()=>{}),fe(n.token).then(x).catch(()=>{}),ue(n.token).then(C).catch(()=>{}),_e(n.token).then(D).catch(()=>{}),ve(n.token).then(k).catch(()=>{}))},[e,n.token]),!e)return null;let F=`${location.protocol}//${location.host}/cc/api/webhooks/github`;async function I(){if(l.trim()){f(!0),m(`idle`);try{let e=await P(l.trim());m(e?`valid`:`invalid`),e&&r({token:l.trim()})}catch{m(`invalid`)}finally{f(!1)}}}function L(){r({token:l.trim()}),t()}return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex bg-black/60 ${i?`items-end`:`items-center justify-center`}`,children:(0,U.jsxs)(`div`,{className:`w-full bg-neutral-11 shadow-xl flex flex-col ${i?`max-h-[95vh] rounded-t-xl`:`max-w-2xl rounded-lg border border-neutral-10 max-h-[85vh]`}`,children:[(0,U.jsx)(`div`,{className:`flex-shrink-0 px-6 pt-5 pb-4 border-b border-neutral-10`,children:(0,U.jsx)(`h2`,{className:`text-[19px] font-semibold text-neutral-2`,children:`Settings`})}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5 space-y-4`,children:[(0,U.jsxs)(pn,{icon:(0,U.jsx)(Mt,{size:15}),title:`Authentication`,children:[(0,U.jsx)(`label`,{className:`mb-1 block text-[15px] text-neutral-4`,children:`Claude Code Web Token`}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`input`,{type:`password`,value:l,onChange:e=>{u(e.target.value),m(`idle`)},placeholder:`Enter your auth token`,className:`flex-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7`,onKeyDown:e=>e.key===`Enter`&&I()}),(0,U.jsx)(`button`,{onClick:I,disabled:d||!l.trim(),className:`rounded bg-primary-8 px-3 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50`,children:d?`...`:`Verify`})]}),p===`valid`&&(0,U.jsx)(`p`,{className:`mt-1 text-[13px] text-success-6`,children:`Token verified successfully`}),p===`invalid`&&(0,U.jsx)(`p`,{className:`mt-1 text-[13px] text-error-5`,children:`Invalid token`})]}),(0,U.jsx)(pn,{icon:(0,U.jsx)(Bt,{size:15}),title:`Preferences`,children:(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`mb-1.5 block text-[15px] text-neutral-4`,children:(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Yt,{size:14,className:`text-neutral-5`}),`Agent Name`]})}),(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`input`,{type:`text`,value:s,onChange:e=>{let t=e.target.value;c?.(t)},onBlur:e=>{let t=e.target.value.trim();t&&t!==s&&he(n.token,t).then(e=>c?.(e)).catch(()=>T(`Failed to save agent name`))},onKeyDown:e=>{if(e.key===`Enter`){let t=e.target.value.trim();t&&he(n.token,t).then(e=>c?.(e)).catch(()=>T(`Failed to save agent name`))}},placeholder:`Joe`,maxLength:30,className:`w-40 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7`})}),(0,U.jsx)(`p`,{className:`mt-1 text-[13px] text-neutral-6`,children:`Display name for the orchestrator agent in the sidebar and chat`})]}),(0,U.jsx)(`div`,{className:`border-t border-neutral-9/40`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`mb-1.5 block text-[15px] text-neutral-4`,children:`Theme`}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>r({theme:`dark`}),className:`rounded px-4 py-1.5 text-[15px] font-medium transition-colors ${n.theme===`light`?`border border-neutral-9 bg-neutral-10 text-neutral-3 hover:bg-neutral-9`:`bg-primary-8 text-neutral-1`}`,children:`Dark`}),(0,U.jsx)(`button`,{onClick:()=>r({theme:`light`}),className:`rounded px-4 py-1.5 text-[15px] font-medium transition-colors ${n.theme===`light`?`bg-primary-8 text-neutral-1`:`border border-neutral-9 bg-neutral-10 text-neutral-3 hover:bg-neutral-9`}`,children:`Light`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`mb-1.5 block text-[15px] text-neutral-4`,children:(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(at,{size:14,className:`text-neutral-5`}),`Archived Session Retention`]})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{type:`number`,min:1,max:365,value:h,onChange:e=>{let t=Math.max(1,Math.min(365,Number(e.target.value)));g(t),se(n.token,t).catch(()=>T(`Failed to save retention setting`))},className:`w-20 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7`}),(0,U.jsx)(`span`,{className:`text-[15px] text-neutral-5`,children:`days`})]}),(0,U.jsx)(`p`,{className:`mt-1 text-[13px] text-neutral-6`,children:`Auto-delete archived sessions older than this`})]})]}),(0,U.jsx)(`div`,{className:`border-t border-neutral-9/40`}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer group`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:S,onChange:e=>{let t=e.target.checked;C(t),de(n.token,t).catch(()=>T(`Failed to save queue messages setting`))},className:`h-4 w-4 rounded border-neutral-7 bg-neutral-10 text-primary-7 accent-primary-7 cursor-pointer`}),(0,U.jsx)(`span`,{className:`text-[15px] text-neutral-4 group-hover:text-neutral-3 transition-colors`,children:`Queue messages across sessions`})]}),(0,U.jsx)(`p`,{className:`mt-1 ml-[26px] text-[13px] text-neutral-6`,children:`When enabled, messages sent while another session for the same repo is processing will be queued and sent automatically when it finishes.`})]}),(0,U.jsx)(`div`,{className:`border-t border-neutral-9/40`}),(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(fn,{value:_,token:n.token,placeholder:`~/repos (default)`,helpText:`Absolute path to your locally cloned repositories. Leave empty to use the server default.`,inputClass:`text-[15px]`,onSave:async e=>{await le(n.token,e),y(e)}}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer group`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o?.(e.target.checked),className:`h-4 w-4 rounded border-neutral-7 bg-neutral-10 text-primary-7 accent-primary-7 cursor-pointer`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[15px] text-neutral-4 group-hover:text-neutral-3 transition-colors`,children:[(0,U.jsx)(jt,{size:14,className:`text-neutral-5`}),`Auto-enable worktrees for new sessions`]})]}),(0,U.jsx)(`p`,{className:`mt-1 ml-[26px] text-[13px] text-neutral-6`,children:`When enabled, new sessions will automatically start in a git worktree`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`mb-1.5 block text-[15px] text-neutral-4`,children:`Worktree Branch Prefix`}),(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`input`,{type:`text`,value:b,onChange:e=>{let t=e.target.value;x(t),pe(n.token,t).catch(()=>T(`Failed to save worktree prefix`))},placeholder:`wt/`,className:`w-40 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7`})}),(0,U.jsx)(`p`,{className:`mt-1 text-[13px] text-neutral-6`,children:`Prefix for worktree branch names (e.g. wt/ → wt/abc12345)`})]})]})]})}),(0,U.jsxs)(pn,{icon:(0,U.jsx)(ft,{size:15}),title:`GitHub Webhooks`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:E?E.enabled?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(cn,{size:16,className:`text-success-6`}),(0,U.jsx)(`span`,{className:`text-[15px] text-success-5 font-medium`,children:`Active`}),(0,U.jsxs)(`span`,{className:`text-[13px] text-neutral-6`,children:[`· max `,E.maxConcurrentSessions,` concurrent sessions`]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ln,{size:16,className:`text-neutral-6`}),(0,U.jsx)(`span`,{className:`text-[15px] text-neutral-5`,children:`Disabled`})]}):(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-6`,children:`Loading...`})}),(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-5 mb-3`,children:`Automatically create Claude sessions to diagnose and fix CI failures. When a GitHub Actions workflow fails, a webhook triggers Codekin to analyze logs, identify the issue, and propose a fix.`}),(0,U.jsxs)(`div`,{className:`mb-3`,children:[(0,U.jsx)(`label`,{className:`mb-1 block text-[12px] font-medium text-neutral-5 uppercase tracking-wide`,children:`Webhook URL`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2`,children:[(0,U.jsx)(`code`,{className:`flex-1 text-[13px] text-neutral-3 font-mono truncate select-all`,children:F}),(0,U.jsx)(mn,{text:F})]})]}),(0,U.jsxs)(`button`,{onClick:()=>j(!A),className:`flex items-center gap-1.5 text-[13px] text-primary-6 hover:text-primary-5 mb-2 transition-colors`,children:[A?(0,U.jsx)(ht,{size:14}):(0,U.jsx)(_t,{size:14}),`Setup instructions`]}),A&&(0,U.jsxs)(`div`,{className:`rounded border border-neutral-9 bg-neutral-10/50 px-4 py-3 mb-3 text-[13px] text-neutral-4 space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`span`,{className:`text-primary-6 font-semibold shrink-0`,children:`1.`}),(0,U.jsxs)(`span`,{children:[`In your GitHub repo, go to `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`Settings → Webhooks → Add webhook`})]})]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`span`,{className:`text-primary-6 font-semibold shrink-0`,children:`2.`}),(0,U.jsxs)(`span`,{children:[`Set `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`Payload URL`}),` to the webhook URL above. Set `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`Content type`}),` to `,(0,U.jsx)(`code`,{className:`text-neutral-3 bg-neutral-9/50 px-1 rounded`,children:`application/json`})]})]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`span`,{className:`text-primary-6 font-semibold shrink-0`,children:`3.`}),(0,U.jsxs)(`span`,{children:[`Set a `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`Secret`}),` matching the server's `,(0,U.jsx)(`code`,{className:`text-neutral-3 bg-neutral-9/50 px-1 rounded`,children:`GITHUB_WEBHOOK_SECRET`}),` env var`]})]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`span`,{className:`text-primary-6 font-semibold shrink-0`,children:`4.`}),(0,U.jsxs)(`span`,{children:[`Under `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`“Which events?”`}),`, select `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`Let me select individual events`}),` and check `,(0,U.jsx)(`strong`,{className:`text-neutral-3`,children:`Workflow runs`})]})]}),(0,U.jsxs)(`p`,{className:`text-[13px] text-neutral-6 pt-1 border-t border-neutral-9/50`,children:[`Failed workflow runs will automatically spawn a `,(0,U.jsx)(Yt,{size:12,className:`inline -mt-0.5`}),` session that analyzes logs and proposes fixes.`]})]}),O.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{onClick:()=>N(!M),className:`flex items-center gap-1.5 text-[13px] text-primary-6 hover:text-primary-5 transition-colors`,children:[M?(0,U.jsx)(ht,{size:14}):(0,U.jsx)(_t,{size:14}),`Recent events (`,O.length,`)`]}),M&&(0,U.jsx)(`div`,{className:`mt-2 rounded border border-neutral-9 bg-neutral-10/50 divide-y divide-neutral-9/50 max-h-48 overflow-y-auto`,children:O.slice(0,10).map(e=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[12px]`,children:[(0,U.jsx)(Yt,{size:13,className:`text-neutral-6 shrink-0`}),(0,U.jsx)(`span`,{className:`text-neutral-3 font-mono truncate flex-1`,children:e.repo}),(0,U.jsx)(`span`,{className:`text-neutral-5 truncate max-w-24`,children:e.workflow}),(0,U.jsx)(hn,{status:e.status})]},e.id))})]}),E&&!E.enabled&&(0,U.jsxs)(`p`,{className:`mt-3 text-[13px] text-neutral-6`,children:[`Set `,(0,U.jsx)(`code`,{className:`bg-neutral-9/50 px-1 rounded text-neutral-4`,children:`GITHUB_WEBHOOK_ENABLED=true`}),` and `,(0,U.jsx)(`code`,{className:`bg-neutral-9/50 px-1 rounded text-neutral-4`,children:`GITHUB_WEBHOOK_SECRET`}),` on the server to enable.`]})]})]}),(0,U.jsxs)(`div`,{className:`flex-shrink-0 px-6 py-4 border-t border-neutral-10 flex items-center justify-between`,children:[(0,U.jsx)(`div`,{children:w&&(0,U.jsx)(`p`,{className:`text-[13px] text-error-5`,children:w})}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[n.token&&(0,U.jsx)(`button`,{onClick:t,className:`rounded px-4 py-2 text-[15px] text-neutral-6 hover:text-neutral-2`,children:`Cancel`}),(0,U.jsx)(`button`,{onClick:L,disabled:!l.trim(),className:`rounded bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50`,children:`Save`})]})]})]})})}function _n({size:e=24,className:t=``}){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`}),(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`0.75`,fill:`currentColor`,stroke:`none`}),(0,U.jsx)(`path`,{d:`M8 20.1a9 9 0 0 1 -5 -7.1`}),(0,U.jsx)(`path`,{d:`M16 20.1a9 9 0 0 0 5 -7.1`}),(0,U.jsx)(`path`,{d:`M6.2 5a9 9 0 0 1 11.4 0`}),(0,U.jsx)(`circle`,{cx:`12`,cy:`21`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,U.jsx)(`circle`,{cx:`3`,cy:`9`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,U.jsx)(`circle`,{cx:`21`,cy:`9`,r:`1`,fill:`currentColor`,stroke:`none`})]})}function vn({groups:e,selectedId:t,onSelect:n,cloningId:r,maxHeight:i=`240px`,autoFocus:a}){let[o,s]=(0,v.useState)(``),c=(0,v.useRef)(null);(0,v.useEffect)(()=>{a&&c.current?.focus()},[a]);let l=o.trim()?e.map(e=>({...e,repos:e.repos.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.description?.toLowerCase().includes(o.toLowerCase()))})).filter(e=>e.repos.length>0):e;return e.reduce((e,t)=>e+t.repos.length,0)===0?(0,U.jsx)(`p`,{className:`text-center text-[15px] text-neutral-6 py-2`,children:`No repositories available`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{ref:c,type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`Search repos…`,className:`mb-2 w-full rounded-lg border border-neutral-7 bg-neutral-11/50 px-3 py-2 text-[15px] text-neutral-2 placeholder-neutral-5 focus:border-accent-6 focus:outline-none`}),(0,U.jsx)(`div`,{className:`overflow-y-auto rounded-lg border border-neutral-7 bg-neutral-11/50`,style:{maxHeight:i},children:l.length===0?(0,U.jsx)(`p`,{className:`px-3 py-3 text-[13px] text-neutral-5 text-center`,children:`No matching repos`}):l.map(e=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`sticky top-0 z-10 bg-neutral-8 backdrop-blur-sm px-3 py-1.5 text-[13px] font-medium uppercase tracking-wider text-neutral-4 border-b border-neutral-7`,children:e.owner}),e.repos.map(e=>{let i=r===e.id,a=t===e.id;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e),disabled:!!r,className:`group flex w-full items-start gap-3 border-b border-neutral-7/50 px-3 py-2.5 text-left transition last:border-b-0 ${a?`bg-accent-9/20 border-l-2 border-l-accent-6`:r?`cursor-wait opacity-60`:`hover:bg-neutral-7/20`}`,children:[(0,U.jsx)(`div`,{className:`mt-0.5 flex-shrink-0 text-neutral-4 group-hover:text-neutral-3 transition-colors`,children:e.cloned?(0,U.jsx)(jt,{size:16,stroke:1.5}):(0,U.jsx)(xt,{size:16,stroke:1.5})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[15px] font-medium text-neutral-2 group-hover:text-neutral-1 transition-colors truncate`,children:e.name}),i&&(0,U.jsx)(`span`,{className:`flex-shrink-0 rounded bg-primary-9/30 px-1.5 py-0.5 text-[13px] text-primary-4 animate-pulse`,children:`cloning...`}),!e.cloned&&!i&&(0,U.jsx)(`span`,{className:`flex-shrink-0 rounded border border-neutral-6 bg-neutral-8/50 px-1.5 py-0.5 text-[13px] text-neutral-3`,children:`remote`})]}),e.description&&(0,U.jsx)(`div`,{className:`mt-0.5 text-[13px] text-neutral-6 truncate`,children:e.description})]})]},e.id)})]},e.owner))})]})}function yn({groups:e,token:t,onOpen:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null);(0,v.useLayoutEffect)(()=>{if(!r||!s.current||!c.current)return;let e=s.current.getBoundingClientRect(),t=c.current,n=e.bottom+6,i=Math.max(8,Math.min(e.right-288,window.innerWidth-288-8));t.style.top=`${n}px`,t.style.left=`${i}px`},[r]),(0,v.useEffect)(()=>{if(!r)return;function e(e){e.key===`Escape`&&i(!1)}function t(e){let t=e.target;s.current&&!s.current.contains(t)&&c.current&&!c.current.contains(t)&&i(!1)}return document.addEventListener(`keydown`,e),document.addEventListener(`mousedown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`mousedown`,t)}},[r]);async function l(e){if(!a){if(!e.cloned){o(e.id);try{let n={"Content-Type":`application/json`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`/cc/api/clone`,{method:`POST`,headers:n,body:JSON.stringify({owner:e.owner,name:e.name})});if(!r.ok){let e=await r.json();throw Error(e.error||`Clone failed`)}e.cloned=!0}catch{o(null);return}o(null)}i(!1),n(e)}}return(0,U.jsxs)(`div`,{ref:s,className:`relative h-full flex items-center`,children:[(0,U.jsx)(`button`,{onClick:()=>i(!r),className:`app-new-session-btn rounded p-1.5 transition ${r?`bg-neutral-6 text-neutral-1`:`text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1`}`,title:`New session`,children:(0,U.jsx)(Kt,{size:16,stroke:2})}),r&&(0,U.jsxs)(`div`,{ref:c,className:`fixed z-50 w-72 rounded-md border border-neutral-10 bg-neutral-12 shadow-lg`,children:[(0,U.jsxs)(`div`,{className:`px-3 pt-3 pb-1`,children:[(0,U.jsx)(`h3`,{className:`text-[15px] font-medium text-neutral-3`,children:`New Session`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[13px] text-neutral-6`,children:`Choose a repository to work on`})]}),(0,U.jsx)(`div`,{className:`px-2 pb-2`,children:(0,U.jsx)(vn,{groups:e,onSelect:l,cloningId:a,maxHeight:`240px`,autoFocus:!0})})]})]})}function bn({token:e,workingDir:t,visible:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{if(!n||!t||!e)return;let r=!1;return o(!0),c(!1),B(e,t).then(e=>{r||i(e)}).catch(()=>{r||(i(null),c(!0))}).finally(()=>{r||o(!1)}),()=>{r=!0}},[n,t,e]),!n)return null;async function l(n){if(!(!t||!e))try{await V(e,t,n),i(await B(e,t))}catch{B(e,t).then(i).catch(()=>{})}}async function u(n){if(!(!t||!e||n.length===0))try{await ne(e,t,n),i(await B(e,t))}catch{B(e,t).then(i).catch(()=>{})}}if(!t)return(0,U.jsx)(`div`,{className:`border-t border-neutral-8/30 px-3 py-3`,children:(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-5`,children:`Select a session to manage approvals.`})});if(a)return(0,U.jsx)(`div`,{className:`border-t border-neutral-8/30 px-3 py-3`,children:(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-5`,children:`Loading...`})});if(s||!r)return(0,U.jsx)(`div`,{className:`border-t border-neutral-8/30 px-3 py-3`,children:(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-5`,children:`Could not load approvals.`})});let d=t.split(`/`).pop()||t;return(0,U.jsx)(`div`,{className:`border-t border-neutral-8/30 flex flex-col min-h-0`,children:(0,U.jsxs)(`div`,{className:`ml-3 border-l border-neutral-7/30 flex flex-col min-h-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 flex-shrink-0`,children:[(0,U.jsx)(`span`,{className:`text-[13px] font-medium text-neutral-5 uppercase tracking-wider flex-shrink-0`,children:`Approvals`}),(0,U.jsx)(`span`,{className:`text-[12px] font-mono text-neutral-6 truncate`,title:t,children:d})]}),(0,U.jsx)(xn,{approvals:r,onRemove:l,onRevokeMultiple:u})]})})}function xn({approvals:e,onRemove:t,onRevokeMultiple:n}){let[r,i]=(0,v.useState)(new Set([`__tools__`,`__commands__`,`__patterns__`])),a=e.tools.length+e.commands.length+e.patterns.length,o=a===0;function s(e){i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let c=(0,v.useMemo)(()=>[...e.tools].sort(),[e.tools]),l=(0,v.useMemo)(()=>[...e.patterns??[]].sort(),[e.patterns]),u=(0,v.useMemo)(()=>Sn(e.commands),[e.commands]),d=Object.entries(u),f=c.length>0,p=l.length>0,m=d.length>0;return(0,U.jsxs)(U.Fragment,{children:[!o&&(0,U.jsx)(`div`,{className:`flex-shrink-0 px-3 pb-1.5`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{className:`text-[13px] text-neutral-5`,children:[a,` rule`,a===1?``:`s`]}),(0,U.jsx)(`button`,{onClick:()=>{let t=[...e.tools.map(e=>({tool:e})),...e.commands.map(e=>({command:e})),...(e.patterns??[]).map(e=>({pattern:e}))];confirm(`Revoke all ${a} approval rules?`)&&n(t)},className:`text-[13px] text-neutral-5 hover:text-error-5 transition-colors`,children:`Revoke All`})]})}),(0,U.jsxs)(`div`,{className:`overflow-y-auto min-h-0 flex-1 px-2 py-1 approvals-scroll`,children:[!f&&!p&&!m&&(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-6 py-2 text-center`,children:`No auto-approval rules yet.`}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[p&&(0,U.jsx)(Cn,{title:`Patterns`,count:l.length,collapsed:r.has(`__patterns__`),onToggle:()=>{s(`__patterns__`)},onRevokeAll:()=>{confirm(`Revoke all ${l.length} pattern approvals?`)&&n(l.map(e=>({pattern:e})))},children:(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:l.map(e=>(0,U.jsxs)(`li`,{className:`group flex items-center justify-between rounded-md px-2 py-1 text-[13px] text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors`,children:[(0,U.jsx)(`code`,{className:`truncate font-mono`,children:e}),(0,U.jsx)(`button`,{onClick:()=>{t({pattern:e})},className:`ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all`,children:`×`})]},e))})}),f&&(0,U.jsx)(Cn,{title:`Tools`,count:c.length,collapsed:r.has(`__tools__`),onToggle:()=>{s(`__tools__`)},onRevokeAll:()=>{confirm(`Revoke all ${c.length} tool approvals?`)&&n(c.map(e=>({tool:e})))},children:(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:c.map(e=>(0,U.jsxs)(`li`,{className:`group flex items-center justify-between rounded-md px-2 py-1 text-[13px] text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e}),(0,U.jsx)(`button`,{onClick:()=>{t({tool:e})},className:`ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all`,children:`×`})]},e))})}),m&&(0,U.jsx)(Cn,{title:`Commands`,count:e.commands.length,collapsed:r.has(`__commands__`),onToggle:()=>{s(`__commands__`)},onRevokeAll:()=>{let t=e.commands;confirm(`Revoke all ${t.length} command approvals?`)&&n(t.map(e=>({command:e})))},children:(0,U.jsx)(`div`,{className:`space-y-1.5`,children:d.map(([e,i])=>(0,U.jsx)(wn,{prefix:e,commands:i,collapsed:r.has(`cmd:${e}`),onToggle:()=>{s(`cmd:${e}`)},onRemove:e=>{t({command:e})},onRevokeAll:()=>{confirm(`Revoke all ${i.length} "${e}" approvals?`)&&n(i.map(e=>({command:e})))}},e))})})]})]})]})}function Sn(e){let t={};for(let n of e){let e=n.split(/\s+/)[0]||`other`;t[e]||(t[e]=[]),t[e].push(n)}let n={};for(let e of Object.keys(t).sort())n[e]=t[e].sort();return n}function Cn({title:e,count:t,collapsed:n,onToggle:r,onRevokeAll:i,children:a}){return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,U.jsxs)(`button`,{onClick:r,className:`flex items-center gap-1.5 text-[15px] text-neutral-4 hover:text-neutral-2 transition-colors`,children:[(0,U.jsx)(`svg`,{className:`w-2.5 h-2.5 transition-transform flex-shrink-0 ${n?``:`rotate-90`}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,U.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5l7 7-7 7`})}),(0,U.jsx)(`span`,{className:`font-medium`,children:e}),(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-5`,children:t})]}),!n&&t>1&&(0,U.jsx)(`button`,{onClick:i,className:`text-[13px] text-neutral-5 hover:text-error-5 transition-colors`,children:`revoke all`})]}),!n&&a]})}function wn({prefix:e,commands:t,collapsed:n,onToggle:r,onRemove:i,onRevokeAll:a}){return t.length===1?(0,U.jsxs)(`div`,{className:`group flex items-center justify-between rounded-md px-2 py-1 hover:bg-neutral-6/50 transition-colors`,children:[(0,U.jsxs)(`code`,{className:`truncate font-mono text-[13px] text-neutral-3`,title:t[0],children:[`$ `,t[0]]}),(0,U.jsx)(`button`,{onClick:()=>{i(t[0])},className:`ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all`,children:`×`})]}):(0,U.jsxs)(`div`,{className:`rounded-md overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-0.5`,children:[(0,U.jsxs)(`button`,{onClick:r,className:`flex items-center gap-1 text-[13px] text-neutral-4 hover:text-neutral-2 transition-colors`,children:[(0,U.jsx)(`svg`,{className:`w-2 h-2 transition-transform flex-shrink-0 ${n?``:`rotate-90`}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,U.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5l7 7-7 7`})}),(0,U.jsx)(`code`,{className:`font-mono font-medium`,children:e}),(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-5`,children:t.length})]}),!n&&(0,U.jsx)(`button`,{onClick:a,className:`text-[13px] text-neutral-5 hover:text-error-5 transition-colors`,children:`revoke all`})]}),!n&&(0,U.jsx)(`ul`,{className:`pl-3`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`group flex items-center justify-between rounded-md px-2 py-1 hover:bg-neutral-6/50 transition-colors`,children:[(0,U.jsxs)(`code`,{className:`truncate font-mono text-[13px] text-neutral-3`,title:e,children:[`$ `,e]}),(0,U.jsx)(`button`,{onClick:()=>{i(e)},className:`ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all`,children:`×`})]},e))})]})}function Tn({files:e,loading:t,starredDocs:n,onSelect:r,onClose:i}){let[a,o]=(0,v.useState)(``),s=(0,v.useRef)(null);(0,v.useEffect)(()=>{function e(e){e.key===`Escape`&&i()}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]);let c=new Set(n),l=a.trim()?e.filter(e=>e.path.toLowerCase().includes(a.toLowerCase())):e,u=l.filter(e=>c.has(e.path)),d=l.filter(e=>e.pinned&&!c.has(e.path)),f=l.filter(e=>!e.pinned&&!c.has(e.path)),p=(u.length>0?1:0)+(d.length>0?1:0)+(f.length>0?1:0)>1;return(0,U.jsx)(`div`,{ref:s,className:`mt-1 border-t border-neutral-8/30 pt-1`,children:t?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,U.jsx)(Nt,{size:14,className:`animate-spin text-neutral-5`})}):e.length===0?(0,U.jsx)(`div`,{className:`pl-10 pr-2 py-1 text-[13px] text-neutral-5`,children:`No markdown files found`}):(0,U.jsxs)(U.Fragment,{children:[e.length>5&&(0,U.jsx)(`div`,{className:`px-2 pb-1`,children:(0,U.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Filter docs...`,autoFocus:!0,className:`w-full rounded border border-neutral-7 bg-neutral-10/50 px-2 py-1 text-[13px] text-neutral-2 placeholder-neutral-5 focus:border-accent-6 focus:outline-none`})}),(0,U.jsx)(`div`,{className:`overflow-y-auto`,style:{maxHeight:`320px`},children:l.length===0?(0,U.jsx)(`div`,{className:`pl-10 pr-2 py-1 text-[13px] text-neutral-5`,children:`No matching files`}):(0,U.jsxs)(U.Fragment,{children:[u.map(e=>(0,U.jsxs)(`button`,{onClick:()=>r(e.path),className:`group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-2 font-medium hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors cursor-pointer rounded-md`,children:[(0,U.jsx)(un,{size:13,className:`flex-shrink-0 text-primary-5`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:e.path})]},e.path)),u.length>0&&p&&(0,U.jsx)(`div`,{className:`border-t border-neutral-8/30 my-0.5 mx-10`}),d.map(e=>(0,U.jsxs)(`button`,{onClick:()=>r(e.path),className:`group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-2 font-medium hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors cursor-pointer rounded-md`,children:[(0,U.jsx)(Dt,{size:13,className:`flex-shrink-0 text-neutral-5`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:e.path})]},e.path)),d.length>0&&f.length>0&&(0,U.jsx)(`div`,{className:`border-t border-neutral-8/30 my-0.5 mx-10`}),f.map(e=>(0,U.jsxs)(`button`,{onClick:()=>r(e.path),className:`group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-4 hover:bg-neutral-6/50 hover:text-neutral-2 transition-colors cursor-pointer rounded-md`,children:[(0,U.jsx)(Dt,{size:13,className:`flex-shrink-0 text-neutral-6`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:e.path})]},e.path))]})})]})})}var En=5;function Dn({session:e}){return e.worktreePath?(0,U.jsx)(`span`,{title:`Worktree: ${e.worktreePath.split(`/`).pop()??e.worktreePath}`,className:`flex-shrink-0 text-primary-6`,children:(0,U.jsx)(jt,{size:12,stroke:2})}):null}function On(e){let t=e.name||e.id.slice(0,8);return t.startsWith(`hub:`)?`new session`:t}function kn(e){let t=e.name||e.id.slice(0,8);return t.startsWith(`hub:`)?`unnamed session`:t}function An(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function jn(e){return!e.includes(`T`)&&!e.includes(`Z`)&&!e.includes(`+`)?new Date(e.replace(` `,`T`)+`Z`):new Date(e)}function Mn(e){let t=Math.floor((Date.now()-jn(e).getTime())/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function Nn({node:e,isActive:t,activeSessionId:n,waitingSessions:r,tentativeQueues:i,token:a,archiveRefreshKey:o,onSelectSession:s,onDeleteSession:c,onRenameSession:l,onNewSession:u,onSelectRepo:d,onDeleteRepo:f,onViewArchivedSession:p,onBrowseDocs:m,docsPickerOpen:h,docsPickerRepoDir:g,docsPickerFiles:_,docsPickerLoading:y,onDocsPickerSelect:b,onDocsPickerClose:x,docsStarredDocs:S,isMobile:C}){let[w,T]=(0,v.useState)(t||!!C),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)([]),[P,F]=(0,v.useState)(null),[I,L]=(0,v.useState)(``);(0,v.useEffect)(()=>{t&&T(!0)},[t]),(0,v.useEffect)(()=>{!O||!a||re(a,e.workingDir).then(N).catch(()=>{})},[O,a,e.workingDir,o]);let[ee,R]=e.hasTentative?[`bg-accent-6 animate-pulse`,`Queued`]:e.hasWaiting?[`bg-warning-5 animate-pulse`,`Waiting for input`]:e.hasActive?[`bg-success-6 animate-pulse`,`Processing`]:[`bg-neutral-6`,`Idle`],te=A?M:M.slice(0,En),z=M.length>En,B=e=>{F(e.id),L(On(e))},V=()=>{P&&I.trim()&&l(P,I.trim()),F(null)};return(0,U.jsxs)(`div`,{className:`group/repo`,children:[(0,U.jsxs)(`div`,{className:`group flex items-center gap-1.5 px-2 py-1`,children:[(0,U.jsxs)(`button`,{onClick:()=>{T(!w),t||d(e.workingDir)},className:`flex flex-1 items-center gap-2 min-w-0 rounded px-2 py-0.5 text-left transition-colors text-neutral-3 hover:text-neutral-2`,children:[w?(0,U.jsx)(ht,{size:14,stroke:2.5,className:`flex-shrink-0 text-neutral-5 opacity-0 group-hover/repo:opacity-100 transition-opacity`}):(0,U.jsx)(_t,{size:14,stroke:2.5,className:`flex-shrink-0 text-neutral-5 opacity-0 group-hover/repo:opacity-100 transition-opacity`}),(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${ee}`,title:R}),(0,U.jsx)(`span`,{className:`truncate font-semibold tracking-wide ${C?`text-[17px]`:`text-[15px]`}`,children:e.displayName}),!w&&e.sessions.length>1&&(0,U.jsxs)(`span`,{className:`text-[12px] text-neutral-6 flex-shrink-0`,children:[`(`,e.sessions.length,`)`]})]}),m&&(0,U.jsx)(`button`,{onClick:t=>{t.stopPropagation(),m(e.workingDir)},className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${h&&g===e.workingDir?`text-primary-5 opacity-100!`:`text-neutral-5 hover:text-neutral-2`}`,title:`Browse docs`,children:(0,U.jsx)(Dt,{size:14,stroke:2})}),(0,U.jsx)(`button`,{onClick:()=>D(!E),className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${E?`text-primary-5 opacity-100!`:`text-neutral-5 hover:text-neutral-2`}`,title:`Repo approvals`,children:(0,U.jsx)(Qt,{size:16,stroke:2})}),(0,U.jsx)(`button`,{onClick:()=>k(!O),className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${O?`text-primary-5 opacity-100!`:`text-neutral-5 hover:text-neutral-2`}`,title:`Archived sessions`,children:(0,U.jsx)(at,{size:16,stroke:2})}),(0,U.jsx)(`span`,{onClick:t=>{t.stopPropagation(),f(e.workingDir)},className:`cursor-pointer text-[15px] text-transparent hover:text-error-5 group-hover:text-neutral-6 flex-shrink-0 px-0.5`,children:`×`})]}),w&&(0,U.jsxs)(`div`,{className:`px-2 pb-1`,children:[e.sessions.map(e=>{let t=e.id===n,[a,o]=(i[e.id]?.length??0)>0?[`bg-accent-6 animate-pulse`,`Queued`]:r[e.id]?[`bg-warning-5 animate-pulse`,`Waiting for input`]:e.isProcessing?[`bg-success-6 animate-pulse`,`Processing`]:e.active?[`bg-neutral-5`,`Idle`]:[`bg-neutral-7`,`Inactive`],l=P===e.id;return(0,U.jsxs)(`div`,{onClick:()=>{l||s(e.id)},className:`group w-full flex items-baseline gap-2 pl-10 pr-2 py-1 text-left ${C?`text-[17px]`:`text-[15px]`} transition-colors rounded-md cursor-pointer ${t?`bg-accent-9/30 text-accent-2`:`text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1`}`,children:[e.source===`workflow`?(0,U.jsx)($t,{size:12,className:`flex-shrink-0 self-center ${a.replace(/bg-/g,`text-`)}`,title:o}):e.source===`webhook`?(0,U.jsx)(Yt,{size:12,className:`flex-shrink-0 self-center ${a.replace(/bg-/g,`text-`)}`,title:o}):e.source===`orchestrator`||e.source===`agent`?(0,U.jsx)(Jt,{size:12,className:`flex-shrink-0 self-center ${a.replace(/bg-/g,`text-`)}`,title:o}):(0,U.jsx)(`span`,{className:`inline-flex items-center justify-center w-[12px] flex-shrink-0 self-center`,title:o,children:(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${a}`})}),l?(0,U.jsx)(`input`,{autoFocus:!0,value:I,onChange:e=>L(e.target.value),onBlur:V,onKeyDown:e=>{e.key===`Enter`&&V(),e.key===`Escape`&&F(null)},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-neutral-10 border border-neutral-7 rounded px-1 py-0 text-[15px] text-neutral-1 outline-none focus:border-primary-6`}):(0,U.jsxs)(`span`,{className:`flex-1 truncate font-normal flex items-center gap-1`,children:[(0,U.jsx)(Dn,{session:e}),On(e)]}),!l&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-6 tabular-nums flex-shrink-0`,children:An(e.created)}),(0,U.jsx)(`span`,{onClick:t=>{t.stopPropagation(),B(e)},className:`cursor-pointer flex-shrink-0 text-transparent group-hover:text-neutral-5 hover:text-neutral-2! transition-colors`,title:`Rename session`,children:(0,U.jsx)(Ht,{size:13,stroke:2})}),(0,U.jsx)(`span`,{onClick:t=>{t.stopPropagation(),c(e.id)},className:`cursor-pointer text-[15px] text-transparent hover:text-error-5 group-hover:text-neutral-6 flex-shrink-0`,children:`×`})]})]},e.id)}),u&&(0,U.jsx)(`div`,{className:`pl-10 opacity-0 group-hover/repo:opacity-100`,children:(0,U.jsxs)(`button`,{onClick:u,className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[13px] text-neutral-5 hover:text-neutral-2 hover:bg-neutral-6/50 transition-colors`,children:[(0,U.jsx)(Kt,{size:12,stroke:2,className:`flex-shrink-0`}),(0,U.jsx)(`span`,{children:`New session`})]})}),h&&g===e.workingDir&&b&&x&&(0,U.jsx)(Tn,{files:_??[],loading:y??!1,starredDocs:S??[],onSelect:b,onClose:x}),E&&(0,U.jsx)(`div`,{className:`mt-1 border-t border-neutral-8/30`,children:(0,U.jsx)(bn,{token:a,workingDir:e.workingDir,visible:E})}),O&&(0,U.jsx)(`div`,{className:`mt-1 border-t border-neutral-8/30 pt-1`,children:M.length===0?(0,U.jsx)(`div`,{className:`pl-12 pr-2 py-1 text-[13px] text-neutral-5`,children:`No archived sessions`}):(0,U.jsxs)(U.Fragment,{children:[te.map(e=>(0,U.jsxs)(`button`,{onClick:()=>p(e.id),className:`group w-full flex items-baseline gap-2 pl-12 pr-2 py-0.5 text-left text-[15px] text-neutral-4 hover:bg-neutral-6/50 hover:text-neutral-2 transition-colors`,children:[(0,U.jsx)(at,{size:12,className:`flex-shrink-0 self-center opacity-40`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:kn(e)}),(0,U.jsx)(`span`,{className:`shrink-0 text-[13px] text-neutral-6 tabular-nums`,children:Mn(e.archivedAt)})]},e.id)),z&&!A&&(0,U.jsxs)(`button`,{onClick:()=>j(!0),className:`w-full pl-12 pr-2 py-0.5 text-left text-[13px] text-neutral-5 hover:text-neutral-2 transition-colors`,children:[`Show all `,M.length,` archived...`]}),A&&z&&(0,U.jsx)(`button`,{onClick:()=>j(!1),className:`w-full pl-12 pr-2 py-0.5 text-left text-[13px] text-neutral-5 hover:text-neutral-2 transition-colors`,children:`Show less`})]})})]})]})}function Pn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Fn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,In=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ln={};function Rn(e,t){return((t||Ln).jsx?In:Fn).test(e)}var zn=/[ \t\n\f\r]/g;function Bn(e){return typeof e==`object`?e.type===`text`?Vn(e.value):!1:Vn(e)}function Vn(e){return e.replace(zn,``)===``}var Hn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Hn.prototype.normal={},Hn.prototype.property={},Hn.prototype.space=void 0;function Un(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Hn(n,r,t)}function Wn(e){return e.toLowerCase()}var Gn=class{constructor(e,t){this.attribute=t,this.property=e}};Gn.prototype.attribute=``,Gn.prototype.booleanish=!1,Gn.prototype.boolean=!1,Gn.prototype.commaOrSpaceSeparated=!1,Gn.prototype.commaSeparated=!1,Gn.prototype.defined=!1,Gn.prototype.mustUseProperty=!1,Gn.prototype.number=!1,Gn.prototype.overloadedBoolean=!1,Gn.prototype.property=``,Gn.prototype.spaceSeparated=!1,Gn.prototype.space=void 0;var Kn=s({boolean:()=>W,booleanish:()=>Jn,commaOrSpaceSeparated:()=>Qn,commaSeparated:()=>Zn,number:()=>G,overloadedBoolean:()=>Yn,spaceSeparated:()=>Xn}),qn=0,W=$n(),Jn=$n(),Yn=$n(),G=$n(),Xn=$n(),Zn=$n(),Qn=$n();function $n(){return 2**++qn}var er=Object.keys(Kn),tr=class extends Gn{constructor(e,t,n,r){let i=-1;if(super(e,t),nr(this,`space`,r),typeof n==`number`)for(;++i<er.length;){let e=er[i];nr(this,er[i],(n&Kn[e])===Kn[e])}}};tr.prototype.defined=!0;function nr(e,t,n){n&&(e[t]=n)}function rr(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new tr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Wn(r)]=r,n[Wn(a.attribute)]=r}return new Hn(t,n,e.space)}var ir=rr({properties:{ariaActiveDescendant:null,ariaAtomic:Jn,ariaAutoComplete:null,ariaBusy:Jn,ariaChecked:Jn,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:Xn,ariaCurrent:null,ariaDescribedBy:Xn,ariaDetails:null,ariaDisabled:Jn,ariaDropEffect:Xn,ariaErrorMessage:null,ariaExpanded:Jn,ariaFlowTo:Xn,ariaGrabbed:Jn,ariaHasPopup:null,ariaHidden:Jn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Xn,ariaLevel:G,ariaLive:null,ariaModal:Jn,ariaMultiLine:Jn,ariaMultiSelectable:Jn,ariaOrientation:null,ariaOwns:Xn,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:Jn,ariaReadOnly:Jn,ariaRelevant:null,ariaRequired:Jn,ariaRoleDescription:Xn,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:Jn,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ar(e,t){return t in e?e[t]:t}function or(e,t){return ar(e,t.toLowerCase())}var sr=rr({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Zn,acceptCharset:Xn,accessKey:Xn,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:Xn,autoFocus:W,autoPlay:W,blocking:Xn,capture:null,charSet:null,checked:W,cite:null,className:Xn,cols:G,colSpan:null,content:null,contentEditable:Jn,controls:W,controlsList:Xn,coords:G|Zn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:Yn,draggable:Jn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:Xn,height:G,hidden:Yn,high:G,href:null,hrefLang:null,htmlFor:Xn,httpEquiv:Xn,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:Xn,itemRef:Xn,itemScope:W,itemType:Xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:G,pattern:null,ping:Xn,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:Xn,required:W,reversed:W,rows:G,rowSpan:G,sandbox:Xn,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:Jn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:Jn,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Xn,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:Jn,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:or}),cr=rr({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Qn,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:Xn,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:Zn,g2:Zn,glyphName:Zn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,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:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ar}),lr=rr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ur=rr({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:or}),dr=rr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),fr={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`},pr=/[A-Z]/g,mr=/-[a-z]/g,hr=/^data[-\w.:]+$/i;function gr(e,t){let n=Wn(t),r=t,i=Gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&hr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(mr,vr);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!mr.test(e)){let n=e.replace(pr,_r);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=tr}return new i(r,t)}function _r(e){return`-`+e.toLowerCase()}function vr(e){return e.charAt(1).toUpperCase()}var yr=Un([ir,sr,lr,ur,dr],`html`),br=Un([ir,cr,lr,ur,dr],`svg`);function xr(e){return e.join(` `).trim()}var Sr=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
11
|
-
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Cr=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Sr());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),wr=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Tr=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Cr()),r=wr();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Er=Or(`end`),Dr=Or(`start`);function Or(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function kr(e){let t=Dr(e),n=Er(e);if(t&&n)return{start:t,end:n}}function Ar(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Mr(e.position):`start`in e||`end`in e?Mr(e):`line`in e||`column`in e?jr(e):``}function jr(e){return Nr(e&&e.line)+`:`+Nr(e&&e.column)}function Mr(e){return jr(e&&e.start)+`-`+jr(e&&e.end)}function Nr(e){return e&&typeof e==`number`?e:1}var Pr=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ar(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Pr.prototype.file=``,Pr.prototype.name=``,Pr.prototype.reason=``,Pr.prototype.message=``,Pr.prototype.stack=``,Pr.prototype.column=void 0,Pr.prototype.line=void 0,Pr.prototype.ancestors=void 0,Pr.prototype.cause=void 0,Pr.prototype.fatal=void 0,Pr.prototype.place=void 0,Pr.prototype.ruleId=void 0,Pr.prototype.source=void 0;var Fr=l(Tr(),1),Ir={}.hasOwnProperty,Lr=new Map,Rr=/[A-Z]/g,zr=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Br=new Set([`td`,`th`]),Vr=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Hr(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=$r(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Qr(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?br:yr,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ur(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ur(e,t,n){if(t.type===`element`)return Wr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Gr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return qr(e,t,n);if(t.type===`mdxjsEsm`)return Kr(e,t);if(t.type===`root`)return Jr(e,t,n);if(t.type===`text`)return Yr(e,t)}function Wr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=br,e.schema=i),e.ancestors.push(t);let a=ai(e,t.tagName,!1),o=ei(e,t),s=ni(e,t);return zr.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Bn(e):!0})),Xr(e,o,a,t),Zr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Gr(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}oi(e,t.position)}function Kr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oi(e,t.position)}function qr(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=br,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ai(e,t.name,!0),o=ti(e,t),s=ni(e,t);return Xr(e,o,a,t),Zr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Jr(e,t,n){let r={};return Zr(r,ni(e,t)),e.create(t,e.Fragment,r,n)}function Yr(e,t){return t.value}function Xr(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zr(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Qr(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function $r(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Dr(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ei(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ir.call(t.properties,i)){let a=ri(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Br.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ti(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else oi(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else oi(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function ni(e,t){let n=[],r=-1,i=e.passKeys?new Map:Lr;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ur(e,a,o);s!==void 0&&n.push(s)}return n}function ri(e,t,n){let r=gr(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Pn(n):xr(n)),r.property===`style`){let t=typeof n==`object`?n:ii(e,String(n));return e.stylePropertyNameCase===`css`&&(t=si(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?fr[r.property]||r.property:r.attribute,n]}}function ii(e,t){try{return(0,Fr.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Pr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Vr+`#cannot-parse-style-attribute`,r}}function ai(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Rn(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Rn(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ir.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);oi(e)}function oi(e,t){let n=new Pr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Vr+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function si(e){let t={},n;for(n in e)Ir.call(e,n)&&(t[ci(n)]=e[n]);return t}function ci(e){let t=e.replace(Rr,li);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function li(e){return`-`+e.toLowerCase()}var ui={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`]},di={};function fi(e,t){let n=t||di;return pi(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function pi(e,t,n){if(hi(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return mi(e.children,t,n)}return Array.isArray(e)?mi(e,t,n):``}function mi(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=pi(e[i],t,n);return r.join(``)}function hi(e){return!!(e&&typeof e==`object`)}var gi=document.createElement(`i`);function _i(e){let t=`&`+e+`;`;gi.innerHTML=t;let n=gi.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function vi(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function yi(e,t){return e.length>0?(vi(e,e.length,0,t),e):t}var bi={}.hasOwnProperty;function xi(e){let t={},n=-1;for(;++n<e.length;)Si(t,e[n]);return t}function Si(e,t){let n;for(n in t){let r=(bi.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){bi.call(r,a)||(r[a]=[]);let e=i[a];Ci(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ci(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);vi(e,0,0,r)}function wi(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Ti(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ei=Fi(/[A-Za-z]/),K=Fi(/[\dA-Za-z]/),Di=Fi(/[#-'*+\--9=?A-Z^-~]/);function Oi(e){return e!==null&&(e<32||e===127)}var ki=Fi(/\d/),Ai=Fi(/[\dA-Fa-f]/),ji=Fi(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function Mi(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var Ni=Fi(/\p{P}|\p{S}/u),Pi=Fi(/\s/);function Fi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ii(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&K(e.charCodeAt(n+1))&&K(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Li={tokenize:Ri};function Ri(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var zi={tokenize:Vi},Bi={tokenize:Hi};function Vi(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return vi(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Bi,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Bi,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;vi(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Hi(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Ui(e){if(e===null||Mi(e)||Pi(e))return 1;if(Ni(e))return 2}function Wi(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Gi={name:`attention`,resolveAll:Ki,tokenize:qi};function Ki(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ji(d,-c),Ji(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=yi(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=yi(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=yi(l,Wi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=yi(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=yi(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,vi(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function qi(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ui(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Ui(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ji(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Yi={name:`autolink`,tokenize:Xi};function Xi(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Ei(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||K(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||K(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Oi(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Di(t)?(e.consume(t),l):n(t)}function u(e){return K(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||K(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Zi={partial:!0,tokenize:Qi};function Qi(e,t,n){return r;function r(t){return J(t)?Y(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||q(e)?t(e):n(e)}}var $i={continuation:{tokenize:ta},exit:na,name:`blockQuote`,tokenize:ea};function ea(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return J(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ta(e,t,n){let r=this;return i;function i(t){return J(t)?Y(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt($i,t,n)(r)}}function na(e){e.exit(`blockQuote`)}var ra={name:`characterEscape`,tokenize:ia};function ia(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ji(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var aa={name:`characterReference`,tokenize:oa};function oa(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=K,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ai,u):(e.enter(`characterReferenceValue`),a=7,o=ki,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===K&&!_i(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var sa={partial:!0,tokenize:ua},ca={concrete:!0,name:`codeFenced`,tokenize:la};function la(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(sa,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Y(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(sa,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ua(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var da={name:`codeIndented`,tokenize:pa},fa={partial:!0,tokenize:ma};function pa(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):q(t)?e.attempt(fa,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ma(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):q(e)?i(e):n(e)}}var ha={name:`codeText`,previous:_a,resolve:ga,tokenize:va};function ga(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function _a(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function va(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ya=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ba(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ba(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ba(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);ba(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ba(this.left,t.reverse())}}};function ba(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function xa(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ya(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Sa(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return vi(e,0,1/0,u.slice(0)),!l}function Sa(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ca={resolve:Ta,tokenize:Ea},wa={partial:!0,tokenize:Da};function Ta(e){return xa(e),e}function Ea(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):q(t)?e.check(wa,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Da(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,a,`linePrefix`)}function a(i){if(i===null||q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Oa(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Oi(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Mi(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Oi(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ka(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Aa(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ja(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ma={name:`definition`,tokenize:Pa},Na={partial:!0,tokenize:Fa};function Pa(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ka.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ti(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Mi(t)?ja(e,l)(t):l(t)}function l(t){return Oa(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Na,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Fa(e,t,n){return r;function r(t){return Mi(t)?ja(e,i)(t):n(t)}function i(t){return Aa(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var Ia={name:`hardBreakEscape`,tokenize:La};function La(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ra={name:`headingAtx`,resolve:za,tokenize:Ba};function za(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},vi(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Ba(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Mi(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Mi(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Va=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ha=[`pre`,`script`,`style`,`textarea`],Ua={concrete:!0,name:`htmlFlow`,resolveTo:Ka,tokenize:qa},Wa={partial:!0,tokenize:Ya},Ga={partial:!0,tokenize:Ja};function Ka(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qa(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):Ei(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Ei(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Ei(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Mi(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ha.includes(l)?(i=1,r.interrupt?t(s):O(s)):Va.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||K(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Ei(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Mi(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||q(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Wa,ee,k)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Ga,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Ha.includes(n)?(e.consume(t),L):O(t)}return Ei(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||q(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function Ja(e,t,n){let r=this;return i;function i(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ya(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Zi,t,n)}}var Xa={name:`htmlText`,tokenize:Za};function Za(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Ei(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Ei(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):q(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):q(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):q(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Ei(t)?(e.consume(t),S):n(t)}function S(t){return t===45||K(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,N(t)):J(t)?(e.consume(t),C):M(t)}function w(t){return t===45||K(t)?(e.consume(t),w):t===47||t===62||Mi(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Ei(t)?(e.consume(t),E):q(t)?(o=T,N(t)):J(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):q(t)?(o=D,N(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):q(t)?(o=O,N(t)):J(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):q(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Mi(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Mi(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return J(t)?Y(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Qa={name:`labelEnd`,resolveAll:no,resolveTo:X,tokenize:ro},$a={tokenize:io},eo={tokenize:ao},to={tokenize:oo};function no(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&vi(e,0,e.length,n),e}function X(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=yi(s,e.slice(a+1,a+r+3)),s=yi(s,[[`enter`,u,t]]),s=yi(s,Wi(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=yi(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=yi(s,e.slice(o+1)),s=yi(s,[[`exit`,c,t]]),vi(e,a,e.length,s),e}function ro(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Ti(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt($a,u,o?u:d)(t):t===91?e.attempt(eo,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(to,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function io(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Mi(t)?ja(e,a)(t):a(t)}function a(t){return t===41?u(t):Oa(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Mi(t)?ja(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Aa(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Mi(t)?ja(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ao(e,t,n){let r=this;return i;function i(t){return ka.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ti(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function oo(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var so={name:`labelStartImage`,resolveAll:Qa.resolveAll,tokenize:co};function co(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var lo={name:`labelStartLink`,resolveAll:Qa.resolveAll,tokenize:uo};function uo(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var fo={name:`lineEnding`,tokenize:po};function po(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}}var mo={name:`thematicBreak`,tokenize:ho};function ho(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var go={continuation:{tokenize:bo},exit:So,name:`list`,tokenize:yo},_o={partial:!0,tokenize:Co},vo={partial:!0,tokenize:xo};function yo(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:ki(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(mo,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return ki(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Zi,r.interrupt?n:u,e.attempt(_o,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function bo(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Zi,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vo,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(go,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function xo(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function So(e){e.exit(this.containerState.type)}function Co(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var wo={name:`setextUnderline`,resolveTo:To,tokenize:Eo};function To(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Eo(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Do={tokenize:Oo};function Oo(e){let t=this,n=e.attempt(Zi,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ca,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ko={resolveAll:No()},Ao=Mo(`string`),jo=Mo(`text`);function Mo(e){return{resolveAll:No(e===`text`?Po:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function No(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Po(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Fo=s({attentionMarkers:()=>Uo,contentInitial:()=>Lo,disable:()=>Wo,document:()=>Io,flow:()=>zo,flowInitial:()=>Ro,insideSpan:()=>Ho,string:()=>Bo,text:()=>Vo}),Io={42:go,43:go,45:go,48:go,49:go,50:go,51:go,52:go,53:go,54:go,55:go,56:go,57:go,62:$i},Lo={91:Ma},Ro={[-2]:da,[-1]:da,32:da},zo={35:Ra,42:mo,45:[wo,mo],60:Ua,61:wo,95:mo,96:ca,126:ca},Bo={38:aa,92:ra},Vo={[-5]:fo,[-4]:fo,[-3]:fo,33:so,38:aa,42:Gi,60:[Yi,Xa],91:lo,92:[Ia,ra],93:Qa,95:Gi,96:ha},Ho={null:[Gi,ko]},Uo={null:[42,95]},Wo={null:[]};function Go(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=yi(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Wi(a,l.events,l),l.events):[]}function f(e,t){return qo(p(e),t)}function p(e){return Ko(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&vi(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ko(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function qo(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
12
|
-
`;break;case-3:o=`\r
|
|
13
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Jo(e){let t={constructs:xi([Fo,...(e||{}).extensions||[]]),content:n(Li),defined:[],document:n(zi),flow:n(Do),lazy:{},string:n(Ao),text:n(jo)};return t;function n(e){return n;function n(n){return Go(t,e,n)}}}function Yo(e){for(;!xa(e););return e}var Xo=/[\0\t\n\r]/g;function Zo(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Xo.lastIndex=u,c=Xo.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Qo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $o(e){return e.replace(Qo,es)}function es(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return wi(n.slice(t?2:1),t?16:10)}return _i(n)||e}var ts={}.hasOwnProperty;function ns(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),rs(n)(Yo(Jo(n).document().write(Zo()(e,t,!0))))}function rs(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(le),blockQuote:a(ie),characterEscape:T,characterReference:T,codeFenced:a(ae),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ae,o),codeText:a(oe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ce),hardBreakEscape:a(ue),hardBreakTrailing:a(ue),htmlFlow:a(de,o),htmlFlowData:T,htmlText:a(de,o),htmlTextData:T,image:a(fe),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(le),strong:a(_e),thematicBreak:a(ye)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:re,autolinkProtocol:ne,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:B,characterReference:V,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};as(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];ts.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ss).call(a,void 0,e[0])}for(r.position={start:is(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:is(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:is(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ss).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ar({start:e.start,end:e.end})+`): it’s not open`);n.position.end=is(e.end)}function u(){return fi(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ti(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ve(),n.position={start:is(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=is(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=is(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=$o(t),n.identifier=Ti(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function R(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ti(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function z(e){this.data.characterReferenceType=e.type}function B(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=wi(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=_i(t);let i=this.stack[this.stack.length-1];i.value+=r}function V(e){let t=this.stack.pop();t.position.end=is(e.end)}function ne(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[]}}function ae(){return{type:`code`,lang:null,meta:null,value:``}}function oe(){return{type:`inlineCode`,value:``}}function se(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ce(){return{type:`emphasis`,children:[]}}function le(){return{type:`heading`,depth:0,children:[]}}function ue(){return{type:`break`}}function de(){return{type:`html`,value:``}}function fe(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function _e(){return{type:`strong`,children:[]}}function ve(){return{type:`text`,value:``}}function ye(){return{type:`thematicBreak`}}}function is(e){return{line:e.line,column:e.column,offset:e.offset}}function as(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?as(e,r):os(e,r)}}function os(e,t){let n;for(n in t)if(ts.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ss(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ar({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+`) is still open`)}function cs(e){let t=this;t.parser=n;function n(n){return ns(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ls(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function us(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
14
|
-
`}]}function ds(e,t){let n=t.value?t.value+`
|
|
15
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function fs(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ps(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ms(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Ii(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function hs(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gs(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _s(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function vs(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _s(e,t);let i={src:Ii(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ys(e,t){let n={src:Ii(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function bs(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function xs(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _s(e,t);let i={href:Ii(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ss(e,t){let n={href:Ii(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Cs(e,t,n){let r=e.all(t),i=n?ws(n):Ts(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
16
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
17
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function ws(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Ts(n[r])}return t}function Ts(e){return e.spread??e.children.length>1}function Es(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Ds(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Os(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ks(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function As(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Dr(t.children[1]),o=Er(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function js(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Ms(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Ns=9,Ps=32;function Fs(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Is(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Is(t.slice(i),i>0,!1)),a.join(``)}function Is(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Ns||t===Ps;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Ns||t===Ps;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Ls(e,t){let n={type:`text`,value:Fs(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Rs(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var zs={blockquote:ls,break:us,code:ds,delete:fs,emphasis:ps,footnoteReference:ms,heading:hs,html:gs,imageReference:vs,image:ys,inlineCode:bs,linkReference:xs,link:Ss,listItem:Cs,list:Es,paragraph:Ds,root:Os,strong:ks,table:As,tableCell:Ms,tableRow:js,text:Ls,thematicBreak:Rs,toml:Bs,yaml:Bs,definition:Bs,footnoteDefinition:Bs};function Bs(){}var Vs=typeof self==`object`?self:globalThis,Hs=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new Vs[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new Vs[a](o),i)};return r},Us=e=>Hs(new Map,e)(0),Ws=``,{toString:Gs}={},{keys:Ks}=Object,qs=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Gs.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ws];case`Object`:return[2,Ws];case`Date`:return[3,Ws];case`RegExp`:return[4,Ws];case`Map`:return[5,Ws];case`Set`:return[6,Ws];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Js=([e,t])=>e===0&&(t===`function`||t===`symbol`),Ys=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=qs(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Ks(r))(e||!Js(qs(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Js(qs(n))||Js(qs(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Js(qs(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Xs=(e,{json:t,lossy:n}={})=>{let r=[];return Ys(!(t||n),!!t,new Map,r)(e),r},Zs=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Us(Xs(e,t)):structuredClone(e):(e,t)=>Us(Xs(e,t));function Qs(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function $s(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ec(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Qs,r=e.options.footnoteBackLabel||$s,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Ii(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Zs(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
18
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
19
|
-
`}]}}var tc=(function(e){if(e==null)return oc;if(typeof e==`function`)return ac(e);if(typeof e==`object`)return Array.isArray(e)?nc(e):rc(e);if(typeof e==`string`)return ic(e);throw Error(`Expected function, string, or object as test`)});function nc(e){let t=[],n=-1;for(;++n<e.length;)t[n]=tc(e[n]);return ac(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function rc(e){let t=e;return ac(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ic(e){return ac(t);function t(t){return t&&t.type===e}}function ac(e){return t;function t(t,n,r){return!!(sc(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function oc(){return!0}function sc(e){return typeof e==`object`&&!!e&&`type`in e}function cc(e){return e}var lc=[];function uc(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=tc(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+cc(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=lc,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=dc(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function dc(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?lc:[e]}function fc(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),uc(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var pc={}.hasOwnProperty,mc={};function hc(e,t){let n=t||mc,r=new Map,i=new Map,a={all:s,applyData:_c,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...zs,...n.handlers},one:o,options:n,patch:gc,wrap:yc};return fc(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(pc.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Zs(n);return r.children=a.all(e),r}return Zs(e)}return(a.options.unknownHandler||vc)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=bc(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=bc(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function gc(e,t){e.position&&(t.position=kr(e))}function _c(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Zs(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function vc(e,t){let n=t.data||{},r=`value`in t&&!(pc.call(n,`hProperties`)||pc.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yc(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
20
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
21
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
22
|
-
`}),n}function bc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xc(e,t){let n=hc(e,t),r=n.one(e,void 0),i=ec(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
23
|
-
`},i)),a}function Sc(e,t){return e&&`run`in e?async function(n,r){let i=xc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xc(n,{file:r,...e||t})}}function Cc(e){if(e)throw e}var wc=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Tc(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ec(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Dc(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Dc(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Oc={basename:kc,dirname:Ac,extname:jc,join:Mc,sep:`/`};function kc(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Fc(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ac(e){if(Fc(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function jc(e){Fc(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Mc(...e){let t=-1,n;for(;++t<e.length;)Fc(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Nc(n)}function Nc(e){Fc(e);let t=e.codePointAt(0)===47,n=Pc(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Pc(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Fc(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Ic={cwd:Lc};function Lc(){return`/`}function Rc(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function zc(e){if(typeof e==`string`)e=new URL(e);else if(!Rc(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Bc(e)}function Bc(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Vc=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Hc=class{constructor(e){let t;t=e?Rc(e)?{path:e}:typeof e==`string`||Kc(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Ic.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Vc.length;){let e=Vc[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Vc.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Oc.basename(this.path):void 0}set basename(e){Wc(e,`basename`),Uc(e,`basename`),this.path=Oc.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Oc.dirname(this.path):void 0}set dirname(e){Gc(this.basename,`dirname`),this.path=Oc.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Oc.extname(this.path):void 0}set extname(e){if(Uc(e,`extname`),Gc(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Oc.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Rc(e)&&(e=zc(e)),Wc(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Oc.basename(this.path,this.extname):void 0}set stem(e){Wc(e,`stem`),Uc(e,`stem`),this.path=Oc.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Pr(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Uc(e,t){if(e&&e.includes(Oc.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Oc.sep+"`")}function Wc(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Gc(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Kc(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var qc=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Jc=l(wc(),1),Yc={}.hasOwnProperty,Xc=new class e extends qc{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=Ec()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Jc.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?($c(`data`,this.frozen),this.namespace[e]=t,this):Yc.call(this.namespace,e)&&this.namespace[e]||void 0:e?($c(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=nl(e),n=this.parser||this.Parser;return Zc(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Zc(`process`,this.parser||this.Parser),Qc(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=nl(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);il(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Zc(`processSync`,this.parser||this.Parser),Qc(`processSync`,this.compiler||this.Compiler),this.process(e,r),tl(`processSync`,`process`,t),n;function r(e,r){t=!0,Cc(e),n=r}}run(e,t,n){el(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=nl(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),tl(`runSync`,`run`,n),r;function i(e,t){Cc(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=nl(t),r=this.compiler||this.Compiler;return Qc(`stringify`,r),el(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if($c(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Jc.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Tc(o)&&Tc(r)&&(r=(0,Jc.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Zc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Qc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function $c(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function el(e){if(!Tc(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function tl(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nl(e){return rl(e)?e:new Hc(e)}function rl(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function il(e){return typeof e==`string`||al(e)}function al(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ol=[],sl={allowDangerousHtml:!0},cl=/^(https?|ircs?|mailto|xmpp)$/i,ll=[{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 ul(e){let t=dl(e),n=fl(e);return pl(t.runSync(t.parse(n),n),e)}function dl(e){let t=e.rehypePlugins||ol,n=e.remarkPlugins||ol,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sl}:sl;return Xc().use(cs).use(n).use(Sc,r).use(t)}function fl(e){let t=e.children||``,n=new Hc;return typeof t==`string`?n.value=t:``+t,n}function pl(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||ml;for(let e of ll)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return fc(e,l),Hr(e,{Fragment:U.Fragment,components:i,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in ui)if(Object.hasOwn(ui,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ui[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function ml(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||cl.test(e.slice(0,t))?e:``}function hl(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function gl(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function _l(e,t,n){let r=tc((n||{}).ignore||[]),i=vl(t),a=-1;for(;++a<i.length;)uc(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function vl(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([yl(e[0]),bl(e[1])])}return t}function yl(e){return typeof e==`string`?new RegExp(gl(e),`g`):e}function bl(e){return typeof e==`function`?e:function(){return e}}var xl=`phrasing`,Sl=[`autolink`,`link`,`image`,`label`];function Cl(){return{transforms:[jl],enter:{literalAutolink:Tl,literalAutolinkEmail:El,literalAutolinkHttp:El,literalAutolinkWww:El},exit:{literalAutolink:Al,literalAutolinkEmail:kl,literalAutolinkHttp:Dl,literalAutolinkWww:Ol}}}function wl(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:xl,notInConstruct:Sl},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:xl,notInConstruct:Sl},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:xl,notInConstruct:Sl}]}}function Tl(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function El(e){this.config.enter.autolinkProtocol.call(this,e)}function Dl(e){this.config.exit.autolinkProtocol.call(this,e)}function Ol(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function kl(e){this.config.exit.autolinkEmail.call(this,e)}function Al(e){this.exit(e)}function jl(e){_l(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ml],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Nl]],{ignore:[`link`,`linkReference`]})}function Ml(e,t,n,r,i){let a=``;if(!Z(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Pl(n)))return!1;let o=Fl(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Nl(e,t,n,r){return!Z(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Pl(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Fl(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=hl(e,`(`),a=hl(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Z(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Pi(n)||Ni(n))&&(!t||n!==47)}Gl.peek=Wl;function Il(){this.buffer()}function Ll(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Rl(){this.buffer()}function zl(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Bl(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ti(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vl(e){this.exit(e)}function Hl(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ti(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ul(e){this.exit(e)}function Wl(){return`[`}function Gl(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Kl(){return{enter:{gfmFootnoteCallString:Il,gfmFootnoteCall:Ll,gfmFootnoteDefinitionLabelString:Rl,gfmFootnoteDefinition:zl},exit:{gfmFootnoteCallString:Bl,gfmFootnoteCall:Vl,gfmFootnoteDefinitionLabelString:Hl,gfmFootnoteDefinition:Ul}}}function ql(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gl},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
24
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Yl:Jl))),s(),o}}function Jl(e,t,n){return t===0?e:Yl(e,t,n)}function Yl(e,t,n){return(n?``:` `)+e}var Xl=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];tu.peek=nu;function Zl(){return{canContainEols:[`delete`],enter:{strikethrough:$l},exit:{strikethrough:eu}}}function Ql(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Xl}],handlers:{delete:tu}}}function $l(e){this.enter({type:`delete`,children:[]},e)}function eu(e){this.exit(e)}function tu(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function nu(){return`~`}function ru(e){return e.length}function iu(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ru,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=au(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=ou(r[d]);else{let e=ou(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
25
|
-
`)}function au(e){return e==null?``:String(e)}function ou(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function su(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),cu);return i(),o}function cu(e,t,n){return`>`+(n?``:` `)+e}function lu(e,t){return uu(e,t.inConstruct,!0)&&!uu(e,t.notInConstruct,!1)}function uu(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function du(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
26
|
-
`&&lu(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
27
|
-
`}function fu(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function pu(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function mu(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hu(e,t,n,r){let i=mu(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(pu(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,gu);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(fu(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
28
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
29
|
-
`),a&&(u+=s.move(a+`
|
|
30
|
-
`)),u+=s.move(c),l(),u}function gu(e,t,n){return(n?``:` `)+e}function _u(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function vu(e,t,n,r){let i=_u(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
31
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function yu(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bu(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function xu(e,t,n){let r=Ui(e),i=Ui(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Su.peek=Cu;function Su(e,t,n,r){let i=yu(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=xu(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=bu(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=xu(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+bu(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Cu(e,t,n){return n.options.emphasis||`*`}function wu(e,t){let n=!1;return fc(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&fi(e)&&(t.options.setext||n))}function Tu(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(wu(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
32
|
-
`,after:`
|
|
33
|
-
`});return r(),t(),o+`
|
|
34
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
35
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
36
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=bu(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Eu.peek=Du;function Eu(e){return e.value||``}function Du(){return`<`}Ou.peek=ku;function Ou(e,t,n,r){let i=_u(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ku(){return`!`}Au.peek=ju;function Au(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ju(){return`!`}Mu.peek=Nu;function Mu(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Nu(){return"`"}function Pu(e,t){let n=fi(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Fu.peek=Iu;function Fu(e,t,n,r){let i=_u(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Pu(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Iu(e,t,n){return Pu(e,n)?`<`:`[`}Lu.peek=Ru;function Lu(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ru(){return`[`}function zu(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Bu(e){let t=zu(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Vu(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Hu(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Uu(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Vu(n):zu(n),s=e.ordered?o===`.`?`)`:`.`:Bu(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Hu(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Wu(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Gu(e,t,n,r){let i=Wu(n),a=n.bulletCurrent||zu(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Ku(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var qu=tc([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Ju(e,t,n,r){return(e.children.some(function(e){return qu(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Yu(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xu.peek=Zu;function Xu(e,t,n,r){let i=Yu(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=xu(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=bu(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=xu(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+bu(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Zu(e,t,n){return n.options.strong||`*`}function Qu(e,t,n,r){return n.safe(e.value,r)}function $u(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ed(e,t,n){let r=(Hu(n)+(n.options.ruleSpaces?` `:``)).repeat($u(n));return n.options.ruleSpaces?r.slice(0,-1):r}var td={blockquote:su,break:du,code:hu,definition:vu,emphasis:Su,hardBreak:du,heading:Tu,html:Eu,image:Ou,imageReference:Au,inlineCode:Mu,link:Fu,linkReference:Lu,list:Uu,listItem:Gu,paragraph:Ku,root:Ju,strong:Xu,text:Qu,thematicBreak:ed};function nd(){return{enter:{table:rd,tableData:sd,tableHeader:sd,tableRow:ad},exit:{codeText:cd,table:id,tableData:od,tableHeader:od,tableRow:od}}}function rd(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function id(e){this.exit(e),this.data.inTable=void 0}function ad(e){this.enter({type:`tableRow`,children:[]},e)}function od(e){this.exit(e)}function sd(e){this.enter({type:`tableCell`,children:[]},e)}function cd(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ld));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ld(e,t){return t===`|`?t:e}function ud(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
37
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
38
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return iu(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=td.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function dd(){return{exit:{taskListCheckValueChecked:pd,taskListCheckValueUnchecked:pd,paragraph:md}}}function fd(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:hd}}}function pd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function md(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hd(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=td.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function gd(){return[Cl(),Kl(),Zl(),nd(),dd()]}function _d(e){return{extensions:[wl(),ql(e),Ql(),ud(e),fd()]}}var vd={tokenize:jd,partial:!0},yd={tokenize:Md,partial:!0},Q={tokenize:Nd,partial:!0},bd={tokenize:Pd,partial:!0},xd={tokenize:Fd,partial:!0},Sd={name:`wwwAutolink`,tokenize:kd,previous:Id},Cd={name:`protocolAutolink`,tokenize:Ad,previous:Ld},wd={name:`emailAutolink`,tokenize:Od,previous:Rd},Td={};function Ed(){return{text:Td}}for(var Dd=48;Dd<123;)Td[Dd]=wd,Dd++,Dd===58?Dd=65:Dd===91&&(Dd=97);Td[43]=wd,Td[45]=wd,Td[46]=wd,Td[95]=wd,Td[72]=[wd,Cd],Td[104]=[wd,Cd],Td[87]=[wd,Sd],Td[119]=[wd,Sd];function Od(e,t,n){let r=this,i,a;return o;function o(t){return!zd(t)||!Rd.call(r,r.previous)||Bd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return zd(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(xd,u,l)(t):t===45||t===95||K(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Ei(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function kd(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Id.call(r,r.previous)||Bd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(vd,e.attempt(yd,e.attempt(Q,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Ad(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Ld.call(r,r.previous)&&!Bd(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Ei(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Oi(t)||Mi(t)||Pi(t)||Ni(t)?n(t):e.attempt(yd,e.attempt(Q,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function jd(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Md(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(bd,c,s)(t):t===null||Mi(t)||Pi(t)||t!==45&&Ni(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Nd(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(bd,t,a)(o):o===null||Mi(o)||Pi(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Pd(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Mi(o)||Pi(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Mi(e)||Pi(e)?t(e):r(e)}function a(e){return Ei(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Ei(t)?(e.consume(t),o):n(t)}}function Fd(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return K(e)?n(e):t(e)}}function Id(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Mi(e)}function Ld(e){return!Ei(e)}function Rd(e){return!(e===47||zd(e))}function zd(e){return e===43||e===45||e===46||e===95||K(e)}function Bd(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Vd={tokenize:Yd,partial:!0};function Hd(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Kd,continuation:{tokenize:qd},exit:Jd}},text:{91:{name:`gfmFootnoteCall`,tokenize:Gd},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ud,resolveTo:Wd}}}}function Ud(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Ti(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Wd(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Gd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Mi(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ti(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Mi(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Kd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Mi(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ti(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Mi(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function qd(e,t,n){return e.check(Zi,t,e.attempt(Vd,t,n))}function Jd(e){e.exit(`gfmFootnoteDefinition`)}function Yd(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Xd(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&vi(o,o.length,0,Wi(s,e.slice(r+1,n),t)),vi(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),vi(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Ui(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Ui(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Zd=class{constructor(){this.map=[]}add(e,t,n){Qd(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Qd(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function $d(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ef(){return{flow:{null:{name:`table`,tokenize:tf,resolveAll:nf}}}}function tf(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Mi(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||q(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Mi(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function nf(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Zd;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(af(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=rf(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=rf(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=rf(f,t,o,i,n,d)):(o[0]=o[1],d=rf(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&af(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=$d(t.events,n))}return e}function rf(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},of(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=of(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=of(t.events,n[2]),a=of(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},of(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function af(e,t,n,r,i){let a=[],o=of(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function of(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var sf={name:`tasklistCheck`,tokenize:lf};function cf(){return{text:{91:sf}}}function lf(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Mi(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return q(r)?t(r):J(r)?e.check({tokenize:uf},t,n)(r):n(r)}}function uf(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function df(e){return xi([Ed(),Hd(),Xd(e),ef(),cf()])}var ff={};function pf(e){let t=this,n=e||ff,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(df(n)),a.push(gd()),o.push(_d(n))}var{entries:mf,setPrototypeOf:hf,isFrozen:gf,getPrototypeOf:_f,getOwnPropertyDescriptor:vf}=Object,{freeze:yf,seal:bf,create:xf}=Object,{apply:Sf,construct:Cf}=typeof Reflect<`u`&&Reflect;yf||=function(e){return e},bf||=function(e){return e},Sf||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Cf||=function(e){return new e(...[...arguments].slice(1))};var wf=Rf(Array.prototype.forEach),Tf=Rf(Array.prototype.lastIndexOf),Ef=Rf(Array.prototype.pop),Df=Rf(Array.prototype.push),Of=Rf(Array.prototype.splice),kf=Rf(String.prototype.toLowerCase),Af=Rf(String.prototype.toString),jf=Rf(String.prototype.match),Mf=Rf(String.prototype.replace),Nf=Rf(String.prototype.indexOf),Pf=Rf(String.prototype.trim),Ff=Rf(Object.prototype.hasOwnProperty),If=Rf(RegExp.prototype.test),Lf=zf(TypeError);function Rf(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Sf(e,t,n)}}function zf(e){return function(){return Cf(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kf;hf&&hf(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(gf(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Bf(e){for(let t=0;t<e.length;t++)Ff(e,t)||(e[t]=null);return e}function Vf(e){let t=xf(null);for(let[n,r]of mf(e))Ff(e,n)&&(Array.isArray(r)?t[n]=Bf(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=Vf(r):t[n]=r);return t}function Hf(e,t){for(;e!==null;){let n=vf(e,t);if(n){if(n.get)return Rf(n.get);if(typeof n.value==`function`)return Rf(n.value)}e=_f(e)}function n(){return null}return n}var Uf=yf(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Wf=yf(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Gf=yf([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Kf=yf([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),qf=yf(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Jf=yf([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Yf=yf([`#text`]),Xf=yf(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),Zf=yf(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Qf=yf(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),$f=yf([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ep=bf(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tp=bf(/<%[\w\W]*|[\w\W]*%>/gm),np=bf(/\$\{[\w\W]*/gm),rp=bf(/^data-[\-\w.\u00B7-\uFFFF]+$/),ip=bf(/^aria-[\-\w]+$/),ap=bf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),op=bf(/^(?:\w+script|data):/i),sp=bf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cp=bf(/^html$/i),lp=bf(/^[a-z][.\w]*(-[.\w]+)+$/i),up=Object.freeze({__proto__:null,ARIA_ATTR:ip,ATTR_WHITESPACE:sp,CUSTOM_ELEMENT:lp,DATA_ATTR:rp,DOCTYPE_NAME:cp,ERB_EXPR:tp,IS_ALLOWED_URI:ap,IS_SCRIPT_OR_DATA:op,MUSTACHE_EXPR:ep,TMPLIT_EXPR:np}),dp={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},fp=function(){return typeof window>`u`?null:window},pp=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},mp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function hp(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fp(),t=e=>hp(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==dp.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Hf(m,`cloneNode`),g=Hf(m,`remove`),_=Hf(m,`nextSibling`),v=Hf(m,`childNodes`),y=Hf(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=mp();t.isSupported=typeof mf==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:k,TMPLIT_EXPR:A,DATA_ATTR:j,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:F}=up,{IS_ALLOWED_URI:I}=up,L=null,ee=$({},[...Uf,...Wf,...Gf,...qf,...Yf]),R=null,te=$({},[...Xf,...Zf,...Qf,...$f]),z=Object.seal(xf(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,V=null,ne=Object.seal(xf(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),re=!0,ie=!0,ae=!1,oe=!0,se=!1,ce=!0,le=!1,ue=!1,de=!1,fe=!1,pe=!1,me=!1,he=!0,ge=!1,_e=!0,ve=!1,ye={},be=null,xe=$({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Se=null,Ce=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),we=null,Te=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ee=`http://www.w3.org/1998/Math/MathML`,De=`http://www.w3.org/2000/svg`,Oe=`http://www.w3.org/1999/xhtml`,ke=Oe,Ae=!1,je=null,Me=$({},[Ee,De,Oe],Af),Ne=$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Pe=$({},[`annotation-xml`]),Fe=$({},[`title`,`style`,`font`,`a`,`script`]),Ie=null,Le=[`application/xhtml+xml`,`text/html`],Re=null,ze=null,Be=n.createElement(`form`),Ve=function(e){return e instanceof RegExp||e instanceof Function},He=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ze&&ze===e)){if((!e||typeof e!=`object`)&&(e={}),e=Vf(e),Ie=Le.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Re=Ie===`application/xhtml+xml`?Af:kf,L=Ff(e,`ALLOWED_TAGS`)?$({},e.ALLOWED_TAGS,Re):ee,R=Ff(e,`ALLOWED_ATTR`)?$({},e.ALLOWED_ATTR,Re):te,je=Ff(e,`ALLOWED_NAMESPACES`)?$({},e.ALLOWED_NAMESPACES,Af):Me,we=Ff(e,`ADD_URI_SAFE_ATTR`)?$(Vf(Te),e.ADD_URI_SAFE_ATTR,Re):Te,Se=Ff(e,`ADD_DATA_URI_TAGS`)?$(Vf(Ce),e.ADD_DATA_URI_TAGS,Re):Ce,be=Ff(e,`FORBID_CONTENTS`)?$({},e.FORBID_CONTENTS,Re):xe,B=Ff(e,`FORBID_TAGS`)?$({},e.FORBID_TAGS,Re):Vf({}),V=Ff(e,`FORBID_ATTR`)?$({},e.FORBID_ATTR,Re):Vf({}),ye=Ff(e,`USE_PROFILES`)?e.USE_PROFILES:!1,re=e.ALLOW_ARIA_ATTR!==!1,ie=e.ALLOW_DATA_ATTR!==!1,ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,oe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=e.SAFE_FOR_TEMPLATES||!1,ce=e.SAFE_FOR_XML!==!1,le=e.WHOLE_DOCUMENT||!1,fe=e.RETURN_DOM||!1,pe=e.RETURN_DOM_FRAGMENT||!1,me=e.RETURN_TRUSTED_TYPE||!1,de=e.FORCE_BODY||!1,he=e.SANITIZE_DOM!==!1,ge=e.SANITIZE_NAMED_PROPS||!1,_e=e.KEEP_CONTENT!==!1,ve=e.IN_PLACE||!1,I=e.ALLOWED_URI_REGEXP||ap,ke=e.NAMESPACE||Oe,Ne=e.MATHML_TEXT_INTEGRATION_POINTS||Ne,Pe=e.HTML_INTEGRATION_POINTS||Pe,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),se&&(ie=!1),pe&&(fe=!0),ye&&(L=$({},Yf),R=xf(null),ye.html===!0&&($(L,Uf),$(R,Xf)),ye.svg===!0&&($(L,Wf),$(R,Zf),$(R,$f)),ye.svgFilters===!0&&($(L,Gf),$(R,Zf),$(R,$f)),ye.mathMl===!0&&($(L,qf),$(R,Qf),$(R,$f))),Ff(e,`ADD_TAGS`)||(ne.tagCheck=null),Ff(e,`ADD_ATTR`)||(ne.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?ne.tagCheck=e.ADD_TAGS:(L===ee&&(L=Vf(L)),$(L,e.ADD_TAGS,Re))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?ne.attributeCheck=e.ADD_ATTR:(R===te&&(R=Vf(R)),$(R,e.ADD_ATTR,Re))),e.ADD_URI_SAFE_ATTR&&$(we,e.ADD_URI_SAFE_ATTR,Re),e.FORBID_CONTENTS&&(be===xe&&(be=Vf(be)),$(be,e.FORBID_CONTENTS,Re)),e.ADD_FORBID_CONTENTS&&(be===xe&&(be=Vf(be)),$(be,e.ADD_FORBID_CONTENTS,Re)),_e&&(L[`#text`]=!0),le&&$(L,[`html`,`head`,`body`]),L.table&&($(L,[`tbody`]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Lf(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Lf(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=pp(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));yf&&yf(e),ze=e}},Ue=$({},[...Wf,...Gf,...Kf]),We=$({},[...qf,...Jf]),Ge=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:ke,tagName:`template`});let n=kf(e.tagName),r=kf(t.tagName);return je[e.namespaceURI]?e.namespaceURI===De?t.namespaceURI===Oe?n===`svg`:t.namespaceURI===Ee?n===`svg`&&(r===`annotation-xml`||Ne[r]):!!Ue[n]:e.namespaceURI===Ee?t.namespaceURI===Oe?n===`math`:t.namespaceURI===De?n===`math`&&Pe[r]:!!We[n]:e.namespaceURI===Oe?t.namespaceURI===De&&!Pe[r]||t.namespaceURI===Ee&&!Ne[r]?!1:!We[n]&&(Fe[n]||!Ue[n]):!!(Ie===`application/xhtml+xml`&&je[e.namespaceURI]):!1},Ke=function(e){Df(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},qe=function(e,n){try{Df(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Df(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(fe||pe)try{Ke(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Je=function(e){let t=null,r=null;if(de)e=`<remove></remove>`+e;else{let t=jf(e,/^[\r\n\t ]+/);r=t&&t[0]}Ie===`application/xhtml+xml`&&ke===Oe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(ke===Oe)try{t=new f().parseFromString(i,Ie)}catch{}if(!t||!t.documentElement){t=S.createDocument(ke,`template`,null);try{t.documentElement.innerHTML=Ae?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),ke===Oe?T.call(t,le?`html`:`body`)[0]:le?t.documentElement:a},Ye=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Xe=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Ze=function(e){return typeof s==`function`&&e instanceof s};function Qe(e,n,r){wf(e,e=>{e.call(t,n,r,ze)})}let $e=function(e){let n=null;if(Qe(D.beforeSanitizeElements,e,null),Xe(e))return Ke(e),!0;let r=Re(e.nodeName);if(Qe(D.uponSanitizeElement,e,{tagName:r,allowedTags:L}),ce&&e.hasChildNodes()&&!Ze(e.firstElementChild)&&If(/<[/\w!]/g,e.innerHTML)&&If(/<[/\w!]/g,e.textContent)||e.nodeType===dp.progressingInstruction||ce&&e.nodeType===dp.comment&&If(/<[/\w]/g,e.data))return Ke(e),!0;if(!(ne.tagCheck instanceof Function&&ne.tagCheck(r))&&(!L[r]||B[r])){if(!B[r]&&tt(r)&&(z.tagNameCheck instanceof RegExp&&If(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r)))return!1;if(_e&&!be[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,_(e))}}}return Ke(e),!0}return e instanceof c&&!Ge(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&If(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ke(e),!0):(se&&e.nodeType===dp.text&&(n=e.textContent,wf([O,k,A],e=>{n=Mf(n,e,` `)}),e.textContent!==n&&(Df(t.removed,{element:e.cloneNode()}),e.textContent=n)),Qe(D.afterSanitizeElements,e,null),!1)},et=function(e,t,r){if(V[t]||he&&(t===`id`||t===`name`)&&(r in n||r in Be))return!1;if(!(ie&&!V[t]&&If(j,t))&&!(re&&If(M,t))&&!(ne.attributeCheck instanceof Function&&ne.attributeCheck(t,e))){if(!R[t]||V[t]){if(!(tt(e)&&(z.tagNameCheck instanceof RegExp&&If(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&If(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t,e))||t===`is`&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&If(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r))))return!1}else if(!we[t]&&!If(I,Mf(r,P,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Nf(r,`data:`)===0&&Se[e])&&!(ae&&!If(N,Mf(r,P,``)))&&r)return!1}return!0},tt=function(e){return e!==`annotation-xml`&&jf(e,F)},nt=function(e){Qe(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||Xe(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Re(a),l=s,u=a===`value`?l:Pf(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Qe(D.uponSanitizeAttribute,e,r),u=r.attrValue,ge&&(c===`id`||c===`name`)&&(qe(a,e),u=`user-content-`+u),ce&&If(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){qe(a,e);continue}if(c===`attributename`&&jf(u,`href`)){qe(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){qe(a,e);continue}if(!oe&&If(/\/>/i,u)){qe(a,e);continue}se&&wf([O,k,A],e=>{u=Mf(u,e,` `)});let d=Re(e.nodeName);if(!et(d,c,u)){qe(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),Xe(e)?Ke(e):Ef(t.removed)}catch{qe(a,e)}}Qe(D.afterSanitizeAttributes,e,null)},rt=function e(t){let n=null,r=Ye(t);for(Qe(D.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Qe(D.uponSanitizeShadowNode,n,null),$e(n),nt(n),n.content instanceof a&&e(n.content);Qe(D.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Ae=!e,Ae&&(e=`<!-->`),typeof e!=`string`&&!Ze(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Lf(`dirty is not a string, aborting`)}else throw Lf(`toString is not a function`);if(!t.isSupported)return e;if(ue||He(n),t.removed=[],typeof e==`string`&&(ve=!1),ve){if(e.nodeName){let t=Re(e.nodeName);if(!L[t]||B[t])throw Lf(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Je(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===dp.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!fe&&!se&&!le&&e.indexOf(`<`)===-1)return b&&me?b.createHTML(e):e;if(i=Je(e),!i)return fe?null:me?x:``}i&&de&&Ke(i.firstChild);let u=Ye(ve?e:i);for(;c=u.nextNode();)$e(c),nt(c),c.content instanceof a&&rt(c.content);if(ve)return e;if(fe){if(pe)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(R.shadowroot||R.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=le?i.outerHTML:i.innerHTML;return le&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&If(cp,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
39
|
-
`+d),se&&wf([O,k,A],e=>{d=Mf(d,e,` `)}),b&&me?b.createHTML(d):d},t.setConfig=function(){He(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),ue=!0},t.clearConfig=function(){ze=null,ue=!1},t.isValidAttribute=function(e,t,n){return ze||He({}),et(Re(e),Re(t),n)},t.addHook=function(e,t){typeof t==`function`&&Df(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Tf(D[e],t);return n===-1?void 0:Of(D[e],n,1)[0]}return Ef(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=mp()},t}var gp=hp(),_p=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),ee=I(`/\\*`,`\\*/`),R=I(`#`,`$`),te={scope:`number`,begin:D,relevance:0},z={scope:`number`,begin:O,relevance:0},B={scope:`number`,begin:k,relevance:0},V={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},ne={scope:`title`,begin:T,relevance:0},re={scope:`title`,begin:E,relevance:0},ie={begin:`\\.\\s*`+E,relevance:0},ae=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:B,BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:z,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:ie,NUMBER_MODE:te,NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:V,RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:ne,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:re});function oe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function se(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ce(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=oe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function le(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ue(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function de(e,t){e.relevance===void 0&&(e.relevance=1)}var fe=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},pe=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],me=`keyword`;function he(e,t,n=me){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,he(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ge(n[0],n[1])]})}}function ge(e,t){return t?Number(t):_e(e)?0:1}function _e(e){return pe.includes(e.toLowerCase())}var ve={},ye=e=>{console.error(e)},be=(e,...t)=>{console.log(`WARN: ${e}`,...t)},xe=(e,t)=>{ve[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ve[`${e}/${t}`]=!0)},Se=Error();function Ce(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function we(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ye(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Se;if(typeof e.beginScope!=`object`||e.beginScope===null)throw ye(`beginScope must be object`),Se;Ce(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Te(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ye(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Se;if(typeof e.endScope!=`object`||e.endScope===null)throw ye(`endScope must be object`),Se;Ce(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ee(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function De(e){Ee(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),we(e),Te(e)}function Oe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[se,ue,De,fe].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ce,le,de].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=he(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ae(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function ke(e){return e?e.endsWithParent||ke(e.starts):!1}function Ae(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ke(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var je=`11.11.1`,Me=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Ne=i,Pe=a,Fe=Symbol(`nomatch`),Ie=7,Le=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(be(s.replace(`{}`,n[1])),be(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(xe(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),xe(`10.7.0`,`Please use highlight(code, options) instead.
|
|
40
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};R(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,R(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ie&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(ee=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Fe;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Fe)return e}if(r.type===`illegal`&&a===``)return P+=`
|
|
41
|
-
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw ye(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Oe(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ne(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Ne(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Ne(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(R(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Me(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),R(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Pe(l,e)}let E=()=>{k(),xe(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),xe(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(ye(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)ye(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function R(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function te(e){return xe(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),xe(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:te,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Pe,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=je,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ae)typeof ae[e]==`object`&&n(ae[e]);return Object.assign(e,ae),e},Re=Le({});Re.newInstance=()=>Le({}),t.exports=Re,Re.HighlightJS=Re,Re.default=Re}))()).default,vp=`[A-Za-z$_][0-9A-Za-z$_]*`,yp=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),bp=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],xp=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Sp=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Cp=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],wp=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Tp=[].concat(Cp,xp,Sp);function Ep(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=vp,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:vp,keyword:yp,literal:bp,built_in:Tp,"variable.language":wp},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...xp,...Sp]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Cp,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Dp(e){let t=e.regex,n=Ep(e),r=vp,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:vp,keyword:yp.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:bp,built_in:Tp.concat(i),"variable.language":wp},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var Op=`[A-Za-z$_][0-9A-Za-z$_]*`,kp=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Ap=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],jp=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Mp=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Np=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Pp=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Fp=[].concat(Np,jp,Mp);function Ip(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Op,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Op,keyword:kp,literal:Ap,built_in:Fp,"variable.language":Pp},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...jp,...Mp]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Np,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Lp(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Rp(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function zp(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Bp(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function Vp(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}function Hp(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Up(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var Wp=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Gp=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Kp=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),qp=[...Gp,...Kp],Jp=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Yp=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Xp=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Zp=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Qp(e){let t=e.regex,n=Wp(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Yp.join(`|`)+`)`},{begin:`:(:)?(`+Xp.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Zp.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Jp.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+qp.join(`|`)+`)\\b`}]}}function $p(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}function em(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function tm(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}_p.registerLanguage(`typescript`,Dp),_p.registerLanguage(`ts`,Dp),_p.registerLanguage(`tsx`,Dp),_p.registerLanguage(`javascript`,Ip),_p.registerLanguage(`js`,Ip),_p.registerLanguage(`jsx`,Ip),_p.registerLanguage(`json`,Lp),_p.registerLanguage(`bash`,Rp),_p.registerLanguage(`sh`,Rp),_p.registerLanguage(`shell`,Rp),_p.registerLanguage(`zsh`,Rp),_p.registerLanguage(`python`,zp),_p.registerLanguage(`py`,zp),_p.registerLanguage(`go`,Bp),_p.registerLanguage(`yaml`,Vp),_p.registerLanguage(`yml`,Vp),_p.registerLanguage(`markdown`,Hp),_p.registerLanguage(`md`,Hp),_p.registerLanguage(`html`,Up),_p.registerLanguage(`xml`,Up),_p.registerLanguage(`css`,Qp),_p.registerLanguage(`rust`,$p),_p.registerLanguage(`rs`,$p),_p.registerLanguage(`sql`,em),_p.registerLanguage(`diff`,tm);var nm=_p;function rm(e){let t=e.match(/^claude-(\w+)-(\d+)-(\d+)/);return t?`${t[1].charAt(0).toUpperCase()+t[1].slice(1)} ${t[2]}.${t[3]}`:e}function im(e){return e.replace(/\[Attached files?: ([^\]]+)\]/g,(e,t)=>`\u{1F4CE} ${t.split(`, `).map(e=>e.split(`/`).pop()||e).join(`, `)}`)}function am(e){let t=e.match(/^(.*?)\s*(\{.+\})\s*$/);if(!t)return null;try{let e=JSON.parse(t[2]);if(e?.error?.message)return{prefix:t[1].replace(/\s*$/,``),errorType:e.error.type||`error`,message:e.error.message,requestId:e.request_id}}catch{}return null}function om({msg:e}){let t=e.subtype===`init`?`text-success-5`:e.subtype===`notification`?`text-primary-5`:e.subtype===`exit`||e.subtype===`restart`?`text-warning-5`:e.subtype===`info`?`text-neutral-5`:`text-error-5`,n=e.subtype===`init`?`bg-success-5`:e.subtype===`notification`?`bg-primary-5`:e.subtype===`exit`||e.subtype===`restart`?`bg-warning-5`:e.subtype===`info`?`bg-neutral-5`:`bg-error-5`,r=e.model?` (${rm(e.model)})`:``,i=e.subtype===`error`?am(e.text):null;return i?(0,U.jsxs)(`div`,{className:`px-4 py-2 text-[15px] ${t}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${n} flex-shrink-0`}),(0,U.jsx)(`span`,{className:`font-semibold`,children:i.prefix||`API Error`})]}),(0,U.jsxs)(`div`,{className:`ml-3.5 mt-1 space-y-0.5 text-[14px] opacity-90`,children:[(0,U.jsx)(`div`,{children:i.message}),i.requestId&&(0,U.jsxs)(`div`,{className:`opacity-50 text-[12px] font-mono`,children:[`Request ID: `,i.requestId]})]})]}):(0,U.jsxs)(`div`,{className:`px-4 py-1.5 text-[15px] ${t} flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${n} flex-shrink-0`}),e.text,r]})}function sm({msg:e,fontSize:t,isMobile:n}){return(0,U.jsx)(`div`,{className:`px-4 py-2`,children:(0,U.jsx)(`div`,{className:`user-bubble rounded-lg bg-neutral-10/60 px-3 py-2 text-neutral-3 whitespace-pre-wrap ${n?`max-w-[95%]`:`max-w-[80%]`}`,style:{fontSize:`${t}px`},children:im(e.text)})})}function cm({code:e}){let[t,n]=(0,v.useState)(!1);return(0,U.jsx)(`button`,{onClick:(0,v.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})},[e]),className:`absolute top-2 right-2 rounded p-1 opacity-0 transition-opacity group-hover/codeblock:opacity-100 bg-neutral-8/80 hover:bg-neutral-7 text-neutral-4 hover:text-neutral-2 cursor-pointer`,title:`Copy to clipboard`,children:t?(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,U.jsx)(`path`,{d:`M20 6L9 17l-5-5`})}):(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,U.jsx)(`path`,{d:`M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1`})]})})}function lm(e,t){return nm.getLanguage(t)?nm.highlight(e,{language:t}).value:e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}var um=/^\s*(Ignoring\b.*|All clear)\.?\s*$/;function dm(e){return e.split(`
|
|
42
|
-
`).filter(e=>!um.test(e)).join(`
|
|
43
|
-
`).replace(/\n{3,}/g,`
|
|
44
|
-
|
|
45
|
-
`).trim()}function fm({msg:e,fontSize:t,variant:n=`default`,repeatCount:r}){let i=dm(e.text);return i?(0,U.jsx)(`div`,{className:`px-4 py-2 ${n===`orchestrator`?`orchestrator-assistant-msg`:``}`,children:(0,U.jsxs)(`div`,{className:`prose prose-themed max-w-none`,style:{fontSize:`${t}px`},children:[(0,U.jsx)(ul,{remarkPlugins:[pf],components:{code({className:e,children:n,...r}){let i=/language-(\w+)/.exec(e||``),a=String(n).replace(/\n$/,``);return i?(0,U.jsxs)(`div`,{className:`group/codeblock relative`,children:[(0,U.jsx)(`div`,{className:`hljs`,style:{margin:`0.5em 0`,borderRadius:`6px`,fontSize:`${t-1}px`,padding:`1em`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:gp.sanitize(lm(a,i[1]))}}),(0,U.jsx)(cm,{code:a})]}):(0,U.jsx)(`code`,{className:`${e||``} rounded bg-neutral-10 px-1.5 py-0.5`,...r,children:n})},a({href:e,children:t,...n}){return(0,U.jsx)(`a`,{href:e&&/^(https?:|mailto:|\/|#)/i.test(e)?e:`#`,target:`_blank`,rel:`noopener noreferrer`,...n,children:t})},img({src:e,alt:t,...n}){return(0,U.jsx)(`img`,{src:e,alt:t||`Image`,className:`max-w-full max-h-96 rounded-lg border border-neutral-8 my-2`,loading:`lazy`,...n})}},children:i}),r&&r>1&&(0,U.jsxs)(`span`,{className:`inline-block ml-1 text-[12px] text-neutral-5 bg-neutral-10 rounded-full px-2 py-0.5 align-middle`,children:[`×`,r]})]})}):null}function pm({msg:e,fontSize:t}){return(0,U.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-0.5 text-neutral-4`,style:{fontSize:`${t-1}px`,fontFamily:`'Inconsolata', monospace`},children:e.tools.map((e,t)=>(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 whitespace-nowrap overflow-hidden`,children:[e.active?(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse flex-shrink-0`}):(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-neutral-6 flex-shrink-0`}),(0,U.jsx)(`span`,{className:`text-accent-6`,children:e.name}),e.summary&&(0,U.jsx)(`span`,{className:`text-neutral-5 truncate max-w-[400px]`,children:e.summary})]},t))})}function mm({msg:e,fontSize:t}){let[n,r]=(0,v.useState)(!1),i=t-1,a=e.isError?`text-error-5`:`text-neutral-5`,o=e.content.split(`
|
|
46
|
-
`),s=o.length>3,c=s&&!n?o.slice(0,3).join(`
|
|
47
|
-
`):e.content;return(0,U.jsxs)(`div`,{className:`pl-4 py-0.5 ${a}`,style:{fontSize:`${i}px`,fontFamily:`'Inconsolata', monospace`},children:[(0,U.jsx)(`div`,{className:`whitespace-pre-wrap break-all`,children:c}),s&&(0,U.jsx)(`button`,{onClick:()=>r(!n),className:`text-neutral-6 hover:text-neutral-3 transition-colors mt-0.5`,style:{fontSize:`${i}px`},children:n?`▴ collapse`:`▾ ${o.length-3} more lines`})]})}function hm({run:e,fontSize:t}){let n=e.groups.some(e=>e.tools.some(e=>e.active)),[r,i]=(0,v.useState)(!1),a=n||r,o=t-1,s=e.groups.flatMap(e=>e.tools),c=[...new Set(s.map(e=>e.name))],l=s.length,u=e.outputs.filter(e=>e.isError).length;return(0,U.jsxs)(`div`,{className:`px-4 py-0.5`,children:[(0,U.jsxs)(`button`,{onClick:()=>i(!a),className:`flex items-center gap-1.5 text-neutral-5 hover:text-neutral-3 transition-colors w-full text-left`,style:{fontSize:`${o}px`,fontFamily:`'Inconsolata', monospace`},children:[n?(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse flex-shrink-0`}):(0,U.jsx)(`span`,{className:`text-neutral-6 flex-shrink-0`,children:a?`▾`:`▸`}),(0,U.jsxs)(`span`,{className:`text-neutral-5`,children:[l,` tool`,l===1?` call`:` calls`,` — `,(0,U.jsxs)(`span`,{className:`text-accent-6`,children:[c.slice(0,4).join(`, `),c.length>4?` +${c.length-4}`:``]}),u>0&&(0,U.jsxs)(`span`,{className:`text-error-5 ml-1`,children:[`(`,u,` error`,u===1?``:`s`,`)`]})]})]}),a&&(0,U.jsxs)(`div`,{className:`pl-3 mt-0.5 border-l border-neutral-9/50`,children:[e.groups.map((e,n)=>(0,U.jsx)(`div`,{children:(0,U.jsx)(pm,{msg:e,fontSize:t})},`g-${n}`)),e.outputs.map((e,n)=>(0,U.jsx)(mm,{msg:e,fontSize:t},`o-${n}`))]}),e.images.map((e,t)=>(0,U.jsx)(gm,{msg:e},`img-${t}`))]})}function gm({msg:e}){let[t,n]=(0,v.useState)(!1);return(0,U.jsx)(`div`,{className:`pl-4 py-1`,children:(0,U.jsx)(`img`,{src:`data:${new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`]).has(e.mediaType)?e.mediaType:`image/png`};base64,${e.base64}`,alt:`Tool output`,className:`rounded-lg border border-neutral-8 cursor-pointer transition-all ${t?`max-w-full`:`max-w-xs max-h-48 object-contain`}`,onClick:()=>n(!t)})})}function _m({msg:e,fontSize:t}){return(0,U.jsx)(`div`,{className:`px-4 py-2`,children:(0,U.jsxs)(`div`,{className:`max-w-[80%] rounded-lg border-l-2 border-warning-6 bg-warning-11/20 px-3 py-2 text-neutral-4 whitespace-pre-wrap`,style:{fontSize:`${t}px`},children:[(0,U.jsx)(`div`,{className:`mb-1 text-[13px] text-warning-5 uppercase tracking-wider`,children:`queued`}),e.text]})})}function vm({msg:e}){return(0,U.jsxs)(`div`,{className:`px-4 py-1.5 text-[15px] text-primary-5 flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-primary-5 flex-shrink-0`}),e.active?`Entered plan mode`:`Exited plan mode`]})}function ym({agentName:e}){return(0,U.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-end pb-8 px-6`,children:(0,U.jsxs)(`div`,{className:`max-w-lg w-full`,children:[(0,U.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-xl bg-accent-9/40`,children:(0,U.jsx)(Jt,{size:22,className:`text-accent-5`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h2`,{className:`text-[17px] font-semibold text-neutral-2 leading-tight`,children:[`Agent `,e??`Joe`]}),(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-5`,children:`Your AI ops manager`})]})]}),(0,U.jsx)(`div`,{className:`grid gap-2 text-[14px]`,children:[`Triage repo health reports and prioritize fixes`,`Spawn implementation sessions for issues or tasks`,`Review code, plan refactors, or investigate bugs`].map(e=>(0,U.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-neutral-10 px-3.5 py-2.5 text-neutral-4 transition-colors hover:border-neutral-8 hover:text-neutral-3`,children:[(0,U.jsx)(`span`,{className:`h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent-6`}),(0,U.jsx)(`span`,{children:e})]},e))})]})})}function bm({label:e,variant:t=`default`}){let[n,r]=(0,v.useState)(0),i=(0,v.useRef)(0);return(0,v.useEffect)(()=>{i.current=Date.now(),r(0);let e=setInterval(()=>{r(Math.floor((Date.now()-i.current)/1e3))},1e3);return()=>clearInterval(e)},[e]),(0,U.jsx)(`div`,{className:`px-4 pt-4 pb-2`,children:(0,U.jsxs)(`div`,{className:`app-thinking-badge inline-flex items-center gap-2 rounded-lg bg-neutral-9/80 px-3.5 py-2`,children:[(0,U.jsxs)(`svg`,{className:`h-4 w-4 animate-[spin_3s_linear_infinite]`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:t===`orchestrator`?`var(--color-accent-7)`:`var(--color-primary-7)`},children:[(0,U.jsx)(`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`}),(0,U.jsx)(`path`,{d:`M12 21l0 .01`}),(0,U.jsx)(`path`,{d:`M3 9l0 .01`}),(0,U.jsx)(`path`,{d:`M21 9l0 .01`}),(0,U.jsx)(`path`,{d:`M8 20.1a9 9 0 0 1 -5 -7.1`}),(0,U.jsx)(`path`,{d:`M16 20.1a9 9 0 0 0 5 -7.1`}),(0,U.jsx)(`path`,{d:`M6.2 5a9 9 0 0 1 11.4 0`})]}),(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-4 tracking-wide`,children:e}),n>=10&&(0,U.jsxs)(`span`,{className:`text-[12px] text-neutral-5`,children:[n,`s`]})]})})}function xm({messages:e,fontSize:t,disabled:n,planningMode:r,activityLabel:i,isMobile:a,variant:o=`default`,agentName:s}){let c=(0,v.useRef)(null),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(!0),f=(0,v.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<100;d.current=t,u(!t)},[]);(0,v.useEffect)(()=>{d.current&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e]);let p=(0,v.useCallback)(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight,u(!1),d.current=!0)},[]);return(0,U.jsxs)(`div`,{className:`relative flex flex-1 min-h-0 w-full flex-col`,children:[r&&(0,U.jsxs)(`div`,{className:`z-10 flex items-center gap-2 border-b border-primary-9/50 bg-primary-11/80 px-4 py-1.5 text-[15px] text-primary-5 backdrop-blur-sm flex-shrink-0`,children:[(0,U.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-primary-5 animate-pulse`}),`Plan Mode`]}),(0,U.jsx)(`div`,{ref:c,className:`chat-scroll flex-1 overflow-y-auto overflow-x-hidden min-h-0`,onScroll:f,children:o===`orchestrator`&&e.length===0&&!i?(0,U.jsx)(ym,{agentName:s}):(0,U.jsxs)(`div`,{className:`flex flex-col py-2`,children:[(()=>{let n=0,r=[],i=0;for(;i<e.length;){let s=e[i],c=s.ts;if(c&&(s.type===`user`||s.type===`assistant`)&&c-n>=6e4){n=c;let e=new Date(c),t=String(e.getHours()).padStart(2,`0`),a=String(e.getMinutes()).padStart(2,`0`);r.push((0,U.jsxs)(`div`,{className:`px-4 pt-3 pb-0.5 text-[13px] text-neutral-6`,children:[t,`:`,a]},`ts-${s.key||i}`))}if(s.type===`tool_group`||s.type===`tool_output`||s.type===`image`){let n={groups:[],outputs:[],images:[]},a=i;for(;i<e.length&&(e[i].type===`tool_group`||e[i].type===`tool_output`||e[i].type===`image`);){let t=e[i];t.type===`tool_group`&&n.groups.push(t),t.type===`tool_output`&&n.outputs.push(t),t.type===`image`&&n.images.push(t),i++}let o=n.groups[0]?.key||n.outputs[0]?.key||`ta-${a}`;r.push((0,U.jsx)(hm,{run:n,fontSize:t},o));continue}if(s.type===`assistant`&&s.complete){let n=1,a=s.text.trim();for(;i+1<e.length;){let t=e[i+1];if(t.type===`assistant`&&t.complete&&t.text.trim()===a)n++,i++;else break}r.push((0,U.jsx)(fm,{msg:s,fontSize:t,variant:o,repeatCount:n},s.key||i)),i++;continue}let l;switch(s.type){case`system`:if(s.subtype===`trim`){l=(0,U.jsxs)(`div`,{className:`px-4 py-1.5 text-[15px] text-neutral-6 flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-neutral-6 flex-shrink-0`}),`Older messages trimmed`]},s.key||i);break}l=(0,U.jsx)(om,{msg:s},s.key||i);break;case`user`:l=(0,U.jsx)(sm,{msg:s,fontSize:t,isMobile:a},s.key||i);break;case`assistant`:l=(0,U.jsx)(fm,{msg:s,fontSize:t,variant:o},s.key||i);break;case`planning_mode`:l=(0,U.jsx)(vm,{msg:s},s.key||i);break;case`todo_list`:l=null;break;case`tentative`:l=(0,U.jsx)(_m,{msg:s,fontSize:t},s.key||`tentative-${s.index}`);break}r.push(l),i++}return r})(),i&&(0,U.jsx)(bm,{label:i,variant:o})]})}),l&&(0,U.jsx)(`button`,{onClick:p,className:`absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full bg-neutral-8/90 p-2 text-neutral-3 shadow-lg transition hover:bg-neutral-7 hover:text-neutral-1`,title:`Scroll to bottom`,children:(0,U.jsx)(ot,{size:16,stroke:2})}),n&&(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-neutral-12/80`,children:(0,U.jsx)(`p`,{className:`text-[15px] text-neutral-3`,children:`Configure token in Settings to use chat`})})]})}function Sm(e){return!e.includes(`T`)&&!e.includes(`Z`)&&!e.includes(`+`)?new Date(e.replace(` `,`T`)+`Z`):new Date(e)}function Cm(e){let t=Math.floor((Date.now()-Sm(e).getTime())/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function wm(e){let t=e.name||e.id.slice(0,8);return t.startsWith(`hub:`)?`unnamed session`:t}function Tm(e,t){let n=[];n.push(`Here is the conversation from a previous session "${t}" for context:\n`);for(let t of e)t.type===`user`?n.push(`**User:** ${t.text}`):t.type===`assistant`&&n.push(`**Assistant:** ${t.text}`);return n.push(`
|
|
48
|
-
---
|
|
49
|
-
Please continue from where this conversation left off. What would you like to work on?`),n.join(`
|
|
50
|
-
|
|
51
|
-
`)}function Em({token:e,visible:t,fontSize:n,workingDir:r,refreshKey:i,onNewSessionFromArchive:a,initialViewId:o,onClose:s}){let[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(7),g=(0,v.useCallback)(async()=>{if(e)try{let[t,n]=await Promise.all([re(e,r??void 0),oe(e)]);l(t),h(n)}catch(e){console.error(`Failed to load archived sessions:`,e)}},[e,r]);(0,v.useEffect)(()=>{t&&!o&&g()},[t,o,g,i]),(0,v.useEffect)(()=>{!t||!o||!e||(p(!0),ie(e,o).then(d).catch(e=>console.error(`Failed to load archived session:`,e)).finally(()=>p(!1)))},[t,o,e]);let _=(0,v.useCallback)(async t=>{p(!0);try{d(await ie(e,t))}catch(e){console.error(`Failed to load archived session:`,e)}finally{p(!1)}},[e]),y=(0,v.useCallback)(async(t,n)=>{n.stopPropagation();try{await ae(e,t),l(e=>e.filter(e=>e.id!==t)),u?.id===t&&d(null)}catch(e){console.error(`Failed to delete archived session:`,e)}},[e,u]),b=(0,v.useCallback)(async t=>{try{h(await se(e,t))}catch(e){console.error(`Failed to update retention:`,e)}},[e]),x=(0,v.useCallback)(()=>{if(!u||!a)return;let e=Tm(Ae(u.outputHistory),wm(u));a(u.workingDir,e),d(null),s?.()},[u,a,s]),S=(0,v.useCallback)(()=>{d(null),s?.()},[s]);if(!t)return null;if(o&&f&&!u)return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-neutral-12`,children:(0,U.jsx)(Nt,{size:24,className:`text-neutral-4 animate-spin`})});if(u){let e=Ae(u.outputHistory);return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-neutral-12`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 bg-neutral-9/70 border-b border-neutral-8/40 flex-shrink-0`,children:[(0,U.jsx)(at,{size:16,className:`text-neutral-4`}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-[15px] font-medium text-neutral-1 truncate block`,children:wm(u)}),(0,U.jsxs)(`span`,{className:`text-[13px] text-neutral-5`,children:[`Archived `,Cm(u.archivedAt),` ago · `,u.messageCount,` messages`]})]}),a&&(0,U.jsxs)(`button`,{onClick:x,className:`flex items-center gap-1.5 rounded px-2.5 py-1.5 text-[13px] font-medium text-primary-4 bg-primary-10/30 hover:bg-primary-9/40 hover:text-primary-3 transition-colors`,title:`Start a new session with this conversation as context`,children:[(0,U.jsx)(Lt,{size:16,stroke:2}),(0,U.jsx)(`span`,{children:`Continue in new session`})]}),(0,U.jsx)(`button`,{onClick:S,className:`rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-8 transition-colors`,title:`Close`,children:(0,U.jsx)(sn,{size:16,stroke:2})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden flex flex-col`,children:(0,U.jsx)(xm,{messages:e,fontSize:n,planningMode:!1,activityLabel:void 0})})]})}return o?null:(0,U.jsxs)(`div`,{className:`flex flex-col min-h-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-neutral-9/70 border-b border-neutral-8/40 flex-shrink-0`,children:[(0,U.jsx)(`span`,{className:`text-[13px] font-semibold text-neutral-1 uppercase tracking-wider`,children:`Archived Sessions`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`label`,{className:`text-[12px] text-neutral-5`,title:`Auto-delete after this many days`,children:`Keep`}),(0,U.jsx)(`input`,{type:`number`,min:1,max:365,value:m,onChange:e=>b(Number(e.target.value)),className:`w-10 text-[13px] text-neutral-2 bg-neutral-8 border border-neutral-7 rounded px-1 py-0.5 text-center`}),(0,U.jsx)(`span`,{className:`text-[12px] text-neutral-5`,children:`d`})]})]}),c.length===0?(0,U.jsx)(`div`,{className:`px-3 py-4 text-[13px] text-neutral-5 text-center`,children:`No archived sessions`}):(0,U.jsx)(`div`,{className:`flex flex-col py-0.5 overflow-y-auto flex-1 min-h-0`,children:c.map(e=>(0,U.jsxs)(`button`,{onClick:()=>_(e.id),className:`group flex items-center gap-2 px-3 py-1 text-left transition-colors text-neutral-3 hover:bg-neutral-8/50 hover:text-neutral-1`,children:[e.source===`workflow`?(0,U.jsx)(rn,{size:12,className:`shrink-0 opacity-50`}):e.source===`joe`||e.source===`agent`?(0,U.jsx)(Jt,{size:12,className:`shrink-0 opacity-50`}):e.source===`webhook`?(0,U.jsx)(Yt,{size:12,className:`shrink-0 opacity-50`}):(0,U.jsx)(at,{size:12,className:`shrink-0 opacity-50`}),(0,U.jsx)(`span`,{className:`flex-1 truncate text-[15px]`,children:wm(e)}),(0,U.jsx)(`span`,{className:`shrink-0 text-[13px] text-neutral-5 tabular-nums`,children:Cm(e.archivedAt)}),f?(0,U.jsx)(Nt,{size:14,className:`shrink-0 text-neutral-5 animate-spin`}):(0,U.jsx)(`span`,{onClick:t=>y(e.id,t),className:`cursor-pointer text-transparent hover:text-error-5 group-hover:text-neutral-5 flex-shrink-0`,children:(0,U.jsx)(an,{size:14})})]},e.id))})]})}function Dm({repo:e,globalModules:t=[],onSendModule:n,disabled:r}){let i=e?.modules??[];return t.length===0&&i.length===0?null:(0,U.jsxs)(`div`,{className:`mt-3 border-t border-neutral-10 pt-3`,children:[(0,U.jsx)(`h3`,{className:`mb-2 text-[15px] font-medium uppercase tracking-wider text-neutral-5`,children:`Modules`}),t.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`mb-1 px-2 text-[12px] font-medium uppercase tracking-wider text-neutral-5`,children:`Global`}),(0,U.jsx)(`div`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,U.jsxs)(`button`,{onClick:()=>n(e),disabled:r,className:`group rounded px-2 py-1.5 text-left transition hover:bg-neutral-10/50 disabled:opacity-50 disabled:pointer-events-none`,children:[(0,U.jsx)(`div`,{className:`text-[15px] font-medium text-primary-6 group-hover:text-primary-5`,children:e.name}),e.description&&(0,U.jsx)(`div`,{className:`text-[13px] text-neutral-4 group-hover:text-neutral-4`,children:e.description})]},e.id))})]}),i.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`mb-1 mt-2 px-2 text-[12px] font-medium uppercase tracking-wider text-neutral-5`,children:e?.name}),(0,U.jsx)(`div`,{className:`flex flex-col gap-1`,children:i.map(e=>(0,U.jsxs)(`button`,{onClick:()=>n(e),disabled:r,className:`group rounded px-2 py-1.5 text-left transition hover:bg-neutral-10/50 disabled:opacity-50 disabled:pointer-events-none`,children:[(0,U.jsx)(`div`,{className:`text-[15px] font-medium text-primary-6 group-hover:text-primary-5`,children:e.name}),e.description&&(0,U.jsx)(`div`,{className:`text-[13px] text-neutral-4 group-hover:text-neutral-4`,children:e.description})]},e.id))})]})]})}var Om=`codekin-left-sidebar-width`,km=224,Am=160,jm=480;function Mm(e){let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}function Nm(e,t,n){let r=new Map;for(let t of e){if(t.source===`orchestrator`)continue;let e=Be(t),n=r.get(e)??[];n.push(t),r.set(e,n)}return Array.from(r.entries()).sort((e,t)=>{let n=e[0].replace(/\/+$/,``).split(`/`).pop()??e[0],r=t[0].replace(/\/+$/,``).split(`/`).pop()??t[0];return n.localeCompare(r)}).map(([e,r])=>({workingDir:e,displayName:Mm(e),sessions:r,hasWaiting:r.some(e=>t[e.id]),hasActive:r.some(e=>e.isProcessing),hasTentative:r.some(e=>(n[e.id]?.length??0)>0)}))}function Pm({sessions:e,activeSessionId:t,activeWorkingDir:n,waitingSessions:r,tentativeQueues:i,groups:a,globalModules:o,activeRepo:s,token:c,theme:l,fontSize:u,connState:d,view:f,archiveRefreshKey:p,onSelectSession:m,onDeleteSession:h,onRenameSession:g,onNewSession:_,onNewSessionFromArchive:y,onOpenSession:b,onSelectRepo:x,onDeleteRepo:S,onSettingsOpen:C,onUpdateTheme:w,onSendModule:T,agentName:E=`Joe`,onNavigateToWorkflows:D,onNavigateToOrchestrator:O,onBrowseDocs:k,docsPicker:A={},mobile:j={}}){let{isMobile:M=!1,mobileOpen:N=!1,onMobileClose:P}=j,[F,I]=(0,v.useState)(()=>localStorage.getItem(`codekin-left-sidebar-collapsed`)===`true`),[L,ee]=(0,v.useState)(()=>{let e=localStorage.getItem(Om);return e?Math.max(Am,Math.min(jm,Number(e))):km}),[R,te]=(0,v.useState)(!1),[z,B]=(0,v.useState)(null),V=(0,v.useRef)(null),ne=(0,v.useRef)(!1),re=(0,v.useRef)(0),ie=(0,v.useRef)(0);(0,v.useEffect)(()=>{localStorage.setItem(`codekin-left-sidebar-collapsed`,String(F))},[F]),(0,v.useEffect)(()=>{localStorage.setItem(Om,String(L))},[L]),(0,v.useEffect)(()=>{if(!R)return;function e(e){V.current&&!V.current.contains(e.target)&&te(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[R]);let ae=(0,v.useCallback)(e=>{e.preventDefault(),ne.current=!0,re.current=e.clientX,ie.current=L;let t=e=>{if(!ne.current)return;let t=e.clientX-re.current;ee(Math.max(Am,Math.min(jm,ie.current+t)))},n=()=>{ne.current=!1,document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,n),document.body.style.cursor=``,document.body.style.userSelect=``};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,n)},[L]),oe=Nm(e,r,i),se=d===`connected`?`bg-success-7`:d===`connecting`?`bg-warning-6`:`bg-error-7`,ce=e.find(e=>e.source===`orchestrator`),le=ce?(i[ce.id]?.length??0)>0?`!text-accent-5 animate-pulse`:r[ce.id]?`!text-warning-5 animate-pulse`:ce.isProcessing?`!text-success-6 animate-pulse`:ce.active?`!text-neutral-5`:``:``,ue=o.length>0||s&&s.modules.length>0,de=(0,v.useCallback)(e=>{m(e),M&&P?.()},[m,M,P]);if(!M&&F)return(0,U.jsxs)(`div`,{className:`app-left-sidebar flex flex-col items-center w-12 flex-shrink-0 bg-neutral-12 py-3 gap-3 border-r border-neutral-8/30`,children:[(0,U.jsx)(`div`,{className:`app-logo-circle flex items-center justify-center rounded-full`,style:{width:28,height:28},children:(0,U.jsx)(_n,{size:26,className:`text-primary-7`})}),(0,U.jsx)(`button`,{onClick:()=>I(!1),className:`rounded-lg p-1.5 text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1`,title:`Expand sidebar`,children:(0,U.jsx)(_t,{size:14,stroke:2})}),(0,U.jsxs)(`div`,{className:`mt-auto flex flex-col items-center gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>w(l===`dark`?`light`:`dark`),className:`rounded-lg p-1.5 text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1`,title:l===`dark`?`Switch to light mode`:`Switch to dark mode`,children:l===`dark`?(0,U.jsx)(tn,{size:14,stroke:2}):(0,U.jsx)(zt,{size:14,stroke:2})}),(0,U.jsx)(`div`,{title:d.charAt(0).toUpperCase()+d.slice(1),children:(0,U.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full ${se}`})})]})]});let fe=(0,U.jsxs)(`div`,{className:`app-left-sidebar relative flex flex-col bg-neutral-12 min-h-0 h-full ${M?`w-[280px] max-w-[85vw]`:`flex-shrink-0 border-r border-neutral-8/30`}`,style:M?void 0:{width:L},children:[!M&&(0,U.jsx)(`div`,{className:`absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary-7/50 active:bg-primary-6/60 z-10`,onMouseDown:ae}),(0,U.jsxs)(`div`,{className:`group/header flex items-center gap-2 px-3 py-2.5 border-b border-neutral-8/30 flex-shrink-0`,children:[(0,U.jsx)(`div`,{className:`app-logo-circle flex items-center justify-center rounded-full flex-shrink-0`,style:{width:26,height:26},children:(0,U.jsx)(_n,{size:24,className:`text-primary-7`})}),(0,U.jsx)(`span`,{className:`flex-1 text-[17px] font-semibold text-neutral-2 truncate`,children:`Codekin`}),M?(0,U.jsx)(`button`,{onClick:P,className:`rounded p-1 text-neutral-3 hover:text-neutral-2 hover:bg-neutral-6 transition-colors flex-shrink-0`,title:`Close menu`,children:(0,U.jsx)(sn,{size:18,stroke:2})}):(0,U.jsx)(`button`,{onClick:()=>I(!0),className:`rounded p-1 text-neutral-3 hover:text-neutral-2 hover:bg-neutral-6 transition-colors flex-shrink-0 opacity-0 group-hover/header:opacity-100`,title:`Collapse sidebar`,children:(0,U.jsx)(gt,{size:16,stroke:2})}),(0,U.jsx)(yn,{groups:a,token:c,onOpen:e=>{b(e),M&&P?.()}})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-1 min-h-0`,children:[(0,U.jsxs)(`div`,{className:`px-2 py-1`,children:[(0,U.jsxs)(`button`,{onClick:()=>{D(),M&&P?.()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${f===`workflows`?`bg-accent-9/30 text-accent-2`:`text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6`}`,children:[(0,U.jsx)($t,{size:16,stroke:2,className:`flex-shrink-0`}),(0,U.jsx)(`span`,{className:`flex-1 text-left`,children:`AI Workflows`})]}),(0,U.jsxs)(`button`,{onClick:()=>{O(),M&&P?.()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${f===`orchestrator`?`bg-accent-9/30 text-accent-2`:`text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6`}`,children:[(0,U.jsx)(Jt,{size:16,stroke:2,className:`flex-shrink-0 ${le}`}),(0,U.jsxs)(`span`,{className:`flex-1 text-left`,children:[`Agent `,E]})]}),ue&&(0,U.jsxs)(`div`,{ref:V,className:`relative`,children:[(0,U.jsxs)(`button`,{onClick:()=>te(!R),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${R?`bg-accent-9/30 text-accent-2`:`text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6/50`}`,children:[(0,U.jsx)(dt,{size:16,stroke:2,className:`flex-shrink-0`}),(0,U.jsx)(`span`,{className:`flex-1`,children:`Modules`})]}),R&&(0,U.jsx)(`div`,{className:`absolute left-full top-0 ml-1 w-64 z-50 rounded-md border border-neutral-10 bg-neutral-12 px-3 pb-3 shadow-lg`,children:(0,U.jsx)(Dm,{repo:s,globalModules:o,onSendModule:e=>{T(e),te(!1)},disabled:!t})})]})]}),(0,U.jsx)(`div`,{className:`mx-3 my-1 border-t border-neutral-8/40`}),oe.length>0&&(0,U.jsx)(`div`,{className:`px-4 pt-1.5 pb-0.5 text-[11px] font-medium uppercase tracking-wider text-neutral-6`,children:`Active sessions`}),oe.map(e=>(0,U.jsx)(Nn,{node:e,isActive:e.workingDir===n,activeSessionId:t,waitingSessions:r,tentativeQueues:i,token:c,archiveRefreshKey:p,onSelectSession:de,onDeleteSession:h,onRenameSession:g,onNewSession:e.workingDir===n?_:void 0,onSelectRepo:e=>{x(e),M&&P?.()},onDeleteRepo:S,onViewArchivedSession:B,onBrowseDocs:k,docsPickerOpen:A.open,docsPickerRepoDir:A.repoDir,docsPickerFiles:A.files,docsPickerLoading:A.loading,onDocsPickerSelect:A.onSelect,onDocsPickerClose:A.onClose,docsStarredDocs:A.starredDocs,isMobile:M},e.workingDir)),oe.length===0&&(0,U.jsxs)(`div`,{className:`px-4 py-6 text-center text-[13px] text-neutral-5`,children:[`No sessions yet.`,(0,U.jsx)(`br`,{}),`Click + to start one.`]}),(0,U.jsx)(Em,{token:c,visible:z!==null,fontSize:u,workingDir:n,refreshKey:p,onNewSessionFromArchive:y,initialViewId:z,onClose:()=>B(null)})]}),(0,U.jsx)(`div`,{className:`flex flex-col border-t border-neutral-8/30 flex-shrink-0`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 ${M?`gap-1 py-3`:`py-2`}`,children:[(0,U.jsx)(`div`,{className:`flex items-center justify-center px-1 py-1`,title:d.charAt(0).toUpperCase()+d.slice(1),children:(0,U.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full ${se}`})}),(0,U.jsx)(`button`,{onClick:C,className:`flex items-center gap-1 rounded text-[13px] text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6 transition-colors ${M?`px-2 py-2`:`px-1.5 py-1`}`,title:`Settings`,children:(0,U.jsx)(Zt,{size:M?24:20,stroke:2})}),(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsx)(`button`,{onClick:()=>w(l===`dark`?`light`:`dark`),className:`rounded text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1 transition-colors ${M?`px-2 py-2`:`px-1.5 py-1`}`,title:l===`dark`?`Switch to light mode`:`Switch to dark mode`,children:l===`dark`?(0,U.jsx)(tn,{size:M?24:20,stroke:2}):(0,U.jsx)(zt,{size:M?24:20,stroke:2})}),(0,U.jsx)(`button`,{onClick:()=>{window.location.href=`/authelia/logout`},className:`rounded text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1 transition-colors ${M?`px-2 py-2`:`px-1.5 py-1`}`,title:`Logout`,children:(0,U.jsx)(Pt,{size:M?24:20,stroke:2})})]})})]});return M?(0,U.jsx)(`div`,{className:`fixed inset-0 z-40 transition-colors duration-200 ${N?`bg-black/50`:`bg-transparent pointer-events-none`}`,onClick:P,children:(0,U.jsx)(`div`,{className:`h-full w-fit transition-transform duration-200 ease-out ${N?`translate-x-0`:`-translate-x-full`}`,onClick:e=>e.stopPropagation(),children:fe})}):fe}function Fm({repoName:e,sessionName:t,onMenuOpen:n,onNewSession:r,onSettingsOpen:i}){return(0,U.jsxs)(`div`,{className:`app-left-sidebar mobile-top-bar-safe flex items-center h-12 px-1.5 border-b border-neutral-8/30 bg-neutral-12 flex-shrink-0`,children:[(0,U.jsx)(`button`,{onClick:n,className:`flex items-center justify-center rounded-lg size-[34px] text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6 transition-colors`,"aria-label":`Open menu`,children:(0,U.jsx)(It,{size:24,stroke:2})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 px-1.5`,children:[(0,U.jsx)(_n,{size:24,className:`text-primary-7 flex-shrink-0`}),(0,U.jsx)(`div`,{className:`flex-1 min-w-0 truncate text-[16px] text-neutral-2`,children:e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-semibold`,children:e}),t&&(0,U.jsxs)(`span`,{className:`text-neutral-5 ml-1.5`,children:[`/ `,t]})]}):(0,U.jsx)(`span`,{className:`font-semibold`,children:`Codekin`})})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,U.jsx)(`button`,{onClick:i,className:`flex items-center justify-center rounded-lg size-[34px] text-neutral-4 hover:text-neutral-1 hover:bg-neutral-6 transition-colors`,"aria-label":`Settings`,children:(0,U.jsx)(Zt,{size:24,stroke:2})}),(0,U.jsx)(`button`,{onClick:r,className:`flex items-center justify-center rounded-lg size-[34px] text-neutral-4 hover:text-neutral-1 hover:bg-neutral-6 transition-colors`,"aria-label":`New session`,children:(0,U.jsx)(Kt,{size:24,stroke:2})})]})]})}var Im=`/cc/api/workflows`;function Lm(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${e}`}}async function Rm(e,t){let n=new URLSearchParams;t&&n.set(`repoPath`,t);let r=n.toString(),i=await fetch(`${Im}/kinds${r?`?${r}`:``}`,{headers:Lm(e)});if(!i.ok)throw Error(`Failed to list kinds: ${i.status}`);return(await i.json()).kinds}async function zm(e,t){let n=new URLSearchParams;t?.kind&&n.set(`kind`,t.kind),t?.status&&n.set(`status`,t.status),t?.limit&&n.set(`limit`,String(t.limit)),t?.offset&&n.set(`offset`,String(t.offset));let r=n.toString(),i=await fetch(`${Im}/runs${r?`?${r}`:``}`,{headers:Lm(e)});if(!i.ok)throw Error(`Failed to list runs: ${i.status}`);return(await i.json()).runs}async function Bm(e,t){let n=await fetch(`${Im}/runs/${t}`,{headers:Lm(e)});if(!n.ok)throw Error(`Failed to get run: ${n.status}`);return(await n.json()).run}async function Vm(e,t,n={}){let r=await fetch(`${Im}/runs`,{method:`POST`,headers:Lm(e),body:JSON.stringify({kind:t,input:n})});if(!r.ok)throw Error(`Failed to trigger run: ${r.status}`);return(await r.json()).run}async function Hm(e,t){let n=await fetch(`${Im}/runs/${t}/cancel`,{method:`POST`,headers:Lm(e)});if(!n.ok)throw Error(`Failed to cancel run: ${n.status}`)}async function Um(e){let t=await fetch(`${Im}/schedules`,{headers:Lm(e)});if(!t.ok)throw Error(`Failed to list schedules: ${t.status}`);return(await t.json()).schedules}async function Wm(e,t){let n=await fetch(`${Im}/schedules/${t}/trigger`,{method:`POST`,headers:Lm(e)});if(!n.ok)throw Error(`Failed to trigger schedule: ${n.status}`);return(await n.json()).run}async function Gm(e){let t=await fetch(`${Im}/config`,{headers:Lm(e)});if(!t.ok)throw Error(`Failed to get config: ${t.status}`);return(await t.json()).config}async function Km(e,t){let n=await fetch(`${Im}/config/repos`,{method:`POST`,headers:Lm(e),body:JSON.stringify(t)});if(!n.ok)throw Error(`Failed to add repo config: ${n.status}`);return(await n.json()).config}async function qm(e,t){let n=await fetch(`${Im}/config/repos/${t}`,{method:`DELETE`,headers:Lm(e)});if(!n.ok)throw Error(`Failed to remove repo config: ${n.status}`);return(await n.json()).config}async function Jm(e,t,n){let r=await fetch(`${Im}/config/repos/${t}`,{method:`PATCH`,headers:Lm(e),body:JSON.stringify(n)});if(!r.ok)throw Error(`Failed to update repo config: ${r.status}`);return(await r.json()).config}var Ym=5e3,Xm=15e3;function Zm(e){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!0),[l,u]=(0,v.useState)(null),d=(0,v.useRef)(null),f=(0,v.useCallback)(async()=>{if(e)try{let[t,r,a]=await Promise.all([zm(e,{limit:50}),Um(e),Gm(e)]);n(t),i(r),o(a),u(null)}catch(e){u(e instanceof Error?e.message:`Failed to load workflow data`)}finally{c(!1)}},[e]),p=t.some(e=>e.status===`running`||e.status===`queued`)?Ym:Xm;return(0,v.useEffect)(()=>(f(),d.current=setInterval(f,p),()=>{d.current&&clearInterval(d.current)}),[f,p]),{runs:t,schedules:r,config:a,loading:s,error:l,refresh:f,triggerRun:(0,v.useCallback)(async(t,n)=>{try{await Vm(e,t,n),await f()}catch(e){u(e instanceof Error?e.message:`Failed to trigger run`)}},[e,f]),cancelRun:(0,v.useCallback)(async t=>{try{await Hm(e,t),await f()}catch(e){u(e instanceof Error?e.message:`Failed to cancel run`)}},[e,f]),triggerSchedule:(0,v.useCallback)(async t=>{try{await Wm(e,t),await f()}catch(e){u(e instanceof Error?e.message:`Failed to trigger schedule`)}},[e,f]),addRepo:(0,v.useCallback)(async t=>{await Km(e,t),await f()},[e,f]),removeRepo:(0,v.useCallback)(async t=>{await qm(e,t),await f()},[e,f]),updateRepo:(0,v.useCallback)(async(t,n)=>{await Jm(e,t,n),await f()},[e,f]),toggleScheduleEnabled:(0,v.useCallback)(async(t,n)=>{await Jm(e,t,{enabled:n}),await f()},[e,f])}}var Qm=[{value:`coverage.daily`,label:`Coverage Assessment`,category:`assessment`},{value:`code-review.daily`,label:`Code Review`,category:`assessment`},{value:`commit-review`,label:`Commit Review`,category:`event`},{value:`comment-assessment.daily`,label:`Comment Assessment`,category:`assessment`},{value:`dependency-health.daily`,label:`Dependency Health`,category:`assessment`},{value:`security-audit.weekly`,label:`Security Audit`,category:`assessment`},{value:`complexity.weekly`,label:`Complexity Report`,category:`assessment`},{value:`repo-health.weekly`,label:`Repository Health`,category:`assessment`},{value:`docs-audit.weekly`,label:`Documentation Audit`,category:`assessment`}],$m=new Set([`commit-review`]);function eh(e){return $m.has(e)}var th=[{value:``,label:`Default (Opus)`},{value:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{value:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`}],nh=[{label:`Daily`,dow:`*`},{label:`Weekdays`,dow:`1-5`}],rh=[{label:`Mon`,dow:`1`},{label:`Tue`,dow:`2`},{label:`Wed`,dow:`3`},{label:`Thu`,dow:`4`},{label:`Fri`,dow:`5`},{label:`Sat`,dow:`6`},{label:`Sun`,dow:`0`}];function ih(e){return e.startsWith(`biweekly`)}function ah(e){let t=e.split(`-`);return t.length>=2?t.slice(1).join(`-`):`*`}function oh(e,t,n=0){return ih(t)?`${n} ${e} */14 * ${ah(t)}`:`${n} ${e} * * ${t}`}function sh(e){let t=e.trim().split(/\s+/);if(t.length===5){let[e,n,r,,i]=t;return{hour:parseInt(n)||0,minute:parseInt(e)||0,dow:r===`*/14`?i===`*`?`biweekly`:`biweekly-${i}`:i}}return{hour:6,minute:0,dow:`*`}}var ch=`event`;function lh(e){if(e===`event`)return`On commit`;let t=e.trim().split(/\s+/);if(t.length!==5)return e;let[n,r,i,,a]=t,o=e=>e.length===1?`0${e}`:e,s=`${o(r)}:${o(n)}`,c=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];return i===`*/14`?`Bi-weekly${a===`*`?``:` ${c[parseInt(a)]??a}`} at ${s}`:a===`*`?`Daily at ${s}`:a===`1-5`?`Weekdays at ${s}`:`Weekly ${c[parseInt(a)]??a} at ${s}`}function uh(e){return e?th.find(t=>t.value===e)?.label??e:null}function dh(e){return Qm.find(t=>t.value===e)?.label??e}function fh(e){return Qm.find(t=>t.value===e)?.category??`assessment`}function ph(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}function mh(e,t){if(!e)return`—`;let n=(t?new Date(t):new Date).getTime()-new Date(e).getTime();return n<1e3?`<1s`:n<6e4?`${Math.round(n/1e3)}s`:`${Math.round(n/6e4)}m`}function hh(e){return e?new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):`—`}function gh(e){return e.input.repoName||e.input.repoPath?.split(`/`).pop()||e.kind}function _h(e){switch(e){case`succeeded`:return`bg-success-7 text-success-2`;case`failed`:return`bg-error-8 text-error-2`;case`running`:return`bg-accent-8 text-accent-2 animate-pulse`;case`queued`:return`bg-neutral-8 text-neutral-3`;case`canceled`:return`bg-warning-8 text-warning-2`;case`skipped`:return`bg-neutral-8 text-neutral-5`;default:return`bg-neutral-8 text-neutral-3`}}function vh({kind:e}){let t=fh(e);return(0,U.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-[13px] font-medium capitalize ${{assessment:`border-accent-7/60 bg-accent-9/30 text-accent-4`,organizer:`border-success-7/60 bg-success-9/30 text-success-4`,executor:`border-warning-7/60 bg-warning-9/30 text-warning-4`,event:`border-purple-700/60 bg-purple-900/30 text-purple-400`}[t]}`,children:t})}function yh({status:e}){switch(e){case`succeeded`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-success-7/60 bg-success-8/40 px-2.5 py-0.5 text-[13px] font-medium text-success-4`,children:[(0,U.jsx)(mt,{size:12,stroke:2.5}),`succeeded`]});case`failed`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-error-7/60 bg-error-9/40 px-2.5 py-0.5 text-[13px] font-medium text-error-4`,children:[(0,U.jsx)(sn,{size:12,stroke:2.5}),`failed`]});case`running`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-accent-7/60 bg-accent-9/40 px-2.5 py-0.5 text-[13px] font-medium text-accent-4`,children:[(0,U.jsx)(Nt,{size:12,stroke:2,className:`animate-spin`}),`running`]});case`queued`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-4`,children:[(0,U.jsx)(bt,{size:12,stroke:2}),`queued`]});case`canceled`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-warning-7/60 bg-warning-9/40 px-2.5 py-0.5 text-[13px] font-medium text-warning-4`,children:[(0,U.jsx)(Rt,{size:12,stroke:2}),`canceled`]});case`skipped`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-5`,children:[(0,U.jsx)(Ut,{size:12,stroke:2}),`skipped`]});default:return(0,U.jsx)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-4`,children:e})}}var bh=Array.from({length:24},(e,t)=>t);function xh({hour:e,minute:t,onChange:n,step:r=15,className:i=``}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=Array.from({length:60/r},(e,t)=>t*r),d=e=>String(e).padStart(2,`0`);(0,v.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),(0,v.useEffect)(()=>{a&&requestAnimationFrame(()=>{c.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView({block:`nearest`}),l.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView({block:`nearest`})})},[a]);let f=(0,v.useCallback)(e=>{e.key===`Escape`&&o(!1)},[]);return(0,U.jsxs)(`div`,{ref:s,className:`relative inline-block ${i}`,onKeyDown:f,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex items-center gap-2 rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] font-mono text-neutral-1 focus:border-accent-6 focus:outline-none w-40 cursor-pointer hover:border-neutral-5 transition-colors`,children:[(0,U.jsxs)(`span`,{className:`flex-1 text-left`,children:[d(e),`:`,d(t)]}),(0,U.jsxs)(`svg`,{className:`w-4 h-4 text-neutral-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`polyline`,{points:`12 6 12 12 16 14`})]})]}),a&&(0,U.jsxs)(`div`,{className:`absolute top-full left-0 z-50 mt-1 flex rounded-md border border-neutral-7 bg-neutral-10 shadow-lg overflow-hidden`,children:[(0,U.jsx)(`div`,{ref:c,className:`h-52 overflow-y-auto scrollbar-thin`,children:bh.map(r=>(0,U.jsx)(`button`,{type:`button`,"data-selected":r===e,onClick:()=>{n(r,t)},className:`block w-full px-4 py-1.5 text-center font-mono text-[14px] transition-colors cursor-pointer
|
|
52
|
-
${r===e?`bg-accent-8 text-accent-2`:`text-neutral-2 hover:bg-neutral-8`}`,children:d(r)},r))}),(0,U.jsx)(`div`,{className:`w-px bg-neutral-7`}),(0,U.jsx)(`div`,{ref:l,className:`h-52 overflow-y-auto scrollbar-thin`,children:u.map(r=>(0,U.jsx)(`button`,{type:`button`,"data-selected":r===t,onClick:()=>{n(e,r)},className:`block w-full px-4 py-1.5 text-center font-mono text-[14px] transition-colors cursor-pointer
|
|
53
|
-
${r===t?`bg-accent-8 text-accent-2`:`text-neutral-2 hover:bg-neutral-8`}`,children:d(r)},r))})]})]})}function Sh({current:e,eventDriven:t}){let n=[{num:1,label:`Repository`},{num:2,label:`Workflow`},{num:3,label:t?`Configure`:`Schedule`}];return(0,U.jsx)(`div`,{className:`flex items-center gap-1 mb-5`,children:n.map((t,r)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-1 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-1`,children:[(0,U.jsx)(`span`,{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-semibold shrink-0 ${t.num<e?`bg-success-7 text-white`:t.num===e?`bg-accent-7 text-white`:`bg-neutral-9 text-neutral-5`}`,children:t.num<e?(0,U.jsx)(mt,{size:12,stroke:3}):t.num}),(0,U.jsx)(`span`,{className:`text-[13px] font-medium ${t.num===e?`text-neutral-1`:`text-neutral-5`}`,children:t.label})]}),r<n.length-1&&(0,U.jsx)(`div`,{className:`h-px flex-1 mx-1 ${t.num<e?`bg-success-7`:`bg-neutral-8`}`})]},t.num))})}function Ch({token:e,selectedRepoId:t,onSelect:n}){let{groups:r,loading:i,error:a}=T(e),o=r.flatMap(e=>e.repos);return i?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 py-8 justify-center text-[13px] text-neutral-5`,children:[(0,U.jsx)(Nt,{size:16,stroke:2,className:`animate-spin`}),`Loading repositories…`]}):a?(0,U.jsxs)(`div`,{className:`rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4`,children:[`Failed to load repos: `,a]}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-4 mb-3`,children:`Choose which repository this workflow will run against.`}),(0,U.jsx)(vn,{groups:r,selectedId:t,onSelect:e=>{let t=o.find(t=>t.id===e.id);t&&n(t.id,t.path,t.name)},maxHeight:`320px`})]})}function wh({token:e,repoPath:t,selectedKind:n,onSelect:r}){let[i,a]=(0,v.useState)(Qm.map(e=>({kind:e.value,name:e.label,source:`builtin`}))),[o,s]=(0,v.useState)(!0);(0,v.useEffect)(()=>{let n=!1;return Rm(e,t||void 0).then(e=>{n||e.length>0&&a(e)}).catch(()=>{}).finally(()=>{n||s(!1)}),()=>{n=!0}},[e,t]);let c=new Map;for(let e of i){let t=fh(e.kind);c.has(t)||c.set(t,[]),c.get(t).push(e)}return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-4 mb-3`,children:`Select the type of automated workflow to run.`}),o&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-[13px] text-neutral-5 mb-2`,children:[(0,U.jsx)(Nt,{size:14,stroke:2,className:`animate-spin`}),`Checking for repo-specific workflows…`]}),(0,U.jsx)(`div`,{className:`space-y-4`,children:Array.from(c.entries()).map(([e,t])=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 mb-2`,children:(0,U.jsx)(vh,{kind:t[0].kind})}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{r(e.kind)},className:`rounded-lg border px-3 py-2.5 text-left transition-colors ${n===e.kind?`border-accent-6 bg-accent-9/30 ring-1 ring-accent-6/30`:`border-neutral-7 bg-neutral-10 hover:border-neutral-6`}`,children:[(0,U.jsx)(`span`,{className:`block text-[15px] font-medium ${n===e.kind?`text-accent-2`:`text-neutral-2`}`,children:e.name}),e.source===`repo`&&(0,U.jsx)(`span`,{className:`block text-[11px] text-neutral-5 mt-0.5`,children:`repo-specific`})]},e.kind))})]},e))}),!o&&(0,U.jsxs)(`p`,{className:`mt-4 text-[12px] text-neutral-5 leading-relaxed`,children:[`You can define custom workflow types by adding `,(0,U.jsx)(`code`,{className:`text-neutral-4`,children:`.md`}),` files to `,(0,U.jsxs)(`code`,{className:`text-neutral-4`,children:[t,`/.codekin/workflows/`]}),`. See the guide on the Workflows page for details.`]})]})}function Th({label:e,dow:t,selected:n,onSelect:r}){return(0,U.jsx)(`button`,{type:`button`,onClick:()=>{r(t)},className:`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${n?`border-accent-6 bg-accent-9/40 text-accent-2`:`border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2`}`,children:e})}function Eh({form:e,onChange:t}){return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[eh(e.kind)?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-4 mb-3`,children:`This workflow runs automatically on every commit via a post-commit hook.`}),(0,U.jsxs)(`div`,{className:`rounded-lg border border-purple-700/40 bg-purple-900/20 px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`text-[14px] font-medium text-purple-400`,children:`Trigger: On commit`}),(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-4 mt-1`,children:`Each commit will be reviewed automatically. No schedule needed.`})]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-4 mb-3`,children:`Choose when this workflow should run automatically.`}),(0,U.jsx)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-2`,children:`Time`}),(0,U.jsx)(xh,{hour:e.cronHour,minute:e.cronMinute,onChange:(e,n)=>{t({cronHour:e,cronMinute:n})}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-2`,children:`Frequency`}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mb-2`,children:nh.map(n=>{let r=e.cronDow===n.dow;return(0,U.jsx)(Th,{label:n.label,dow:n.dow,selected:r,onSelect:e=>{t({cronDow:e})}},n.dow)})}),(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:rh.map(n=>{let r=(ih(e.cronDow)?e.cronDow.split(`-`).slice(1).join(`-`):e.cronDow)===n.dow;return(0,U.jsx)(Th,{label:n.label,dow:n.dow,selected:r,onSelect:n=>{t({cronDow:ih(e.cronDow)?`biweekly-${n}`:n})}},n.dow)})}),(()=>{if(!rh.some(t=>t.dow===e.cronDow||e.cronDow===`biweekly-${t.dow}`))return null;let n=ih(e.cronDow),r=n?e.cronDow.split(`-`).slice(1).join(`-`):e.cronDow;return(0,U.jsxs)(`div`,{className:`flex gap-1.5 mt-2`,children:[(0,U.jsx)(Th,{label:`Every week`,dow:r,selected:!n,onSelect:e=>{t({cronDow:e})}}),(0,U.jsx)(Th,{label:`Every 2 weeks`,dow:`biweekly-${r}`,selected:n,onSelect:e=>{t({cronDow:e})}})]})})(),(0,U.jsx)(`div`,{className:`mt-2 text-[13px] text-neutral-5`,children:lh(oh(e.cronHour,e.cronDow,e.cronMinute))})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-2`,children:`Model`}),(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:th.map(n=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>{t({model:n.value})},className:`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${e.model===n.value?`border-accent-6 bg-accent-9/40 text-accent-2`:`border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2`}`,children:n.label},n.value))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-1.5`,children:[`Focus areas `,(0,U.jsx)(`span`,{className:`text-neutral-5 font-normal`,children:`(optional)`})]}),(0,U.jsx)(`textarea`,{value:e.customPrompt,onChange:e=>{t({customPrompt:e.target.value})},rows:3,placeholder:`e.g. Focus on the auth module and payment flows`,className:`w-full rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-1 placeholder-neutral-5 focus:border-accent-6 focus:outline-none resize-none`})]})]})}function Dh({token:e,onClose:t,onAdd:n}){let[r,i]=(0,v.useState)(1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)({kind:``,repoPath:``,repoName:``,cronHour:6,cronMinute:0,cronDow:`*`,customPrompt:``,model:``}),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),p=eh(s.kind),m=e=>{c(t=>({...t,...e}))};return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60`,onClick:t,children:(0,U.jsxs)(`div`,{className:`w-[520px] max-h-[90vh] overflow-y-auto rounded-xl border border-neutral-7 bg-neutral-11 p-6 shadow-2xl`,onClick:e=>{e.stopPropagation()},children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,U.jsx)(`h2`,{className:`text-[19px] font-semibold text-neutral-1`,children:`New Workflow`}),(0,U.jsx)(`button`,{onClick:t,className:`rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-9`,children:(0,U.jsx)(sn,{size:16,stroke:2})})]}),(0,U.jsx)(Sh,{current:r,eventDriven:p}),(0,U.jsxs)(`div`,{className:`min-h-[200px]`,children:[r===1&&(0,U.jsx)(Ch,{token:e,selectedRepoId:a,onSelect:(e,t,n)=>{o(e),m({repoPath:t,repoName:n})}}),r===2&&(0,U.jsx)(wh,{token:e,repoPath:s.repoPath,selectedKind:s.kind,onSelect:e=>{m({kind:e})}}),r===3&&(0,U.jsx)(Eh,{form:s,onChange:m})]}),d&&(0,U.jsx)(`div`,{className:`rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4 mt-3`,children:d}),(0,U.jsxs)(`div`,{className:`flex gap-2 mt-5 pt-4 border-t border-neutral-8/50`,children:[r>1?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{f(null),r>1&&i(r-1)},className:`flex items-center gap-1.5 rounded-md border border-neutral-7 bg-neutral-10 px-4 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors`,children:[(0,U.jsx)(st,{size:14,stroke:2}),`Back`]}):(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-7 bg-neutral-10 px-4 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors`,children:`Cancel`}),(0,U.jsx)(`div`,{className:`flex-1`}),r<3?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{if(f(null),r===1&&!s.repoPath){f(`Please select a repository`);return}if(r===2&&!s.kind){f(`Please select a workflow`);return}r<3&&i(r+1)},disabled:!(r===1?s.repoPath:r!==2||s.kind),className:`flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-40 transition-colors`,children:[`Next`,(0,U.jsx)(ct,{size:14,stroke:2})]}):(0,U.jsx)(`button`,{type:`button`,onClick:async()=>{u(!0),f(null);try{let e=s.repoName||s.repoPath.split(`/`).pop()||`workflow`,r=p?ch:oh(s.cronHour,s.cronDow,s.cronMinute);await n({id:`${ph(e)}-${ph(s.kind)}`,name:e,repoPath:s.repoPath.trim(),cronExpression:r,kind:s.kind,enabled:!0,customPrompt:s.customPrompt.trim()||void 0,model:s.model||void 0}),t()}catch(e){f(e instanceof Error?e.message:`Failed to add workflow`)}finally{u(!1)}},disabled:l,className:`flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50 transition-colors`,children:l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Nt,{size:14,stroke:2,className:`animate-spin`}),`Creating…`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(mt,{size:14,stroke:2}),`Create Workflow`]})})]})]})})}var Oh=e=>`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${e?`border-accent-6 bg-accent-9/40 text-accent-2`:`border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2`}`;function kh({repo:e,onClose:t,onSave:n}){let r=sh(e.cronExpression),[i,a]=(0,v.useState)({kind:e.kind??`coverage.daily`,cronHour:r.hour,cronMinute:r.minute,cronDow:r.dow,customPrompt:e.customPrompt??``,model:e.model??``}),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),u=eh(i.kind),d=async r=>{r.preventDefault(),s(!0),l(null);try{let r=u?ch:oh(i.cronHour,i.cronDow,i.cronMinute);await n(e.id,{kind:i.kind,cronExpression:r,customPrompt:i.customPrompt.trim()||void 0,model:i.model||void 0}),t()}catch(e){l(e instanceof Error?e.message:`Failed to save workflow`)}finally{s(!1)}},f=e.repoPath.split(`/`).pop()||e.name,p=ih(i.cronDow),m=p?i.cronDow.split(`-`).slice(1).join(`-`):i.cronDow,h=rh.some(e=>e.dow===m);return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60`,onClick:t,children:(0,U.jsxs)(`div`,{className:`w-[480px] max-h-[90vh] overflow-y-auto rounded-xl border border-neutral-7 bg-neutral-11 p-6 shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-[19px] font-semibold text-neutral-1`,children:`Edit Workflow`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-4`,children:f}),(0,U.jsx)(`span`,{className:`text-neutral-7`,children:`·`}),(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-4`,children:dh(e.kind??``)})]})]}),(0,U.jsx)(`button`,{onClick:t,className:`rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-9`,children:(0,U.jsx)(sn,{size:16,stroke:2})})]}),(0,U.jsxs)(`form`,{onSubmit:d,className:`space-y-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,U.jsx)(`label`,{className:`text-[13px] font-medium text-neutral-3`,children:`Workflow type`}),(0,U.jsx)(vh,{kind:i.kind})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:Qm.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(t=>({...t,kind:e.value})),className:`rounded-lg border px-3 py-2.5 text-left transition-colors ${i.kind===e.value?`border-accent-6 bg-accent-9/30 ring-1 ring-accent-6/30`:`border-neutral-7 bg-neutral-10 hover:border-neutral-6`}`,children:(0,U.jsx)(`span`,{className:`block text-[15px] font-medium ${i.kind===e.value?`text-accent-2`:`text-neutral-2`}`,children:e.label})},e.value))})]}),u?(0,U.jsxs)(`div`,{className:`rounded-lg border border-purple-700/40 bg-purple-900/20 px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`text-[14px] font-medium text-purple-400`,children:`Trigger: On commit`}),(0,U.jsx)(`p`,{className:`text-[13px] text-neutral-4 mt-1`,children:`Each commit will be reviewed automatically. No schedule needed.`})]}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-2`,children:`Time`}),(0,U.jsx)(xh,{hour:i.cronHour,minute:i.cronMinute,onChange:(e,t)=>a(n=>({...n,cronHour:e,cronMinute:t})),className:`mb-3`}),(0,U.jsx)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-2`,children:`Frequency`}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mb-2`,children:nh.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(t=>({...t,cronDow:e.dow})),className:Oh(i.cronDow===e.dow),children:e.label},e.dow))}),(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:rh.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(t=>({...t,cronDow:p?`biweekly-${e.dow}`:e.dow})),className:Oh(m===e.dow),children:e.label},e.dow))}),h&&(0,U.jsxs)(`div`,{className:`flex gap-1.5 mt-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(e=>({...e,cronDow:m})),className:Oh(!p),children:`Every week`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(e=>({...e,cronDow:`biweekly-${m}`})),className:Oh(p),children:`Every 2 weeks`})]}),(0,U.jsx)(`div`,{className:`mt-2 text-[13px] text-neutral-5`,children:lh(oh(i.cronHour,i.cronDow,i.cronMinute))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-2`,children:`Model`}),(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:th.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(t=>({...t,model:e.value})),className:Oh(i.model===e.value),children:e.label},e.value))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`block text-[13px] font-medium text-neutral-3 mb-1.5`,children:[`Focus areas `,(0,U.jsx)(`span`,{className:`text-neutral-5 font-normal`,children:`(optional)`})]}),(0,U.jsx)(`textarea`,{value:i.customPrompt,onChange:e=>a(t=>({...t,customPrompt:e.target.value})),rows:3,placeholder:`e.g. Focus on the auth module and payment flows`,className:`w-full rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-1 placeholder-neutral-5 focus:border-accent-6 focus:outline-none resize-none`})]}),c&&(0,U.jsx)(`div`,{className:`rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4`,children:c}),(0,U.jsxs)(`div`,{className:`flex gap-2 pt-2 border-t border-neutral-8/50`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`flex-1 rounded-md border border-neutral-7 bg-neutral-10 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors`,children:`Cancel`}),(0,U.jsx)(`button`,{type:`submit`,disabled:o,className:`flex-1 rounded-md bg-primary-8 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50 transition-colors flex items-center justify-center gap-1.5`,children:o?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Nt,{size:14,stroke:2,className:`animate-spin`}),`Saving…`]}):`Save Changes`})]})]})]})})}function Ah({status:e}){return e?(0,U.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full shrink-0 ${{succeeded:`bg-success-5`,failed:`bg-error-5`,running:`bg-accent-5 animate-pulse`,queued:`bg-neutral-5 animate-pulse`,canceled:`bg-warning-5`,skipped:`bg-neutral-6`}[e]||`bg-neutral-7`}`,title:e}):(0,U.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-neutral-7 shrink-0`,title:`No runs yet`})}function jh({status:e}){let t=`shrink-0`;switch(e){case`succeeded`:return(0,U.jsx)(mt,{size:14,stroke:2.5,className:`${t} text-success-4`});case`failed`:return(0,U.jsx)(sn,{size:14,stroke:2.5,className:`${t} text-error-4`});case`running`:return(0,U.jsx)(Nt,{size:14,stroke:2,className:`${t} text-accent-4 animate-spin`});case`skipped`:return(0,U.jsx)(Rt,{size:14,stroke:2,className:`${t} text-neutral-6`});default:return(0,U.jsx)(yt,{size:14,stroke:2,className:`${t} text-neutral-6`})}}function Mh({label:e,data:t,defaultOpen:n=!1}){if(!t||Object.keys(t).length===0)return null;let r=JSON.stringify(t,null,2),i=r.length>4e3?r.slice(0,4e3)+`
|
|
54
|
-
… (truncated)`:r;return(0,U.jsxs)(`details`,{open:n,className:`mt-1.5`,children:[(0,U.jsxs)(`summary`,{className:`cursor-pointer select-none text-[14px] text-neutral-5 hover:text-neutral-3 list-none flex items-center gap-1`,children:[(0,U.jsx)(_t,{size:12,stroke:2,className:`details-arrow transition-transform`}),e,(0,U.jsxs)(`span`,{className:`text-neutral-6`,children:[`(`,Object.keys(t).length,` fields)`]})]}),(0,U.jsx)(`pre`,{className:`mt-1 overflow-x-auto rounded-md bg-neutral-12 p-2.5 text-[14px] text-neutral-3 font-mono leading-relaxed max-h-64 overflow-y-auto`,children:i})]})}function Nh({step:e}){return(0,U.jsxs)(`div`,{className:`rounded-md border border-neutral-8/40 bg-neutral-11/60 px-3 py-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(jh,{status:e.status}),(0,U.jsx)(`span`,{className:`font-mono text-[14px] text-neutral-2 font-medium`,children:e.key}),(0,U.jsx)(`span`,{className:`ml-auto inline-flex items-center rounded px-1.5 py-0.5 text-[13px] font-medium ${_h(e.status)}`,children:e.status}),(0,U.jsx)(`span`,{className:`text-[14px] text-neutral-5 tabular-nums`,children:mh(e.startedAt,e.completedAt)})]}),e.error&&(0,U.jsx)(`div`,{className:`mt-1.5 rounded bg-error-10/50 px-2 py-1 text-[14px] text-error-4 font-mono`,children:e.error}),(0,U.jsxs)(`div`,{className:`mt-0.5`,children:[(0,U.jsx)(Mh,{label:`input`,data:e.input}),(0,U.jsx)(Mh,{label:`output`,data:e.output})]})]})}function Ph({run:e}){return(0,U.jsxs)(`div`,{className:`mt-2 space-y-1.5 border-l-2 border-neutral-8/50 pl-3`,children:[(0,U.jsx)(`div`,{className:`text-[14px] font-medium text-neutral-5 uppercase tracking-wider mb-2`,children:`Steps`}),e.steps.length===0?(0,U.jsx)(`div`,{className:`text-[14px] text-neutral-5 py-1`,children:`No steps recorded yet.`}):e.steps.map(e=>(0,U.jsx)(Nh,{step:e},e.id)),e.output&&Object.keys(e.output).length>0&&(0,U.jsx)(`div`,{className:`pt-1`,children:(0,U.jsx)(Mh,{label:`run output`,data:e.output,defaultOpen:!0})}),e.error&&(0,U.jsx)(`div`,{className:`rounded-md bg-error-10/50 px-3 py-2 text-[14px] text-error-4 font-mono`,children:e.error})]})}function Fh({run:e,selected:t,detail:n,detailLoading:r,onToggle:i,onCancel:a,onNavigateToSession:o}){let s=e.output?.sessionId||e.input?.sessionId;return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{onClick:i,className:`flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors rounded-md ${t?`bg-neutral-10`:`hover:bg-neutral-10/50`}`,children:[(0,U.jsx)(`span`,{className:`text-neutral-5 w-4 shrink-0`,children:t?(0,U.jsx)(ht,{size:13,stroke:2}):(0,U.jsx)(_t,{size:13,stroke:2})}),(0,U.jsx)(`span`,{className:`text-[14px] text-neutral-4 tabular-nums whitespace-nowrap`,children:hh(e.createdAt)}),(0,U.jsx)(`span`,{className:`text-[14px] text-neutral-4 tabular-nums whitespace-nowrap`,children:mh(e.startedAt,e.completedAt)}),(0,U.jsx)(`span`,{className:`ml-auto`,children:(0,U.jsx)(yh,{status:e.status})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,onClick:e=>e.stopPropagation(),children:[e.status===`running`&&(0,U.jsx)(`button`,{onClick:()=>a(e.id),className:`rounded p-1 text-neutral-4 hover:text-error-4 hover:bg-neutral-9 transition-colors`,title:`Cancel`,children:(0,U.jsx)(Gt,{size:13,stroke:2})}),s&&o&&(0,U.jsx)(`button`,{onClick:()=>o(s),className:`rounded p-1 text-neutral-4 hover:text-accent-3 hover:bg-neutral-9 transition-colors`,title:`View session`,children:(0,U.jsx)(wt,{size:13,stroke:2})})]})]}),t&&(0,U.jsx)(`div`,{className:`px-3 pb-2`,children:r?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-[14px] text-neutral-5`,children:[(0,U.jsx)(Nt,{size:16,stroke:2,className:`animate-spin`}),`Loading steps…`]}):n?(0,U.jsx)(Ph,{run:n}):null})]})}function Ih({repo:e,schedule:t,recentRuns:n,selectedRunId:r,runDetail:i,detailLoading:a,onTrigger:o,onToggleEnabled:s,onEdit:c,onDelete:l,onToggleRun:u,onCancel:d,onNavigateToSession:f}){let[p,m]=(0,v.useState)(!1),h=eh(e.kind??``),g=t?!t.enabled:!1,_=n[0];return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`group flex items-center gap-3 px-3 py-2 rounded-md transition-colors hover:bg-neutral-10/50 ${g&&!h?`opacity-60`:``}`,children:[(0,U.jsx)(Ah,{status:_?.status}),(0,U.jsx)(`span`,{className:`text-[14px] font-medium min-w-0 truncate ${g&&!h?`text-neutral-5`:`text-neutral-2`}`,children:dh(e.kind??``)}),g&&!h&&(0,U.jsx)(`span`,{className:`text-[12px] text-warning-5 shrink-0`,children:`paused`}),(0,U.jsx)(`span`,{className:`text-[14px] whitespace-nowrap shrink-0 ${h?`text-purple-400`:`text-neutral-5`}`,children:h?`On commit`:lh(t?t.cronExpression:e.cronExpression)}),uh(e.model)&&(0,U.jsx)(`span`,{className:`text-[12px] text-neutral-5 bg-neutral-9 rounded px-1.5 py-0.5 shrink-0`,children:uh(e.model)}),_&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(yh,{status:_.status}),(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-5 tabular-nums whitespace-nowrap shrink-0`,children:hh(_.createdAt)})]}),n.length>0&&(0,U.jsx)(`button`,{onClick:()=>m(!p),className:`flex items-center gap-0.5 shrink-0 rounded px-1 py-0.5 hover:bg-neutral-9 transition-colors`,title:`${n.length} recent runs`,children:n.slice(0,5).map(e=>(0,U.jsx)(Ah,{status:e.status},e.id))}),(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0 ml-auto opacity-0 group-hover:opacity-100 transition-opacity`,children:[!h&&(0,U.jsx)(`button`,{onClick:()=>o(e.id),className:`rounded p-1 text-neutral-5 hover:text-accent-3 hover:bg-neutral-9 transition-colors`,title:`Run now`,children:(0,U.jsx)(Wt,{size:14,stroke:2})}),!h&&(0,U.jsx)(`button`,{onClick:()=>s(e.id,!t?.enabled),className:`rounded p-1 transition-colors ${g?`text-success-5 hover:text-success-3 hover:bg-neutral-9`:`text-neutral-5 hover:text-warning-4 hover:bg-neutral-9`}`,title:g?`Resume`:`Pause`,children:g?(0,U.jsx)(Wt,{size:14,stroke:2}):(0,U.jsx)(Ut,{size:14,stroke:2})}),(0,U.jsx)(`button`,{onClick:()=>c(e),className:`rounded p-1 text-neutral-5 hover:text-neutral-2 hover:bg-neutral-9 transition-colors`,title:`Edit`,children:(0,U.jsx)(Ht,{size:14,stroke:2})}),(0,U.jsx)(`button`,{onClick:()=>l(e.id),className:`rounded p-1 text-neutral-6 hover:text-error-4 hover:bg-neutral-9 transition-colors`,title:`Delete`,children:(0,U.jsx)(an,{size:14,stroke:2})})]})]}),p&&n.length>0&&(0,U.jsx)(`div`,{className:`ml-6 border-l border-neutral-8/40 pl-2 pb-1`,children:n.map(e=>(0,U.jsx)(Fh,{run:e,selected:r===e.id,detail:r===e.id?i:null,detailLoading:r===e.id?a:!1,onToggle:()=>u(e.id),onCancel:d,onNavigateToSession:f},e.id))})]})}function Lh({repoPath:e,workflows:t,scheduleMap:n,runsPerRepo:r,selectedRunId:i,runDetail:a,detailLoading:o,onTrigger:s,onToggleEnabled:c,onEdit:l,onDelete:u,onToggleRun:d,onCancel:f,onNavigateToSession:p}){return(0,U.jsxs)(`div`,{className:`workflow-card rounded-lg border border-neutral-9/60 bg-neutral-10/30 overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline gap-2 px-4 py-2.5 border-b border-neutral-9/40 bg-neutral-10/20`,children:[(0,U.jsx)(`span`,{className:`text-[15px] font-semibold text-neutral-2`,children:e.split(`/`).pop()||e}),(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-6`,children:t.length})]}),(0,U.jsx)(`div`,{className:`py-1 px-1`,children:t.map(e=>(0,U.jsx)(Ih,{repo:e,schedule:n.get(e.id),recentRuns:r.get(e.id)??[],selectedRunId:i,runDetail:a,detailLoading:o,onTrigger:s,onToggleEnabled:c,onEdit:l,onDelete:u,onToggleRun:d,onCancel:f,onNavigateToSession:p},e.id))})]})}function Rh({run:e,onNavigateToSession:t}){let n=e.output?.sessionId||e.input?.sessionId;return(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 hover:bg-neutral-10/30 transition-colors rounded-md`,children:[(0,U.jsx)(Ah,{status:e.status}),(0,U.jsx)(`span`,{className:`text-[15px] font-medium text-neutral-2 min-w-0 truncate max-w-[140px]`,children:gh(e)}),(0,U.jsx)(`span`,{className:`text-[14px] text-neutral-4`,children:dh(e.kind)}),(0,U.jsx)(`span`,{className:`text-[14px] text-neutral-5 tabular-nums ml-auto whitespace-nowrap`,children:hh(e.createdAt)}),(0,U.jsx)(`span`,{className:`text-[14px] text-neutral-5 tabular-nums whitespace-nowrap`,children:mh(e.startedAt,e.completedAt)}),(0,U.jsx)(yh,{status:e.status}),n&&t&&(0,U.jsx)(`button`,{onClick:()=>t(n),className:`rounded p-1 text-neutral-5 hover:text-accent-3 hover:bg-neutral-9 transition-colors shrink-0`,title:`View session`,children:(0,U.jsx)(wt,{size:13,stroke:2})})]})}function zh(){let[e,t]=(0,v.useState)(!1);return(0,U.jsxs)(`div`,{className:`workflow-card mt-6 rounded-lg border border-neutral-9/60 bg-neutral-10/30`,children:[(0,U.jsxs)(`button`,{onClick:()=>t(!e),className:`w-full flex items-center gap-2 px-4 py-3 text-left text-[15px] font-medium text-neutral-3 hover:text-neutral-1 transition-colors`,children:[e?(0,U.jsx)(ht,{size:14,stroke:2,className:`text-neutral-5`}):(0,U.jsx)(_t,{size:14,stroke:2,className:`text-neutral-5`}),`Defining Custom Workflows`,(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-5 font-normal ml-1`,children:`via workflow.md files`})]}),e&&(0,U.jsxs)(`div`,{className:`px-4 pb-4 text-[14px] text-neutral-4 space-y-3 border-t border-neutral-9/40 pt-3`,children:[(0,U.jsxs)(`p`,{children:[`You can define custom workflow types per-repo by adding `,(0,U.jsx)(`code`,{className:`text-accent-3 bg-neutral-10 px-1 rounded`,children:`.md`}),` files to:`]}),(0,U.jsx)(`pre`,{className:`rounded-md bg-neutral-12 px-3 py-2 text-[14px] text-neutral-3 font-mono overflow-x-auto`,children:`<repo>/.codekin/workflows/<kind>.md`}),(0,U.jsx)(`p`,{children:`Each file uses YAML frontmatter + a prompt body:`}),(0,U.jsx)(`pre`,{className:`rounded-md bg-neutral-12 px-3 py-2 text-[14px] text-neutral-3 font-mono overflow-x-auto leading-relaxed`,children:`---
|
|
55
|
-
kind: api-docs.weekly
|
|
56
|
-
name: API Documentation Check
|
|
57
|
-
sessionPrefix: api-docs
|
|
58
|
-
outputDir: .codekin/reports/api-docs
|
|
59
|
-
filenameSuffix: _api-docs.md
|
|
60
|
-
commitMessage: chore: api docs check
|
|
61
|
-
---
|
|
62
|
-
You are reviewing the API documentation for this project.
|
|
63
|
-
|
|
64
|
-
1. Find all REST endpoints and verify they have docs
|
|
65
|
-
2. Check for outdated examples or missing parameters
|
|
66
|
-
3. Produce a Markdown report
|
|
67
|
-
|
|
68
|
-
Important: Do NOT modify any source files.`}),(0,U.jsxs)(`div`,{className:`space-y-1.5 text-[14px]`,children:[(0,U.jsx)(`p`,{className:`font-medium text-neutral-3`,children:`Frontmatter fields:`}),(0,U.jsxs)(`ul`,{className:`list-disc list-inside space-y-0.5 text-neutral-4 ml-1`,children:[(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`kind`}),` — unique ID, e.g. `,(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`code-review.daily`})]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`name`}),` — display name shown in the UI`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`sessionPrefix`}),` — prefix for the session name`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`outputDir`}),` — where reports are saved in the repo`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`filenameSuffix`}),` — appended to the date for the report filename`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`commitMessage`}),` — git commit message prefix`]})]})]}),(0,U.jsxs)(`p`,{className:`text-neutral-5`,children:[`Custom workflows appear automatically when adding a new workflow for that repo. To override a built-in workflow`,`'`,`s prompt, use the same `,(0,U.jsx)(`code`,{className:`text-neutral-3`,children:`kind`}),` value.`]})]})]})}function Bh({token:e,onNavigateToSession:t}){let{runs:n,schedules:r,config:i,error:a,cancelRun:o,triggerSchedule:s,addRepo:c,removeRepo:l,updateRepo:u,toggleScheduleEnabled:d}=Zm(e),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(!1),C=f!==null&&(m===null||m.id!==f),w=new Map;if(i)for(let e of i.reviewRepos)w.set(e.id,e);let T=new Map;for(let e of r)T.set(e.id,e);let E=new Map;for(let e of n){let t=e.input.repoPath;if(!t)continue;let n=i?.reviewRepos.find(n=>n.repoPath===t&&n.kind===e.kind);if(n){let t=n.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}}let D=new Set;for(let e of E.values())for(let t of e)D.add(t.id);(0,v.useEffect)(()=>{if(!f)return;let t=!1;return Bm(e,f).then(e=>{t||h(e)}).catch(()=>{t||h(null)}),()=>{t=!0}},[f,e]),(0,v.useEffect)(()=>{!f||!m||(m.status===`running`||m.status===`queued`)&&Bm(e,f).then(h).catch(()=>{})},[n]);let O=(0,v.useCallback)(e=>{p(t=>t===e?null:e)},[]),k=(0,v.useCallback)(async e=>{try{await l(e)}catch{}},[l]),A=(0,v.useCallback)(async(e,t)=>{try{await d(e,t)}catch{}},[d]),j=i?.reviewRepos??[],M=new Map;for(let e of j)M.has(e.repoPath)||M.set(e.repoPath,[]),M.get(e.repoPath).push(e);return(0,U.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-8/50 px-5 py-3`,children:[(0,U.jsx)(`h1`,{className:`text-[18px] font-medium text-neutral-1`,children:`Workflows`}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,U.jsxs)(`button`,{onClick:()=>_(!0),className:`flex items-center gap-1.5 rounded-md bg-primary-8 px-3 py-1.5 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 transition-colors`,children:[(0,U.jsx)(Kt,{size:14,stroke:2}),`New Workflow`]})})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-5`,children:[a&&(0,U.jsx)(`div`,{className:`rounded-lg border border-error-8/50 bg-error-10/30 px-4 py-2 text-[16px] text-error-4 mb-4`,children:a}),j.length===0?(0,U.jsxs)(`div`,{className:`rounded-xl border border-dashed border-neutral-8 px-6 py-10 text-center`,children:[(0,U.jsxs)(`div`,{className:`text-neutral-5 mb-1`,children:[(0,U.jsx)(pt,{size:32,stroke:1.5,className:`mx-auto mb-3 text-neutral-6`}),(0,U.jsx)(`div`,{className:`text-[16px] text-neutral-3 font-medium mb-1`,children:`No workflows configured`}),(0,U.jsx)(`div`,{className:`text-[14px] text-neutral-5`,children:`Set up automated code reviews, security audits, and more.`})]}),(0,U.jsxs)(`button`,{onClick:()=>_(!0),className:`mt-4 inline-flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 transition-colors`,children:[(0,U.jsx)(Kt,{size:14,stroke:2}),`Create your first workflow`]})]}):(0,U.jsx)(`div`,{className:`space-y-3`,children:Array.from(M.entries()).map(([e,n])=>(0,U.jsx)(Lh,{repoPath:e,workflows:n,scheduleMap:T,runsPerRepo:E,selectedRunId:f,runDetail:m,detailLoading:C,onTrigger:s,onToggleEnabled:A,onEdit:b,onDelete:k,onToggleRun:O,onCancel:o,onNavigateToSession:t},e))}),n.length>0&&(0,U.jsxs)(`div`,{className:`mt-6`,children:[(0,U.jsxs)(`button`,{onClick:()=>S(!x),className:`flex items-center gap-2 text-[15px] font-medium text-neutral-3 hover:text-neutral-1 transition-colors mb-2`,children:[x?(0,U.jsx)(ht,{size:14,stroke:2}):(0,U.jsx)(ct,{size:14,stroke:2}),`Recent Activity`,(0,U.jsxs)(`span`,{className:`text-[13px] text-neutral-5 font-normal`,children:[`(`,n.length,` runs)`]})]}),x&&(0,U.jsx)(`div`,{className:`workflow-card rounded-lg border border-neutral-9/60 bg-neutral-10/30 py-1 divide-y divide-neutral-9/30`,children:n.slice(0,20).map(e=>(0,U.jsx)(Rh,{run:e,onNavigateToSession:t},e.id))})]}),(0,U.jsx)(zh,{})]}),g&&(0,U.jsx)(Dh,{token:e,onClose:()=>_(!1),onAdd:c}),y&&(0,U.jsx)(kh,{repo:y,schedules:r.filter(e=>e.id===y.id),recentRuns:n.filter(e=>e.input.repoPath===y.repoPath||e.input.repoName===y.name),onClose:()=>b(null),onSave:u})]})}var Vh=1,Hh=.9,Uh=.8,Wh=.17,Gh=.1,Kh=.999,qh=.9999,Jh=.99,Yh=/[\\\/_+.#"@\[\(\{&]/,Xh=/[\\\/_+.#"@\[\(\{&]/g,Zh=/[\s-]/,Qh=/[\s-]/g;function $h(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Vh:Jh;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=$h(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Vh:Yh.test(e.charAt(l-1))?(d*=Uh,p=e.slice(i,l-1).match(Xh),p&&i>0&&(d*=Kh**+p.length)):Zh.test(e.charAt(l-1))?(d*=Hh,m=e.slice(i,l-1).match(Qh),m&&i>0&&(d*=Kh**+m.length)):(d*=Wh,i>0&&(d*=Kh**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=qh)),(d<Gh&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=$h(e,t,n,r,l+1,a+2,o),f*Gh>d&&(d=f*Gh)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function eg(e){return e.toLowerCase().replace(Qh,` `)}function tg(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,$h(e,t,eg(e),eg(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function ng(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function rg(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ig(...e){return t=>{let n=!1,r=e.map(e=>{let r=rg(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rg(e[t],null)}}}}function ag(...e){return v.useCallback(ig(...e),e)}function og(e,t){let n=v.createContext(t),r=e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,U.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=v.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function sg(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,U.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=v.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>v.createContext(e));return function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,cg(i,...t)]}function cg(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var lg=globalThis?.document?v.useLayoutEffect:()=>{},ug=v.useId||(()=>void 0),dg=0;function fg(e){let[t,n]=v.useState(ug());return lg(()=>{e||n(e=>e??String(dg++))},[e]),e||(t?`radix-${t}`:``)}var pg=v.useInsertionEffect||lg;function mg({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=hg({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=v.useRef(e!==void 0);v.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,v.useCallback(t=>{if(s){let n=gg(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function hg({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return pg(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function gg(e){return typeof e==`function`}var _g=l(h(),1);function vg(e){let t=yg(e),n=v.forwardRef((e,n)=>{let{children:r,...i}=e,a=v.Children.toArray(r),o=a.find(xg);if(o){let e=o.props.children,r=a.map(t=>t===o?v.Children.count(e)>1?v.Children.only(null):v.isValidElement(e)?e.props.children:null:t);return(0,U.jsx)(t,{...i,ref:n,children:v.isValidElement(e)?v.cloneElement(e,void 0,r):null})}return(0,U.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function yg(e){let t=v.forwardRef((e,t)=>{let{children:n,...r}=e;if(v.isValidElement(n)){let e=Cg(n),i=Sg(r,n.props);return n.type!==v.Fragment&&(i.ref=t?ig(t,e):e),v.cloneElement(n,i)}return v.Children.count(n)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bg=Symbol(`radix.slottable`);function xg(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===bg}function Sg(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Cg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wg=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vg(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Tg(e,t){e&&_g.flushSync(()=>e.dispatchEvent(t))}function Eg(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...e)=>t.current?.(...e),[])}function Dg(e,t=globalThis?.document){let n=Eg(e);v.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Og=`DismissableLayer`,kg=`dismissableLayer.update`,Ag=`dismissableLayer.pointerDownOutside`,jg=`dismissableLayer.focusOutside`,Mg,Ng=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pg=v.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=v.useContext(Ng),[u,d]=v.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=v.useState({}),m=ag(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),y=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=_,S=Lg(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=Rg(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Dg(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),v.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Mg=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),zg(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Mg)}},[u,f,n,l]),v.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),zg())},[u,l]),v.useEffect(()=>{let e=()=>p({});return document.addEventListener(kg,e),()=>document.removeEventListener(kg,e)},[]),(0,U.jsx)(wg.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:ng(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ng(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ng(e.onPointerDownCapture,S.onPointerDownCapture)})});Pg.displayName=Og;var Fg=`DismissableLayerBranch`,Ig=v.forwardRef((e,t)=>{let n=v.useContext(Ng),r=v.useRef(null),i=ag(t,r);return v.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,U.jsx)(wg.div,{...e,ref:i})});Ig.displayName=Fg;function Lg(e,t=globalThis?.document){let n=Eg(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Bg(Ag,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Rg(e,t=globalThis?.document){let n=Eg(e),r=v.useRef(!1);return v.useEffect(()=>{let e=e=>{e.target&&!r.current&&Bg(jg,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zg(){let e=new CustomEvent(kg);document.dispatchEvent(e)}function Bg(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Tg(i,a):i.dispatchEvent(a)}var Vg=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vg(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Hg=`focusScope.autoFocusOnMount`,Ug=`focusScope.autoFocusOnUnmount`,Wg={bubbles:!1,cancelable:!0},Gg=`FocusScope`,Kg=v.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Eg(i),u=Eg(a),d=v.useRef(null),f=ag(t,e=>c(e)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:$g(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||$g(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$g(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){e_.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Hg,Wg);s.addEventListener(Hg,l),s.dispatchEvent(t),t.defaultPrevented||(qg(r_(Yg(s)),{select:!0}),document.activeElement===e&&$g(s))}return()=>{s.removeEventListener(Hg,l),setTimeout(()=>{let t=new CustomEvent(Ug,Wg);s.addEventListener(Ug,u),s.dispatchEvent(t),t.defaultPrevented||$g(e??document.body,{select:!0}),s.removeEventListener(Ug,u),e_.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Jg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&$g(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&$g(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,U.jsx)(Vg.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Kg.displayName=Gg;function qg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if($g(r,{select:t}),document.activeElement!==n)return}function Jg(e){let t=Yg(e);return[Xg(t,e),Xg(t.reverse(),e)]}function Yg(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xg(e,t){for(let n of e)if(!Zg(n,{upTo:t}))return n}function Zg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Qg(e){return e instanceof HTMLInputElement&&`select`in e}function $g(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qg(e)&&t&&e.select()}}var e_=t_();function t_(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=n_(e,t),e.unshift(t)},remove(t){e=n_(e,t),e[0]?.resume()}}}function n_(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function r_(e){return e.filter(e=>e.tagName!==`A`)}var i_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vg(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),a_=`Portal`,o_=v.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=v.useState(!1);lg(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_g.createPortal((0,U.jsx)(i_.div,{...r,ref:t}),o):null});o_.displayName=a_;function s_(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}var c_=e=>{let{present:t,children:n}=e,r=l_(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=ag(r.ref,d_(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null};c_.displayName=`Presence`;function l_(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),[o,s]=s_(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{let e=u_(r.current);a.current=o===`mounted`?e:`none`},[o]),lg(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=u_(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),lg(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=u_(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=u_(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:v.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function u_(e){return e?.animationName||`none`}function d_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var f_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vg(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),p_=0;function m_(){v.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??h_()),document.body.insertAdjacentElement(`beforeend`,e[1]??h_()),p_++,()=>{p_===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),p_--}},[])}function h_(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var g_=function(){return g_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},g_.apply(this,arguments)};function __(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function v_(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var y_=`right-scroll-bar-position`,b_=`width-before-scroll-bar`,x_=`with-scroll-bars-hidden`,S_=`--removed-body-scroll-bar-size`;function C_(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function w_(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var T_=typeof window<`u`?v.useLayoutEffect:v.useEffect,E_=new WeakMap;function D_(e,t){var n=w_(t||null,function(t){return e.forEach(function(e){return C_(e,t)})});return T_(function(){var t=E_.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||C_(e,null)}),i.forEach(function(e){r.has(e)||C_(e,a)})}E_.set(n,e)},[e]),n}function O_(e){return e}function k_(e,t){t===void 0&&(t=O_);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function A_(e){e===void 0&&(e={});var t=k_(null);return t.options=g_({async:!0,ssr:!1},e),t}var j_=function(e){var t=e.sideCar,n=__(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,g_({},n))};j_.isSideCarExport=!0;function M_(e,t){return e.useMedium(t),j_}var N_=A_(),P_=function(){},F_=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:P_,onWheelCapture:P_,onTouchMoveCapture:P_}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=__(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=D_([n,t]),w=g_(g_({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:N_,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),g_(g_({},w),{ref:C})):v.createElement(y,g_({},w,{className:c,ref:C}),s))});F_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},F_.classNames={fullWidth:b_,zeroRight:y_};var I_,L_=function(){if(I_)return I_;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function R_(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=L_();return t&&e.setAttribute(`nonce`,t),e}function z_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function B_(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var V_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=R_())&&(z_(t,n),B_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H_=function(){var e=V_();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},U_=function(){var e=H_();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},W_={left:0,top:0,right:0,gap:0},G_=function(e){return parseInt(e||``,10)||0},K_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[G_(n),G_(r),G_(i)]},q_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return W_;var t=K_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},J_=U_(),Y_=`data-scroll-locked`,X_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
69
|
-
.${x_} {
|
|
70
|
-
overflow: hidden ${r};
|
|
71
|
-
padding-right: ${s}px ${r};
|
|
72
|
-
}
|
|
73
|
-
body[${Y_}] {
|
|
74
|
-
overflow: hidden ${r};
|
|
75
|
-
overscroll-behavior: contain;
|
|
76
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
77
|
-
padding-left: ${i}px;
|
|
78
|
-
padding-top: ${a}px;
|
|
79
|
-
padding-right: ${o}px;
|
|
80
|
-
margin-left:0;
|
|
81
|
-
margin-top:0;
|
|
82
|
-
margin-right: ${s}px ${r};
|
|
83
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.${y_} {
|
|
87
|
-
right: ${s}px ${r};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.${b_} {
|
|
91
|
-
margin-right: ${s}px ${r};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.${y_} .${y_} {
|
|
95
|
-
right: 0 ${r};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.${b_} .${b_} {
|
|
99
|
-
margin-right: 0 ${r};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
body[${Y_}] {
|
|
103
|
-
${S_}: ${s}px;
|
|
104
|
-
}
|
|
105
|
-
`},Z_=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Q_=function(){v.useEffect(function(){return document.body.setAttribute(Y_,(Z_()+1).toString()),function(){var e=Z_()-1;e<=0?document.body.removeAttribute(Y_):document.body.setAttribute(Y_,e.toString())}},[])},$_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Q_();var a=v.useMemo(function(){return q_(i)},[i]);return v.createElement(J_,{styles:X_(a,!t,i,n?``:`!important`)})},ev=!1;if(typeof window<`u`)try{var tv=Object.defineProperty({},`passive`,{get:function(){return ev=!0,!0}});window.addEventListener(`test`,tv,tv),window.removeEventListener(`test`,tv,tv)}catch{ev=!1}var nv=ev?{passive:!1}:!1,rv=function(e){return e.tagName===`TEXTAREA`},iv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!rv(e)&&n[t]===`visible`)},av=function(e){return iv(e,`overflowY`)},ov=function(e){return iv(e,`overflowX`)},sv=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),uv(e,r)){var i=dv(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cv=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},lv=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},uv=function(e,t){return e===`v`?av(t):ov(t)},dv=function(e,t){return e===`v`?cv(t):lv(t)},fv=function(e,t){return e===`h`&&t===`rtl`?-1:1},pv=function(e,t,n,r,i){var a=fv(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=dv(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&uv(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},mv=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hv=function(e){return[e.deltaX,e.deltaY]},gv=function(e){return e&&`current`in e?e.current:e},_v=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vv=function(e){return`
|
|
106
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
107
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
108
|
-
`},yv=0,bv=[];function xv(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(yv++)[0],a=v.useState(U_)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=v_([e.lockRef.current],(e.shards||[]).map(gv),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=mv(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=sv(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=sv(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return pv(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!bv.length||bv[bv.length-1]!==a)){var r=`deltaY`in n?hv(n):mv(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&_v(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(gv).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Sv(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=mv(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,hv(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,mv(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return bv.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,nv),document.addEventListener(`touchmove`,c,nv),document.addEventListener(`touchstart`,u,nv),function(){bv=bv.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,nv),document.removeEventListener(`touchmove`,c,nv),document.removeEventListener(`touchstart`,u,nv)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:vv(i)}):null,p?v.createElement($_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Cv=M_(N_,xv),wv=v.forwardRef(function(e,t){return v.createElement(F_,g_({},e,{ref:t,sideCar:Cv}))});wv.classNames=F_.classNames;var Tv=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ev=new WeakMap,Dv=new WeakMap,Ov={},kv=0,Av=function(e){return e&&(e.host||Av(e.parentNode))},jv=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Av(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Mv=function(e,t,n,r){var i=jv(t,Array.isArray(e)?e:[e]);Ov[n]||(Ov[n]=new WeakMap);var a=Ov[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Ev.get(e)||0)+1,l=(a.get(e)||0)+1;Ev.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Dv.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),kv++,function(){o.forEach(function(e){var t=Ev.get(e)-1,i=a.get(e)-1;Ev.set(e,t),a.set(e,i),t||(Dv.has(e)||e.removeAttribute(r),Dv.delete(e)),i||e.removeAttribute(n)}),kv--,kv||(Ev=new WeakMap,Ev=new WeakMap,Dv=new WeakMap,Ov={})}},Nv=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Tv(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Mv(r,i,n,`aria-hidden`)):function(){return null}},Pv=`Dialog`,[Fv,Iv]=sg(Pv),[Lv,Rv]=Fv(Pv),zv=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=mg({prop:r,defaultProp:i??!1,onChange:a,caller:Pv});return(0,U.jsx)(Lv,{scope:t,triggerRef:s,contentRef:c,contentId:fg(),titleId:fg(),descriptionId:fg(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};zv.displayName=Pv;var Bv=`DialogTrigger`,Vv=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Rv(Bv,n),a=ag(t,i.triggerRef);return(0,U.jsx)(f_.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sy(i.open),...r,ref:a,onClick:ng(e.onClick,i.onOpenToggle)})});Vv.displayName=Bv;var Hv=`DialogPortal`,[Uv,Wv]=Fv(Hv,{forceMount:void 0}),Gv=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Rv(Hv,t);return(0,U.jsx)(Uv,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,U.jsx)(c_,{present:n||a.open,children:(0,U.jsx)(o_,{asChild:!0,container:i,children:e})}))})};Gv.displayName=Hv;var Kv=`DialogOverlay`,qv=v.forwardRef((e,t)=>{let n=Wv(Kv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Rv(Kv,e.__scopeDialog);return a.modal?(0,U.jsx)(c_,{present:r||a.open,children:(0,U.jsx)(Yv,{...i,ref:t})}):null});qv.displayName=Kv;var Jv=vg(`DialogOverlay.RemoveScroll`),Yv=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Rv(Kv,n);return(0,U.jsx)(wv,{as:Jv,allowPinchZoom:!0,shards:[i.contentRef],children:(0,U.jsx)(f_.div,{"data-state":sy(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Xv=`DialogContent`,Zv=v.forwardRef((e,t)=>{let n=Wv(Xv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Rv(Xv,e.__scopeDialog);return(0,U.jsx)(c_,{present:r||a.open,children:a.modal?(0,U.jsx)(Qv,{...i,ref:t}):(0,U.jsx)($v,{...i,ref:t})})});Zv.displayName=Xv;var Qv=v.forwardRef((e,t)=>{let n=Rv(Xv,e.__scopeDialog),r=v.useRef(null),i=ag(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return Nv(e)},[]),(0,U.jsx)(ey,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ng(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ng(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ng(e.onFocusOutside,e=>e.preventDefault())})}),$v=v.forwardRef((e,t)=>{let n=Rv(Xv,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,U.jsx)(ey,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ey=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Rv(Xv,n),c=v.useRef(null),l=ag(t,c);return m_(),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Kg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,U.jsx)(Pg,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sy(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(dy,{titleId:s.titleId}),(0,U.jsx)(py,{contentRef:c,descriptionId:s.descriptionId})]})]})}),ty=`DialogTitle`,ny=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Rv(ty,n);return(0,U.jsx)(f_.h2,{id:i.titleId,...r,ref:t})});ny.displayName=ty;var ry=`DialogDescription`,iy=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Rv(ry,n);return(0,U.jsx)(f_.p,{id:i.descriptionId,...r,ref:t})});iy.displayName=ry;var ay=`DialogClose`,oy=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Rv(ay,n);return(0,U.jsx)(f_.button,{type:`button`,...r,ref:t,onClick:ng(e.onClick,()=>i.onOpenChange(!1))})});oy.displayName=ay;function sy(e){return e?`open`:`closed`}var cy=`DialogTitleWarning`,[ly,uy]=og(cy,{contentName:Xv,titleName:ty,docsSlug:`dialog`}),dy=({titleId:e})=>{let t=uy(cy),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
109
|
-
|
|
110
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
111
|
-
|
|
112
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fy=`DialogDescriptionWarning`,py=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uy(fy).contentName}}.`;return v.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},my=zv,hy=Gv,gy=qv,_y=Zv,vy=Symbol.for(`react.lazy`),yy=v.use;function by(e){return typeof e==`object`&&!!e&&`then`in e}function xy(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===vy&&`_payload`in e&&by(e._payload)}function Sy(e){let t=Cy(e),n=v.forwardRef((e,n)=>{let{children:r,...i}=e;xy(r)&&typeof yy==`function`&&(r=yy(r._payload));let a=v.Children.toArray(r),o=a.find(Ty);if(o){let e=o.props.children,r=a.map(t=>t===o?v.Children.count(e)>1?v.Children.only(null):v.isValidElement(e)?e.props.children:null:t);return(0,U.jsx)(t,{...i,ref:n,children:v.isValidElement(e)?v.cloneElement(e,void 0,r):null})}return(0,U.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Cy(e){let t=v.forwardRef((e,t)=>{let{children:n,...r}=e;if(xy(n)&&typeof yy==`function`&&(n=yy(n._payload)),v.isValidElement(n)){let e=Dy(n),i=Ey(r,n.props);return n.type!==v.Fragment&&(i.ref=t?ig(t,e):e),v.cloneElement(n,i)}return v.Children.count(n)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wy=Symbol(`radix.slottable`);function Ty(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===wy}function Ey(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Dy(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Oy=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Sy(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ky=`[cmdk-group=""]`,Ay=`[cmdk-group-items=""]`,jy=`[cmdk-group-heading=""]`,My=`[cmdk-item=""]`,Ny=`${My}:not([aria-disabled="true"])`,Py=`cmdk-item-select`,Fy=`data-value`,Iy=(e,t,n)=>tg(e,t,n),Ly=v.createContext(void 0),Ry=()=>v.useContext(Ly),zy=v.createContext(void 0),By=()=>v.useContext(zy),Vy=v.createContext(void 0),Hy=v.forwardRef((e,t)=>{let n=nb(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=nb(()=>new Set),i=nb(()=>new Map),a=nb(()=>new Map),o=nb(()=>new Set),s=eb(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,y=fg(),b=fg(),x=fg(),S=v.useRef(null),C=ab();tb(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),tb(()=>{C(6,A)},[]);let w=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Iy;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Ay);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ay} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Ay} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${ky}[${Fy}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Fy);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ky)?.querySelector(jy))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${My}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Ny)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(Fy))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(Fy))}function F(e){let t=j()?.closest(ky),n;for(;t&&!n;)t=e>0?Qy(t,ky):$y(t,ky),n=t?.querySelector(Ny);n?w.setState(`value`,n.getAttribute(Fy)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},ee=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return v.createElement(Oy.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&ee(e);break;case`ArrowUp`:ee(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(Py);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:cb},c),sb(e,e=>v.createElement(zy.Provider,{value:w},v.createElement(Ly.Provider,{value:T},e))))}),Uy=v.forwardRef((e,t)=>{let n=fg(),r=v.useRef(null),i=v.useContext(Vy),a=Ry(),o=eb(e),s=o.current?.forceMount??i?.forceMount;tb(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=ib(n,r,[e.value,e.children,r],e.keywords),l=By(),u=rb(e=>e.value&&e.value===c.current),d=rb(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Py,f),()=>t.removeEventListener(Py,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:y,...b}=e;return v.createElement(Oy.div,{ref:ig(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Wy=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=fg(),s=v.useRef(null),c=v.useRef(null),l=fg(),u=Ry(),d=rb(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);tb(()=>u.group(o),[]),ib(o,s,[e.value,e.heading,c]);let f=v.useMemo(()=>({id:o,forceMount:i}),[i]);return v.createElement(Oy.div,{ref:ig(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&v.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),sb(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},v.createElement(Vy.Provider,{value:f},e))))}),Gy=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),a=rb(e=>!e.search);return!n&&!a?null:v.createElement(Oy.div,{ref:ig(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ky=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=By(),o=rb(e=>e.search),s=rb(e=>e.selectedItemId),c=Ry();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(Oy.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),qy=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=v.useRef(null),o=v.useRef(null),s=rb(e=>e.selectedItemId),c=Ry();return v.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(Oy.div,{ref:ig(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},sb(e,e=>v.createElement(`div`,{ref:ig(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Jy=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(my,{open:n,onOpenChange:r},v.createElement(hy,{container:o},v.createElement(gy,{"cmdk-overlay":``,className:i}),v.createElement(_y,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(Hy,{ref:t,...s}))))}),Yy=v.forwardRef((e,t)=>rb(e=>e.filtered.count===0)?v.createElement(Oy.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Xy=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(Oy.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},sb(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),Zy=Object.assign(Hy,{List:qy,Item:Uy,Input:Ky,Group:Wy,Separator:Gy,Dialog:Jy,Empty:Yy,Loading:Xy});function Qy(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $y(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function eb(e){let t=v.useRef(e);return tb(()=>{t.current=e}),t}var tb=typeof window>`u`?v.useEffect:v.useLayoutEffect;function nb(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function rb(e){let t=By(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function ib(e,t,n,r=[]){let i=v.useRef(),a=Ry();return tb(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Fy,s),i.current=s}),i}var ab=()=>{let[e,t]=v.useState(),n=nb(()=>new Map);return tb(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ob(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function sb({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(ob(t),{ref:t.ref},n(t.props.children)):n(t)}var cb={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function lb({open:e,onClose:t,repos:n,globalSkills:r=[],globalModules:i=[],onOpenRepo:a,onSendSkill:o,onSendModule:s,onOpenSettings:c,isMobile:l=!1}){return e?(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex bg-black/60 ${l?`items-end`:`items-start justify-center pt-[20vh]`}`,onClick:t,children:(0,U.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`w-full ${l?``:`max-w-lg`}`,children:(0,U.jsxs)(Zy,{className:`rounded-lg border border-neutral-10 bg-neutral-11 shadow-2xl`,label:`Command palette`,children:[(0,U.jsx)(Zy.Input,{placeholder:`Search repos, skills, modules, actions...`,className:`w-full border-b border-neutral-10 bg-transparent px-4 py-3 text-[15px] text-neutral-2 outline-none placeholder:text-neutral-5`,autoFocus:!0}),(0,U.jsxs)(Zy.List,{className:`max-h-72 overflow-y-auto p-2`,children:[(0,U.jsx)(Zy.Empty,{className:`px-4 py-8 text-center text-[15px] text-neutral-5`,children:`No results found.`}),(0,U.jsx)(Zy.Group,{heading:`Repos`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5`,children:n.map(e=>(0,U.jsxs)(Zy.Item,{value:`repo ${e.name} ${e.tags.join(` `)}`,onSelect:()=>{a(e),t()},className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4`,children:[(0,U.jsx)(`span`,{className:`text-neutral-5`,children:`▢`}),e.name,(0,U.jsx)(`span`,{className:`ml-auto text-[12px] text-neutral-5`,children:e.tags.join(`, `)})]},e.id))}),(0,U.jsxs)(Zy.Group,{heading:`Skills`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5`,children:[r.map(e=>(0,U.jsxs)(Zy.Item,{value:`skill ${e.name} ${e.command} global`,onSelect:()=>{o(e.command),t()},className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4`,children:[(0,U.jsx)(`span`,{className:`text-accent-6`,children:`/`}),(0,U.jsx)(`span`,{children:e.name}),(0,U.jsx)(`span`,{className:`ml-auto text-[12px] text-neutral-5`,children:`global`})]},`global-${e.id}`)),n.flatMap(e=>e.skills.map(n=>(0,U.jsxs)(Zy.Item,{value:`skill ${n.name} ${n.command} ${e.name}`,onSelect:()=>{o(n.command),t()},className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4`,children:[(0,U.jsx)(`span`,{className:`text-accent-6`,children:`/`}),(0,U.jsx)(`span`,{children:n.name}),(0,U.jsx)(`span`,{className:`ml-auto text-[12px] text-neutral-5`,children:e.name})]},`${e.id}-${n.id}`)))]}),(0,U.jsx)(Zy.Group,{heading:`Modules`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5`,children:i.map(e=>(0,U.jsxs)(Zy.Item,{value:`module ${e.name} ${e.description} global`,onSelect:()=>{s(e),t()},className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4`,children:[(0,U.jsx)(`span`,{className:`text-primary-6`,children:`◆`}),(0,U.jsx)(`span`,{children:e.name}),(0,U.jsx)(`span`,{className:`ml-auto text-[12px] text-neutral-5`,children:`global`})]},`module-${e.id}`))}),(0,U.jsx)(Zy.Group,{heading:`Actions`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5`,children:(0,U.jsxs)(Zy.Item,{value:`settings token configure`,onSelect:()=>{c(),t()},className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4`,children:[(0,U.jsx)(`span`,{className:`text-neutral-5`,children:`⚙`}),`Settings`]})})]})]})})}):null}function ub({groups:e,token:t,ghMissing:n,onOpen:r,onRefreshRepos:i}){let[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``);(0,v.useEffect)(()=>{t&&ce(t).then(e=>{c(e)}).catch(()=>{})},[t]);async function l(e){t&&(await le(t,e),c(e),i?.())}async function u(e){if(!a){if(!e.cloned){o(e.id);try{let n={"Content-Type":`application/json`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`/cc/api/clone`,{method:`POST`,headers:n,body:JSON.stringify({owner:e.owner,name:e.name})});if(!r.ok){let e=await r.json();throw Error(e.error||`Clone failed`)}e.cloned=!0}catch{o(null);return}o(null)}r(e)}}let d=e.reduce((e,t)=>e+t.repos.length,0);return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,U.jsxs)(`div`,{className:`mb-6 text-center`,children:[(0,U.jsx)(`div`,{className:`mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-neutral-7/50`,children:(0,U.jsx)(jt,{size:24,stroke:1.5,className:`text-neutral-3`})}),(0,U.jsx)(`h2`,{className:`text-[19px] font-medium text-neutral-2`,children:`Choose a repository to start a Claude Code session`})]}),n?(0,U.jsxs)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-[13px] leading-relaxed text-neutral-3`,children:[(0,U.jsx)(`p`,{className:`mb-2 font-medium text-amber-400`,children:`GitHub CLI (gh) not found`}),(0,U.jsxs)(`p`,{className:`text-neutral-4`,children:[`The repo browser needs `,(0,U.jsx)(`code`,{className:`rounded bg-neutral-8 px-1 py-0.5 text-neutral-3`,children:`gh`}),` to list and clone your repositories.`]}),(0,U.jsxs)(`p`,{className:`mt-2 text-neutral-4`,children:[`Install it:`,` `,(0,U.jsx)(`a`,{href:`https://cli.github.com`,target:`_blank`,rel:`noreferrer`,className:`text-amber-400 underline underline-offset-2 hover:text-amber-300`,children:`https://cli.github.com`})]}),(0,U.jsxs)(`p`,{className:`mt-1 text-neutral-4`,children:[`Then run: `,(0,U.jsx)(`code`,{className:`rounded bg-neutral-8 px-1 py-0.5 text-neutral-3`,children:`gh auth login`})]})]}):d===0?(0,U.jsx)(`p`,{className:`text-center text-[17px] text-neutral-6`,children:`No repositories configured`}):(0,U.jsx)(vn,{groups:e,onSelect:u,cloningId:a,autoFocus:!0}),(0,U.jsx)(`div`,{className:`mt-6 border-t border-neutral-8 pt-5`,children:(0,U.jsx)(fn,{value:s,token:t,helpText:`Absolute path to your locally cloned repositories`,onSave:l})})]})})}var db=[`ls`,`cat`,`echo`,`grep`,`git log`,`git status`,`pwd`,`which`,`node -e`,`head`,`tail`,`wc`,`file`,`stat`,`find`,`type`,`env`,`printenv`];function fb({send:e,isOpen:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)({filesChanged:0,insertions:0,deletions:0,truncated:!1}),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(`all`),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),m=(0,v.useRef)(c),h=(0,v.useRef)(t),g=(0,v.useRef)(null);(0,v.useEffect)(()=>{m.current=c},[c]),(0,v.useEffect)(()=>{h.current=t},[t]);let _=(0,v.useCallback)(()=>{h.current&&(d(!0),p(null),e({type:`get_diff`,scope:m.current}))},[e]),y=(0,v.useCallback)(t=>{l(t),m.current=t,h.current&&(d(!0),p(null),e({type:`get_diff`,scope:t}))},[e]),b=(0,v.useCallback)((t,n)=>{d(!0),e({type:`discard_changes`,scope:m.current,paths:t,statuses:n})},[e]),x=(0,v.useCallback)(e=>{e.type===`diff_result`?(r(e.files),a(e.summary),s(e.branch),l(e.scope),m.current=e.scope,d(!1),p(null)):e.type===`diff_error`&&(p(e.message),d(!1))},[]),S=(0,v.useCallback)(()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{g.current=null,_()},500)},[_]),C=(0,v.useCallback)((e,t)=>{if(h.current){if(e===`Edit`||e===`Write`){S();return}if(e===`Bash`&&t){let e=t.trim().toLowerCase();if(db.some(t=>e.startsWith(t)))return}e===`Bash`&&S()}},[S]),w=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{t&&!w.current&&e({type:`get_diff`,scope:m.current}),w.current=t},[t,e]),(0,v.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]),{files:n,summary:i,branch:o,scope:c,loading:u,error:f,refresh:_,changeScope:y,discard:b,handleMessage:x,handleToolDone:C}}var pb={all:`Uncommitted changes`,staged:`Staged`,unstaged:`Unstaged`};function mb({branch:e,scope:t,summary:n,loading:r,hasUntrackedFiles:i,onScopeChange:a,onRefresh:o,onDiscardAll:s}){let[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1);return(0,U.jsxs)(`div`,{className:`sticky top-0 z-10 bg-neutral-10 border-b border-neutral-9 px-3 py-2 flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-neutral-4 shrink-0`,children:[(0,U.jsx)(jt,{size:13}),(0,U.jsx)(`span`,{className:`truncate max-w-[120px]`,title:e,children:e})]}),(0,U.jsxs)(`div`,{className:`relative flex-1`,children:[(0,U.jsxs)(`button`,{className:`flex items-center gap-1 text-xs text-neutral-2 bg-neutral-10 hover:bg-neutral-9 rounded px-2 py-1`,onClick:()=>l(!c),children:[(0,U.jsx)(`span`,{children:pb[t]}),n.filesChanged>0&&(0,U.jsxs)(`span`,{className:`text-neutral-5`,children:[`(`,n.filesChanged,`)`]}),(0,U.jsx)(ht,{size:12})]}),c&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-10`,onClick:()=>l(!1)}),(0,U.jsx)(`div`,{className:`absolute top-full left-0 mt-1 bg-neutral-10 border border-neutral-8 rounded shadow-lg z-20 min-w-[160px]`,children:[`all`,`staged`,`unstaged`].map(e=>(0,U.jsx)(`button`,{className:`block w-full text-left px-3 py-1.5 text-xs hover:bg-neutral-9 ${e===t?`text-primary-5`:`text-neutral-2`}`,onClick:()=>{a(e),l(!1)},children:pb[e]},e))})]})]}),(0,U.jsx)(`button`,{className:`p-1 rounded hover:bg-neutral-9 text-neutral-4 hover:text-neutral-2 ${r?`animate-spin`:``}`,onClick:o,title:`Refresh diff`,disabled:r,children:(0,U.jsx)(qt,{size:14})}),(0,U.jsx)(`button`,{className:`p-1 rounded text-xs ${n.filesChanged===0?`text-neutral-7 cursor-not-allowed`:u?`text-error-4 bg-error-950/30 hover:bg-error-950/50`:`text-error-5 hover:bg-error-950/30`}`,onClick:()=>{if(!u){d(!0),setTimeout(()=>d(!1),3e3);return}s(),d(!1)},disabled:n.filesChanged===0,title:u?i?`Click again — untracked files will be deleted!`:`Click again to confirm discard all`:`Discard all changes`,children:(0,U.jsx)(an,{size:14})})]}),n.filesChanged>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-neutral-4`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n.truncated&&(0,U.jsx)(`span`,{className:`text-warning-5`,title:n.truncationReason,children:`truncated`}),(0,U.jsxs)(`span`,{children:[n.filesChanged,` file`,n.filesChanged===1?``:`s`,` changed`]})]}),(0,U.jsxs)(`span`,{className:`text-success-5`,children:[`+`,n.insertions]}),(0,U.jsxs)(`span`,{className:`text-error-5`,children:[`−`,n.deletions]})]})]})}var hb={modified:{label:`M`,color:`text-warning-5 bg-warning-950/40`},added:{label:`A`,color:`text-success-5 bg-success-950/40`},deleted:{label:`D`,color:`text-error-5 bg-error-950/40`},renamed:{label:`R`,color:`text-accent-5 bg-accent-950/40`}};function gb({files:e,activeFile:t,onSelectFile:n}){return e.length===0?null:(0,U.jsx)(`div`,{className:`flex flex-col text-xs`,children:e.map(e=>{let r=hb[e.status],i=e.path===t,a=e.status===`renamed`&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,U.jsxs)(`button`,{className:`flex items-center gap-2 px-3 py-1.5 text-left hover:bg-neutral-10 transition-colors ${i?`bg-neutral-10 text-neutral-1`:`text-neutral-3`}`,onClick:()=>n(e.path),children:[(0,U.jsx)(`span`,{className:`inline-flex items-center justify-center w-4 h-4 rounded text-[10px] font-bold shrink-0 ${r.color}`,children:r.label}),(0,U.jsx)(`span`,{className:`font-mono truncate flex-1`,title:a,children:a}),!e.isBinary&&(e.additions>0||e.deletions>0)&&(0,U.jsxs)(`span`,{className:`whitespace-nowrap shrink-0`,children:[e.additions>0&&(0,U.jsxs)(`span`,{className:`text-success-5`,children:[`+`,e.additions]}),e.additions>0&&e.deletions>0&&` `,e.deletions>0&&(0,U.jsxs)(`span`,{className:`text-error-5`,children:[`−`,e.deletions]})]}),e.isBinary&&(0,U.jsx)(`span`,{className:`text-neutral-6 italic shrink-0`,children:`binary`})]},e.path)})})}function _b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_b(Object(n),!0).forEach((function(t){yb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yb(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bb(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xb(e,t){return Cb(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||Tb(e,t)||Db()}function Sb(e){return function(e){if(Array.isArray(e))return Eb(e)}(e)||wb(e)||Tb(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
113
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Cb(e){if(Array.isArray(e))return e}function wb(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Tb(e,t){if(e){if(typeof e==`string`)return Eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eb(e,t):void 0}}function Eb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Db(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ob(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Tb(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
115
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}var kb=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Ab(e,t){return e(t={exports:{}},t.exports),t.exports}var jb=Ab((function(e){(function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var a=typeof i;if(a===`string`||a===`number`)e.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&e.push(o)}}else if(a===`object`){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes(`[native code]`)){e.push(i.toString());continue}for(var s in i)t.call(i,s)&&i[s]&&e.push(s)}}}return e.join(` `)}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),Mb={hunkClassName:``,lineClassName:``,gutterClassName:``,codeClassName:``,monotonous:!1,gutterType:`default`,viewType:`split`,widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},Nb=(0,v.createContext)(Mb),Pb=Nb.Provider,Fb=function(){return(0,v.useContext)(Nb)};Ab((function(e,t){(function(t){function n(e){var t=e.slice(11),n=null,r=null;switch(t.indexOf(`"`)){case-1:n=(o=t.split(` `))[0].slice(2),r=o[1].slice(2);break;case 0:var i=t.indexOf(`"`,2);n=t.slice(3,i);var a=t.indexOf(`"`,i+1);r=a<0?t.slice(i+4):t.slice(a+3,-1);break;default:var o;n=(o=t.split(` `))[0].slice(2),r=o[1].slice(3,-1)}return{oldPath:n,newPath:r}}e.exports={parse:function(e){for(var t,r,i,a,o,s=[],c=2,l=e.split(`
|
|
116
|
-
`),u=l.length,d=0;d<u;){var f=l[d];if(f.indexOf(`diff --git`)===0){t={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(o=n(f)).oldPath,newPath:o.newPath},s.push(t);var p,m=null;simiLoop:for(;p=l[++d];){var h=p.indexOf(` `),g=h>-1?p.slice(0,h):g;switch(g){case`diff`:d--;break simiLoop;case`deleted`:case`new`:var _=p.slice(h+1);_.indexOf(`file mode`)===0&&(t[g===`new`?`newMode`:`oldMode`]=_.slice(10));break;case`similarity`:t.similarity=parseInt(p.split(` `)[2],10);break;case`index`:var v=p.slice(h+1).split(` `),y=v[0].split(`..`);t.oldRevision=y[0],t.newRevision=y[1],v[1]&&(t.oldMode=t.newMode=v[1]);break;case`copy`:case`rename`:var b=p.slice(h+1);b.indexOf(`from`)===0?t.oldPath=b.slice(5):t.newPath=b.slice(3),m=g;break;case`---`:var x=p.slice(h+1),S=l[++d].slice(4);x===`/dev/null`?(S=S.slice(2),m=`add`):S===`/dev/null`?(x=x.slice(2),m=`delete`):(m=`modify`,x=x.slice(2),S=S.slice(2)),x&&(t.oldPath=x),S&&(t.newPath=S),c=5;break simiLoop}}t.type=m||`modify`}else if(f.indexOf(`Binary`)===0)t.isBinary=!0,t.type=f.indexOf(`/dev/null and`)>=0?`add`:f.indexOf(`and /dev/null`)>=0?`delete`:`modify`,c=2,t=null;else if(c===5)if(f.indexOf(`@@`)===0){var C=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(f);r={content:f,oldStart:C[1]-0,newStart:C[4]-0,oldLines:C[3]-0||1,newLines:C[6]-0||1,changes:[]},t.hunks.push(r),i=r.oldStart,a=r.newStart}else{var w=f.slice(0,1),T={content:f.slice(1)};switch(w){case`+`:T.type=`insert`,T.isInsert=!0,T.lineNumber=a,a++;break;case`-`:T.type=`delete`,T.isDelete=!0,T.lineNumber=i,i++;break;case` `:T.type=`normal`,T.isNormal=!0,T.oldLineNumber=i,T.newLineNumber=a,i++,a++;break;case`\\`:var E=r.changes[r.changes.length-1];E.isDelete||(t.newEndingNewLine=!1),E.isInsert||(t.oldEndingNewLine=!1)}T.type&&r.changes.push(T)}d++}return s}}})()}));function Ib(e){return e.type===`insert`}function Lb(e){return e.type===`delete`}function Rb(e){return e.type===`normal`}function zb(e){return e[0]}function Bb(e){return e[e.length-1]}function Vb(e){return[`${e}Start`,`${e}Lines`]}function Hb(e){return e===`old`?function(e){return Ib(e)?-1:Rb(e)?e.oldLineNumber:e.lineNumber}:function(e){return Lb(e)?-1:Rb(e)?e.newLineNumber:e.lineNumber}}function Ub(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r<a}}function Wb(e,t){return function(n,r,i){var a=n[e]+n[t],o=r[e];return i>=a&&i<o}}function Gb(e){var t=Hb(e),n=function(e){var t=xb(Vb(e),2),n=Ub(t[0],t[1]);return function(e,t){return e.find((function(e){return n(e,t)}))}}(e);return function(e,r){var i=n(e,r);if(i)return i.changes.find((function(e){return t(e)===r}))}}function Kb(e){var t=e===`old`?`new`:`old`,n=xb(Vb(e),2),r=n[0],i=n[1],a=xb(Vb(t),2),o=a[0],s=a[1],c=Hb(e),l=Hb(t),u=Ub(r,i),d=Wb(r,i);return function(e,t){var n=zb(e);if(t<n[r]){var a=n[r]-t;return n[o]-a}var f=Bb(e);if(f[r]+f[i]<=t){var p=t-f[r]-f[i];return f[o]+f[s]+p}for(var m=0;m<e.length;m++){var h=e[m],g=e[m+1];if(u(h,t)){var _=h.changes.findIndex((function(e){return c(e)===t})),v=h.changes[_];if(Rb(v))return l(v);var y=Lb(v)?_+1:_-1,b=h.changes[y];if(!b)return-1;var x=Ib(v)?`delete`:`insert`;return b.type===x?l(b):-1}if(d(h,g,t)){var S=t-h[r]-h[i];return h[o]+h[s]+S}}throw Error(`Unexpected line position ${t}`)}}var qb=function(){this.__data__=[],this.size=0},Jb=function(e,t){return e===t||e!=e&&t!=t},Yb=function(e,t){for(var n=e.length;n--;)if(Jb(e[n][0],t))return n;return-1},Xb=Array.prototype.splice,Zb=function(e){var t=this.__data__,n=Yb(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xb.call(t,n,1),--this.size,!0)},Qb=function(e){var t=this.__data__,n=Yb(t,e);return n<0?void 0:t[n][1]},$b=function(e){return Yb(this.__data__,e)>-1},ex=function(e,t){var n=this.__data__,r=Yb(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function tx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tx.prototype.clear=qb,tx.prototype.delete=Zb,tx.prototype.get=Qb,tx.prototype.has=$b,tx.prototype.set=ex;var nx=tx,rx=function(){this.__data__=new nx,this.size=0},ix=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ax=function(e){return this.__data__.get(e)},ox=function(e){return this.__data__.has(e)},sx=typeof kb==`object`&&kb&&kb.Object===Object&&kb,cx=typeof self==`object`&&self&&self.Object===Object&&self,lx=sx||cx||Function(`return this`)(),ux=lx.Symbol,dx=Object.prototype,fx=dx.hasOwnProperty,px=dx.toString,mx=ux?ux.toStringTag:void 0,hx=function(e){var t=fx.call(e,mx),n=e[mx];try{e[mx]=void 0;var r=!0}catch{}var i=px.call(e);return r&&(t?e[mx]=n:delete e[mx]),i},gx=Object.prototype.toString,_x=function(e){return gx.call(e)},vx=ux?ux.toStringTag:void 0,yx=function(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:vx&&vx in Object(e)?hx(e):_x(e)},bx=function(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)},xx=function(e){if(!bx(e))return!1;var t=yx(e);return t==`[object Function]`||t==`[object GeneratorFunction]`||t==`[object AsyncFunction]`||t==`[object Proxy]`},Sx=lx[`__core-js_shared__`],Cx=function(){var e=/[^.]+$/.exec(Sx&&Sx.keys&&Sx.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),wx=function(e){return!!Cx&&Cx in e},Tx=Function.prototype.toString,Ex=function(e){if(e!=null){try{return Tx.call(e)}catch{}try{return e+``}catch{}}return``},Dx=/^\[object .+?Constructor\]$/,Ox=Function.prototype,kx=Object.prototype,Ax=Ox.toString,jx=kx.hasOwnProperty,Mx=RegExp(`^`+Ax.call(jx).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Nx=function(e){return!(!bx(e)||wx(e))&&(xx(e)?Mx:Dx).test(Ex(e))},Px=function(e,t){return e?.[t]},Fx=function(e,t){var n=Px(e,t);return Nx(n)?n:void 0},Ix=Fx(lx,`Map`),Lx=Fx(Object,`create`),Rx=function(){this.__data__=Lx?Lx(null):{},this.size=0},zx=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bx=Object.prototype.hasOwnProperty,Vx=function(e){var t=this.__data__;if(Lx){var n=t[e];return n===`__lodash_hash_undefined__`?void 0:n}return Bx.call(t,e)?t[e]:void 0},Hx=Object.prototype.hasOwnProperty,Ux=function(e){var t=this.__data__;return Lx?t[e]!==void 0:Hx.call(t,e)},Wx=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Lx&&t===void 0?`__lodash_hash_undefined__`:t,this};function Gx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gx.prototype.clear=Rx,Gx.prototype.delete=zx,Gx.prototype.get=Vx,Gx.prototype.has=Ux,Gx.prototype.set=Wx;var Kx=Gx,qx=function(){this.size=0,this.__data__={hash:new Kx,map:new(Ix||nx),string:new Kx}},Jx=function(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null},Yx=function(e,t){var n=e.__data__;return Jx(t)?n[typeof t==`string`?`string`:`hash`]:n.map},Xx=function(e){var t=Yx(this,e).delete(e);return this.size-=t?1:0,t},Zx=function(e){return Yx(this,e).get(e)},Qx=function(e){return Yx(this,e).has(e)},$x=function(e,t){var n=Yx(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function eS(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}eS.prototype.clear=qx,eS.prototype.delete=Xx,eS.prototype.get=Zx,eS.prototype.has=Qx,eS.prototype.set=$x;var tS=eS,nS=function(e,t){var n=this.__data__;if(n instanceof nx){var r=n.__data__;if(!Ix||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new tS(r)}return n.set(e,t),this.size=n.size,this};function rS(e){this.size=(this.__data__=new nx(e)).size}rS.prototype.clear=rx,rS.prototype.delete=ix,rS.prototype.get=ax,rS.prototype.has=ox,rS.prototype.set=nS;var iS=rS,aS=function(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this},oS=function(e){return this.__data__.has(e)};function sS(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new tS;++t<n;)this.add(e[t])}sS.prototype.add=sS.prototype.push=aS,sS.prototype.has=oS;var cS=sS,lS=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},uS=function(e,t){return e.has(t)},dS=function(e,t,n,r,i,a){var o=1&n,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=2&n?new cS:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!lS(t,(function(e,t){if(!uS(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(m!==h&&!i(m,h,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f},fS=lx.Uint8Array,pS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},mS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},hS=ux?ux.prototype:void 0,gS=hS?hS.valueOf:void 0,_S=function(e,t,n,r,i,a,o){switch(n){case`[object DataView]`:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case`[object ArrayBuffer]`:return!(e.byteLength!=t.byteLength||!a(new fS(e),new fS(t)));case`[object Boolean]`:case`[object Date]`:case`[object Number]`:return Jb(+e,+t);case`[object Error]`:return e.name==t.name&&e.message==t.message;case`[object RegExp]`:case`[object String]`:return e==t+``;case`[object Map]`:var s=pS;case`[object Set]`:var c=1&r;if(s||=mS,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=dS(s(e),s(t),r,i,a,o);return o.delete(e),u;case`[object Symbol]`:if(gS)return gS.call(e)==gS.call(t)}return!1},vS=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},yS=Array.isArray,bS=function(e,t,n){var r=t(e);return yS(e)?r:vS(r,n(e))},xS=function(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a},SS=function(){return[]},CS=Object.prototype.propertyIsEnumerable,wS=Object.getOwnPropertySymbols,TS=wS?function(e){return e==null?[]:(e=Object(e),xS(wS(e),(function(t){return CS.call(e,t)})))}:SS,ES=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},DS=function(e){return typeof e==`object`&&!!e},OS=function(e){return DS(e)&&yx(e)==`[object Arguments]`},kS=Object.prototype,AS=kS.hasOwnProperty,jS=kS.propertyIsEnumerable,MS=OS(function(){return arguments}())?OS:function(e){return DS(e)&&AS.call(e,`callee`)&&!jS.call(e,`callee`)},NS=function(){return!1},PS=Ab((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n?lx.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||NS})),FS=/^(?:0|[1-9]\d*)$/,IS=function(e,t){var n=typeof e;return!!(t??=9007199254740991)&&(n==`number`||n!=`symbol`&&FS.test(e))&&e>-1&&e%1==0&&e<t},LS=function(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991},RS={};RS[`[object Float32Array]`]=RS[`[object Float64Array]`]=RS[`[object Int8Array]`]=RS[`[object Int16Array]`]=RS[`[object Int32Array]`]=RS[`[object Uint8Array]`]=RS[`[object Uint8ClampedArray]`]=RS[`[object Uint16Array]`]=RS[`[object Uint32Array]`]=!0,RS[`[object Arguments]`]=RS[`[object Array]`]=RS[`[object ArrayBuffer]`]=RS[`[object Boolean]`]=RS[`[object DataView]`]=RS[`[object Date]`]=RS[`[object Error]`]=RS[`[object Function]`]=RS[`[object Map]`]=RS[`[object Number]`]=RS[`[object Object]`]=RS[`[object RegExp]`]=RS[`[object Set]`]=RS[`[object String]`]=RS[`[object WeakMap]`]=!1;var zS=function(e){return DS(e)&&LS(e.length)&&!!RS[yx(e)]},BS=function(e){return function(t){return e(t)}},VS=Ab((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&sx.process;e.exports=function(){try{return r&&r.require&&r.require(`util`).types||i&&i.binding&&i.binding(`util`)}catch{}}()})),HS=VS&&VS.isTypedArray,US=HS?BS(HS):zS,WS=Object.prototype.hasOwnProperty,GS=function(e,t){var n=yS(e),r=!n&&MS(e),i=!n&&!r&&PS(e),a=!n&&!r&&!i&&US(e),o=n||r||i||a,s=o?ES(e.length,String):[],c=s.length;for(var l in e)!t&&!WS.call(e,l)||o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||IS(l,c))||s.push(l);return s},KS=Object.prototype,qS=function(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||KS)},JS=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),YS=Object.prototype.hasOwnProperty,XS=function(e){if(!qS(e))return JS(e);var t=[];for(var n in Object(e))YS.call(e,n)&&n!=`constructor`&&t.push(n);return t},ZS=function(e){return e!=null&&LS(e.length)&&!xx(e)},QS=function(e){return ZS(e)?GS(e):XS(e)},$S=function(e){return bS(e,QS,TS)},eC=Object.prototype.hasOwnProperty,tC=function(e,t,n,r,i,a){var o=1&n,s=$S(e),c=s.length;if(c!=$S(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:eC.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){var h=e[u=s[l]],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v==y||!(`constructor`in e)||!(`constructor`in t)||typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y||(p=!1)}return a.delete(e),a.delete(t),p},nC=Fx(lx,`DataView`),rC=Fx(lx,`Promise`),iC=Fx(lx,`Set`),aC=Fx(lx,`WeakMap`),oC=Ex(nC),sC=Ex(Ix),cC=Ex(rC),lC=Ex(iC),uC=Ex(aC),dC=yx;(nC&&dC(new nC(new ArrayBuffer(1)))!=`[object DataView]`||Ix&&dC(new Ix)!=`[object Map]`||rC&&dC(rC.resolve())!=`[object Promise]`||iC&&dC(new iC)!=`[object Set]`||aC&&dC(new aC)!=`[object WeakMap]`)&&(dC=function(e){var t=yx(e),n=t==`[object Object]`?e.constructor:void 0,r=n?Ex(n):``;if(r)switch(r){case oC:return`[object DataView]`;case sC:return`[object Map]`;case cC:return`[object Promise]`;case lC:return`[object Set]`;case uC:return`[object WeakMap]`}return t});var fC=dC,pC=`[object Object]`,mC=Object.prototype.hasOwnProperty,hC=function(e,t,n,r,i,a){var o=yS(e),s=yS(t),c=o?`[object Array]`:fC(e),l=s?`[object Array]`:fC(t),u=(c=c==`[object Arguments]`?pC:c)==pC,d=(l=l==`[object Arguments]`?pC:l)==pC,f=c==l;if(f&&PS(e)){if(!PS(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new iS,o||US(e)?dS(e,t,n,r,i,a):_S(e,t,c,n,r,i,a);if(!(1&n)){var p=u&&mC.call(e,`__wrapped__`),m=d&&mC.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new iS,i(h,g,n,r,a)}}return!!f&&(a||=new iS,tC(e,t,n,r,i,a))},gC=function e(t,n,r,i,a){return t===n||(t==null||n==null||!DS(t)&&!DS(n)?t!=t&&n!=n:hC(t,n,r,i,e,a))},_C=function(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new iS;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?gC(u,l,3,r,d):f))return!1}}return!0},vC=function(e){return e==e&&!bx(e)},yC=function(e){for(var t=QS(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,vC(i)]}return t},bC=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},xC=function(e){var t=yC(e);return t.length==1&&t[0][2]?bC(t[0][0],t[0][1]):function(n){return n===e||_C(n,e,t)}},SC=function(e){return typeof e==`symbol`||DS(e)&&yx(e)==`[object Symbol]`},CC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wC=/^\w*$/,TC=function(e,t){if(yS(e))return!1;var n=typeof e;return!(n!=`number`&&n!=`symbol`&&n!=`boolean`&&e!=null&&!SC(e))||wC.test(e)||!CC.test(e)||t!=null&&e in Object(t)};function EC(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(EC.Cache||tS),n}EC.Cache=tS;var DC=EC,OC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kC=/\\(\\)?/g,AC=function(e){var t=DC(e,(function(e){return n.size===500&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(OC,(function(e,n,r,i){t.push(r?i.replace(kC,`$1`):n||e)})),t})),jC=function(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},MC=ux?ux.prototype:void 0,NC=MC?MC.toString:void 0,PC=function e(t){if(typeof t==`string`)return t;if(yS(t))return jC(t,e)+``;if(SC(t))return NC?NC.call(t):``;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n},FC=function(e){return e==null?``:PC(e)},IC=function(e,t){return yS(e)?e:TC(e,t)?[e]:AC(FC(e))},LC=function(e){if(typeof e==`string`||SC(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t},RC=function(e,t){for(var n=0,r=(t=IC(t,e)).length;e!=null&&n<r;)e=e[LC(t[n++])];return n&&n==r?e:void 0},zC=function(e,t,n){var r=e==null?void 0:RC(e,t);return r===void 0?n:r},BC=function(e,t){return e!=null&&t in Object(e)},VC=function(e,t,n){for(var r=-1,i=(t=IC(t,e)).length,a=!1;++r<i;){var o=LC(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=e==null?0:e.length)&&LS(i)&&IS(o,i)&&(yS(e)||MS(e))},HC=function(e,t){return e!=null&&VC(e,t,BC)},UC=function(e,t){return TC(e)&&vC(t)?bC(LC(e),t):function(n){var r=zC(n,e);return r===void 0&&r===t?HC(n,e):gC(t,r,3)}},WC=function(e){return e},GC=function(e){return function(t){return t?.[e]}},KC=function(e){return function(t){return RC(t,e)}},qC=function(e){return TC(e)?GC(LC(e)):KC(e)},JC=function(e){return typeof e==`function`?e:e==null?WC:typeof e==`object`?yS(e)?UC(e[0],e[1]):xC(e):qC(e)};function YC(e){if(!e)throw Error(`change is not provided`);return Rb(e)?`N${e.oldLineNumber}`:`${Ib(e)?`I`:`D`}${e.lineNumber}`}Kb(`old`);var XC=Hb(`old`),ZC=Hb(`new`);Gb(`old`),Gb(`new`),Kb(`new`),Kb(`old`);var QC=function(){try{var e=Fx(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),$C=function(e,t,n){t==`__proto__`&&QC?QC(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ew=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(!1===n(a[c],c,a))break}return t}}(),tw=function(e,t){return e&&ew(e,t,QS)},nw=function(e,t){var n={};return t=JC(t),tw(e,(function(e,r,i){$C(n,r,t(e,r,i))})),n},rw=[`changeKey`,`text`,`tokens`,`renderToken`],iw=function e(t,n){var r=t.type,i=t.value,a=t.markType,o=t.properties,s=t.className,c=t.children,l=function(t){return(0,U.jsx)(`span`,{className:t,children:i||c&&c.map(e)},n)};switch(r){case`text`:return i;case`mark`:return l(`diff-code-mark diff-code-mark-${a}`);case`edit`:return l(`diff-code-edit`);default:var u=o&&o.className;return l(jb(s||u))}};function aw(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=xb(e,1)[0];return t.type===`text`&&!t.value}return!0}function ow(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=bb(e,rw),o=i?function(e,t){return i(e,iw,t)}:iw;return(0,U.jsx)(`td`,vb(vb({},a),{},{"data-change-key":t,children:r?aw(r)?` `:r.map(o):n||` `}))}var sw=(0,v.memo)(ow);function cw(e,t){return function(){var n=t===`old`?XC(e):ZC(e);return n===-1?void 0:n}}function lw(e,t){return function(n){return e&&n?(0,U.jsx)(`a`,{href:t?`#`+t:void 0,children:n}):n}}function uw(e,t){return t?function(n){e(),t(n)}:e}function dw(e,t,n,r){return(0,v.useMemo)((function(){var i=nw(e,(function(e){return function(n){return e&&e(t,n)}}));return i.onMouseEnter=uw(n,i.onMouseEnter),i.onMouseLeave=uw(r,i.onMouseLeave),i}),[e,n,r,t])}function fw(e,t,n,r,i,a,o,s,c){var l={change:t,side:r,inHoverState:s,renderDefault:cw(t,r),wrapInAnchor:lw(i,a)};return(0,U.jsx)(`td`,vb(vb({className:e},o),{},{"data-change-key":n,children:c(l)}))}function pw(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,s=e.className,c=e.generateLineClassName,l=e.gutterClassName,u=e.codeClassName,d=e.gutterEvents,f=e.codeEvents,p=e.hideGutter,m=e.gutterAnchor,h=e.generateAnchorID,g=e.renderToken,_=e.renderGutter,y=i.type,b=i.content,x=YC(i),S=xb((t=xb((0,v.useState)(!1),2),n=t[0],r=t[1],[n,(0,v.useCallback)((function(){return r(!0)}),[]),(0,v.useCallback)((function(){return r(!1)}),[])]),3),C=S[0],w=S[1],T=S[2],E=(0,v.useMemo)((function(){return{change:i}}),[i]),D=dw(d,E,w,T),O=dw(f,E,w,T),k=h(i),A=c({changes:[i],defaultGenerate:function(){return s}}),j=jb(`diff-gutter`,`diff-gutter-${y}`,l,{"diff-gutter-selected":a}),M=jb(`diff-code`,`diff-code-${y}`,u,{"diff-code-selected":a});return(0,U.jsxs)(`tr`,{id:k,className:jb(`diff-line`,A),children:[!p&&fw(j,i,x,`old`,m,k,D,C,_),!p&&fw(j,i,x,`new`,m,k,D,C,_),(0,U.jsx)(sw,vb({className:M,changeKey:x,text:b,tokens:o,renderToken:g},O))]})}var mw=(0,v.memo)(pw);function hw(e){var t=e.hideGutter,n=e.element;return(0,U.jsx)(`tr`,{className:`diff-widget`,children:(0,U.jsx)(`td`,{colSpan:t?1:3,className:`diff-widget-content`,children:n})})}var gw=[`hideGutter`,`selectedChanges`,`tokens`,`lineClassName`],_w=[`hunk`,`widgets`,`className`];function vw(e){var t=e.hunk,n=e.widgets,r=e.className,i=bb(e,_w),a=function(e,t){return e.reduce((function(e,n){var r=YC(n);e.push([`change`,r,n]);var i=t[r];return i&&e.push([`widget`,r,i]),e}),[])}(t.changes,n);return(0,U.jsx)(`tbody`,{className:jb(`diff-hunk`,r),children:a.map((function(e){return function(e,t){var n=xb(e,3),r=n[0],i=n[1],a=n[2],o=t.hideGutter,s=t.selectedChanges,c=t.tokens,l=t.lineClassName,u=bb(t,gw);if(r===`change`){var d=Lb(a)?`old`:`new`,f=Lb(a)?XC(a):ZC(a),p=c?c[d][f-1]:null;return(0,U.jsx)(mw,vb({className:l,change:a,hideGutter:o,selected:s.includes(i),tokens:p},u),`change${i}`)}return r===`widget`?(0,U.jsx)(hw,{hideGutter:o,element:a},`widget${i}`):null}(e,i)}))})}var yw=0;function bw(e,t,n,r){var i=(0,v.useCallback)((function(){return t(e)}),[e,t]),a=(0,v.useCallback)((function(){return t(``)}),[t]);return(0,v.useMemo)((function(){var t=nw(r,(function(t){return function(r){return t&&t({side:e,change:n},r)}}));return t.onMouseEnter=uw(i,t.onMouseEnter),t.onMouseLeave=uw(a,t.onMouseLeave),t}),[n,r,i,e,a])}function xw(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,s=e.gutterEvents,c=e.codeEvents,l=e.anchorID,u=e.gutterAnchor,d=e.gutterAnchorTarget,f=e.hideGutter,p=e.hover,m=e.renderToken,h=e.renderGutter;if(!t){var g=jb(`diff-gutter`,`diff-gutter-omit`,a),_=jb(`diff-code`,`diff-code-omit`,o);return[!f&&(0,U.jsx)(`td`,{className:g},`gutter`),(0,U.jsx)(`td`,{className:_},`code`)]}var v=t.type,y=t.content,b=YC(t),x=n===yw?`old`:`new`,S=vb({id:l||void 0,className:jb(`diff-gutter`,`diff-gutter-${v}`,yb({"diff-gutter-selected":r},`diff-line-hover-`+x,p),a),children:h({change:t,side:x,inHoverState:p,renderDefault:cw(t,x),wrapInAnchor:lw(u,d)})},s),C=jb(`diff-code`,`diff-code-${v}`,yb({"diff-code-selected":r},`diff-line-hover-`+x,p),o);return[!f&&(0,U.jsx)(`td`,vb(vb({},S),{},{"data-change-key":b}),`gutter`),(0,U.jsx)(sw,vb({className:C,changeKey:b,text:y,tokens:i,renderToken:m},c),`code`)]}function Sw(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,s=e.newTokens,c=e.monotonous,l=e.gutterClassName,u=e.codeClassName,d=e.gutterEvents,f=e.codeEvents,p=e.hideGutter,m=e.generateAnchorID,h=e.generateLineClassName,g=e.gutterAnchor,_=e.renderToken,y=e.renderGutter,b=xb((0,v.useState)(``),2),x=b[0],S=b[1],C=bw(`old`,S,n,d),w=bw(`new`,S,r,d),T=bw(`old`,S,n,f),E=bw(`new`,S,r,f),D=n&&m(n),O=r&&m(r),k=h({changes:[n,r],defaultGenerate:function(){return t}}),A={monotonous:c,hideGutter:p,gutterClassName:l,codeClassName:u,gutterEvents:d,codeEvents:f,renderToken:_,renderGutter:y},j=vb(vb({},A),{},{change:n,side:yw,selected:i,tokens:o,gutterEvents:C,codeEvents:T,anchorID:D,gutterAnchor:g,gutterAnchorTarget:D,hover:x===`old`}),M=vb(vb({},A),{},{change:r,side:1,selected:a,tokens:s,gutterEvents:w,codeEvents:E,anchorID:n===r?null:O,gutterAnchor:g,gutterAnchorTarget:n===r?D:O,hover:x===`new`});return c?(0,U.jsx)(`tr`,{className:jb(`diff-line`,k),children:xw(n?j:M)}):(0,U.jsxs)(`tr`,{className:jb(`diff-line`,function(e,t){return e&&!t?`diff-line-old-only`:!e&&t?`diff-line-new-only`:e===t?`diff-line-normal`:`diff-line-compare`}(n,r),k),children:[xw(j),xw(M)]})}var Cw=(0,v.memo)(Sw);function ww(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?(0,U.jsx)(`tr`,{className:`diff-widget`,children:(0,U.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:n||r})}):n===r?(0,U.jsx)(`tr`,{className:`diff-widget`,children:(0,U.jsx)(`td`,{colSpan:t?2:4,className:`diff-widget-content`,children:n})}):(0,U.jsxs)(`tr`,{className:`diff-widget`,children:[(0,U.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:n}),(0,U.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:r})]})}var Tw=[`selectedChanges`,`monotonous`,`hideGutter`,`tokens`,`lineClassName`],Ew=[`hunk`,`widgets`,`className`];function Dw(e,t){return(e?YC(e):`00`)+(t?YC(t):`00`)}function Ow(e){var t=e.hunk,n=e.widgets,r=e.className,i=bb(e,Ew),a=function(e,t){for(var n=function(e){return e&&t[YC(e)]||null},r=[],i=0;i<e.length;i++){var a=e[i];if(Rb(a))r.push([`change`,Dw(a,a),a,a]);else if(Lb(a)){var o=e[i+1];o&&Ib(o)?(i+=1,r.push([`change`,Dw(a,o),a,o])):r.push([`change`,Dw(a,null),a,null])}else r.push([`change`,Dw(null,a),null,a]);var s=r[r.length-1],c=n(s[2]),l=n(s[3]);if(c||l){var u=s[1];r.push([`widget`,u,c,l])}}return r}(t.changes,n);return(0,U.jsx)(`tbody`,{className:jb(`diff-hunk`,r),children:a.map((function(e){return function(e,t){var n=xb(e,4),r=n[0],i=n[1],a=n[2],o=n[3],s=t.selectedChanges,c=t.monotonous,l=t.hideGutter,u=t.tokens,d=t.lineClassName,f=bb(t,Tw);return r===`change`?(0,U.jsx)(Cw,vb({className:d,oldChange:a,newChange:o,monotonous:c,hideGutter:l,oldSelected:!!a&&s.includes(YC(a)),newSelected:!!o&&s.includes(YC(o)),oldTokens:a&&u?u.old[XC(a)-1]:null,newTokens:o&&u?u.new[ZC(o)-1]:null},f),`change${i}`):r===`widget`?(0,U.jsx)(ww,{monotonous:c,hideGutter:l,oldElement:a,newElement:o},`widget${i}`):null}(e,i)}))})}var kw=[`gutterType`,`hunkClassName`];function Aw(e){var t=e.hunk,n=Fb(),r=n.gutterType,i=n.hunkClassName,a=bb(n,kw),o=r===`none`,s=r===`anchor`;return(0,U.jsx)(a.viewType===`unified`?vw:Ow,vb(vb({},a),{},{hunk:t,hideGutter:o,gutterAnchor:s,className:i}))}function jw(){}function Mw(e,t){var n=t?`auto`:`none`;e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function Nw(e){return e.map((function(e){return(0,U.jsx)(Aw,{hunk:e},function(e){return`-${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines}`}(e))}))}function Pw(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,i=e.className,a=e.hunkClassName,o=a===void 0?Mb.hunkClassName:a,s=e.lineClassName,c=s===void 0?Mb.lineClassName:s,l=e.generateLineClassName,u=l===void 0?Mb.generateLineClassName:l,d=e.gutterClassName,f=d===void 0?Mb.gutterClassName:d,p=e.codeClassName,m=p===void 0?Mb.codeClassName:p,h=e.gutterType,g=h===void 0?Mb.gutterType:h,_=e.viewType,y=_===void 0?Mb.viewType:_,b=e.gutterEvents,x=b===void 0?Mb.gutterEvents:b,S=e.codeEvents,C=S===void 0?Mb.codeEvents:S,w=e.generateAnchorID,T=w===void 0?Mb.generateAnchorID:w,E=e.selectedChanges,D=E===void 0?Mb.selectedChanges:E,O=e.widgets,k=O===void 0?Mb.widgets:O,A=e.renderGutter,j=A===void 0?Mb.renderGutter:A,M=e.tokens,N=e.renderToken,P=e.children,F=P===void 0?Nw:P,I=(0,v.useRef)(null),L=(0,v.useCallback)((function(e){var t=e.target;if(e.button===0){var n=function(e,t){for(var n=e;n&&n!==document.documentElement&&!n.classList.contains(t);)n=n.parentElement;return n===document.documentElement?null:n}(t,`diff-code`);if(n&&n.parentElement){var r=window.getSelection();r&&r.removeAllRanges();var i=Sb(n.parentElement.children).indexOf(n);if(i===1||i===3){var a,o=Ob(I.current?I.current.querySelectorAll(`.diff-line`):[]);try{for(o.s();!(a=o.n()).done;){var s=a.value.children;Mw(s[1],i===1),Mw(s[3],i===3)}}catch(e){o.e(e)}finally{o.f()}}}}}),[]),ee=g===`none`,R=t===`add`||t===`delete`,te=y===`split`&&!R&&r?L:jw,z=(0,v.useMemo)((function(){return(0,U.jsxs)(`colgroup`,y===`unified`?{children:[!ee&&(0,U.jsx)(`col`,{className:`diff-gutter-col`}),!ee&&(0,U.jsx)(`col`,{className:`diff-gutter-col`}),(0,U.jsx)(`col`,{})]}:R?{children:[!ee&&(0,U.jsx)(`col`,{className:`diff-gutter-col`}),(0,U.jsx)(`col`,{})]}:{children:[!ee&&(0,U.jsx)(`col`,{className:`diff-gutter-col`}),(0,U.jsx)(`col`,{}),!ee&&(0,U.jsx)(`col`,{className:`diff-gutter-col`}),(0,U.jsx)(`col`,{})]})}),[y,R,ee]);return(0,U.jsx)(Pb,{value:(0,v.useMemo)((function(){return{hunkClassName:o,lineClassName:c,generateLineClassName:u,gutterClassName:f,codeClassName:m,monotonous:R,hideGutter:ee,viewType:y,gutterType:g,codeEvents:C,gutterEvents:x,generateAnchorID:T,selectedChanges:D,widgets:k,renderGutter:j,tokens:M,renderToken:N}}),[m,C,T,f,x,g,ee,o,c,u,R,j,N,D,M,y,k]),children:(0,U.jsxs)(`table`,{ref:I,className:jb(`diff`,`diff-${y}`,i),onMouseDown:te,children:[z,F(n)]})})}var Fw=(0,v.memo)(Pw);(function(e,t){return function(n,r){if(n==null)return n;if(!ZS(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}})(tw),ux&&ux.isConcatSpreadable;var Iw=Ab((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var a=i;if(e==null||n==null)throw Error(`Null input. (diff_main)`);if(e==n)return e?[new t.Diff(0,e)]:[];r===void 0&&(r=!0);var o=r,s=this.diff_commonPrefix(e,n),c=e.substring(0,s);e=e.substring(s),n=n.substring(s),s=this.diff_commonSuffix(e,n);var l=e.substring(e.length-s);e=e.substring(0,e.length-s),n=n.substring(0,n.length-s);var u=this.diff_compute_(e,n,o,a);return c&&u.unshift(new t.Diff(0,c)),l&&u.push(new t.Diff(0,l)),this.diff_cleanupMerge(u),u},t.prototype.diff_compute_=function(e,n,r,i){var a;if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var o=e.length>n.length?e:n,s=e.length>n.length?n:e,c=o.indexOf(s);if(c!=-1)return a=[new t.Diff(1,o.substring(0,c)),new t.Diff(0,s),new t.Diff(1,o.substring(c+s.length))],e.length>n.length&&(a[0][0]=a[2][0]=-1),a;if(s.length==1)return[new t.Diff(-1,e),new t.Diff(1,n)];var l=this.diff_halfMatch_(e,n);if(l){var u=l[0],d=l[1],f=l[2],p=l[3],m=l[4],h=this.diff_main(u,f,r,i),g=this.diff_main(d,p,r,i);return h.concat([new t.Diff(0,m)],g)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,i):this.diff_bisect_(e,n,i)},t.prototype.diff_lineMode_=function(e,n,r){var i=this.diff_linesToChars_(e,n);e=i.chars1,n=i.chars2;var a=i.lineArray,o=this.diff_main(e,n,!1,r);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,``));for(var s=0,c=0,l=0,u=``,d=``;s<o.length;){switch(o[s][0]){case 1:l++,d+=o[s][1];break;case-1:c++,u+=o[s][1];break;case 0:if(c>=1&&l>=1){o.splice(s-c-l,c+l),s=s-c-l;for(var f=this.diff_main(u,d,!1,r),p=f.length-1;p>=0;p--)o.splice(s,0,f[p]);s+=f.length}l=0,c=0,u=``,d=``}s++}return o.pop(),o},t.prototype.diff_bisect_=function(e,n,r){for(var i=e.length,a=n.length,o=Math.ceil((i+a)/2),s=o,c=2*o,l=Array(c),u=Array(c),d=0;d<c;d++)l[d]=-1,u[d]=-1;l[s+1]=0,u[s+1]=0;for(var f=i-a,p=f%2!=0,m=0,h=0,g=0,_=0,v=0;v<o&&!(new Date().getTime()>r);v++){for(var y=-v+m;y<=v-h;y+=2){for(var b=s+y,x=(E=y==-v||y!=v&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1)-y;E<i&&x<a&&e.charAt(E)==n.charAt(x);)E++,x++;if(l[b]=E,E>i)h+=2;else if(x>a)m+=2;else if(p&&(w=s+f-y)>=0&&w<c&&u[w]!=-1&&E>=(C=i-u[w]))return this.diff_bisectSplit_(e,n,E,x,r)}for(var S=-v+g;S<=v-_;S+=2){for(var C,w=s+S,T=(C=S==-v||S!=v&&u[w-1]<u[w+1]?u[w+1]:u[w-1]+1)-S;C<i&&T<a&&e.charAt(i-C-1)==n.charAt(a-T-1);)C++,T++;if(u[w]=C,C>i)_+=2;else if(T>a)g+=2;else if(!p&&(b=s+f-S)>=0&&b<c&&l[b]!=-1){var E;if(x=s+(E=l[b])-b,E>=(C=i-C))return this.diff_bisectSplit_(e,n,E,x,r)}}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){(o=e.indexOf(`
|
|
117
|
-
`,i))==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}n[0]=``;var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,c!=0&&e.substring(i-o)!=t.substring(0,o)||(a=o,o++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var i=this;function a(e,t,n){for(var r,a,o,s,c=e.substring(n,n+Math.floor(e.length/4)),l=-1,u=``;(l=t.indexOf(c,l+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(l)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,l));u.length<f+d&&(u=t.substring(l-f,l)+t.substring(l,l+d),r=e.substring(0,n-f),a=e.substring(n+d),o=t.substring(0,l-f),s=t.substring(l+d))}return 2*u.length>=e.length?[r,a,o,s,u]:null}var o,s,c,l,u,d=a(n,r,Math.ceil(n.length/4)),f=a(n,r,Math.ceil(n.length/2));return d||f?(o=f?d&&d[4].length>f[4].length?d:f:d,e.length>t.length?(s=o[0],c=o[1],l=o[2],u=o[3]):(l=o[0],u=o[1],s=o[2],c=o[3]),[s,c,l,u,o[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],i=0,a=null,o=0,s=0,c=0,l=0,u=0;o<e.length;)e[o][0]==0?(r[i++]=o,s=l,c=u,l=0,u=0,a=e[o][1]):(e[o][0]==1?l+=e[o][1].length:u+=e[o][1].length,a&&a.length<=Math.max(s,c)&&a.length<=Math.max(l,u)&&(e.splice(r[i-1],0,new t.Diff(-1,a)),e[r[i-1]+1][0]=1,i--,o=--i>0?r[i-1]:-1,s=0,c=0,l=0,u=0,a=null,n=!0)),o++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o<e.length;){if(e[o-1][0]==-1&&e[o][0]==1){var d=e[o-1][1],f=e[o][1],p=this.diff_commonOverlap_(d,f),m=this.diff_commonOverlap_(f,d);p>=m?(p>=d.length/2||p>=f.length/2)&&(e.splice(o,0,new t.Diff(0,f.substring(0,p))),e[o-1][1]=d.substring(0,d.length-p),e[o+1][1]=f.substring(p),o++):(m>=d.length/2||m>=f.length/2)&&(e.splice(o,0,new t.Diff(0,d.substring(0,m))),e[o-1][0]=1,e[o-1][1]=f.substring(0,f.length-m),e[o+1][0]=-1,e[o+1][1]=d.substring(m),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),a=r.match(t.nonAlphaNumericRegex_),o=i.match(t.nonAlphaNumericRegex_),s=a&&r.match(t.whitespaceRegex_),c=o&&i.match(t.whitespaceRegex_),l=s&&r.match(t.linebreakRegex_),u=c&&i.match(t.linebreakRegex_),d=l&&e.match(t.blanklineEndRegex_),f=u&&n.match(t.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==0&&e[r+1][0]==0){var i=e[r-1][1],a=e[r][1],o=e[r+1][1],s=this.diff_commonSuffix(i,a);if(s){var c=a.substring(a.length-s);i=i.substring(0,i.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=i,u=a,d=o,f=n(i,a)+n(a,o);a.charAt(0)===o.charAt(0);){i+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var p=n(i,a)+n(a,o);p>=f&&(f=p,l=i,u=a,d=o)}e[r-1][1]!=l&&(l?e[r-1][1]=l:(e.splice(r-1,1),r--),e[r][1]=u,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var n=!1,r=[],i=0,a=null,o=0,s=!1,c=!1,l=!1,u=!1;o<e.length;)e[o][0]==0?(e[o][1].length<this.Diff_EditCost&&(l||u)?(r[i++]=o,s=l,c=u,a=e[o][1]):(i=0,a=null),l=u=!1):(e[o][0]==-1?u=!0:l=!0,a&&(s&&c&&l&&u||a.length<this.Diff_EditCost/2&&s+c+l+u==3)&&(e.splice(r[i-1],0,new t.Diff(-1,a)),e[r[i-1]+1][0]=1,i--,a=null,s&&c?(l=u=!0,i=0):(o=--i>0?r[i-1]:-1,l=u=!1),n=!0)),o++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,``));for(var n,r=0,i=0,a=0,o=``,s=``;r<e.length;)switch(e[r][0]){case 1:a++,s+=e[r][1],r++;break;case-1:i++,o+=e[r][1],r++;break;case 0:i+a>1?(i!==0&&a!==0&&((n=this.diff_commonPrefix(s,o))!==0&&(r-i-a>0&&e[r-i-a-1][0]==0?e[r-i-a-1][1]+=s.substring(0,n):(e.splice(0,0,new t.Diff(0,s.substring(0,n))),r++),s=s.substring(n),o=o.substring(n)),(n=this.diff_commonSuffix(s,o))!==0&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),o=o.substring(0,o.length-n))),r-=i+a,e.splice(r,i+a),o.length&&(e.splice(r,0,new t.Diff(-1,o)),r++),s.length&&(e.splice(r,0,new t.Diff(1,s)),r++),r++):r!==0&&e[r-1][0]==0?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,a=0,i=0,o=``,s=``}e[e.length-1][1]===``&&e.pop();var c=!1;for(r=1;r<e.length-1;)e[r-1][0]==0&&e[r+1][0]==0&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),c=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),c=!0)),r++;c&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,i=0,a=0,o=0;for(n=0;n<e.length&&(e[n][0]!==1&&(r+=e[n][1].length),e[n][0]!==-1&&(i+=e[n][1].length),!(r>t));n++)a=r,o=i;return e.length!=n&&e[n][0]===-1?o:o+(t-a)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,i=/>/g,a=/\n/g,o=0;o<e.length;o++){var s=e[o][0],c=e[o][1].replace(n,`&`).replace(r,`<`).replace(i,`>`).replace(a,`¶<br>`);switch(s){case 1:t[o]=`<ins style="background:#e6ffe6;">`+c+`</ins>`;break;case-1:t[o]=`<del style="background:#ffe6e6;">`+c+`</del>`;break;case 0:t[o]=`<span>`+c+`</span>`}}return t.join(``)},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==1&&(t[n]=e[n][1]);return t.join(``)},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==-1&&(t[n]=e[n][1]);return t.join(``)},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=e[i][0],o=e[i][1];switch(a){case 1:n+=o.length;break;case-1:r+=o.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+=Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]=`+`+encodeURI(e[n][1]);break;case-1:t[n]=`-`+e[n][1].length;break;case 0:t[n]=`=`+e[n][1].length}return t.join(` `).replace(/%20/g,` `)},t.prototype.diff_fromDelta=function(e,n){for(var r=[],i=0,a=0,o=n.split(/\t/g),s=0;s<o.length;s++){var c=o[s].substring(1);switch(o[s].charAt(0)){case`+`:try{r[i++]=new t.Diff(1,decodeURI(c))}catch{throw Error(`Illegal escape in diff_fromDelta: `+c)}break;case`-`:case`=`:var l=parseInt(c,10);if(isNaN(l)||l<0)throw Error(`Invalid number in diff_fromDelta: `+c);var u=e.substring(a,a+=l);o[s].charAt(0)==`=`?r[i++]=new t.Diff(0,u):r[i++]=new t.Diff(-1,u);break;default:if(o[s])throw Error(`Invalid diff operation in diff_fromDelta: `+o[s])}}if(a!=e.length)throw Error(`Delta length (`+a+`) does not equal source text length (`+e.length+`).`);return r},t.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),(s=e.lastIndexOf(t,n+t.length))!=-1&&(o=Math.min(a(0,s),o)));var c,l,u=1<<t.length-1;s=-1;for(var d,f=t.length+e.length,p=0;p<t.length;p++){for(c=0,l=f;c<l;)a(p,n+l)<=o?c=l:f=l,l=Math.floor((f-c)/2+c);f=l;var m=Math.max(1,n-l+1),h=Math.min(n+l,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(g[_]=p===0?(g[_+1]<<1|1)&v:(g[_+1]<<1|1)&v|(d[_+1]|d[_])<<1|1|d[_+1],g[_]&u){var y=a(p,_-1);if(y<=o){if(o=y,!((s=_-1)>n))break;m=Math.max(1,2*n-s)}}}if(a(p+1,n)>o)break;d=g}return s},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(n.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=n.substring(e.start2,e.start2+e.length1),i=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=n.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var a=n.substring(e.start2-i,e.start2);a&&e.diffs.unshift(new t.Diff(0,a));var o=n.substring(e.start2+e.length1,e.start2+e.length1+i);o&&e.diffs.push(new t.Diff(0,o)),e.start1-=a.length,e.start2-=a.length,e.length1+=a.length+o.length,e.length2+=a.length+o.length}},t.prototype.patch_make=function(e,n,r){var i,a;if(typeof e==`string`&&typeof n==`string`&&r===void 0)i=e,(a=this.diff_main(i,n,!0)).length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(e&&typeof e==`object`&&n===void 0&&r===void 0)a=e,i=this.diff_text1(a);else if(typeof e==`string`&&n&&typeof n==`object`&&r===void 0)i=e,a=n;else{if(typeof e!=`string`||typeof n!=`string`||!r||typeof r!=`object`)throw Error(`Unknown call format to patch_make.`);i=e,a=r}if(a.length===0)return[];for(var o=[],s=new t.patch_obj,c=0,l=0,u=0,d=i,f=i,p=0;p<a.length;p++){var m=a[p][0],h=a[p][1];switch(c||m===0||(s.start1=l,s.start2=u),m){case 1:s.diffs[c++]=a[p],s.length2+=h.length,f=f.substring(0,u)+h+f.substring(u);break;case-1:s.length1+=h.length,s.diffs[c++]=a[p],f=f.substring(0,u)+f.substring(u+h.length);break;case 0:h.length<=2*this.Patch_Margin&&c&&a.length!=p+1?(s.diffs[c++]=a[p],s.length1+=h.length,s.length2+=h.length):h.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(s,d),o.push(s),s=new t.patch_obj,c=0,d=f,l=u)}m!==1&&(l+=h.length),m!==-1&&(u+=h.length)}return c&&(this.patch_addContext_(s,d),o.push(s)),o},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=new t.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new t.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,n[r]=a}return n},t.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,i=[],a=0;a<e.length;a++){var o,s,c=e[a].start2+r,l=this.diff_text1(e[a].diffs),u=-1;if(l.length>this.Match_MaxBits?(o=this.match_main(t,l.substring(0,this.Match_MaxBits),c))!=-1&&((u=this.match_main(t,l.substring(l.length-this.Match_MaxBits),c+l.length-this.Match_MaxBits))==-1||o>=u)&&(o=-1):o=this.match_main(t,l,c),o==-1)i[a]=!1,r-=e[a].length2-e[a].length1;else if(i[a]=!0,r=o-c,l==(s=u==-1?t.substring(o,o+l.length):t.substring(o,u+this.Match_MaxBits)))t=t.substring(0,o)+this.diff_text2(e[a].diffs)+t.substring(o+l.length);else{var d=this.diff_main(l,s,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(d)/l.length>this.Patch_DeleteThreshold)i[a]=!1;else{this.diff_cleanupSemanticLossless(d);for(var f,p=0,m=0;m<e[a].diffs.length;m++){var h=e[a].diffs[m];h[0]!==0&&(f=this.diff_xIndex(d,p)),h[0]===1?t=t.substring(0,o+f)+h[1]+t.substring(o+f):h[0]===-1&&(t=t.substring(0,o+f)+t.substring(o+this.diff_xIndex(d,p+h[1].length))),h[0]!==-1&&(p+=h[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),i]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r=``,i=1;i<=n;i++)r+=String.fromCharCode(i);for(i=0;i<e.length;i++)e[i].start1+=n,e[i].start2+=n;var a=e[0],o=a.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new t.Diff(0,r)),a.start1-=n,a.start2-=n,a.length1+=n,a.length2+=n;else if(n>o[0][1].length){var s=n-o[0][1].length;o[0][1]=r.substring(o[0][1].length)+o[0][1],a.start1-=s,a.start2-=s,a.length1+=s,a.length2+=s}return(o=(a=e[e.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,r)),a.length1+=n,a.length2+=n):n>o[o.length-1][1].length&&(s=n-o[o.length-1][1].length,o[o.length-1][1]+=r.substring(0,s),a.length1+=s,a.length2+=s),r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var i=e[r];e.splice(r--,1);for(var a=i.start1,o=i.start2,s=``;i.diffs.length!==0;){var c=new t.patch_obj,l=!0;for(c.start1=a-s.length,c.start2=o-s.length,s!==``&&(c.length1=c.length2=s.length,c.diffs.push(new t.Diff(0,s)));i.diffs.length!==0&&c.length1<n-this.Patch_Margin;){var u=i.diffs[0][0],d=i.diffs[0][1];u===1?(c.length2+=d.length,o+=d.length,c.diffs.push(i.diffs.shift()),l=!1):u===-1&&c.diffs.length==1&&c.diffs[0][0]==0&&d.length>2*n?(c.length1+=d.length,a+=d.length,l=!1,c.diffs.push(new t.Diff(u,d)),i.diffs.shift()):(d=d.substring(0,n-c.length1-this.Patch_Margin),c.length1+=d.length,a+=d.length,u===0?(c.length2+=d.length,o+=d.length):l=!1,c.diffs.push(new t.Diff(u,d)),d==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(d.length))}s=(s=this.diff_text2(c.diffs)).substring(s.length-this.Patch_Margin);var f=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);f!==``&&(c.length1+=f.length,c.length2+=f.length,c.diffs.length!==0&&c.diffs[c.diffs.length-1][0]===0?c.diffs[c.diffs.length-1][1]+=f:c.diffs.push(new t.Diff(0,f))),l||e.splice(++r,0,c)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split(`
|
|
118
|
-
`),i=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<r.length;){var o=r[i].match(a);if(!o)throw Error(`Invalid patch string: `+r[i]);var s=new t.patch_obj;for(n.push(s),s.start1=parseInt(o[1],10),o[2]===``?(s.start1--,s.length1=1):o[2]==`0`?s.length1=0:(s.start1--,s.length1=parseInt(o[2],10)),s.start2=parseInt(o[3],10),o[4]===``?(s.start2--,s.length2=1):o[4]==`0`?s.length2=0:(s.start2--,s.length2=parseInt(o[4],10)),i++;i<r.length;){var c=r[i].charAt(0);try{var l=decodeURI(r[i].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+l)}if(c==`-`)s.diffs.push(new t.Diff(-1,l));else if(c==`+`)s.diffs.push(new t.Diff(1,l));else if(c==` `)s.diffs.push(new t.Diff(0,l));else{if(c==`@`)break;if(c!==``)throw Error(`Invalid patch mode "`+c+`" in: `+l)}i++}}return n},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=[`@@ -`+(this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1)+` +`+(this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2)+` @@
|
|
119
|
-
`],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e=`+`;break;case-1:e=`-`;break;case 0:e=` `}t[n+1]=e+encodeURI(this.diffs[n][1])+`
|
|
120
|
-
`}return t.join(``).replace(/%20/g,` `)},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0}));Iw.DIFF_EQUAL,Iw.DIFF_DELETE,Iw.DIFF_INSERT;function Lw(e){return e.map(e=>{let t=e.lines.map(e=>e.type===`add`?{type:`insert`,isInsert:!0,lineNumber:e.newLineNo??0,content:e.content}:e.type===`delete`?{type:`delete`,isDelete:!0,lineNumber:e.oldLineNo??0,content:e.content}:{type:`normal`,isNormal:!0,oldLineNumber:e.oldLineNo??0,newLineNumber:e.newLineNo??0,content:e.content});return{content:e.header,oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart,newLines:e.newLines,changes:t}})}function Rw({hunks:e}){return e.length===0?null:(0,U.jsx)(`div`,{className:`diff-hunk-view text-xs font-mono overflow-x-auto`,children:(0,U.jsx)(Fw,{viewType:`unified`,diffType:`modify`,hunks:Lw(e),children:e=>e.map((e,t)=>(0,U.jsx)(Aw,{hunk:e},`${e.oldStart}:${e.newStart}:${t}`))})})}var zw=300;function Bw({file:e,isActive:t,onDiscard:n,onScrollRef:r}){let i=e.additions+e.deletions,a=i>zw,[o,s]=(0,v.useState)(!a),[c,l]=(0,v.useState)(!1),u=e.status===`renamed`&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,U.jsxs)(`div`,{ref:r,className:`border rounded-lg overflow-hidden ${t?`border-primary-6`:`border-neutral-9`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 bg-neutral-9 cursor-pointer select-none`,onClick:()=>s(!o),children:[o?(0,U.jsx)(ht,{size:14,className:`text-neutral-5 shrink-0`}):(0,U.jsx)(_t,{size:14,className:`text-neutral-5 shrink-0`}),(0,U.jsx)(`span`,{className:`font-mono text-xs text-neutral-2 truncate flex-1`,title:u,children:u}),!e.isBinary&&(0,U.jsxs)(`span`,{className:`text-xs whitespace-nowrap`,children:[e.additions>0&&(0,U.jsxs)(`span`,{className:`text-success-5`,children:[`+`,e.additions]}),e.additions>0&&e.deletions>0&&(0,U.jsx)(`span`,{className:`text-neutral-5 mx-0.5`,children:` `}),e.deletions>0&&(0,U.jsxs)(`span`,{className:`text-error-5`,children:[`−`,e.deletions]})]}),e.isBinary&&(0,U.jsx)(`span`,{className:`text-xs text-neutral-5 italic`,children:`binary`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 ml-1`,onClick:e=>e.stopPropagation(),children:[(0,U.jsx)(`button`,{className:`p-1 rounded hover:bg-neutral-8 text-neutral-4 hover:text-neutral-2`,onClick:()=>{navigator.clipboard.writeText(e.path)},title:`Copy path`,children:(0,U.jsx)(St,{size:13})}),(0,U.jsx)(`button`,{className:`p-1 rounded hover:bg-error-950/50 ${c?`text-error-5`:`text-neutral-4 hover:text-error-5`}`,onClick:()=>{if(!c){l(!0),setTimeout(()=>l(!1),3e3);return}n(e.path,e.status),l(!1)},title:c?`Click again to confirm`:`Discard file changes`,children:(0,U.jsx)(an,{size:13})})]})]}),o&&(0,U.jsx)(`div`,{className:`border-t border-neutral-9`,children:e.isBinary?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-neutral-5 text-xs italic`,children:[(0,U.jsx)(Ot,{size:14}),`Binary file`]}):a&&e.hunks.length>0?(0,U.jsx)(`div`,{className:`px-4 py-3`,children:(0,U.jsx)(Rw,{hunks:e.hunks})}):e.hunks.length>0?(0,U.jsx)(`div`,{className:`px-0`,children:(0,U.jsx)(Rw,{hunks:e.hunks})}):(0,U.jsx)(`div`,{className:`px-4 py-3 text-neutral-5 text-xs italic`,children:`No changes`})}),!o&&a&&(0,U.jsxs)(`div`,{className:`border-t border-neutral-9 px-4 py-2 text-xs text-neutral-5 italic cursor-pointer hover:text-neutral-3`,onClick:()=>s(!0),children:[`Large diff (`,i,` lines) — click to expand`]})]})}var Vw=280,Hw=1200,Uw=400,Ww=`codekin-diff-panel-width`;function Gw({isOpen:e,onClose:t,send:n,onHandleMessage:r,onHandleToolDone:i}){let[a,o]=(0,v.useState)(()=>{let e=localStorage.getItem(Ww);return e?Math.max(Vw,Math.min(Hw,Number(e))):Uw}),s=fb({send:n,isOpen:e}),c=(0,v.useRef)(new Map),[l,u]=(0,v.useState)(null),d=(0,v.useRef)(!1),f=(0,v.useRef)(0),p=(0,v.useRef)(0);(0,v.useEffect)(()=>{r(s.handleMessage)},[s.handleMessage,r]),(0,v.useEffect)(()=>{i(s.handleToolDone)},[s.handleToolDone,i]),(0,v.useEffect)(()=>{localStorage.setItem(Ww,String(a))},[a]);let m=(0,v.useCallback)(e=>{e.preventDefault(),d.current=!0,f.current=e.clientX,p.current=a;let t=e=>{if(!d.current)return;let t=f.current-e.clientX;o(Math.max(Vw,Math.min(Hw,p.current+t)))},n=()=>{d.current=!1,document.body.style.cursor=``,document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,n)};document.body.style.cursor=`col-resize`,document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,n)},[a]),h=(0,v.useCallback)(e=>{u(e);let t=c.current.get(e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`})},[]),g=(0,v.useCallback)((e,t)=>{s.discard([e],{[e]:t})},[s]),_=(0,v.useCallback)(()=>{s.discard()},[s]);if((0,v.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`keydown`,n)}},[e,t]),!e)return null;let y=s.files.some(e=>e.status===`added`);return(0,U.jsxs)(`div`,{className:`relative flex flex-col h-full bg-neutral-12 border-l border-neutral-9 overflow-hidden transition-[width] duration-150`,style:{width:a,minWidth:Vw,maxWidth:Hw},children:[(0,U.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary-6/40 z-20`,onMouseDown:m}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-neutral-9 shrink-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s.summary.filesChanged>0&&(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-success-5`}),(0,U.jsx)(`span`,{className:`text-sm font-medium text-neutral-2`,children:`Changes`})]}),(0,U.jsx)(`button`,{className:`p-1 rounded hover:bg-neutral-9 text-neutral-4 hover:text-neutral-2`,onClick:t,title:`Close diff panel`,children:(0,U.jsx)(sn,{size:14})})]}),(0,U.jsx)(mb,{branch:s.branch,scope:s.scope,summary:s.summary,loading:s.loading,hasUntrackedFiles:y,onScopeChange:s.changeScope,onRefresh:s.refresh,onDiscardAll:_}),s.error&&(0,U.jsx)(`div`,{className:`px-3 py-2 text-xs text-error-5 bg-error-950/20`,children:s.error}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:[s.files.length>0&&(0,U.jsx)(`div`,{className:`border-b border-neutral-9`,children:(0,U.jsx)(gb,{files:s.files,activeFile:l,onSelectFile:h})}),(0,U.jsxs)(`div`,{className:`px-2 py-2 flex flex-col gap-2`,children:[s.files.length===0&&!s.loading&&!s.error&&(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-neutral-6`,children:[(0,U.jsx)(Et,{size:32,className:`mb-2 opacity-50`}),(0,U.jsx)(`span`,{className:`text-xs`,children:`No changes detected`})]}),s.summary.truncated&&(0,U.jsx)(`div`,{className:`px-3 py-2 text-xs text-warning-5 bg-warning-950/20 rounded`,children:`Diff truncated — showing partial results`}),s.files.map(e=>(0,U.jsx)(Bw,{file:e,isActive:e.path===l,onDiscard:g,onScrollRef:t=>{t?c.current.set(e.path,t):c.current.delete(e.path)}},e.path))]})]})]})}function Kw({label:e,value:t,icon:n}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-lg bg-neutral-11 px-3 py-2 min-w-[120px]`,children:[(0,U.jsx)(`div`,{className:`text-neutral-5`,children:n}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[18px] font-semibold text-neutral-2 leading-tight`,children:t}),(0,U.jsx)(`div`,{className:`text-[12px] text-neutral-5 leading-tight`,children:e})]})]})}function qw({token:e,onOrchestratorSessionReady:t,sessionJoined:n,agentName:r}){let[i,a]=(0,v.useState)(`loading`),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(`Joe`),f=r??u,p=(0,v.useCallback)(async()=>{if(e)try{let t=await fetch(`/cc/api/orchestrator/dashboard`,{headers:{Authorization:`Bearer ${e}`}});t.ok&&l((await t.json()).stats)}catch{}},[e]);return(0,v.useEffect)(()=>{if(!e)return;let n=!1;async function r(){try{let r=await R(e);if(n)return;r.agentName&&d(r.agentName),a(`active`),t(r.sessionId),p()}catch(e){if(n)return;s(e instanceof Error?e.message:`Failed to start orchestrator`),a(`error`)}}return r(),()=>{n=!0}},[e]),(0,v.useEffect)(()=>{if(i!==`active`||!e)return;let t=setInterval(()=>void p(),3e4);return()=>clearInterval(t)},[i,e,p]),i===`loading`?(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3 text-neutral-4`,children:[(0,U.jsx)(Jt,{size:20,stroke:2}),(0,U.jsxs)(`span`,{className:`text-[15px]`,children:[`Starting Agent `,f,`...`]})]})}):i===`error`?(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,U.jsxs)(`div`,{className:`text-center`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-error-5 mb-2`,children:[(0,U.jsx)(Jt,{size:20,stroke:2}),(0,U.jsxs)(`span`,{className:`text-[15px] font-medium`,children:[`Failed to start Agent `,f]})]}),(0,U.jsx)(`p`,{className:`text-[14px] text-neutral-5`,children:o})]})}):n?(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2.5 border-b border-neutral-10 bg-neutral-12`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-neutral-2`,children:[(0,U.jsx)(Jt,{size:18,stroke:2,className:`text-accent-5`}),(0,U.jsxs)(`span`,{className:`text-[15px] font-medium`,children:[`Agent `,f]})]}),c&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[c.managedRepos>0&&(0,U.jsx)(Kw,{label:`repos`,value:c.managedRepos,icon:(0,U.jsx)(At,{size:15})}),c.pendingNotifications>0&&(0,U.jsx)(Kw,{label:`pending`,value:c.pendingNotifications,icon:(0,U.jsx)(ut,{size:15})}),c.activeChildSessions>0&&(0,U.jsx)(Kw,{label:`sessions`,value:c.activeChildSessions,icon:(0,U.jsx)(nn,{size:15})})]})]}):null}function Jw({tasks:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(0),o=(0,v.useRef)(!1),s=(0,v.useRef)(0),c=(0,v.useRef)(new Map),l=e.filter(e=>e.status===`completed`).length,u=e.length>0&&l===e.length;return(0,v.useEffect)(()=>{e.length>a.current&&(n(!0),i(!1)),a.current=e.length},[e.length]),(0,v.useEffect)(()=>{!u&&e.length>0&&(o.current=!0)},[e,u]),(0,v.useEffect)(()=>{if(u){let e=o.current?1e4:0,t=setTimeout(()=>{i(!0)},e);return()=>{clearTimeout(t)}}i(!1)},[u]),(0,v.useEffect)(()=>{if(l>s.current&&!u){let t=e.find(e=>e.status!==`completed`);t&&c.current.get(t.id)?.scrollIntoView({behavior:`smooth`,block:`nearest`})}s.current=l},[l,u,e]),e.length===0||r?null:t?(0,U.jsxs)(`div`,{className:`absolute top-14 right-3 z-20 w-64 rounded-lg bg-neutral-9/90 backdrop-blur border border-neutral-8/60 shadow-lg`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-neutral-8/40`,children:[(0,U.jsxs)(`span`,{className:`text-[13px] font-semibold text-neutral-1 uppercase tracking-wider flex items-center gap-1.5`,children:[!u&&(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse`}),`Tasks`,(0,U.jsxs)(`span`,{className:`text-[13px] font-medium ml-1 ${u?`text-success-5`:`text-neutral-5`}`,children:[l,`/`,e.length]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,U.jsx)(`button`,{onClick:()=>{n(!1)},className:`rounded p-0.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/60 transition-colors`,title:`Collapse`,children:(0,U.jsx)(vt,{size:14})}),(0,U.jsx)(`button`,{onClick:()=>{i(!0)},className:`rounded p-0.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/60 transition-colors`,title:`Dismiss`,children:(0,U.jsx)(sn,{size:14})})]})]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-1 px-3 py-2 max-h-[50vh] overflow-y-auto`,children:e.map(e=>(0,U.jsxs)(`div`,{ref:t=>{t?c.current.set(e.id,t):c.current.delete(e.id)},className:`flex items-start gap-2 text-[15px]`,children:[e.status===`completed`?(0,U.jsx)(`span`,{className:`flex-shrink-0 text-success-5 text-[13px] mt-[3px]`,children:`✓`}):e.status===`in_progress`?(0,U.jsx)(`span`,{className:`inline-block h-2 w-2 mt-[7px] rounded-full bg-primary-5 animate-pulse flex-shrink-0`}):(0,U.jsx)(`span`,{className:`inline-block h-2 w-2 mt-[7px] rounded-full border border-neutral-5 flex-shrink-0`}),(0,U.jsx)(`span`,{className:e.status===`completed`?`text-neutral-4 line-through`:`text-neutral-2`,children:e.status===`in_progress`&&e.activeForm?e.activeForm:e.subject})]},e.id))})]}):(0,U.jsx)(`div`,{className:`absolute top-14 right-3 z-20`,children:(0,U.jsxs)(`button`,{onClick:()=>{n(!0)},className:`flex items-center gap-1.5 rounded-lg bg-neutral-9/90 backdrop-blur border border-neutral-8/60 px-2.5 py-1.5 shadow-lg hover:bg-neutral-8/90 transition-colors`,children:[!u&&(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse`}),(0,U.jsxs)(`span`,{className:`text-[13px] font-semibold text-neutral-2`,children:[l,`/`,e.length]}),(0,U.jsx)(ht,{size:14,className:`text-neutral-4`})]})})}function Yw({options:e,question:t,multiSelect:n,promptType:r,questions:i,approvePattern:a,onSelect:o,isMobile:s=!1}){let c=r===`permission`,l=r===`question`,u=s?`px-4 py-2.5 text-[16px] min-h-[34px]`:l?`px-4 py-1.5 text-[15px]`:`px-3 py-0.5 text-[13px]`,[d,f]=(0,v.useState)(15),p=i&&i.length>1,[m,h]=(0,v.useState)(0),[g,_]=(0,v.useState)({}),[y,b]=(0,v.useState)(new Set),x=p?i[m]:null,S=x?x.question:t,C=x?x.options:e,w=x?x.multiSelect:n,T=(0,v.useCallback)(e=>{if(!p||!x){o(e);return}let t={...g,[x.question]:e};m+1<i.length?(_(t),h(m+1),b(new Set)):o(JSON.stringify(t))},[p,x,g,m,i,o]),E=(0,v.useRef)(T);E.current=T,(0,v.useEffect)(()=>{if(!c||!e.find(e=>e.value===`allow`)||!e.some(e=>e.value===`always_allow`))return;let t=15,n=setInterval(()=>{t--,f(t),t<=0&&(clearInterval(n),E.current(`allow`))},1e3);return()=>{clearInterval(n)}},[c,e]);let D=(0,v.useCallback)(e=>{let t=e.join(`, `);if(!p||!x){o(e);return}let n={...g,[x.question]:t};m+1<i.length?(_(n),h(m+1),b(new Set)):o(JSON.stringify(n))},[p,x,g,m,i,o]),O=p?`(${m+1}/${i.length})`:null;if(w){let e=e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,U.jsxs)(`div`,{className:`border-t ${l?`px-4 py-3`:`px-3 py-2`} ${c?`border-warning-9/50 bg-warning-11/30`:`border-neutral-10 bg-neutral-11`}`,children:[S&&(0,U.jsxs)(`p`,{className:`${l?`text-[15px] mb-2`:`text-[13px] mb-1.5`} ${c?`text-warning-4`:`text-neutral-3`}`,children:[O&&(0,U.jsx)(`span`,{className:`text-neutral-5 mr-1`,children:O}),S]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center ${s?`gap-2.5`:l?`gap-2`:`gap-1.5`}`,children:[C.map(t=>(0,U.jsx)(`button`,{onClick:()=>{e(t.value)},title:t.description,className:`rounded-full border ${u} transition-colors ${y.has(t.value)?`border-primary-6 bg-primary-9 text-primary-3`:`border-neutral-8 bg-neutral-10 text-neutral-2 hover:border-primary-7 hover:bg-neutral-9 hover:text-neutral-1`}`,children:t.label},t.value)),y.size>0&&(0,U.jsxs)(`button`,{onClick:()=>{D(Array.from(y)),b(new Set)},className:`rounded-full border border-primary-7 bg-primary-9 ${u} text-primary-3 hover:bg-primary-8 transition-colors`,children:[`Confirm (`,y.size,`)`]})]})]})}return(0,U.jsxs)(`div`,{className:`border-t ${l?`px-4 py-3`:`px-3 py-2`} ${c?`border-warning-9/50 bg-warning-11/30`:`border-neutral-10 bg-neutral-11`}`,children:[S&&(0,U.jsxs)(`p`,{className:`${l?`text-[15px] mb-2`:`text-[13px] mb-1.5`} ${c?`text-warning-4`:`text-neutral-3`}`,children:[O&&(0,U.jsx)(`span`,{className:`text-neutral-5 mr-1`,children:O}),S]}),(0,U.jsx)(`div`,{className:`flex flex-wrap items-center ${l?`gap-2`:`gap-1.5`}`,children:C.map(t=>{let n=c&&t.value===`allow`,r=c&&t.value===`always_allow`,i=r?a?`Auto-approve: ${a}`:`Auto-approve this exact command`:void 0,o=c&&t.value===`deny`,s=`rounded-full border ${u} transition-colors `;return n?s+=`border-success-7 bg-success-10/50 text-success-4 hover:bg-success-9/50`:r?s+=`border-primary-7 bg-primary-10/50 text-primary-4 hover:bg-primary-9/50`:o?s+=`border-error-7 bg-error-10/50 text-error-4 hover:bg-error-9/50`:s+=`border-neutral-8 bg-neutral-10 text-neutral-2 hover:border-primary-7 hover:bg-neutral-9 hover:text-neutral-1`,(0,U.jsxs)(`button`,{onClick:()=>{T(t.value)},title:i??t.description,className:s,children:[t.label,n&&e.some(e=>e.value===`always_allow`)&&` (${d}s)`]},t.value)})})]})}function Xw(e,t,n){(0,v.useEffect)(()=>{if(!t)return;let r=t=>{e.current&&!e.current.contains(t.target)&&n()};return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[t,e,n])}function Zw({groups:e,onSelectSkill:t,onClose:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{function e(e){r.current&&!r.current.contains(e.target)&&n()}function t(e){e.key===`Escape`&&n()}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[n]);let i=e.filter(e=>e.skills.length>0);return i.length===0?null:(0,U.jsxs)(`div`,{ref:r,className:`absolute bottom-full right-0 mb-1 w-56 rounded-lg border border-neutral-6 bg-neutral-8 py-1 shadow-lg z-50`,children:[(0,U.jsx)(`div`,{className:`px-3 py-1.5 text-[13px] font-semibold text-neutral-3 border-b border-neutral-7 mb-1`,children:`Claude Skills`}),i.map((e,n)=>(0,U.jsxs)(`div`,{children:[n>0&&(0,U.jsx)(`div`,{className:`my-1 border-t border-neutral-7`}),(0,U.jsx)(`div`,{className:`px-3 py-1 text-[12px] font-medium uppercase tracking-wider text-neutral-5`,children:e.label}),e.skills.map(e=>(0,U.jsxs)(`button`,{onClick:()=>t(e.command),className:`flex w-full flex-col px-3 py-1.5 text-left hover:bg-neutral-7 transition-colors`,children:[(0,U.jsx)(`span`,{className:`text-[15px] font-medium text-accent-6`,children:e.command}),e.description&&(0,U.jsx)(`span`,{className:`text-[13px] text-neutral-4`,children:e.description})]},e.id))]},e.label))]})}var Qw={skill:{label:`skill`,className:`bg-accent-9/30 text-accent-5`},bundled:{label:`built-in`,className:`bg-primary-9/30 text-primary-5`},builtin:{label:`command`,className:`bg-neutral-8 text-neutral-4`}},$w={skill:`text-accent-6`,bundled:`text-primary-5`,builtin:`text-neutral-5`};function eT({commands:e,filter:t,onSelect:n,onClose:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(null);(0,v.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&r()}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]);let o=(0,v.useCallback)(t=>{let r=e.find(e=>e.command===t);r&&n(r)},[e,n]);return(0,U.jsx)(`div`,{ref:i,className:`absolute bottom-full left-0 mb-1 z-50 w-72`,children:(0,U.jsxs)(Zy,{className:`rounded-lg border border-neutral-10 bg-neutral-11 shadow-2xl`,label:`Slash commands`,filter:(e,t)=>{let n=t.toLowerCase();return e.toLowerCase().includes(n)?1:0},children:[(0,U.jsx)(Zy.Input,{value:t,className:`sr-only`,"aria-hidden":!0,tabIndex:-1,readOnly:!0}),(0,U.jsxs)(Zy.List,{ref:a,className:`max-h-64 overflow-y-auto p-1`,children:[(0,U.jsx)(Zy.Empty,{className:`px-3 py-4 text-center text-[13px] text-neutral-5`,children:`No matching commands.`}),e.map(e=>{let t=Qw[e.category],n=$w[e.category];return(0,U.jsxs)(Zy.Item,{value:`${e.command.slice(1)} ${e.name}`,onSelect:()=>o(e.command),className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[14px] text-neutral-3 aria-selected:bg-primary-8/20 aria-selected:text-primary-4`,children:[(0,U.jsx)(`span`,{className:`font-mono text-[13px] ${n}`,children:`/`}),(0,U.jsxs)(`span`,{className:`flex-1 truncate`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,U.jsx)(`span`,{className:`ml-1.5 text-[12px] text-neutral-5`,children:e.description})]}),(0,U.jsx)(`span`,{className:`flex-shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium ${t.className}`,children:t.label})]},e.command)})]})]})})}function tT(e){let t=[];for(let n of Array.from(e.items)){let e=n.getAsFile();e&&t.push(e)}if(t.length===0)for(let n of Array.from(e.files))t.push(n);return t}function nT({onUpload:e,disabled:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(0);return(0,v.useEffect)(()=>{if(t)return;function n(e){e.preventDefault(),i.current++,i.current===1&&r(!0)}function a(e){e.preventDefault(),i.current--,i.current===0&&r(!1)}function o(e){e.preventDefault()}function s(t){if(t.preventDefault(),i.current=0,r(!1),t.dataTransfer){let n=tT(t.dataTransfer);n.length>0&&e(n)}}return window.addEventListener(`dragenter`,n),window.addEventListener(`dragleave`,a),window.addEventListener(`dragover`,o),window.addEventListener(`drop`,s),()=>{window.removeEventListener(`dragenter`,n),window.removeEventListener(`dragleave`,a),window.removeEventListener(`dragover`,o),window.removeEventListener(`drop`,s)}},[e,t]),(0,v.useEffect)(()=>{if(t)return;function n(t){if(!t.clipboardData)return;let n=tT(t.clipboardData);n.length>0&&(t.preventDefault(),e(n))}return window.addEventListener(`paste`,n),()=>window.removeEventListener(`paste`,n)},[e,t]),!n||t?null:(0,U.jsx)(`div`,{className:`absolute inset-0 z-50 flex items-center justify-center rounded border-2 border-dashed border-primary-7 bg-primary-11/60 backdrop-blur-sm pointer-events-none`,children:(0,U.jsxs)(`div`,{className:`text-center`,children:[(0,U.jsx)(on,{className:`mx-auto mb-2 text-primary-6`,size:40,stroke:1.5}),(0,U.jsx)(`p`,{className:`text-[15px] font-medium text-primary-5`,children:`Drop files here`})]})})}var rT=[{id:`default`,label:`Ask permissions`,description:`Always ask before making changes`,icon:`shield`},{id:`acceptEdits`,label:`Auto accept edits`,description:`Automatically accept all file edits`,icon:`pencil`},{id:`plan`,label:`Plan mode`,description:`Read-only: proposes changes without applying them`,icon:`map`},{id:`bypassPermissions`,label:`Bypass permissions`,description:`Accepts all permissions without asking`,icon:`warning`,dangerous:!0},{id:`dangerouslySkipPermissions`,label:`Skip permissions`,description:`Skips all permission checks entirely — use only in sandboxed environments`,icon:`warning`,dangerous:!0}],iT={shield:Qt,pencil:Ht,map:Ft,warning:it},aT=[{id:`claude-opus-4-6`,label:`Opus 4.6`},{id:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{id:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`}];function oT(e){return aT.find(t=>t.id===e)?.label??e.replace(/^claude-/,``)}function sT({onClick:e,disabled:t,size:n=16,rounded:r=`rounded-md`,className:i=``}){return(0,U.jsx)(`button`,{onClick:e,disabled:t,className:`flex items-center justify-center ${r} p-1.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors disabled:opacity-30 ${i}`,title:`Attach files`,children:(0,U.jsx)(Vt,{size:n,stroke:2})})}function cT({onClick:e,disabled:t,hasContent:n,size:r=16,rounded:i=`rounded-md`,accent:a=!1,className:o=``}){return(0,U.jsx)(`button`,{onClick:e,disabled:t||!n,className:`flex items-center justify-center ${i} p-1.5 transition-colors disabled:opacity-30 ${n?a?`bg-accent-7 text-neutral-1 hover:bg-accent-6`:`bg-primary-8 text-neutral-1 hover:bg-primary-7`:`text-neutral-5`} ${o}`,title:`Send (Enter)`,children:(0,U.jsx)(Xt,{size:r,stroke:2})})}function lT({currentMode:e,isOpen:t,menuRef:n,onToggle:r,onSelect:i}){return(0,U.jsxs)(`div`,{className:`relative`,ref:n,children:[(0,U.jsxs)(`button`,{onClick:r,className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium transition-colors ${e===`bypassPermissions`?`text-error-5 hover:text-error-4 hover:bg-error-9/30`:`text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7`}`,title:`Permission mode`,children:[(()=>{let t=iT[rT.find(t=>t.id===e)?.icon??`shield`];return(0,U.jsx)(t,{size:14,stroke:2})})(),(0,U.jsx)(`span`,{className:`hidden lg:inline`,children:rT.find(t=>t.id===e)?.label??e}),(0,U.jsx)(ht,{size:12,stroke:2})]}),t&&(0,U.jsx)(`div`,{className:`absolute bottom-full mb-1 left-0 z-50 min-w-[260px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1`,children:rT.map(t=>{let n=iT[t.icon],r=t.id===e;return(0,U.jsxs)(`button`,{onClick:()=>i(t.id),className:`w-full text-left px-3 py-2 hover:bg-neutral-7 transition-colors flex items-start gap-2.5 ${t.dangerous?`hover:bg-error-9/20`:``}`,children:[(0,U.jsx)(n,{size:16,stroke:2,className:`mt-0.5 flex-shrink-0 ${t.dangerous?`text-error-5`:r?`text-primary-4`:`text-neutral-4`}`}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-[13px] font-medium ${t.dangerous?`text-error-5`:r?`text-primary-4`:`text-neutral-2`}`,children:t.label}),(0,U.jsx)(`div`,{className:`text-[12px] ${t.dangerous?`text-error-6`:`text-neutral-5`}`,children:t.description})]}),r&&(0,U.jsx)(mt,{size:14,stroke:2.5,className:`mt-0.5 flex-shrink-0 text-primary-4`})]},t.id)})})]})}function uT({currentModel:e,isOpen:t,menuRef:n,onToggle:r,onChange:i}){return(0,U.jsxs)(`div`,{className:`relative`,ref:n,children:[(0,U.jsxs)(`button`,{onClick:r,className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors`,title:`Change model`,children:[oT(e),(0,U.jsx)(ht,{size:12,stroke:2})]}),t&&(0,U.jsx)(`div`,{className:`absolute bottom-full mb-1 right-0 z-50 min-w-[160px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1`,children:aT.map(t=>(0,U.jsx)(`button`,{onClick:()=>i(t.id),className:`w-full text-left px-3 py-1.5 text-[13px] hover:bg-neutral-7 transition-colors ${t.id===e?`text-primary-4`:`text-neutral-2`}`,children:t.label},t.id))})]})}var dT=`inputBarHeight`,fT=120,pT=60,mT=600,hT=(0,v.forwardRef)(function({onSendInput:e,isWaiting:t,disabled:n,onEscape:r,pendingFiles:i,onAddFiles:a,onRemoveFile:o,skillGroups:s,slashCommands:c,initialValue:l=``,onValueChange:u,currentModel:d,onModelChange:f,placeholder:p,isMobile:m=!1,showWorktreeToggle:h=!1,useWorktree:g=!1,onWorktreeChange:_,currentPermissionMode:y,onPermissionModeChange:b,onMoveToWorktree:x,worktreePath:S,variant:C=`default`},w){let T=C===`orchestrator`,[E,D]=(0,v.useState)(l),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(!1),[I,L]=(0,v.useState)(!1),ee=(0,v.useCallback)(e=>{e!==`skill`&&k(!1),e!==`model`&&j(!1),e!==`perm`&&N(!1)},[]),[R,te]=(0,v.useState)(``),z=(0,v.useRef)(null),B=(0,v.useRef)(null),V=(0,v.useRef)(null),ne=`orchestratorInputBarHeight`,[re,ie]=(0,v.useState)(()=>{if(m)return 100;let e=T?ne:dT,t=T?90:fT,n=localStorage.getItem(e);return n?Math.max(pT,Math.min(mT,parseInt(n,10))):t}),ae=(0,v.useRef)(null),oe=(0,v.useRef)(null),se=(0,v.useRef)(!1),ce=(0,v.useRef)(re);(0,v.useImperativeHandle)(w,()=>({insertText(e){D(e),setTimeout(()=>ae.current?.focus(),0)}})),(0,v.useEffect)(()=>{t&&!se.current&&!m&&ae.current?.focus(),se.current=t},[t,m]),Xw(z,P,(0,v.useCallback)(()=>F(!1),[])),Xw(B,M,(0,v.useCallback)(()=>N(!1),[])),Xw(V,A,(0,v.useCallback)(()=>j(!1),[]));let le=(0,v.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=ce.current,r=e=>{let r=Math.max(pT,Math.min(mT,n+(t-e.clientY)));ce.current=r,ie(r),localStorage.setItem(T?ne:dT,String(r))},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[T]),ue=(0,v.useCallback)(()=>{!E.trim()&&i.length===0||(L(!1),e(E),D(``),u?.(``))},[E,i,e,u]),de=(0,v.useCallback)(e=>{let t=e.trimStart();if(t.startsWith(`/`)&&t.indexOf(` `)===-1){te(t.slice(1)),L(!0);return}L(!1),te(``)},[]),fe=(0,v.useCallback)(e=>{let t=e.target.value;D(t),u?.(t),de(t)},[u,de]),pe=(0,v.useCallback)(e=>{let t=e.command+` `;D(t),u?.(t),L(!1),te(``),setTimeout(()=>ae.current?.focus(),0)},[u]),me=(0,v.useCallback)(t=>{if(!t.nativeEvent.isComposing){if(I&&t.key===`Escape`){t.preventDefault(),L(!1);return}t.key===`Enter`&&!t.shiftKey?I||(t.preventDefault(),ue()):t.key===`c`&&t.ctrlKey?(t.preventDefault(),e(``)):t.key===`Escape`&&(t.preventDefault(),ae.current?.blur(),r())}},[I,ue,e,r]),he=(0,v.useCallback)(()=>{oe.current?.click()},[]),ge=(0,v.useCallback)(e=>{let t=e.target.files;t&&t.length>0&&a(Array.from(t)),e.target.value=``},[a]),_e=(0,v.useCallback)(e=>{e===`bypassPermissions`&&!window.confirm(`Warning: Bypass permissions mode will accept ALL tool calls without asking.
|
|
121
|
-
|
|
122
|
-
This includes file writes, bash commands, and web requests. Only use this if you fully trust the task.
|
|
123
|
-
|
|
124
|
-
Are you sure?`)||(b?.(e),N(!1))},[b]),ve=!T&&s&&s.some(e=>e.skills.length>0),ye=!T&&c&&c.length>0;return(0,U.jsxs)(`div`,{className:`app-input-bar relative flex flex-col border-l bg-neutral-10 ${T?`orchestrator-input-bar border-t border-neutral-9`:`border-t border-neutral-9`}`,style:m?{minHeight:100}:{height:re},children:[(0,U.jsx)(nT,{onUpload:a,disabled:n}),I&&ye&&(0,U.jsx)(eT,{commands:c,filter:R,onSelect:pe,onClose:()=>L(!1)}),!m&&(0,U.jsx)(`div`,{className:`h-1 flex-shrink-0 cursor-row-resize hover:bg-primary-7/40 active:bg-primary-7/60 transition-colors`,onMouseDown:le}),i.length>0&&(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5 px-3 pt-1.5 flex-shrink-0`,children:i.map((e,t)=>(0,U.jsxs)(`span`,{className:`flex items-center gap-1 rounded bg-neutral-7 px-2 py-0.5 text-[13px] text-neutral-2`,children:[(0,U.jsx)(`span`,{className:`max-w-[150px] truncate`,children:e.name}),(0,U.jsx)(`button`,{onClick:()=>o(t),className:`flex-shrink-0 rounded p-0.5 text-neutral-4 hover:text-neutral-1`,children:(0,U.jsx)(sn,{size:12,stroke:2})})]},`${e.name}-${t}`))}),(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-2 px-3 pt-2 pb-1`,children:[t&&(0,U.jsx)(`span`,{className:`mt-1 h-2 w-2 flex-shrink-0 rounded-full animate-pulse ${T?`bg-accent-5`:`bg-primary-5`}`}),(0,U.jsx)(`textarea`,{ref:ae,value:E,onChange:fe,onKeyDown:me,disabled:n,autoFocus:!0,placeholder:p??(T?`Ask the orchestrator...`:t?`Type response...`:`What do you want to build?`),className:`flex-1 min-h-0 resize-none bg-transparent ${m?`text-[16px]`:`text-[15px]`} leading-snug text-neutral-1 placeholder:text-neutral-5 outline-none disabled:opacity-50 overflow-y-auto`}),(0,U.jsx)(`input`,{ref:oe,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,text/markdown,.md`,onChange:ge,className:`hidden`})]}),(0,U.jsxs)(`div`,{className:`flex flex-shrink-0 items-center justify-between px-3 pb-2 pt-0`,children:[!m&&!T&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[y&&b&&(0,U.jsx)(lT,{currentMode:y,isOpen:M,menuRef:B,onToggle:()=>{ee(`perm`),N(!M)},onSelect:_e}),S?(0,U.jsxs)(`span`,{className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-primary-5`,title:S,children:[(0,U.jsx)(jt,{size:14,stroke:2}),(0,U.jsx)(`span`,{className:`hidden lg:inline max-w-[120px] truncate`,children:S.split(`/`).pop()})]}):h&&_?(0,U.jsxs)(`button`,{onClick:()=>_(!g),className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium transition-colors ${g?`text-primary-5 bg-primary-9/30 hover:bg-primary-9/50`:`text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7`}`,title:g?`Worktree enabled — session will use a git worktree`:`Enable git worktree for this session`,children:[(0,U.jsx)(jt,{size:14,stroke:2}),(0,U.jsx)(`span`,{className:`hidden lg:inline`,children:`Worktree`})]}):x?(0,U.jsxs)(`button`,{onClick:x,className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors`,title:`Move session to a git worktree`,children:[(0,U.jsx)(jt,{size:14,stroke:2}),(0,U.jsx)(`span`,{className:`hidden lg:inline`,children:`Worktree`})]}):null]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[d&&f&&(0,U.jsx)(uT,{currentModel:d,isOpen:A,menuRef:V,onToggle:()=>{ee(`model`),j(!A)},onChange:e=>{f(e),j(!1)}}),ve&&(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`button`,{onClick:()=>{ee(`skill`),k(!O)},disabled:n,className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors disabled:opacity-30`,title:`Claude Skills`,children:[(0,U.jsx)(nn,{size:14,stroke:2}),(0,U.jsx)(`span`,{className:`hidden lg:inline`,children:`Skills`}),(0,U.jsx)(ht,{size:12,stroke:2})]}),O&&(0,U.jsx)(Zw,{groups:s??[],onSelectSkill:e=>{D(e+` `),k(!1),setTimeout(()=>ae.current?.focus(),0)},onClose:()=>k(!1)})]}),(0,U.jsx)(sT,{onClick:he,disabled:n,size:16,rounded:`rounded-md`}),(0,U.jsx)(cT,{onClick:ue,disabled:n,hasContent:!!(E.trim()||i.length>0),size:16,rounded:`rounded-md`})]})]}),!m&&T&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(sT,{onClick:he,disabled:n,size:16,rounded:`rounded-full`,className:`hover:text-accent-4 hover:bg-accent-9/30`}),(0,U.jsx)(cT,{onClick:ue,disabled:n,hasContent:!!(E.trim()||i.length>0),size:16,rounded:`rounded-full`,accent:!0,className:`px-3 py-1`})]})]}),m&&!T&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsxs)(`div`,{className:`relative`,ref:z,children:[(0,U.jsx)(`button`,{onClick:()=>F(!P),disabled:n,className:`flex items-center justify-center rounded min-w-[34px] min-h-[34px] p-1.5 text-neutral-3 hover:text-neutral-1 hover:bg-neutral-7 transition-colors disabled:opacity-30`,title:`More options`,children:(0,U.jsx)(Ct,{size:24,stroke:2})}),P&&(0,U.jsxs)(`div`,{className:`absolute bottom-full mb-1 right-0 z-50 min-w-[220px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1`,children:[y&&b&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`px-3 py-1.5 text-[12px] text-neutral-5 uppercase tracking-wider`,children:`Permissions`}),rT.map(e=>{let t=iT[e.icon],n=e.id===y;return(0,U.jsxs)(`button`,{onClick:()=>{_e(e.id),F(!1)},className:`w-full text-left px-3 py-2 text-[14px] hover:bg-neutral-7 transition-colors flex items-center gap-2 ${e.dangerous?`hover:bg-error-9/20`:``}`,children:[(0,U.jsx)(t,{size:16,stroke:2,className:e.dangerous?`text-error-5`:n?`text-primary-4`:`text-neutral-4`}),(0,U.jsx)(`span`,{className:e.dangerous?`text-error-5`:n?`text-primary-4`:`text-neutral-2`,children:e.label}),n&&(0,U.jsx)(mt,{size:14,stroke:2.5,className:`ml-auto text-primary-4`})]},e.id)}),(0,U.jsx)(`div`,{className:`my-1 border-t border-neutral-7`})]}),d&&f&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`px-3 py-1.5 text-[12px] text-neutral-5 uppercase tracking-wider`,children:`Model`}),aT.map(e=>(0,U.jsx)(`button`,{onClick:()=>{f(e.id),F(!1)},className:`w-full text-left px-3 py-2 text-[14px] hover:bg-neutral-7 transition-colors ${e.id===d?`text-primary-4`:`text-neutral-2`}`,children:e.label},e.id)),(0,U.jsx)(`div`,{className:`my-1 border-t border-neutral-7`})]}),ve&&(0,U.jsxs)(`button`,{onClick:()=>{F(!1),k(!O)},className:`flex items-center gap-2 w-full text-left px-3 py-2 text-[14px] text-neutral-2 hover:bg-neutral-7 transition-colors`,children:[(0,U.jsx)(nn,{size:18,stroke:2,className:`text-neutral-4`}),`Skills`]}),(0,U.jsxs)(`button`,{onClick:()=>{F(!1),he()},className:`flex items-center gap-2 w-full text-left px-3 py-2 text-[14px] text-neutral-2 hover:bg-neutral-7 transition-colors`,children:[(0,U.jsx)(Vt,{size:18,stroke:2,className:`text-neutral-4`}),`Attach files`]})]}),O&&(0,U.jsx)(Zw,{groups:s??[],onSelectSkill:e=>{D(e+` `),k(!1),setTimeout(()=>ae.current?.focus(),0)},onClose:()=>k(!1)})]}),(0,U.jsx)(cT,{onClick:ue,disabled:n,hasContent:!!(E.trim()||i.length>0),size:24,rounded:`rounded`,className:`min-w-[34px] min-h-[34px]`})]})]}),m&&T&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(sT,{onClick:he,disabled:n,size:24,rounded:`rounded-full`,className:`min-w-[34px] min-h-[34px] hover:text-accent-4 hover:bg-accent-9/30`}),(0,U.jsx)(cT,{onClick:ue,disabled:n,hasContent:!!(E.trim()||i.length>0),size:24,rounded:`rounded-full`,accent:!0,className:`min-w-[34px] min-h-[34px]`})]})]})]})]})});function gT({token:e,onOrchestratorSessionReady:t,sessionJoined:n,activeSessionId:r,messages:i,fontSize:a,isMobile:o,planningMode:s,activityLabel:c,tasks:l,activePrompt:u,sendPromptResponse:d,inputBarRef:f,onSendInput:p,pendingFiles:m,onAddFiles:h,onRemoveFile:g,skillGroups:_,slashCommands:v,currentModel:y,onModelChange:b,currentPermissionMode:x,onPermissionModeChange:S,disabled:C,agentName:w}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(qw,{token:e,onOrchestratorSessionReady:t,sessionJoined:n,agentName:w}),r&&(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden min-h-0`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 min-h-0 flex flex-col`,children:[(0,U.jsx)(xm,{messages:i,fontSize:a,disabled:C,planningMode:s,activityLabel:c,isMobile:o,variant:`orchestrator`,agentName:w}),(0,U.jsx)(Jw,{tasks:l})]}),u&&(0,U.jsx)(Yw,{options:u.options,question:u.question,multiSelect:u.multiSelect,promptType:u.promptType,questions:u.questions,approvePattern:u.approvePattern,onSelect:d,isMobile:o},u.requestId),(0,U.jsx)(hT,{variant:`orchestrator`,ref:f,onSendInput:p,isWaiting:!!u,disabled:C,onEscape:()=>{},pendingFiles:m,onAddFiles:h,onRemoveFile:g,skillGroups:_,slashCommands:v,placeholder:`Ask Agent ${w??`Joe`} to work on your code...`,initialValue:``,onValueChange:()=>{},currentModel:y,onModelChange:b,isMobile:o,currentPermissionMode:x,onPermissionModeChange:S},`orchestrator-${r}`)]})]})}function _T(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vT=_T();function yT(e){vT=e}var bT={exec:()=>null};function xT(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(CT.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ST=(()=>{try{return!0}catch{return!1}})(),CT={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},wT=/^(?:[ \t]*(?:\n|$))+/,TT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ET=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,DT=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,OT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kT=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,AT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jT=xT(AT).replace(/bull/g,kT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),MT=xT(AT).replace(/bull/g,kT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),NT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,PT=/^[^\n]+/,FT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,IT=xT(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,FT).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),LT=xT(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,kT).getRegex(),RT=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,zT=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,BT=xT(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,zT).replace(`tag`,RT).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),VT=xT(NT).replace(`hr`,DT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,RT).getRegex(),HT={blockquote:xT(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,VT).getRegex(),code:TT,def:IT,fences:ET,heading:OT,hr:DT,html:BT,lheading:jT,list:LT,newline:wT,paragraph:VT,table:bT,text:PT},UT=xT(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,DT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,RT).getRegex(),WT={...HT,lheading:MT,table:UT,paragraph:xT(NT).replace(`hr`,DT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,UT).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,RT).getRegex()},GT={...HT,html:xT(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,zT).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:bT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xT(NT).replace(`hr`,DT).replace(`heading`,` *#{1,6} *[^
|
|
125
|
-
]`).replace(`lheading`,jT).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},KT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,JT=/^( {2,}|\\)\n(?!\s*$)/,YT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,XT=/[\p{P}\p{S}]/u,ZT=/[\s\p{P}\p{S}]/u,QT=/[^\s\p{P}\p{S}]/u,$T=xT(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ZT).getRegex(),eE=/(?!~)[\p{P}\p{S}]/u,tE=/(?!~)[\s\p{P}\p{S}]/u,nE=/(?:[^\s\p{P}\p{S}]|~)/u,rE=xT(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ST?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),iE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,aE=xT(iE,`u`).replace(/punct/g,XT).getRegex(),oE=xT(iE,`u`).replace(/punct/g,eE).getRegex(),sE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,cE=xT(sE,`gu`).replace(/notPunctSpace/g,QT).replace(/punctSpace/g,ZT).replace(/punct/g,XT).getRegex(),lE=xT(sE,`gu`).replace(/notPunctSpace/g,nE).replace(/punctSpace/g,tE).replace(/punct/g,eE).getRegex(),uE=xT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,QT).replace(/punctSpace/g,ZT).replace(/punct/g,XT).getRegex(),dE=xT(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,XT).getRegex(),fE=xT(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,QT).replace(/punctSpace/g,ZT).replace(/punct/g,XT).getRegex(),pE=xT(/\\(punct)/,`gu`).replace(/punct/g,XT).getRegex(),mE=xT(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hE=xT(zT).replace(`(?:-->|$)`,`-->`).getRegex(),gE=xT(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,hE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_E=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,vE=xT(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,_E).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yE=xT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,_E).replace(`ref`,FT).getRegex(),bE=xT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,FT).getRegex(),xE=xT(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,yE).replace(`nolink`,bE).getRegex(),SE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,CE={_backpedal:bT,anyPunctuation:pE,autolink:mE,blockSkip:rE,br:JT,code:qT,del:bT,delLDelim:bT,delRDelim:bT,emStrongLDelim:aE,emStrongRDelimAst:cE,emStrongRDelimUnd:uE,escape:KT,link:vE,nolink:bE,punctuation:$T,reflink:yE,reflinkSearch:xE,tag:gE,text:YT,url:bT},wE={...CE,link:xT(/^!?\[(label)\]\((.*?)\)/).replace(`label`,_E).getRegex(),reflink:xT(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,_E).getRegex()},TE={...CE,emStrongRDelimAst:lE,emStrongLDelim:oE,delLDelim:dE,delRDelim:fE,url:xT(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,SE).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xT(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,SE).getRegex()},EE={...TE,br:xT(JT).replace(`{2,}`,`*`).getRegex(),text:xT(TE.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},DE={normal:HT,gfm:WT,pedantic:GT},OE={normal:CE,gfm:TE,breaks:EE,pedantic:wE},kE={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},AE=e=>kE[e];function jE(e,t){if(t){if(CT.escapeTest.test(e))return e.replace(CT.escapeReplace,AE)}else if(CT.escapeTestNoEncode.test(e))return e.replace(CT.escapeReplaceNoEncode,AE);return e}function ME(e){try{e=encodeURI(e).replace(CT.percentDecode,`%`)}catch{return null}return e}function NE(e,t){let n=e.replace(CT.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(CT.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(CT.slashPipe,`|`);return n}function PE(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function FE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function IE(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function LE(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function RE(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
126
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
127
|
-
`)}var zE=class{options;rules;lexer;constructor(e){this.options=e||vT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:PE(e,`
|
|
128
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=RE(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=PE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:PE(t[0],`
|
|
129
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=PE(t[0],`
|
|
130
|
-
`).split(`
|
|
131
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
132
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
133
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
134
|
-
${s}`:s,r=r?`${r}
|
|
135
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
136
|
-
`+e.join(`
|
|
137
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
138
|
-
`+e.join(`
|
|
139
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
140
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=IE(t[2].split(`
|
|
141
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
142
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
143
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
144
|
-
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
145
|
-
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
146
|
-
`+l}u=!l.trim(),r+=p+`
|
|
147
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=NE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
148
|
-
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(NE(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
149
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=PE(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=FE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),LE(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return LE(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},BE=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||vT,this.options.tokenizer=this.options.tokenizer||new zE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:CT,block:DE.normal,inline:OE.normal};this.options.pedantic?(t.block=DE.pedantic,t.inline=OE.pedantic):this.options.gfm&&(t.block=DE.gfm,this.options.breaks?t.inline=OE.breaks:t.inline=OE.gfm),this.tokenizer.rules=t}static get rules(){return{block:DE,inline:OE}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(CT.carriageReturn,`
|
|
150
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(CT.tabCharGlobal,` `).replace(CT.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
151
|
-
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
152
|
-
`)?``:`
|
|
153
|
-
`)+r.raw,n.text+=`
|
|
154
|
-
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
155
|
-
`)?``:`
|
|
156
|
-
`)+r.raw,n.text+=`
|
|
157
|
-
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
158
|
-
`)?``:`
|
|
159
|
-
`)+r.raw,a.text+=`
|
|
160
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
161
|
-
`)?``:`
|
|
162
|
-
`)+r.raw,n.text+=`
|
|
163
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},VE=class{options;parser;constructor(e){this.options=e||vT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(CT.notSpaceStart)?.[0],i=e.replace(CT.endingNewline,``)+`
|
|
164
|
-
`;return r?`<pre><code class="language-`+jE(r)+`">`+(n?i:jE(i,!0))+`</code></pre>
|
|
165
|
-
`:`<pre><code>`+(n?i:jE(i,!0))+`</code></pre>
|
|
166
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
167
|
-
${this.parser.parse(e)}</blockquote>
|
|
168
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
169
|
-
`}hr(e){return`<hr>
|
|
170
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
171
|
-
`+r+`</`+i+`>
|
|
172
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
173
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
174
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
175
|
-
<thead>
|
|
176
|
-
`+t+`</thead>
|
|
177
|
-
`+r+`</table>
|
|
178
|
-
`}tablerow({text:e}){return`<tr>
|
|
179
|
-
${e}</tr>
|
|
180
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
181
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${jE(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=ME(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+jE(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ME(e);if(i===null)return jE(n);e=i;let a=`<img src="${e}" alt="${jE(n)}"`;return t&&(a+=` title="${jE(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:jE(e.text)}},HE=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},UE=class e{options;renderer;textRenderer;constructor(e){this.options=e||vT,this.options.renderer=this.options.renderer||new VE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new HE}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},WE=class{options;block;constructor(e){this.options=e||vT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?BE.lex:BE.lexInline}provideParser(){return this.block?UE.parse:UE.parseInline}},GE=new class{defaults=_T();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=UE;Renderer=VE;TextRenderer=HE;Lexer=BE;Tokenizer=zE;Hooks=WE;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new VE(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new zE(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new WE;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];WE.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&WE.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return BE.lex(e,t??this.defaults)}parser(e,t){return UE.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?BE.lex:BE.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?UE.parse:UE.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?BE.lex:BE.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?UE.parse:UE.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
182
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+jE(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function KE(e,t){return GE.parse(e,t)}KE.options=KE.setOptions=function(e){return GE.setOptions(e),KE.defaults=GE.defaults,yT(KE.defaults),KE},KE.getDefaults=_T,KE.defaults=vT,KE.use=function(...e){return GE.use(...e),KE.defaults=GE.defaults,yT(KE.defaults),KE},KE.walkTokens=function(e,t){return GE.walkTokens(e,t)},KE.parseInline=GE.parseInline,KE.Parser=UE,KE.parser=UE.parse,KE.Renderer=VE,KE.TextRenderer=HE,KE.Lexer=BE,KE.lexer=BE.lex,KE.Tokenizer=zE,KE.Hooks=WE,KE.parse=KE,KE.options,KE.setOptions,KE.use,KE.walkTokens,KE.parseInline,UE.parse,BE.lex;function qE(e){if(typeof e==`function`&&(e={highlight:e}),!e||typeof e.highlight!=`function`)throw Error(`Must provide highlight function`);return typeof e.langPrefix!=`string`&&(e.langPrefix=`language-`),typeof e.emptyLangClass!=`string`&&(e.emptyLangClass=``),{async:!!e.async,walkTokens(t){if(t.type!==`code`)return;let n=JE(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||``)).then(YE(t));let r=e.highlight(t.text,n,t.lang||``);if(r instanceof Promise)throw Error(`markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.`);YE(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t==`object`&&(r=t.escaped,n=t.lang,t=t.text);let i=JE(n),a=i?e.langPrefix+nD(i):e.emptyLangClass,o=a?` class="${a}"`:``;return t=t.replace(/\n$/,``),`<pre><code${o}>${r?t:nD(t,!0)}\n</code></pre>`}}}}function JE(e){return(e||``).match(/\S*/)[0]}function YE(e){return t=>{typeof t==`string`&&t!==e.text&&(e.escaped=!0,e.text=t)}}var XE=/[&<>"']/,ZE=new RegExp(XE.source,`g`),QE=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,$E=new RegExp(QE.source,`g`),eD={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},tD=e=>eD[e];function nD(e,t){if(t){if(XE.test(e))return e.replace(ZE,tD)}else if(QE.test(e))return e.replace($E,tD);return e}KE.use(qE({langPrefix:`hljs language-`,highlight(e,t){return t&&nm.getLanguage(t)?nm.highlight(e,{language:t}).value:e}})),gp.addHook(`afterSanitizeAttributes`,e=>{e.tagName===`A`&&e.getAttribute(`href`)?.startsWith(`http`)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))});function rD({content:e}){return(0,U.jsx)(`div`,{className:`docs-prose`,dangerouslySetInnerHTML:{__html:(0,v.useMemo)(()=>gp.sanitize(KE.parse(e,{gfm:!0})),[e])}})}function iD({repoName:e,filePath:t,content:n,loading:r,error:i,rawMode:a,isStarred:o,onToggleRaw:s,onToggleStar:c,onClose:l}){return(0,U.jsxs)(`div`,{className:`relative flex flex-1 min-h-0 w-full flex-col`,children:[(0,U.jsxs)(`div`,{className:`docs-header flex items-center gap-2 px-4 py-2 border-b flex-shrink-0`,children:[(0,U.jsxs)(`button`,{onClick:l,className:`docs-header-back flex items-center gap-1 text-[13px] transition-colors cursor-pointer`,children:[(0,U.jsx)(gt,{size:14,stroke:2.5}),`Back`]}),(0,U.jsxs)(`span`,{className:`docs-header-path flex-1 text-[13px] text-center truncate`,children:[e,` `,(0,U.jsx)(`span`,{className:`docs-header-slash`,children:`/`}),` `,t]}),(0,U.jsx)(`button`,{onClick:c,className:`docs-header-star transition-colors cursor-pointer ${o?`is-starred`:``}`,title:o?`Remove from favourites`:`Add to favourites`,children:o?(0,U.jsx)(un,{size:15}):(0,U.jsx)(en,{size:15})}),(0,U.jsx)(`button`,{onClick:s,className:`docs-header-toggle rounded px-2 py-0.5 text-[13px] transition-colors cursor-pointer ${a?`is-active`:``}`,children:a?`Rendered`:`Raw`})]}),(0,U.jsxs)(`div`,{className:`chat-scroll flex-1 overflow-y-auto min-h-0`,children:[(0,U.jsx)(`div`,{className:`border-t-2 border-accent-8/40`}),r?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,U.jsx)(Nt,{size:20,className:`animate-spin text-neutral-5`})}):i?(0,U.jsx)(`div`,{className:`rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4 mx-4 mt-4`,children:i}):n===null?null:a?(0,U.jsx)(`pre`,{className:`px-6 py-4 text-[14px] text-neutral-3 whitespace-pre-wrap`,style:{fontFamily:`'Inconsolata', monospace`},children:n}):(0,U.jsx)(`div`,{className:`mx-auto max-w-[720px] px-6 py-4`,children:(0,U.jsx)(rD,{content:n})})]})]})}function aD({docsRepoName:e,filePath:t,content:n,loading:r,error:i,rawMode:a,isStarred:o,onToggleRaw:s,onToggleStar:c,onClose:l,activeSessionId:u,inputBarRef:d,onSendInput:f,activePrompt:p,disabled:m,pendingFiles:h,onAddFiles:g,onRemoveFile:_,skillGroups:v,slashCommands:y,sessionInputs:b,onSessionInputChange:x,currentModel:S,onModelChange:C,isMobile:w,currentPermissionMode:T,onPermissionModeChange:E,moveToWorktree:D,worktreePath:O}){return(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden min-h-0`,children:[(0,U.jsx)(iD,{repoName:e,filePath:t,content:n,loading:r,error:i,rawMode:a,isStarred:o,onToggleRaw:s,onToggleStar:c,onClose:l}),u?(0,U.jsx)(hT,{ref:d,onSendInput:f,isWaiting:!!p,disabled:m,onEscape:l,pendingFiles:h,onAddFiles:g,onRemoveFile:_,skillGroups:v,slashCommands:y,placeholder:`Ask Claude about this doc, or request changes...`,initialValue:u?b[u]??``:``,onValueChange:e=>{u&&x(u,e)},currentModel:S,onModelChange:C,isMobile:w,currentPermissionMode:T,onPermissionModeChange:E,onMoveToWorktree:D,worktreePath:O},`docs-${u}`):(0,U.jsx)(`div`,{className:`px-4 py-3 border-t border-neutral-10`,children:(0,U.jsx)(`div`,{className:`rounded-lg bg-neutral-11 px-3 py-2 text-[15px] text-neutral-5 opacity-40`,children:`Start a session to edit this doc`})})]})}function oD({count:e,repoName:t,onExecute:n,onDiscard:r}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-t border-warning-8/50 bg-warning-11/30 px-4 py-2 flex-shrink-0`,children:[(0,U.jsxs)(`span`,{className:`text-[15px] text-warning-4`,children:[`⏸ `,e,` message`,e===1?``:`s`,` queued — waiting for`,` `,(0,U.jsx)(`span`,{className:`font-medium text-warning-3`,children:t}),` session to finish`]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`button`,{onClick:n,className:`rounded px-2.5 py-1 text-[13px] bg-warning-9/30 hover:bg-warning-8/50 text-warning-3 transition-colors`,children:`Execute now`}),(0,U.jsx)(`button`,{onClick:r,className:`rounded px-2.5 py-1 text-[13px] text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/50 transition-colors`,children:`Discard`})]})]})}function sD({activeSessionId:e,messages:t,fontSize:n,isMobile:r,planningMode:i,activityLabel:a,tasks:o,disabled:s,hasFileChanges:c,diffPanelOpen:l,onOpenDiffPanel:u,activePrompt:d,promptQueueSize:f,sendPromptResponse:p,activeTentativeCount:m,activeRepoName:h,onExecuteTentative:g,onDiscardTentative:_,inputBarRef:v,onSendInput:y,pendingFiles:b,onAddFiles:x,onRemoveFile:S,skillGroups:C,slashCommands:w,sessionInputs:T,onSessionInputChange:E,currentModel:D,onModelChange:O,hasUserMessages:k,useWorktree:A,onWorktreeChange:j,currentPermissionMode:M,onPermissionModeChange:N,moveToWorktree:P,worktreePath:F}){return(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden min-h-0`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 min-h-0 flex flex-col`,children:[(0,U.jsx)(xm,{messages:t,fontSize:n,disabled:s,planningMode:i,activityLabel:a,isMobile:r}),(0,U.jsx)(Jw,{tasks:o}),c&&!l&&(0,U.jsxs)(`button`,{className:`absolute top-3 right-3 z-10 flex items-center gap-1.5 rounded-lg bg-primary-8 px-3 py-1.5 text-[13px] font-medium text-neutral-1 shadow-lg backdrop-blur-sm transition-colors hover:bg-primary-7`,onClick:u,title:`Review code changes (Ctrl+Shift+D)`,children:[(0,U.jsx)(Tt,{size:15}),`Diff view`]})]}),d&&(0,U.jsx)(Yw,{options:d.options,question:d.question,multiSelect:d.multiSelect,promptType:d.promptType,questions:d.questions,approvePattern:d.approvePattern,onSelect:p,isMobile:r},d.requestId),f>1&&(0,U.jsxs)(`div`,{className:`px-3 py-1 text-[12px] text-neutral-5 bg-neutral-11 border-t border-neutral-10`,children:[f-1,` more pending`]}),m>0&&(0,U.jsx)(oD,{count:m,repoName:h,onExecute:g,onDiscard:_}),(0,U.jsx)(hT,{ref:v,onSendInput:y,isWaiting:!!d,disabled:s,onEscape:()=>{},pendingFiles:b,onAddFiles:x,onRemoveFile:S,skillGroups:C,slashCommands:w,initialValue:T[e]??``,onValueChange:t=>{E(e,t)},currentModel:D,onModelChange:O,isMobile:r,showWorktreeToggle:!k,useWorktree:A,onWorktreeChange:j,currentPermissionMode:M,onPermissionModeChange:N,onMoveToWorktree:P,worktreePath:F},e??`no-session`)]})}function cD(){let{settings:e,updateSettings:t}=w(),{groups:n,repos:r,globalSkills:i,globalModules:a,ghMissing:o,refresh:s}=T(e.token),{sessions:c,rename:l,remove:u,refresh:d}=be(e.token),{queues:f,addToQueue:p,clearQueue:m}=ze(),{sessionId:h,view:g,navigate:_}=Pe(),y=Ke(),b=Je(),[x,S]=(0,v.useState)(!1),[C,E]=(0,v.useState)(()=>h??localStorage.getItem(`codekin-active-session`)),D=(0,v.useCallback)(e=>{E(e),g!==`orchestrator`&&(e?_(`/s/${e}`):_(`/`,!0))},[_,g]),[O,k]=(0,v.useState)(!e.token),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(!1),P=(0,v.useRef)(()=>{}),F=(0,v.useRef)(()=>{}),[I,L]=(0,v.useState)(!1),[ee,R]=(0,v.useState)(0),[te,z]=(0,v.useState)(null),B=(0,v.useRef)(null),V=(0,v.useRef)(null),ne=(0,v.useRef)(()=>{}),[re,ie]=(0,v.useState)(()=>localStorage.getItem(`codekin-use-worktree`)===`true`),ae=(0,v.useRef)(re);(0,v.useEffect)(()=>{ae.current=re},[re]);let oe=(0,v.useCallback)(e=>{ie(e),localStorage.setItem(`codekin-use-worktree`,String(e))},[]),[se,ce]=(0,v.useState)(!1);(0,v.useEffect)(()=>{e.token&&ue(e.token).then(ce).catch(()=>{})},[e.token]);let[le,de]=(0,v.useState)(`Joe`);(0,v.useEffect)(()=>{e.token&&me(e.token).then(de).catch(()=>{})},[e.token]);let fe=(0,v.useRef)(localStorage.getItem(`claude-permission-mode`)||`acceptEdits`),pe=(0,v.useRef)(null),[he,ge]=(0,v.useState)({}),{connState:_e,messages:ve,tasks:ye,planningMode:xe,isProcessing:Se,thinkingSummary:Ce,waitingSessions:we,activePrompt:Te,promptQueueSize:Ee,joinSession:De,createSession:Oe,sendInput:ke,sendPromptResponse:Ae,leaveSession:Ne,clearMessages:Fe,restoreSession:Ie,currentModel:Le,setModel:Re,send:Be,currentPermissionMode:He,setPermissionMode:Ue,moveToWorktree:We}=je({token:e.token,onSessionCreated:e=>{if(D(e),d(),V.current){let e=V.current;V.current=null,setTimeout(()=>ne.current(e),500)}},onSessionJoined:e=>{D(e)},onSessionRenamed:()=>{d()},onSessionsUpdated:()=>{d(),R(e=>e+1)},onError:e=>{B.current&&clearTimeout(B.current),z(e),B.current=setTimeout(()=>z(null),5e3),e.toLowerCase().includes(`not found`)&&D(null)},onRawMessage:e=>{e.type===`diff_result`||e.type===`diff_error`?P.current(e):e.type===`tool_done`&&(F.current(e.toolName,e.summary),(e.toolName===`Edit`||e.toolName===`Write`)&&L(!0))}}),Ge=(0,v.useCallback)(e=>{fe.current=e,Ue(e)},[Ue]);(0,v.useEffect)(()=>{L(!1)},[C]);let{activeWorkingDir:qe,handleOpenSession:Ye,handleSelectSession:Xe,handleDeleteSession:Ze,handleSelectRepo:Qe,handleDeleteRepo:et,handleNewSessionForRepo:rt,handleNewSessionFromArchive:H}=Ve({sessions:c,repos:r,activeSessionId:C,setActiveSessionId:D,joinSession:De,leaveSession:Ne,clearMessages:Fe,wsCreateSession:Oe,removeSession:u,pendingContextRef:V,useWorktreeRef:ae,permissionModeRef:fe}),it=qe?r.find(e=>e.workingDir===qe)??null:null,at=(0,v.useMemo)(()=>[...i,...it?.skills??[]],[i,it?.skills]),ot=(0,v.useMemo)(()=>$e(at),[at]),st=(0,v.useCallback)((e,t)=>{switch(e){case`/clear`:case`/reset`:case`/new`:Ne(),Fe(),qe&&rt();break;case`/compact`:ke(`Please compact the conversation context to save tokens while preserving important context.`);break;case`/model`:t?Re(t):ke(`Current model: ${Le??`default`}. To change, use the model selector in the input bar.`);break;case`/help`:ke(`[Codekin] Available commands: /clear, /compact, /model, /cost, /status, /help. Skills: type / to see autocomplete.`);break;default:ke(`[Codekin] Command ${e} is not available in the web UI.`);break}},[Ne,Fe,qe,rt,ke,Le,Re]),{handleSend:ct,handleExecuteTentative:lt,handleDiscardTentative:ut,tentativeMessages:dt,activeTentativeCount:ft,pendingFiles:pt,addFiles:mt,removeFile:ht,uploadStatus:gt}=tt({token:e.token,activeSessionId:C,activeWorkingDir:qe,sessions:c,allSkills:at,sendInput:ke,onBuiltinCommand:st,tentativeQueues:f,addToQueue:p,clearQueue:m,docsContext:{isOpen:y.isOpen,selectedFile:y.selectedFile,repoWorkingDir:y.repoWorkingDir},queueEnabled:se});(0,v.useEffect)(()=>{ne.current=ke},[ke]),(0,v.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),j(e=>!e)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key===`D`&&(e.preventDefault(),N(e=>!e))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,v.useEffect)(()=>{C?localStorage.setItem(`codekin-active-session`,C):localStorage.removeItem(`codekin-active-session`)},[C]);let _t=(0,v.useRef)(!1);(0,v.useEffect)(()=>{_e===`disconnected`&&(_t.current=!1)},[_e]),(0,v.useEffect)(()=>{_t.current||!C||_e!==`connected`||(_t.current=!0,De(C))},[C,_e,De]),(0,v.useEffect)(()=>{h!==C&&(h?(Fe(),Ne(),De(h),E(h)):(Fe(),Ne(),E(null)))},[h]),(0,v.useEffect)(()=>{C&&window.location.pathname===`/`&&_(`/s/${C}`,!0)},[]),Me(()=>{Ie()}),(0,v.useEffect)(()=>{e.token||k(!0)},[e.token]),(0,v.useEffect)(()=>{y.isOpen&&y.close()},[C]);let vt=(0,v.useCallback)(e=>{pe.current?.insertText(e+` `)},[]),yt=(0,v.useCallback)(e=>{ke(`[Module: ${e.name}]\n\n${e.content}`)},[ke]),bt=[{label:`Global`,skills:i},...it&&it.skills.length>0?[{label:it.name,skills:it.skills}]:[]],xt=nt(ve,Se,Ce),St=(0,v.useMemo)(()=>{if(!y.repoWorkingDir)return``;let e=y.repoWorkingDir.replace(/\/+$/,``).split(`/`);return e[e.length-1]||y.repoWorkingDir},[y.repoWorkingDir]),Ct=(0,v.useRef)(null),wt=(0,v.useCallback)(()=>{_(`/orchestrator`),Ct.current&&(Fe(),Ne(),De(Ct.current))},[_,Fe,Ne,De]),Tt=(0,v.useCallback)(e=>{Ct.current=e,Fe(),Ne(),De(e)},[Fe,Ne,De]),Et=(0,v.useCallback)(t=>{y.pickerOpen&&y.pickerRepoDir===t?y.closePicker():y.openPicker(t,e.token)},[y,e.token]),Dt=(0,v.useCallback)(t=>{y.pickerRepoDir&&y.openFile(y.pickerRepoDir,t,e.token)},[y,e.token]);(0,v.useEffect)(()=>{document.documentElement.dataset.theme=e.theme},[e.theme]);let Ot=c.find(e=>e.id===C),kt=Ot?.name??null,At=it?.name??qe?.split(`/`).pop()??null,jt=(0,v.useCallback)((e,t)=>{ge(n=>({...n,[e]:t}))},[]);return(0,U.jsxs)(`div`,{className:`flex h-full bg-neutral-7`,children:[(0,U.jsx)(Pm,{sessions:c,activeSessionId:C,activeWorkingDir:qe,waitingSessions:we,tentativeQueues:f,groups:n,globalModules:a,activeRepo:it,token:e.token,theme:e.theme,fontSize:e.fontSize,connState:_e,view:g,archiveRefreshKey:ee,onSelectSession:e=>{y.close(),g===`orchestrator`&&_(`/s/${e}`),Xe(e)},onDeleteSession:Ze,onRenameSession:l,onNewSession:rt,onNewSessionFromArchive:H,onOpenSession:Ye,onSelectRepo:Qe,onDeleteRepo:et,onSettingsOpen:()=>k(!0),onUpdateTheme:e=>t({theme:e}),onSendModule:yt,agentName:le,onNavigateToWorkflows:()=>_(`/workflows`),onNavigateToOrchestrator:()=>wt(),onBrowseDocs:Et,docsPicker:{open:y.pickerOpen,repoDir:y.pickerRepoDir,files:y.pickerFiles,loading:y.pickerLoading,onSelect:Dt,onClose:y.closePicker,starredDocs:y.starredDocs},mobile:{isMobile:b,mobileOpen:x,onMobileClose:()=>S(!1)}}),(0,U.jsxs)(`div`,{className:`terminal-area flex flex-1 flex-col overflow-hidden bg-neutral-12`,children:[b&&(0,U.jsx)(Fm,{repoName:At,sessionName:kt,onMenuOpen:()=>S(!0),onNewSession:rt,onSettingsOpen:()=>k(!0),activeRepo:it}),te&&(0,U.jsx)(`div`,{className:`border-b border-error-9/50 bg-error-10/50 px-4 py-2 text-[15px] text-error-5`,children:te}),gt&&(0,U.jsx)(`div`,{className:`border-b border-primary-9/50 bg-primary-10/50 px-4 py-2 text-[15px] text-primary-5`,children:gt}),g===`orchestrator`?(0,U.jsx)(gT,{token:e.token,onOrchestratorSessionReady:Tt,sessionJoined:!!C,activeSessionId:C,messages:[...ve,...dt],fontSize:e.fontSize+(b?1:0),isMobile:b,planningMode:xe,activityLabel:xt,tasks:ye,activePrompt:Te,sendPromptResponse:Ae,inputBarRef:pe,onSendInput:ct,pendingFiles:pt,onAddFiles:mt,onRemoveFile:ht,skillGroups:bt,slashCommands:ot,currentModel:Le,onModelChange:Re,currentPermissionMode:He,onPermissionModeChange:Ge,disabled:!e.token,agentName:le}):g===`workflows`?(0,U.jsx)(Bh,{token:e.token,onNavigateToSession:e=>{Fe(),Ne(),De(e),_(`/s/${e}`)}}):y.isOpen?(0,U.jsx)(aD,{docsRepoName:St,filePath:y.selectedFile,content:y.content,loading:y.loading,error:y.error,rawMode:y.rawMode,isStarred:y.isCurrentFileStarred,onToggleRaw:y.toggleRawMode,onToggleStar:y.toggleStarCurrentFile,onClose:y.close,activeSessionId:C,inputBarRef:pe,onSendInput:ct,activePrompt:Te,disabled:!e.token,pendingFiles:pt,onAddFiles:mt,onRemoveFile:ht,skillGroups:bt,slashCommands:ot,sessionInputs:he,onSessionInputChange:jt,currentModel:Le,onModelChange:Re,isMobile:b,currentPermissionMode:He,onPermissionModeChange:Ge,moveToWorktree:We,worktreePath:Ot?.worktreePath}):C?(0,U.jsx)(sD,{activeSessionId:C,messages:[...ve,...dt],fontSize:e.fontSize+(b?1:0),isMobile:b,planningMode:xe,activityLabel:xt,tasks:ye,disabled:!e.token,hasFileChanges:I,diffPanelOpen:M,onOpenDiffPanel:()=>N(!0),activePrompt:Te,promptQueueSize:Ee,sendPromptResponse:Ae,activeTentativeCount:ft,activeRepoName:it?.name??qe?.split(`/`).pop()??`this repo`,onExecuteTentative:()=>lt(C),onDiscardTentative:()=>ut(C),inputBarRef:pe,onSendInput:ct,pendingFiles:pt,onAddFiles:mt,onRemoveFile:ht,skillGroups:bt,slashCommands:ot,sessionInputs:he,onSessionInputChange:jt,currentModel:Le,onModelChange:Re,hasUserMessages:ve.some(e=>e.type===`user`),useWorktree:re,onWorktreeChange:oe,currentPermissionMode:He,onPermissionModeChange:Ge,moveToWorktree:We,worktreePath:Ot?.worktreePath}):(0,U.jsx)(ub,{groups:n,token:e.token,ghMissing:o,onOpen:Ye,onRefreshRepos:s})]}),C&&(0,U.jsx)(Gw,{isOpen:M,onClose:()=>N(!1),send:Be,onHandleMessage:e=>{P.current=e},onHandleToolDone:e=>{F.current=e}}),(0,U.jsx)(gn,{open:O,onClose:()=>k(!1),settings:e,onUpdate:t,isMobile:b,autoWorktree:re,onAutoWorktreeChange:oe,agentName:le,onAgentNameChange:de}),(0,U.jsx)(lb,{open:A,onClose:()=>j(!1),repos:r,globalSkills:i,globalModules:a,onOpenRepo:Ye,onSendSkill:vt,onSendModule:yt,onOpenSettings:()=>k(!0),isMobile:b})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(v.StrictMode,{children:(0,U.jsx)(cD,{})}));
|