neko-harness 0.5.2 → 0.5.4

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.
@@ -0,0 +1,396 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,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},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return ee(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function D(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?D(``+e.key):t.toString(36)}function O(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 ae(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,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=ae(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(O(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 oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ce=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)};function le(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ce)}catch(e){ce(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ue(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else le(ue.bind(null,e))}var de={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=de,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ue,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.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 ee(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)E.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 ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=le,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=d.useLayoutEffect;function p(e){return e[e.length-1]}function m(e,t){return typeof e==`function`?e(t):e}var h=Object.prototype.hasOwnProperty;function g(e){for(let t in e)if(h.call(e,t))return!0;return!1}var _=()=>Object.create(null),v=(e,t)=>y(e,t,!0);function y(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(b(e)&&b(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&p(a)!==`${o-1}`||c&&p(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?y(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?y(d,o,n,r):o,i&&=u===d&&(a[l]===f||h.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let m=i?s.fill(0):n?_():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?y(d,u,n,r):u),m[f]=o<l?d:u):m[f]=a[o];return m}function b(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function x(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!x(a,o,n,r))return!1}return!0}if(b(e)&&b(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!x(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!x(e[a],t[a],n,r)))return!1;return i===0}return!1}var S=/[\x00-\x1f\x7f"<>`{}]/g;function C(e){return e.replace(S,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function w(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return C(t)}var T=[`http:`,`https:`,`mailto:`,`tel:`];function E(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var ee=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function te(e,t){if(!e)return!1;if(ee.test(e))return!0;let n=E(e);return n?!t.has(n):!1}function ne(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=w(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=w(r?e.slice(r):e)}return t}function D(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function re(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ie(){throw Error(`Invariant failed`)}function O(e){return e.replace(/\/{2,}/g,`/`)}function ae(e){return e===`/`?e:e.replace(/^\/+/,``)}function oe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function se(e){return oe(ae(e))}function ce(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function le(e,t,n=`never`,r){if(t.includes(`//`)&&(t=O(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=O(e)),o=e.split(`/`);o.length>1&&p(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(p(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?O(s):s)||`/`;return a&&r&&r.set(a,c),c}function ue(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function de(e){return e==null||e===``}function fe(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function pe(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&de(f)){if(c===`/`&&!d)continue;f=``}o+=c+fe(s,f,r)+(d||``)}}return o+a||`/`}function me(e){return e?.isNotFound===!0}function he(){try{return sessionStorage}catch{return}}var ge=`tsr-scroll-restoration-v1_3`,_e=he();function ve(){try{return JSON.parse(_e?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var ye=ve(),k=`data-scroll-restoration-id`,A=e=>e.state.__TSR_key||e.href;function be(e){let t=e.getAttribute(k);if(t)return`[${k}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var xe=!1,Se=`window`;function Ce(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function we(e){let t=new Set;for(let n of e){if(n===Se)continue;let e=Ce(n);e&&t.add(e)}return t}function Te(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||A,a=new Set,o=e=>{let t=ye[e]||={};for(let e of a)e===document?t[Se]={scrollX,scrollY}:e.isConnected&&(t[be(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,xe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{xe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{_e?.setItem(ge,JSON.stringify(ye))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=ye[d];if(e){let t=ye[u];for(let n in e){if(n===Se){if(s)continue}else{let e=Ce(n);if(!e||s&&o&&(l??=we(o),l.has(e)))continue}t||=ye[u]={},t[n]??=e[n]}}}xe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=we(o));let t=e&&i&&c,s=r.e?ye[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Se){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ce(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{xe=!1}}))}function Ee(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function De(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Oe(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=De(r):Array.isArray(t)?t.push(De(r)):n[e]=[t,De(r)]}return n}var ke=/^(?:\s|["[{\d-]|fa|nu|tr)/,Ae=Me(JSON.parse),je=Ne(JSON.stringify,JSON.parse);function Me(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=Oe(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!ke.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Ne(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!ke.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Ee(e,r);return t?`?${t}`:``}}var Pe=`__root__`;function Fe(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ie(e){return e instanceof Response&&!!e.options}function Le(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Re=4,ze=5;function Be(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Ve(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function He(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,m,h=a?n-1:0;if(!r||s.includes(`$`)){m=a?.slice()??[];let e=p(m);e&&typeof e!=`string`&&e[0]===2&&(m[m.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],h=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Ve(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=We(r);c=n,t.set(e,n)}}else{let t=a[0],p=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),m&&h<n&&(h<e-1&&m.push(s.slice(h,e-1)),a[2]=`/`+p,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),m.push(a),h=n),!r)continue;let _=d&&!!(p||g);d||(p=p.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===p&&e.suffix===g);if(y)c=y;else{let e=We(r,t,_,p,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}m&&h<u&&m.push(s.slice(h,u));let g=m?.slice();if(!r)return g;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=We(r,ze);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&u<l){let e=We(r,Re);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=g,_&&(r.route=t)),[r,o,g]}function Ue(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function We(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ge(e,t){let n=We(),r=[];function i(e,t,n,a){let[o,s,c]=He(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Ue);t.masksTree=n,t.flatCache=Le(1e3)}function Ke(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Xe(e,t.masksTree);return t.flatCache.set(e,r),r}function qe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=We(),He(t,{from:e},1,o),i.singleCache.set(a,o)),Xe(r,o,n)}function Je(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Xe(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Qe(a.route)),t.matchCache.set(r,a),a}function Ye(e,t=!1){let n=We(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&ie(),i[e.id]=e,o!==0&&e.path){let t=oe(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=He(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Ue);return{processedTree:{segmentTree:n,singleCache:Le(1e3),matchCache:Le(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Xe(e,t,n=!1){let r=e.split(`/`),i=et(e,r,t,n);if(!i)return null;let[a]=Ze(e,r,i);return{route:i.node.route,rawParams:a}}function Ze(e,t,n){let r=$e(n.node),i=n.node.data&&Be(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===Re)break;if(u.kind===ze){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Qe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function $e(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function et(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!p(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!it(l,n))continue;if(i.parse){if(!rt(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Re&&it(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Re||i.kind===2)&&it(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(rt(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&nt(f,o))return n;it(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+tt(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+tt(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+tt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+tt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function tt(e,t){return 2**(e-t-1)}function nt(e,t){return e===2**(t-1)-1}function rt(e,t,n){let r,i;try{[r,i]=Ze(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function it(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Re)>(e.node.kind===Re)||t.node.kind===Re==(e.node.kind===Re)&&t.node.depth>e.node.depth)))}function at(e,t,n){let r=se(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=O(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>ot(n,s.input({url:e})),output:({url:e})=>s.output({url:st(n,e)})}:s}function ot(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function st(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ct(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{re(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var lt=`__TSR_index`,ut=`popstate`,dt=`beforeunload`,ft=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function pt(e){let t=ft.exec(e);return t?`/`+e.slice(t[0].length):e}function mt(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
2
+ \r`.includes(e)?``:encodeURIComponent(e))),pt(e)}function ht(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=vt(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[lt];i=gt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[lt];i=gt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[lt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function gt(e,t){let n=yt();return{...t,key:n,__TSR_key:n,[lt]:e}}function _t(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>mt(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>vt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=yt();t.history.replaceState({[lt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=vt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[lt]-l.state[lt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=ht({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(dt,x,{capture:!0}),t.removeEventListener(ut,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(dt,x,{capture:!0}),t.addEventListener(ut,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function vt(e,t){let n=mt(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=yt();t={[lt]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function yt(){return(Math.random()+1).toString(36).slice(7)}function bt(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function xt(e){return e.pathname+e.search+e.hash}function St(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Ct(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function wt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Tt(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Et(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Dt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:_t()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&se(n)?at(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ct(this.latestLocation,e),Te(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ye(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Ge(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Le(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:ne(e),external:!1,searchStr:o,search:v(t?.search,i),hash:ne(r.slice(1)),state:y(t?.state,a)}}let o=ot(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:ne(pt(o.pathname)),external:!!this.rewrite&&bt(o,this.origin),searchStr:c,search:v(t?.search,s),hash:ne(o.hash.slice(1)),state:y(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Je(oe(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=vt(n.href,{});n={...n,to:ot(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=le(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[oe(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Qe(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??He(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Mt(n.params,e),!g(p))break;p===e&&(p=Object.assign(_(),p));try{Object.assign(p,t(p))}catch{}}}p??=Mt(n.params,Nt(n.params,f)?o()[3]:Pt);let m=e.leaveParams?c:pt(ne(f?pe(c,f,p,this.pathParamsDecoder):c)),h=Ft(d,e._includeValidateSearch),v=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,jt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},y=h.length?It(h,v(),n):n.search===!0?v():typeof n.search==`function`?n.search(v()):n.search||Pt,b=this.options.stringifySearch(y),x=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,S=x?`#${x}`:``,C=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Pt,w=`${m}${b}${S}`,T,E,ee=!1;if(this.rewrite){let e=new URL(w,this.origin),t=e.origin,n=st(this.rewrite,e);T=xt(e),bt(n,t)?(E=n.href,ee=!0):E=pt(xt(n))}else T=D(w),E=T;return{publicHref:E,href:T,pathname:m,search:y,searchStr:b,state:C,hash:x??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Ke(r.pathname,this.processedTree);if(t){let i=Object.assign(_(),t.rawParams),{from:a,params:o,...s}=t.route,c=Mt(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Ot(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=oe(this.latestLocation.href)===oe(n.href)&&x(wt(n.state),wt(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?E(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Ot(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await An(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Ct(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&St(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(ee.test(n)||(r=E(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:bt(e,this.origin)||(n=xt(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Vt,this.preloadRoute=e=>jn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?le(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=qe(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!x(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?x(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=ue(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??je,parseSearch:e.parseSearch??Ae,protocolAllowlist:e.protocolAllowlist??T}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=He(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:oe(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Lt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=jt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof kt||(r=new kt(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=_(),b=i._interpolation?pe(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,x=i.id+b+h,S=u(i,n),C=this._cache.get(x)??(S?.id===x?S:void 0);d=C?._strictParams??Object.assign(g,d);let w;if(!C)try{Rt(i,d)}catch(e){if(w=me(e)||Ie(e)?e:new At(e.message,{cause:e}),t?.throwOnError)throw w}let T=S?`stay`:`enter`,E;if(C)E={...C,cause:T,search:v(S?S.search:C.search,l),_strictSearch:f,searchError:p};else{let e=St(i)?`pending`:`success`;E={id:x,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??d,_strictParams:d,pathname:b,updatedAt:Date.now(),search:S?v(S.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:t?._controller??new AbortController,cause:T,loaderDeps:S?y(S.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let ee=s===i.id;E._notFound&&!ee&&(E.error=void 0),E._notFound=ee,c[n]=E}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?v(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=p(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=p(a),c={...e.search};for(let e of a)try{Object.assign(c,jt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Rt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function Ot(e,t,{replace:n,ignoreBlocker:r}){if(!te(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var kt=class extends Error{},At=class extends Error{};function jt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new kt(`Async validation not supported`);if(n.issues)throw new kt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Mt(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Nt(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!h.call(e,t[1]))}var Pt=Object.freeze({});function Ft(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=jt(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function It(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=m(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Lt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Pe}function Rt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function zt(e,t){return e.options[t]?.preload?.()}function Bt(e,t){let n=zt(e,`component`),r=zt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Vt(e,t,n){let r=()=>t===!1?void 0:t?zt(e,t):Bt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Ht(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Ut(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var Wt=0,Gt=1,Kt=2,qt=3,Jt=[4];function Yt(e){return typeof e[0]==`number`}function Xt(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Zt(e,t){return e.routesById[t.routeId]}function Qt(e,t,n){return Ie(e)?[qt,e]:me(e)?(e.routeId||=n,[Kt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Gt,e]):[Wt,e]}function $t(e,t){let n=Qt(t,!0,e.id);if(n[0]!==Gt)return n;try{e.options.onError?.(n[1])}catch(t){n=Qt(t,!0,e.id)}return n}function en(e,t,n,r,i){return i[0].signal.aborted?Jt:_n(e,t,n,$t(n,r),i)}async function tn(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Zt(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return rn(e,r),[i,en(e,t,u,a,n)]}if(c.aborted)return[i,Jt];let p=r.paramsError??r.searchError;if(p!==void 0)return rn(e,r),[i,en(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{sn(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Xt(a,c):a);if(c.aborted)return[i,Jt];let s=_n(e,t,u,Qt(o,!1,u.id),n);if(s[0]!==Wt)return rn(e,r),[i,s];r.context={...r.context,...o}}catch(a){return rn(e,r),[i,en(e,t,u,a,n)]}finally{r.status=h,sn(e,r,!1,n[0])}}i()}function nn(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function rn(e,t){let n=t._flight;t._flight=void 0,nn(e,t,n)?.abort()}function an(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=nn(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function on(e){for(let t of e){let e=t._flight;e&&e[2]++}}function sn(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function cn(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function ln(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Jt;if(!i)return[Wt,void 0];let l=n._flight;sn(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(cn(e,t,n,r,s,a,!!o[3]))).then(e=>Qt(e,!1,r.id),e=>Qt(e,!0,r.id)).then(t=>(t[0]!==Wt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Gt&&l[2]?$t(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],_n(e,t,r,await Xt(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return rn(e,n),Jt}finally{sn(e,n,!1,s)}}function un(e,t,n){t[0]!==qt&&(e.status=`success`,e.error=void 0,t[0]===Wt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function dn(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&rn(e,r)}function fn(e,t){return t[0]===Gt||t[0]===Kt?{...e,status:t[0]===Gt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function pn(e,t,n,r,i,a,o){let s=t[1][n],c=Zt(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(cn(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Jt)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,rn(e,s),p=en(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,nn(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?ln(e,t,s,c,g,i,a).then(t=>(un(s,t,l),t[0]===Wt&&(m&&!a[0].signal.aborted&&dn(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Wt,s.loaderData]),T=(async()=>{try{let e=Vt(c,void 0,C);e&&await Xt(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,en(e,t,c,r,a)]}let r=await w;x&&r[0]===Wt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>fn(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ee=ln(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,un(E,e,!1),e));return(t[2]??=[]).push([n,ee,T,E]),ee.then(e=>fn(E,e))}async function mn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Zt(e,t[n]);try{let e=Vt(i,!1);e&&await Xt(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function hn(e,t){t[2]&&=(an(e,t[2].map(e=>e[3])),void 0)}async function gn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=qt)throw[a,t];!i&&t[0]!==Wt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===qt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function _n(e,t,n,r,i,a){for(;r[0]===qt;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[qt,t]:[qt,t,a]}return[qt,o,n]}catch(e){r=a?[Gt,e]:$t(n,e),a=!0}}return r}async function vn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Kt?mn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=qt)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Wt&&t[0]<qt&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=qt){let n=s[1];if(n[0]!==qt||n[1].options.reloadDocument||n[2])return hn(e,t),n;c=!0,s=[0,[Gt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Gt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Zt(e,u);try{await Xt(i?Promise.resolve().then(()=>Vt(m,l===Gt?`errorComponent`:`notFoundComponent`)):Promise.all([Vt(m),Vt(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return hn(e,t),Jt}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),hn(e,t),an(e,o),p()):u.status=`success`}return t}async function yn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Zt(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Xt(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function bn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await mn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=pn(e,i,t,u,f,r,l)},m=await tn(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Kt){let t=await mn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=qt&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=vn(e,i,u,r[0],gn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=gn(i[2],void 0,void 0,h.then(e=>Yt(e)?0:Ht(n).length,()=>0))),o=await h}catch(t){if(hn(e,i),t===a&&a.aborted)return Jt;throw t}return Yt(o)?o:yn(e,o,a,r[6]===n.length?r[6]:0)}function xn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Zt(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>xn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Sn(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Cn(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Ht(t[3]).some(e=>e.id===n[1]))return;let i;try{await Xt(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function wn(e,t){e._committed=t,e.stores.setMatches(t)}function Tn(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Ht(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Zt(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Tt(n);wn(e,n),an(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Et(e,i,n,a,l,t)}async function En(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Dn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function On(e,t,n,r,i){let a=n.map(e=>({...e}));on(a);for(let t of r)rn(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await vn(e,o,r,t[0],i)}catch(t){throw an(e,a),t}if(Yt(s))an(e,a),s[0]===qt&&e._tx===t&&e._committed===n&&await Dn(e,t,s);else if(await yn(e,s,t[0].signal),e._tx!==t||e._committed!==n)an(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),rn(e,n))}wn(e,a),an(e,n,a)}}async function kn(e,t,n,r,i,a){let o=await bn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Yt(o)){let n=o[0]===qt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Sn(e,t),an(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Sn(e,t);return}await Dn(e,t,o);return}let s=o[1];if(e._tx===t&&await Cn(e,t),e._tx!==t){Sn(e,t),an(e,s),hn(e,o);return}let c=t[2],l=Ct(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Cn(e,t),e._tx!==t){Sn(e,t),an(e,s),hn(e,o);return}let n=await e.startTransition(()=>{Sn(e,t),Tn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&On(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):hn(e,o)})}async function An(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Ct(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await En(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});on(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){an(e,m),await En(e,n);return}e._preflight=void 0;let g,_=()=>kn(e,y,f,()=>xn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>En(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&sn(e,t,!1)}n[0].abort(),an(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&xn(e,y),g?.(_()),await y[5]):(an(e,y[3]),y[3]=[],g?.(),await En(e,y))}async function jn(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),on(a),o=(e._preloads??=new Map).set(i,a),s=await bn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),an(e,a)),i.abort()}if(!Yt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){me(e)||console.error(e);return}}}var Mn=`Error preloading route! ☝️`,Nn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Pe:this.parentRoute||ie();let r=n?Pe:t?.path;r&&r!==`/`&&(r=ae(r));let i=t?.id||r,a=n?Pe:O((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:O(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=oe(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Fe({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Pn=class extends Nn{constructor(e){super(e)}},Fn=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})),j=o(((e,t)=>{t.exports=Fn()}))(),In=class extends d.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?d.createElement(this.props.errorComponent??Ln,{error:e[0],reset:this.reset}):this.props.children}};function Ln({error:e}){let[t,n]=d.useState(!1);return(0,j.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,j.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,j.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,j.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,j.jsx)(`div`,{children:(0,j.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,j.jsx)(`code`,{children:e.message}):null})}):null]})}var Rn=()=>!0,zn=()=>!1;function Bn({children:e,fallback:t=null}){return(0,j.jsx)(d.Fragment,{children:Vn()?e:t})}function Vn(e=!0){return d.useSyncExternalStore(Hn,Rn,e?zn:Rn)}function Hn(){return()=>{}}var Un=d.createContext(null);function Wn(e){return d.useContext(Un)}function Gn(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Ut(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var Kn=d.createContext(void 0),qn=d.createContext(void 0);function Jn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Yn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Xn=[],Zn=0,{link:Qn,unlink:$n,propagate:er,checkDirty:tr,shallowPropagate:nr}=Jn({update(e){return e._update()},notify(e){Xn[ir++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,cr(e))}}),rr=0,ir=0,ar,or=0;function sr(e){try{++or,e()}finally{--or||lr()}}function cr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=$n(n,e)}function lr(){if(!(or>0)){for(;rr<ir;){let e=Xn[rr];Xn[rr++]=void 0,e.notify()}rr=0,ir=0}}function ur(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return ar!==void 0&&Qn(i,ar,Zn),i._snapshot},subscribe(e){let t=Yn(e),n={current:!1},r=dr(()=>{i.get(),n.current?(ar=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ar,o=t?.compare??Object.is;if(n)ar=i,++Zn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{ar=a,n&&(i.flags&=-5),cr(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&tr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&nr(e)}}else e&32&&(i.flags=e&-33);return ar!==void 0&&Qn(i,ar,Zn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(er(e),nr(e),lr())}},i}function dr(e){let t=()=>{let t=ar;ar=n,++Zn,n.depsTail=void 0,n.flags=6;try{return e()}finally{ar=t,n.flags&=-5,cr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&tr(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,cr(this)}};return t(),n}var fr=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),pr=o(((e,t)=>{t.exports=fr()})),mr=o((e=>{var t=u(),n=pr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),hr=o(((e,t)=>{t.exports=mr()}))();function gr(e,t){return e===t}function _r(e,t=e=>e,n){let r=n?.compare??gr,i=(0,d.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,d.useCallback)(()=>e.get(),[e]);return(0,hr.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var vr={};function yr(e,t){let n=d.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=y(n.current,i):i}}function br(e){let t=Wn(),n=d.useContext(e.from?qn:Kn),r=e.from??n,i=t.stores.getMatchStore(r),a=yr(e,t),o=_r(i,e=>e?a(e):vr);if(o!==vr)return o;(e.shouldThrow??!0)&&ie()}function xr(e){return br({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Sr(e){let{select:t,...n}=e;return br({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Cr(e){return br({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function wr(e){return br({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Tr(e){let t=Wn();return d.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Er(e){return br({...e,select:t=>e.select?e.select(t.context):t.context})}function Dr(...e){let t=d.useRef(e),n=t.current;return e.forEach((e,t)=>{x(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Or(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Mn)})}function kr(e,t){let n=typeof e==`string`&&E(e);if(n)return t.has(n)?e:null}function Ar(e,t,n,r){let i=ce(e.pathname,r),a=ce(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!x(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function jr(e,t,n){let r=Wn(),i=d.useRef(null),a=d.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,disabled:u,target:f,onClick:p,onBlur:m,onFocus:h,onMouseEnter:g,onMouseLeave:_,onTouchStart:v}=e,[y,b,x]=Dr(e.search,e.params,o),S=d.useContext(Kn),C=(r.stores._linkScopes??={})[S]??=Gn(r,S),[w,T,ee]=d.useMemo(()=>{let t=kr(s,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,c=()=>{let e=C[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=zr(t,r,u),s=u||o&&!E(o)?Ar(e,t,x,r.basepath):void 0;(!a||a[0]!==o||a[1]!==s)&&(a=[o,s]),i=e}return a};return[n,c,x?.includeHash&&(()=>{let e=c();return e[1]?o??=[e[0],!1]:e})]},[r,C,e.from,e.hash,e.href,s,y,b,e.state,e.mask,e.unsafeRelative,x,u]),[te,ne]=d.useSyncExternalStore(C[1],T,ee||T),D=ne===void 0&&te,re=u||te===void 0,ie=d.useRef(!1),O=e.reloadDocument||D||re?!1:c??r.options.defaultPreload,ae=l??r.options.defaultPreloadDelay??0,oe=d.useCallback(e=>{let t=e?.isIntersecting;t??O===`intent`?ae?i.t??=setTimeout(()=>{i.t=void 0,Or(r,w)},ae):Or(r,w):t===!1&&Lr(i)},[r,w,i,O,ae]);d.useEffect(()=>{if(!O)return;O===`render`&&!ie.current&&(ie.current=!0,Or(r,w));let e=!0,t;return O===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&oe(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),Lr(i)}},[r,w,O,oe,i]);let se=Fr(e,n);if(se.ref=t?a:i,D)return se.href=D,se;let ce=t=>{let n=f??t.currentTarget.getAttribute(`target`);!re&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(!n||n===`_self`)&&t.button===0&&(t.preventDefault(),Lr(i),r.navigate({...e,_fromLocation:w._fromLocation}))},le=()=>{O===`intent`&&Or(r,w)},ue=()=>{O===`intent`&&Lr(i)};return se.onClick=Rr(p,ce),se.onBlur=Rr(m,ue),se.onFocus=Rr(h,oe),se.onMouseEnter=Rr(g,oe),se.onMouseLeave=Rr(_,ue),se.onTouchStart=Rr(v,le),Ir(se,e,ne,te,re,n)}var Mr={},Nr={className:`active`},Pr=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Fr(e,t){let n={};for(let r in e)Pr.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Ir(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=m(n?o:s,{})??(n?Nr:Mr);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var Lr=e=>{clearTimeout(e.t),e.t=void 0},Rr=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function zr(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!te(i,t.protocolAllowlist))return i}var Br=d.memo(d.forwardRef((e,t)=>{let n=e._asChild||`a`,r=jr(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return d.createElement(n,r,i)}),Vr);function Vr(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Pr.has(r)||!x(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Hr=class extends Nn{constructor(e){super(e),this.useMatch=e=>br({...e,from:this.id}),this.useRouteContext=e=>Er({...e,from:this.id}),this.useSearch=e=>wr({...e,from:this.id}),this.useParams=e=>Cr({...e,from:this.id}),this.useLoaderDeps=e=>Sr({...e,from:this.id}),this.useLoaderData=e=>xr({...e,from:this.id}),this.useNavigate=()=>Tr({from:this.fullPath}),this.Link=d.forwardRef((e,t)=>(0,j.jsx)(Br,{ref:t,from:this.fullPath,...e}))}};function Ur(e){return new Hr(e)}var Wr=class extends Pn{constructor(e){super(e),this.useMatch=e=>br({...e,from:this.id}),this.useRouteContext=e=>Er({...e,from:this.id}),this.useSearch=e=>wr({...e,from:this.id}),this.useParams=e=>Cr({...e,from:this.id}),this.useLoaderDeps=e=>Sr({...e,from:this.id}),this.useLoaderData=e=>xr({...e,from:this.id}),this.useNavigate=()=>Tr({from:this.fullPath}),this.Link=d.forwardRef((e,t)=>(0,j.jsx)(Br,{ref:t,from:this.fullPath,...e}))}};function Gr(e){return new Wr(e)}function Kr(e){let t=Wn(),n=`not-found-${_r(t.stores.location,e=>e.pathname)}-${_r(t.stores.status)}`;return(0,j.jsx)(In,{getResetKey:()=>n,onCatch:(t,n)=>{if(me(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(me(t))return e.fallback?.(t);throw t},children:e.children})}function qr(){return(0,j.jsx)(`p`,{children:`Not Found`})}function Jr(e,t,n){return t.options.notFoundComponent?(0,j.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,j.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,j.jsx)(qr,{})}function Yr(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,j.jsx)(n,{}):null}var Xr=(e,t)=>e[0]===t[0]&&e[1]===t[1],Zr=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Qr=d.memo(function({routeId:e}){let t=Wn();return $r(t,_r(t.stores.getMatchStore(e)))});function $r(e,t){let n=e.routesById[t.routeId],r=Yr(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Zr(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,j.jsx)(ei,{match:t});s&&(l=(0,j.jsx)(Bn,{fallback:r,children:l})),o&&(l=(0,j.jsx)(Kr,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return d.createElement(o,e)},children:l})),i&&(l=(0,j.jsx)(In,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(me(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,j.jsx)(d.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,j.jsx)(Kn.Provider,{value:t.routeId,children:(0,j.jsxs)(u,{children:[l,null]})}):(0,j.jsxs)(Kn.Provider,{value:t.routeId,children:[l,null]})}var ei=d.memo(function({match:e}){let t=Wn(),n=e.routeId,r=t.routesById[n],i=d.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=d.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,j.jsx)(e,{},i):(0,j.jsx)(ti,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Zr(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Yr(t,r)}if(e.status===`notFound`)return Jr(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ti=d.memo(function(){let e=Wn(),t=d.useContext(Kn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=_r(a,e=>[!!e._notFound,e.error],{compare:Xr}),i=_r(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Jr(e,e.routesById[t],r);if(!i)return null;let a=(0,j.jsx)(Qr,{routeId:i});return t===`__root__`?(0,j.jsx)(d.Suspense,{fallback:Yr(e),children:a}):a});function ni(e,t){let n=e[1];e.length=0,n?.(t)}function ri({t:e}){let t=Wn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ni(n,!1),n.push(i,a),e(t),d.startTransition(r)}),f(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(oe(r.publicHref)!==oe(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Ct(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ii(){let e=Wn(),t=e.routesById[Pe],n=Yr(e,t),r=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ri,{t:d.useState()[1]}),e.ssr?(0,j.jsx)(ai,{}):(0,j.jsx)(d.Suspense,{fallback:n,children:(0,j.jsx)(ai,{})})]});return e.options.InnerWrap?(0,j.jsx)(e.options.InnerWrap,{children:r}):r}function ai(){let e=Wn(),t=e._rendered,n=_r(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;f(()=>{t[0]===n&&ni(t,!0)},[t,n]);let a=i?(0,j.jsx)(Qr,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,j.jsx)(In,{getResetKey:()=>r,onCatch:void 0,children:a})}var oi=e=>({createMutableStore:ur,createReadonlyStore:ur,batch:sr}),si=e=>new ci(e),ci=class extends Dt{constructor(e){super(e,oi)}};function li({router:e,children:t,...n}){g(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,j.jsx)(Un.Provider,{value:e,children:t});return e.options.Wrap?(0,j.jsx)(e.options.Wrap,{children:r}):r}function ui({router:e,...t}){return(0,j.jsx)(li,{router:e,...t,children:(0,j.jsx)(ii,{})})}var di=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,te());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){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&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,D=ne.port2;ne.port1.onmessage=ee,te=function(){D.postMessage(null)}}else te=function(){_(ee,0)};function re(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,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),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}}}})),fi=o(((e,t)=>{t.exports=di()})),pi=o((e=>{var t=u();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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=d(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=d(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=d(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=d(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),mi=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=pi()})),hi=o((e=>{var t=fi(),n=u(),r=mi();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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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 d(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}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),ee=Symbol.for(`react.transitional.element`),te=Symbol.for(`react.portal`),ne=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),O=Symbol.for(`react.context`),ae=Symbol.for(`react.forward_ref`),oe=Symbol.for(`react.suspense`),se=Symbol.for(`react.suspense_list`),ce=Symbol.for(`react.memo`),le=Symbol.for(`react.lazy`),ue=Symbol.for(`react.activity`),de=Symbol.for(`react.legacy_hidden`),fe=Symbol.for(`react.memo_cache_sentinel`),pe=Symbol.for(`react.view_transition`),me=Symbol.for(`react.recoverable`),he=Symbol.iterator;function ge(e){return typeof e!=`object`||!e?null:(e=he&&e[he]||e[`@@iterator`],typeof e==`function`?e:null)}var _e=Symbol.for(`react.client.reference`);function ve(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===_e?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ne:return`Fragment`;case re:return`Profiler`;case D:return`StrictMode`;case oe:return`Suspense`;case se:return`SuspenseList`;case ue:return`Activity`;case pe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case te:return`Portal`;case O:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case ae:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ce:return t=e.displayName||null,t===null?ve(e.type)||`Memo`:t;case le:t=e._payload,e=e._init;try{return ve(e(t))}catch{}}return null}var ye=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},xe=[],Se=-1;function Ce(e){return{current:e}}function we(e){0>Se||(e.current=xe[Se],xe[Se]=null,Se--)}function Te(e,t){Se++,xe[Se]=e.current,e.current=t}var Ee=Ce(null),De=Ce(null),Oe=Ce(null),ke=Ce(null);function Ae(e,t){switch(Te(Oe,t),Te(De,e),Te(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kp(t),e=Ap(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}we(Ee),Te(Ee,e)}function je(){we(Ee),we(De),we(Oe)}function Me(e){var t=e.memoizedState;t!==null&&(Ch._currentValue=t.memoizedState,Te(ke,e)),t=Ee.current;var n=Ap(t,e.type);t!==n&&(Te(De,e),Te(Ee,n))}function Ne(e){De.current===e&&(we(Ee),we(De)),ke.current===e&&(we(ke),Ch._currentValue=be)}var Pe,Fe;function Ie(e){if(Pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||``,Fe=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+Pe+e+Fe}var Le=!1;function Re(e,t){if(!e||Le)return``;Le=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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(`
5
+ `),l=s.split(`
6
+ `);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=`
7
+ `+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{Le=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ie(n):``}function ze(e,t){switch(e.tag){case 26:case 27:case 5:return Ie(e.type);case 16:return Ie(`Lazy`);case 13:return e.child!==t&&t!==null?Ie(`Suspense Fallback`):Ie(`Suspense`);case 19:return Ie(`SuspenseList`);case 0:case 15:return Re(e.type,!1);case 11:return Re(e.type.render,!1);case 1:return Re(e.type,!0);case 31:return Ie(`Activity`);case 30:return Ie(`ViewTransition`);default:return``}}function Be(e){try{var t=``,n=null;do t+=ze(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var Ve=Object.prototype.hasOwnProperty,He=t.unstable_scheduleCallback,Ue=t.unstable_cancelCallback,We=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ke=t.unstable_now,qe=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,Ye=t.unstable_UserBlockingPriority,Xe=t.unstable_NormalPriority,Ze=t.unstable_LowPriority,Qe=t.unstable_IdlePriority,$e=t.log,et=t.unstable_setDisableYieldValue,tt=null,nt=null;function rt(e){if(typeof $e==`function`&&et(e),nt&&typeof nt.setStrictMode==`function`)try{nt.setStrictMode(tt,e)}catch{}}var it=Math.clz32?Math.clz32:st,at=Math.log,ot=Math.LN2;function st(e){return e>>>=0,e===0?32:31-(at(e)/ot|0)|0}var ct=256,lt=262144,ut=4194304;function dt(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&-e;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 ft(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=dt(n))):i=dt(o):i=dt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=dt(n))):i=dt(o)):i=dt(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 pt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-it(n),i=1<<r;t|=e[r],n&=~i}return t}function ht(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 gt(){var e=ut;return ut<<=1,!(ut&62914560)&&(ut=4194304),e}function _t(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yt(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-it(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&&bt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function bt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-it(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function xt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function St(e,t){var n=t&-t;return n=n&42?1:Ct(n),(n&(e.suspendedLanes|t))===0?n:0}function Ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function wt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Tt(){var e=A.p;return e===0?(e=window.event,e===void 0?32:zh(e.type)):e}function Et(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var Dt=Math.random().toString(36).slice(2),Ot=`__reactFiber$`+Dt,kt=`__reactProps$`+Dt,At=`__reactContainer$`+Dt,jt=`__reactEvents$`+Dt,Mt=`__reactListeners$`+Dt,Nt=`__reactHandles$`+Dt,Pt=`__reactResources$`+Dt,Ft=`__reactMarker$`+Dt,It=`__reactLoad$`+Dt;function Lt(e){delete e[Ot],delete e[kt],delete e[Mt],delete e[Nt]}function Rt(e){var t;if(t=e[Ot])return t;for(var n=e.parentNode;n;){if(t=n[At]||n[Ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=L(e);e!==null;){if(n=e[Ot])return n;e=L(e)}return t}e=n,n=e.parentNode}return null}function zt(e){if(e=e[Ot]||e[At]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Vt(e){var t=e[Pt];return t||=e[Pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ht(e){e[Ft]=!0}function Ut(e){e[It]=void 0}var Wt=new Set,Gt={};function Kt(e,t){qt(e,t),qt(e+`Capture`,t)}function qt(e,t){for(Gt[e]=t,e=0;e<t.length;e++)Wt.add(t[e])}var Jt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Yt={},Xt={};function Zt(e){return Ve.call(Xt,e)?!0:Ve.call(Yt,e)?!1:Jt.test(e)?Xt[e]=!0:(Yt[e]=!0,!1)}var Qt=!1;function $t(){var e=Qt;return Qt=!1,e}function en(e,t,n){if(Zt(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 tn(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 nn(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 rn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function an(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function on(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 sn(e){if(!e._valueTracker){var t=an(e)?`checked`:`value`;e._valueTracker=on(e,t,``+e[t])}}function cn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=an(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var ln=/[\n"\\]/g;function un(e){return e.replace(ln,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function dn(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=``+rn(t)):e.value!==``+rn(t)&&(e.value=``+rn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):pn(e,rn(n)):o===`number`&&e.value==t?pn(e,rn(e.value)):pn(e,rn(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=``+rn(s):e.removeAttribute(`name`)}function fn(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)){sn(e);return}n=n==null?``:``+rn(n),t=t==null?n:``+rn(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),sn(e)}function pn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function mn(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=``+rn(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 hn(e,t,n){t!=null&&(t=``+rn(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+rn(n)}function gn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ye(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=rn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),sn(e)}function _n(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vn=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 yn(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||vn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function bn(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]=``,Qt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(yn(e,a,r),Qt=!0)}else for(var o in t)t.hasOwnProperty(o)&&yn(e,o,t[o])}function xn(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 Sn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Cn=/^[\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 wn(e){return Cn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Tn(){}var En=null;function Dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var On=null,kn=null;function An(e){var t=zt(e);if(t&&(e=t.stateNode)){var n=e[kt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(dn(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="`+un(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[kt]||null;if(!a)throw Error(i(90));dn(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&&cn(r)}break a;case`textarea`:hn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&mn(e,!!n.multiple,t,!1)}}}var jn=!1;function Mn(e,t,n){if(jn)return e(t,n);jn=!0;try{return e(t)}finally{if(jn=!1,(On!==null||kn!==null)&&(tf(),On&&(t=On,e=kn,kn=On=null,An(t),e)))for(t=0;t<e.length;t++)An(e[t])}}function Nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[kt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Pn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Fn=!1;if(Pn)try{var j={};Object.defineProperty(j,"passive",{get:function(){Fn=!0}}),window.addEventListener(`test`,j,j),window.removeEventListener(`test`,j,j)}catch{Fn=!1}var In=null,Ln=null,Rn=null;function zn(){if(Rn)return Rn;var e,t=Ln,n=t.length,r,i=`value`in In?In.value:In.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 Rn=i.slice(e,1<r?1-r:void 0)}function Bn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Vn(){return!0}function Hn(){return!1}function Un(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)?Vn:Hn,this.isPropagationStopped=Hn,this}return T(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=Vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){},isPersistent:Vn}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=Un(Wn),Kn=T({},Wn,{view:0,detail:0}),qn=Un(Kn),Jn,Yn,Xn,Zn=T({},Kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cr,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`?(Jn=e.screenX-Xn.screenX,Yn=e.screenY-Xn.screenY):Yn=Jn=0,Xn=e),Jn)},movementY:function(e){return`movementY`in e?e.movementY:Yn}}),Qn=Un(Zn),$n=Un(T({},Zn,{dataTransfer:0})),er=Un(T({},Kn,{relatedTarget:0})),tr=Un(T({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0})),nr=Un(T({},Wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),rr=Un(T({},Wn,{data:0})),ir={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},ar={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`},or={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function sr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=or[e])?!!t[e]:!1}function cr(){return sr}var lr=Un(T({},Kn,{key:function(e){if(e.key){var t=ir[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?ar[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cr,charCode:function(e){return e.type===`keypress`?Bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ur=Un(T({},Zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dr=Un(T({},Wn,{submitter:0})),fr=Un(T({},Kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cr})),pr=Un(T({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),mr=Un(T({},Zn,{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})),hr=Un(T({},Wn,{newState:0,oldState:0,source:0})),gr=[9,13,27,32],_r=Pn&&`CompositionEvent`in window,vr=null;Pn&&`documentMode`in document&&(vr=document.documentMode);var yr=Pn&&`TextEvent`in window&&!vr,br=Pn&&(!_r||vr&&8<vr&&11>=vr),xr=` `,Sr=!1;function Cr(e,t){switch(e){case`keyup`:return gr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function wr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Tr=!1;function Er(e,t){switch(e){case`compositionend`:return wr(t);case`keypress`:return t.which===32?(Sr=!0,xr):null;case`textInput`:return e=t.data,e===xr&&Sr?null:e;default:return null}}function Dr(e,t){if(Tr)return e===`compositionend`||!_r&&Cr(e,t)?(e=zn(),Rn=Ln=In=null,Tr=!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 br&&t.locale!==`ko`?null:t.data;default:return null}}var Or={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 kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Or[e.type]:t===`textarea`}function Ar(e,t,n,r){On?kn?kn.push(r):kn=[r]:On=r,t=fp(t,`onChange`),0<t.length&&(n=new Gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var jr=null,Mr=null;function Nr(e){ip(e,0)}function Pr(e){if(cn(Bt(e)))return e}function Fr(e,t){if(e===`change`)return t}var Ir=!1;if(Pn){var Lr;if(Pn){var Rr=`oninput`in document;if(!Rr){var zr=document.createElement(`div`);zr.setAttribute(`oninput`,`return;`),Rr=typeof zr.oninput==`function`}Lr=Rr}else Lr=!1;Ir=Lr&&(!document.documentMode||9<document.documentMode)}function Br(){jr&&(jr.detachEvent(`onpropertychange`,Vr),Mr=jr=null)}function Vr(e){if(e.propertyName===`value`&&Pr(Mr)){var t=[];Ar(t,Mr,e,Dn(e)),Mn(Nr,t)}}function Hr(e,t,n){e===`focusin`?(Br(),jr=t,Mr=n,jr.attachEvent(`onpropertychange`,Vr)):e===`focusout`&&Br()}function Ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Pr(Mr)}function Wr(e,t){if(e===`click`)return Pr(t)}function Gr(e,t){if(e===`input`||e===`change`)return Pr(t)}function Kr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var qr=typeof Object.is==`function`?Object.is:Kr;function Jr(e,t){if(qr(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(!Ve.call(t,i)||!qr(e[i],t[i]))return!1}return!0}function Yr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zr(e,t){var n=Xr(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=Xr(n)}}function Qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $r(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yr(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=Yr(e.document)}return t}function ei(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 ti=Pn&&`documentMode`in document&&11>=document.documentMode,ni=null,ri=null,ii=null,ai=!1;function oi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ai||ni==null||ni!==Yr(r)||(r=ni,`selectionStart`in r&&ei(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}),ii&&Jr(ii,r)||(ii=r,r=fp(ri,`onSelect`),0<r.length&&(t=new Gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ni)))}function si(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ci={animationend:si(`Animation`,`AnimationEnd`),animationiteration:si(`Animation`,`AnimationIteration`),animationstart:si(`Animation`,`AnimationStart`),transitionrun:si(`Transition`,`TransitionRun`),transitionstart:si(`Transition`,`TransitionStart`),transitioncancel:si(`Transition`,`TransitionCancel`),transitionend:si(`Transition`,`TransitionEnd`)},li={},ui={};Pn&&(ui=document.createElement(`div`).style,`AnimationEvent`in window||(delete ci.animationend.animation,delete ci.animationiteration.animation,delete ci.animationstart.animation),`TransitionEvent`in window||delete ci.transitionend.transition);function di(e){if(li[e])return li[e];if(!ci[e])return e;var t=ci[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ui)return li[e]=t[n];return e}var pi=di(`animationend`),hi=di(`animationiteration`),gi=di(`animationstart`),_i=di(`transitionrun`),vi=di(`transitionstart`),yi=di(`transitioncancel`),bi=di(`transitionend`),xi=new Map,Si=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Si.push(`scrollEnd`);function Ci(e,t){xi.set(e,t),Kt(t,[e])}var wi=0;function Ti(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Id.identifierPrefix;var n=wi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Ei(e){if(e==null||typeof e==`string`)return e;var t=null,n=Wd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Di(e,t){return e=Ei(e),t=Ei(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Oi=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)},ki=[],Ai=0,ji=0;function Mi(){for(var e=Ai,t=ji=Ai=0;t<e;){var n=ki[t];ki[t++]=null;var r=ki[t];ki[t++]=null;var i=ki[t];ki[t++]=null;var a=ki[t];if(ki[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ii(n,i,a)}}function Ni(e,t,n,r){ki[Ai++]=e,ki[Ai++]=t,ki[Ai++]=n,ki[Ai++]=r,ji|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pi(e,t,n,r){return Ni(e,t,n,r),Li(e)}function Fi(e,t){return Ni(e,null,null,t),Li(e)}function Ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-it(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Li(e){if(50<Gd)throw Gd=0,Kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ri={};function zi(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 Bi(e,t,n,r){return new zi(e,t,n,r)}function Vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hi(e,t){var n=e.alternate;return n===null?(n=Bi(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&1206910976,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 Ui(e,t){e.flags&=1206910978;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 Wi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Vi(r)&&(s=1);else if(typeof r==`string`)s=lh(e,n,Ee.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ue:return e=Bi(31,n,t,a),e.elementType=ue,e.lanes=o,e;case ne:return Gi(n.children,a,o,t);case D:s=8,a|=24;break;case re:return e=Bi(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case oe:return e=Bi(13,n,t,a),e.elementType=oe,e.lanes=o,e;case se:return e=Bi(19,n,t,a),e.elementType=se,e.lanes=o,e;case de:case pe:return e=a|32,e=Bi(30,n,t,e),e.elementType=pe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case O:s=10;break a;case ie:s=9;break a;case ae:s=11;break a;case ce:s=14;break a;case le:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Bi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Gi(e,t,n,r){return e=Bi(7,e,r,t),e.lanes=n,e}function Ki(e,t,n){return e=Bi(6,e,null,t),e.lanes=n,e}function qi(e){var t=Bi(18,null,null,0);return t.stateNode=e,t}function Ji(e,t,n){return t=Bi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yi=new WeakMap;function Xi(e,t){if(typeof e==`object`&&e){var n=Yi.get(e);return n===void 0?(t={value:e,source:t,stack:Be(t)},Yi.set(e,t),t):n}return{value:e,source:t,stack:Be(t)}}var Zi=[],Qi=0,$i=null,ea=0,ta=[],na=0,ra=null,ia=1,aa=``;function oa(e,t){Zi[Qi++]=ea,Zi[Qi++]=$i,$i=e,ea=t}function sa(e,t,n){ta[na++]=ia,ta[na++]=aa,ta[na++]=ra,ra=e;var r=ia;e=aa;var i=32-it(r)-1;r&=~(1<<i),n+=1;var a=32-it(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ia=1<<32-it(t)+i|n<<i|r,aa=a+e}else ia=1<<a|n<<i|r,aa=e}function ca(e){e.return!==null&&(oa(e,1),sa(e,1,0))}function la(e){for(;e===$i;)$i=Zi[--Qi],Zi[Qi]=null,ea=Zi[--Qi],Zi[Qi]=null;for(;e===ra;)ra=ta[--na],ta[na]=null,aa=ta[--na],ta[na]=null,ia=ta[--na],ta[na]=null}function ua(e,t){ta[na++]=ia,ta[na++]=aa,ta[na++]=ra,ia=t.id,aa=t.overflow,ra=e}var da=null,M=null,N=!1,fa=null,pa=!1,ma=Error(i(519));function ha(e){throw xa(Xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ma}function ga(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ot]=e,t[kt]=r,n){case`dialog`:ap(`cancel`,t),ap(`close`,t);break;case`iframe`:case`object`:case`embed`:ap(`load`,t);break;case`video`:case`audio`:for(n=0;n<np.length;n++)ap(np[n],t);break;case`source`:ap(`error`,t);break;case`img`:case`image`:case`link`:ap(`error`,t),ap(`load`,t);break;case`details`:ap(`toggle`,t);break;case`input`:ap(`invalid`,t),fn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:ap(`invalid`,t);break;case`textarea`:ap(`invalid`,t),gn(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||vp(t.textContent,n)?(r.popover!=null&&(ap(`beforetoggle`,t),ap(`toggle`,t)),r.onScroll!=null&&ap(`scroll`,t),r.onScrollEnd!=null&&ap(`scrollend`,t),r.onClick!=null&&(t.onclick=Tn),t=!0):t=!1,t||ha(e,!0)}function _a(e){for(da=e.return;da;)switch(da.tag){case 5:case 31:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:da=da.return}}function va(e){if(e!==da)return!1;if(!N)return _a(e),N=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Mp(e.type,e.memoizedProps)),n=!n),n&&M&&ha(e),_a(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));M=I(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));M=I(e)}else t===27?(t=M,Vp(e.type)?(e=Om,Om=null,M=e):M=t):M=da?Dm(e.stateNode.nextSibling):null;return!0}function ya(){M=da=null,N=!1}function ba(){var e=fa;return e!==null&&(Od===null?Od=e:Od.push.apply(Od,e),fa=null),e}function xa(e){fa===null?fa=[e]:fa.push(e)}var Sa=Ce(null),Ca=null,wa=null;function Ta(e,t,n){Te(Sa,t._currentValue),t._currentValue=n}function Ea(e){e._currentValue=Sa.current,we(Sa)}function Da(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 Oa(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),Da(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),Da(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Da(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 ka(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;qr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ke.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Ch]:e.push(Ch))}a=a.return}return e!==null&&Oa(t,e,n,r),t.flags|=262144,e!==null}function Aa(e){for(e=e.firstContext;e!==null;){if(!qr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ja(e){Ca=e,wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ma(e){return Pa(Ca,e)}function Na(e,t){return Ca===null&&ja(e),Pa(e,t)}function Pa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},wa===null){if(e===null)throw Error(i(308));wa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else wa=wa.next=t;return n}var Fa=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()})}},Ia=t.unstable_scheduleCallback,La=t.unstable_NormalPriority,Ra={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function za(){return{controller:new Fa,data:new Map,refCount:0}}function Ba(e){e.refCount--,e.refCount===0&&Ia(La,function(){e.controller.abort()})}function Va(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ha=null;function Ua(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Wa=null,Ga=0,Ka=0,qa=null;function Ja(e,t){if(Wa===null){var n=Wa=[];Ga=0,Ka=Zf(),qa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ga++,t.then(Ya,Ya),t}function Ya(){if(--Ga===0&&(Ha=null,Wa!==null)){qa!==null&&(qa.status=`fulfilled`);var e=Wa;Wa=null,Ka=0,qa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Xa(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 Za=k.S;k.S=function(e,t){if(jd=Ke(),typeof t==`object`&&t&&typeof t.then==`function`&&Ja(e,t),Ha!==null)for(var n=Lf;n!==null;)Va(n,Ha),n=n.next;if(n=e.types,n!==null){for(var r=Lf;r!==null;)Va(r,n),r=r.next;if(Ka!==0){r=Ha,r===null&&(r=Ha=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Za!==null&&Za(e,t)};var Qa=Ce(null);function $a(){var e=Qa.current;return e===null?fd.pooledCache:e}function eo(e,t){t===null?Te(Qa,Qa.current):Te(Qa,t.pool)}function to(){var e=$a();return e===null?null:{parent:Ra._currentValue,pool:e}}var no=Error(i(460)),ro=Error(i(474)),io=Error(i(542)),ao={then:function(){}};function oo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function so(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Tn,Tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,fo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(Tn,Tn);else{if(e=fd,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,fo(e),e}throw lo=t,no}}function co(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(lo=e,no):e}}var lo=null;function uo(){if(lo===null)throw Error(i(459));var e=lo;return lo=null,e}function fo(e){if(e===no||e===io)throw Error(i(483))}var po=null,mo=0;function ho(e){var t=mo;return mo+=1,po===null&&(po=[]),so(po,e,t)}function go(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function _o(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function vo(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=Hi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ki(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===ne?(e=d(e,t,n.props.children,r,n.key),go(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===le&&co(i)===t.type)?(t=a(t,n.props),go(t,n),t.return=e,t):(t=Wi(n.type,n.key,n.props,null,e.mode,r),go(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=Ji(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Gi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ki(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ee:return n=Wi(t.type,t.key,t.props,null,e.mode,n),go(n,t),n.return=e,n;case te:return t=Ji(t,e.mode,n),t.return=e,t;case le:return t=co(t),f(e,t,n)}if(ye(t)||ge(t))return t=Gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ho(t),n);if(t.$$typeof===O)return f(e,Na(e,t),n);_o(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 ee:return n.key===i?l(e,t,n,r):null;case te:return n.key===i?u(e,t,n,r):null;case le:return n=co(n),p(e,t,n,r)}if(ye(n)||ge(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ho(n),r);if(n.$$typeof===O)return p(e,t,Na(e,n),r);_o(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 ee:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case te:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case le:return r=co(r),m(e,t,n,r,i)}if(ye(r)||ge(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ho(r),i);if(r.$$typeof===O)return m(e,t,n,Na(t,r),i);_o(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),N&&oa(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 N&&oa(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(_.key===null?h:_.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)}),N&&oa(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),N&&oa(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 N&&oa(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(_.key===null?g:_.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)}),N&&oa(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ne&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ee:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ne){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),go(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===le&&co(l)===r.type){n(e,r.sibling),c=a(r,o.props),go(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ne?(c=Gi(o.props.children,e.mode,c,o.key),go(c,o),c.return=e,e=c):(c=Wi(o.type,o.key,o.props,null,e.mode,c),go(c,o),c.return=e,e=c)}return s(e);case te:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ji(o,e.mode,c),c.return=e,e=c}return s(e);case le:return o=co(o),_(e,r,o,c)}if(ye(o))return h(e,r,o,c);if(ge(o)){if(l=ge(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ho(o),c);if(o.$$typeof===O)return _(e,r,Na(e,o),c);_o(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=Ki(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{mo=0;var i=_(e,t,n,r);return po=null,i}catch(t){if(t===no||t===io)throw t;var a=Bi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var yo=vo(!0),bo=vo(!1),xo=!1;function So(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Co(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 wo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function To(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,dd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Li(e),Ii(e,null,n),t}return Ni(e,r,t,n),Li(e)}function Eo(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,xt(e,n)}}function Do(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Oo=!1;function ko(){if(Oo){var e=qa;if(e!==null)throw e}}function Ao(e,t,n,r){Oo=!1;var i=e.updateQueue;xo=!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?(md&f)===f:(r&f)===f){f!==0&&f===Ka&&(Oo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:xo=!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),Sd|=o,e.lanes=o,e.memoizedState=d}}function jo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Mo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jo(n[e],t)}var No=Ce(null),Po=Ce(0);function Fo(e,t){e=bd,Te(Po,e),Te(No,t),bd=e|t.baseLanes}function Io(){Te(Po,bd),Te(No,No.current)}function Lo(){bd=Po.current,we(No),we(Po)}var Ro=Ce(null),zo=null;function Bo(e){var t=e.alternate;Te(Go,Go.current&1),Te(Ro,e),zo===null&&(t===null||No.current!==null||t.memoizedState!==null)&&(zo=e)}function Vo(e){Te(Go,Go.current),Te(Ro,e),zo===null&&(zo=e)}function Ho(e){e.tag===22?(Te(Go,Go.current),Te(Ro,e),zo===null&&(zo=e)):Uo()}function Uo(){Te(Go,Go.current),Te(Ro,Ro.current)}function Wo(e){we(Ro),zo===e&&(zo=null),we(Go)}var Go=Ce(0);function Ko(e,t){Te(Ro,Ro.current),Te(Go,t)}function qo(e){we(Go),we(Ro),zo===e&&(zo=null)}function Jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Tm(n)||Em(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Yo=0,Xo=null,Zo=null,Qo=null,$o=!1,es=!1,ts=!1,ns=0,rs=0,is=null,as=0;function os(){throw Error(i(321))}function ss(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function cs(e,t,n,r,i,a){return Yo=a,Xo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?wc:Tc,ts=!1,a=n(r,i),ts=!1,es&&(a=us(t,n,r,i)),ls(e),a}function ls(e){k.H=Cc;var t=Zo!==null&&Zo.next!==null;if(Yo=0,Qo=Zo=Xo=null,$o=!1,rs=0,is=null,t)throw Error(i(300));e===null||Hc||(e=e.dependencies,e!==null&&Aa(e)&&(Hc=!0))}function us(e,t,n,r){Xo=e;var a=0;do{if(es&&(is=null),rs=0,es=!1,25<=a)throw Error(i(301));if(a+=1,Qo=Zo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Ec,o=t(n,r)}while(es);return o}function ds(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?vs(t):t,e=e.useState()[0],(Zo===null?null:Zo.memoizedState)!==e&&(Xo.flags|=1024),t}function fs(){var e=ns!==0;return ns=0,e}function ps(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ms(e){if($o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}$o=!1}Yo=0,Qo=Zo=Xo=null,es=!1,rs=ns=0,is=null}function hs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qo===null?Xo.memoizedState=Qo=e:Qo=Qo.next=e,Qo}function gs(){if(Zo===null){var e=Xo.alternate;e=e===null?null:e.memoizedState}else e=Zo.next;var t=Qo===null?Xo.memoizedState:Qo.next;if(t!==null)Qo=t,Zo=e;else{if(e===null)throw Xo.alternate===null?Error(i(467)):Error(i(310));Zo=e,e={memoizedState:Zo.memoizedState,baseState:Zo.baseState,baseQueue:Zo.baseQueue,queue:Zo.queue,next:null},Qo===null?Xo.memoizedState=Qo=e:Qo=Qo.next=e}return Qo}function _s(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vs(e){var t=rs;return rs+=1,is===null&&(is=[]),e=so(is,e,t),t=Xo,(Qo===null?t.memoizedState:Qo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?wc:Tc),e}function ys(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return vs(e);if(e.$$typeof===me)return;if(e.$$typeof===O)return Ma(e)}throw Error(i(438,String(e)))}function bs(e){var t=null,n=Xo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Xo.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=_s(),Xo.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]=fe;return t.index++,n}function P(e,t){return typeof t==`function`?t(e):t}function xs(e){return Ss(gs(),Zo,e)}function Ss(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?(Yo&f)===f:(md&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===Ka&&(d=!0);else if((Yo&p)===p){u=u.next,p===Ka&&(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,Xo.lanes|=p,Sd|=p;f=u.action,ts&&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,Xo.lanes|=f,Sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!qr(o,e.memoizedState)&&(Hc=!0,d&&(n=qa,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 Cs(e){var t=gs(),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);qr(o,t.memoizedState)||(Hc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ws(e,t,n){var r=Xo,a=gs(),o=N;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!qr((Zo||a).memoizedState,n);if(s&&(a.memoizedState=n,Hc=!0),a=a.queue,Ys(Ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Qo!==null&&!!(Qo.memoizedState.tag&1),Ws(e?9:8,{destroy:void 0},Es.bind(null,r,a,n,t),null),e){if(r.flags|=2048,fd===null)throw Error(i(349));o||Yo&127||Ts(r,t,n)}return n}function Ts(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xo.updateQueue,t===null?(t=_s(),Xo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Es(e,t,n,r){t.value=n,t.getSnapshot=r,Os(t)&&ks(e)}function Ds(e,t,n){return n(function(){Os(t)&&ks(e)})}function Os(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qr(e,n)}catch{return!0}}function ks(e){var t=Fi(e,2);t!==null&&Xd(t,e,2)}function As(e){var t=hs();if(typeof e==`function`){var n=e;if(e=n(),ts){rt(!0);try{n()}finally{rt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:P,lastRenderedState:e},t}function js(e,t,n,r){return e.baseState=n,Ss(e,Zo,typeof r==`function`?r:P)}function Ms(e,t,n,r,a){if(bc(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)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ns(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};o.types=a===null?null:a.types,k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Ps(e,t,s)}catch(n){Is(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Ps(e,t,a)}catch(n){Is(e,t,n)}}function Ps(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Fs(e,t,n)},function(n){return Is(e,t,n)}):Fs(e,t,n)}function Fs(e,t,n){t.status=`fulfilled`,t.value=n,Ls(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ns(e,n)))}function Is(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ls(t),t=t.next;while(t!==r)}e.action=null}function Ls(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Rs(e,t){return t}function zs(e,t){if(N){var n=fd.formState;if(n!==null){a:{var r=Xo;if(N){if(M){b:{for(var i=M,a=pa;i.nodeType!==8;)if(!a||(i=Dm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){M=Dm(i.nextSibling),r=i.data===`F!`;break a}}ha(r)}r=!1}r&&(t=n[0])}}return n=hs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:t},n.queue=r,n=_c.bind(null,Xo,r),r.dispatch=n,r=As(!1),a=yc.bind(null,Xo,!1,r.queue),r=hs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ms.bind(null,Xo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Bs(e){return Vs(gs(),Zo,e)}function Vs(e,t,n){if(t=Ss(e,t,Rs)[0],e=xs(P)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=vs(t)}catch(e){throw e===no?io:e}else r=t;t=gs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Xo.flags|=2048,Ws(9,{destroy:void 0},Hs.bind(null,i,n),null)),[r,a,e]}function Hs(e,t){e.action=t}function Us(e){var t=gs(),n=Zo;if(n!==null)return Vs(t,n,e);gs(),t=t.memoizedState,n=gs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ws(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Xo.updateQueue,t===null&&(t=_s(),Xo.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 Gs(){return gs().memoizedState}function Ks(e,t,n,r){var i=hs();Xo.flags|=e,i.memoizedState=Ws(1|t,{destroy:void 0},n,r===void 0?null:r)}function qs(e,t,n,r){var i=gs();r=r===void 0?null:r;var a=i.memoizedState.inst;Zo!==null&&r!==null&&ss(r,Zo.memoizedState.deps)?i.memoizedState=Ws(t,a,n,r):(Xo.flags|=e,i.memoizedState=Ws(1|t,a,n,r))}function Js(e,t){Ks(8390656,8,e,t)}function Ys(e,t){qs(2048,8,e,t)}function Xs(e){Xo.flags|=4;var t=Xo.updateQueue;if(t===null)t=_s(),Xo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Zs(e){var t=gs().memoizedState;return Xs({ref:t,nextImpl:e}),function(){if(dd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Qs(e,t){return qs(4,2,e,t)}function $s(e,t){return qs(4,4,e,t)}function ec(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 tc(e,t,n){n=n==null?null:n.concat([e]),qs(4,4,ec.bind(null,t,e),n)}function nc(){}function rc(e,t){var n=gs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ss(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ic(e,t){var n=gs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ss(t,r[1]))return r[0];if(r=e(),ts){rt(!0);try{e()}finally{rt(!1)}}return n.memoizedState=[r,t],r}function ac(e,t,n){return n===void 0||Yo&1073741824&&!(md&261930)?e.memoizedState=t:(e.memoizedState=n,e=Jd(),Xo.lanes|=e,Sd|=e,n)}function oc(e,t,n,r){return qr(n,t)?n:No.current===null?!(Yo&106)||Yo&1073741824&&!(md&261930)?(Hc=!0,e.memoizedState=n):(e=Jd(),Xo.lanes|=e,Sd|=e,t):(e=ac(e,n,r),qr(e,t)||(Hc=!0),e)}function sc(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};s.types=o===null?null:o.types,k.T=s,yc(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?vc(e,t,Xa(c,r),qd(e)):vc(e,t,r,qd(e))}catch(n){vc(e,t,{then:function(){},status:`rejected`,reason:n},qd())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function cc(){}function lc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=uc(e).queue;sc(e,a,t,be,n===null?cc:function(){return dc(e),n(r)})}function uc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:P,lastRenderedState:be},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:P,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dc(e){var t=uc(e);t.next===null&&(t=e.alternate.memoizedState),vc(e,t.next.queue,{},qd())}function fc(){return Ma(Ch)}function pc(){return gs().memoizedState}function mc(){return gs().memoizedState}function hc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=qd();e=wo(n);var r=To(t,e,n);r!==null&&(Xd(r,t,n),Eo(r,t,n)),t={cache:za()},e.payload=t;return}t=t.return}}function gc(e,t,n){var r=qd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bc(e)?xc(t,n):(n=Pi(e,t,n,r),n!==null&&(Xd(n,e,r),Sc(n,t,r)))}function _c(e,t,n){vc(e,t,n,qd())}function vc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bc(e))xc(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,qr(s,o))return Ni(e,t,i,0),fd===null&&Mi(),!1}catch{}if(n=Pi(e,t,i,r),n!==null)return Xd(n,e,r),Sc(n,t,r),!0}return!1}function yc(e,t,n,r){if(r={lane:2,revertLane:Zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bc(e)){if(t)throw Error(i(479))}else t=Pi(e,n,r,2),t!==null&&Xd(t,e,2)}function bc(e){var t=e.alternate;return e===Xo||t!==null&&t===Xo}function xc(e,t){es=$o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xt(e,n)}}var Cc={readContext:Ma,use:ys,useCallback:os,useContext:os,useEffect:os,useImperativeHandle:os,useLayoutEffect:os,useInsertionEffect:os,useMemo:os,useReducer:os,useRef:os,useState:os,useDebugValue:os,useDeferredValue:os,useTransition:os,useSyncExternalStore:os,useId:os,useHostTransitionStatus:os,useFormState:os,useActionState:os,useOptimistic:os,useMemoCache:os,useCacheRefresh:os,useEffectEvent:os},wc={readContext:Ma,use:ys,useCallback:function(e,t){return hs().memoizedState=[e,t===void 0?null:t],e},useContext:Ma,useEffect:Js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ks(4194308,4,ec.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var n=hs();t=t===void 0?null:t;var r=e();if(ts){rt(!0);try{e()}finally{rt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=hs();if(n!==void 0){var i=n(t);if(ts){rt(!0);try{n(t)}finally{rt(!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=gc.bind(null,Xo,e),[r.memoizedState,e]},useRef:function(e){var t=hs();return e={current:e},t.memoizedState=e},useState:function(e){e=As(e);var t=e.queue,n=_c.bind(null,Xo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:nc,useDeferredValue:function(e,t){return ac(hs(),e,t)},useTransition:function(){var e=As(!1);return e=sc.bind(null,Xo,e.queue,!0,!1),hs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Xo,a=hs();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),fd===null)throw Error(i(349));md&127||Ts(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Js(Ds.bind(null,r,o,e),[e]),r.flags|=2048,Ws(9,{destroy:void 0},Es.bind(null,r,o,n,t),null),n},useId:function(){var e=hs(),t=fd.identifierPrefix;if(N){var n=aa,r=ia;n=(r&~(1<<32-it(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ns++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=as++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:fc,useFormState:zs,useActionState:zs,useOptimistic:function(e){var t=hs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=yc.bind(null,Xo,!0,n),n.dispatch=t,[e,t]},useMemoCache:bs,useCacheRefresh:function(){return hs().memoizedState=hc.bind(null,Xo)},useEffectEvent:function(e){var t=hs(),n={impl:e};return t.memoizedState=n,function(){if(dd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Tc={readContext:Ma,use:ys,useCallback:rc,useContext:Ma,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:xs,useRef:Gs,useState:function(){return xs(P)},useDebugValue:nc,useDeferredValue:function(e,t){return oc(gs(),Zo.memoizedState,e,t)},useTransition:function(){var e=xs(P)[0],t=gs().memoizedState;return[typeof e==`boolean`?e:vs(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){return js(gs(),Zo,e,t)},useMemoCache:bs,useCacheRefresh:mc,useEffectEvent:Zs},Ec={readContext:Ma,use:ys,useCallback:rc,useContext:Ma,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:Cs,useRef:Gs,useState:function(){return Cs(P)},useDebugValue:nc,useDeferredValue:function(e,t){var n=gs();return Zo===null?ac(n,e,t):oc(n,Zo.memoizedState,e,t)},useTransition:function(){var e=Cs(P)[0],t=gs().memoizedState;return[typeof e==`boolean`?e:vs(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Us,useActionState:Us,useOptimistic:function(e,t){var n=gs();return Zo===null?(n.baseState=e,[e,n.queue.dispatch]):js(n,Zo,e,t)},useMemoCache:bs,useCacheRefresh:mc,useEffectEvent:Zs};function Dc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qd(),i=wo(r);i.payload=t,n!=null&&(i.callback=n),t=To(e,i,r),t!==null&&(Xd(t,e,r),Eo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qd(),i=wo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=To(e,i,r),t!==null&&(Xd(t,e,r),Eo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qd(),r=wo(n);r.tag=2,t!=null&&(r.callback=t),t=To(e,r,n),t!==null&&(Xd(t,e,n),Eo(t,e,n))}};function kc(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?!Jr(n,r)||!Jr(i,a):!0}function Ac(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&&Oc.enqueueReplaceState(t,t.state,null)}function jc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Mc(e){Oi(e)}function Nc(e){console.error(e)}function Pc(e){Oi(e)}function Fc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ic(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Lc(e,t,n){return n=wo(n),n.tag=3,n.payload={element:null},n.callback=function(){Fc(e,t)},n}function Rc(e){return e=wo(e),e.tag=3,e}function zc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ic(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ic(t,n,r),typeof i!=`function`&&(Pd===null?Pd=new Set([this]):Pd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Bc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ka(t,n,a,!0),n=Ro.current,n!==null){switch(n.tag){case 31:case 13:case 19:return zo===null?lf():n.alternate===null&&xd===0&&(xd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ao?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),jf(e,r,a)),!1;case 22:return n.flags|=65536,r===ao?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)),jf(e,r,a)),!1}throw Error(i(435,n.tag))}return jf(e,r,a),lf(),!1}if(N)return t=Ro.current,t===null?(r!==ma&&(t=Error(i(423),{cause:r}),xa(Xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Xi(r,n),a=Lc(e.stateNode,r,a),Do(e,a),xd!==4&&(xd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ma&&(e=Error(i(422),{cause:r}),xa(Xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Xi(o,n),Dd===null?Dd=[o]:Dd.push(o),xd!==4&&(xd=2),t===null)return!0;r=Xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Lc(n.stateNode,r,e),Do(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`&&(Pd===null||!Pd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Rc(a),zc(a,e,n,r),Do(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Vc=Error(i(461)),Hc=!1;function Uc(e,t,n,r){t.child=e===null?bo(t,null,n,r):yo(t,e.child,n,r)}function Wc(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 ja(t),r=cs(e,t,n,o,a,i),s=fs(),e!==null&&!Hc?(ps(e,t,i),vl(e,t,i)):(N&&s&&ca(t),t.flags|=1,Uc(e,t,r,i),t.child)}function Gc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Kc(e,t,a,r,i)):(e=Wi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!yl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Jr:n,n(o,r)&&e.ref===t.ref)return vl(e,t,i)}return t.flags|=1,e=Hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Kc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Jr(a,r)&&e.ref===t.ref){if(Hc=!1,t.pendingProps=r=a,yl(e,i))e.flags&131072&&(Hc=!0);else return t.lanes=e.lanes,vl(e,t,i)}}return el(e,t,n,r,i)}function qc(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 Yc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&eo(t,a===null?null:a.cachePool),a===null?Io():Fo(t,a),Ho(t);else return r=t.lanes=536870912,Yc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&eo(t,null),Io(),Uo()):(eo(t,a.cachePool),Fo(t,a),Uo(),t.memoizedState=null);return Uc(e,t,i,n),t.child}function Jc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yc(e,t,n,r,i){var a=$a();return a=a===null?null:{parent:Ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&eo(t,null),Io(),Ho(t),e!==null&&ka(e,t,r,!0),t.childLanes=i,null}function Xc(e,t){return t=ll({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zc(e,t,n){return yo(t,e.child,null,n),e=Xc(t,t.pendingProps),e.flags|=2,Wo(t),t.memoizedState=null,e}function Qc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(N){if(r.mode===`hidden`)return e=Xc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Jc(null,e);if(Vo(t),(e=M)?(e=wm(e,pa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra===null?null:{id:ia,overflow:aa},retryLane:536870912,hydrationErrors:null},n=qi(e),n.return=t,t.child=n,da=t,M=null)):e=null,e===null)throw ha(t);return t.lanes=536870912,null}return Xc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Vo(t),a){if(t.flags&256)t.flags&=-257,t=Zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Hc||ka(e,t,n,!1),a=(n&e.childLanes)!==0,Hc||a){if(No.current===null){if(r=fd,r!==null&&(s=St(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Fi(e,s),Xd(r,e,s),Vc;lf()}t=Zc(e,t,n)}else e=o.treeContext,M=Dm(s.nextSibling),da=t,N=!0,fa=null,pa=!1,e!==null&&ua(t,e),t=Xc(t,r),t.flags|=134221824;return t}return e=Hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function $c(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function el(e,t,n,r,i){return ja(t),n=cs(e,t,n,r,void 0,i),r=fs(),e!==null&&!Hc?(ps(e,t,i),vl(e,t,i)):(N&&r&&ca(t),t.flags|=1,Uc(e,t,n,i),t.child)}function tl(e,t,n,r,i,a){return ja(t),t.updateQueue=null,n=us(t,r,n,i),ls(e),r=fs(),e!==null&&!Hc?(ps(e,t,a),vl(e,t,a)):(N&&r&&ca(t),t.flags|=1,Uc(e,t,n,a),t.child)}function nl(e,t,n,r,i){if(ja(t),t.stateNode===null){var a=Ri,o=n.contextType;typeof o==`object`&&o&&(a=Ma(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Oc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},So(t),o=n.contextType,a.context=typeof o==`object`&&o?Ma(o):Ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Dc(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&&Oc.enqueueReplaceState(a,a.state,null),Ao(t,r,a,i),ko(),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=jc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ri,typeof u==`object`&&u&&(o=Ma(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)&&Ac(t,a,r,o),xo=!1;var f=t.memoizedState;a.state=f,Ao(t,r,a,i),ko(),l=t.memoizedState,s||f!==l||xo?(typeof d==`function`&&(Dc(t,n,d,r),l=t.memoizedState),(c=xo||kc(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,Co(e,t),o=t.memoizedProps,u=jc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ri,typeof l==`object`&&l&&(c=Ma(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)&&Ac(t,a,r,c),xo=!1,f=t.memoizedState,a.state=f,Ao(t,r,a,i),ko();var p=t.memoizedState;o!==d||f!==p||xo||e!==null&&e.dependencies!==null&&Aa(e.dependencies)?(typeof s==`function`&&(Dc(t,n,s,r),p=t.memoizedState),(u=xo||kc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Aa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,$c(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=yo(t,e.child,null,i),t.child=yo(t,null,n,i)):Uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=vl(e,t,i),e}function rl(e,t,n,r){return ya(),t.flags|=256,Uc(e,t,n,r),t.child}var il={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function al(e){return{baseLanes:e,cachePool:to()}}function ol(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Td),e}function sl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Go.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(N){if(i?Bo(t):Uo(),(e=M)?(e=wm(e,pa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra===null?null:{id:ia,overflow:aa},retryLane:536870912,hydrationErrors:null},n=qi(e),n.return=t,t.child=n,da=t,M=null)):e=null,e===null)throw ha(t);return t.lanes=Em(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Uo(),i=t.mode,a=ll({mode:`hidden`,children:a},i),r=Gi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=al(n),r.childLanes=ol(e,o,n),t.memoizedState=il,Jc(null,r)):(Bo(t),cl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return dl(e,t,a,o,r,c,s,n)}return i?(Uo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Hi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Gi(i,a,n,null),i.flags|=2):i=Hi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Jc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=al(n):(a=i.cachePool,a===null?a=to():(s=Ra._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=ol(e,o,n),t.memoizedState=il,Jc(e.child,r)):(Bo(t),n=e.child,e=n.sibling,n=Hi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function cl(e,t){return t=ll({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ll(e,t){return e=Bi(22,e,null,t),e.lanes=0,e}function ul(e,t,n){return yo(t,e.child,null,n),e=cl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Bo(t),t.flags&=-257,ul(e,t,c)):t.memoizedState===null?(Uo(),o=a.fallback,s=t.mode,a=ll({mode:`visible`,children:a.children},s),o=Gi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,yo(t,e.child,null,c),a=t.child,a.memoizedState=al(c),a.childLanes=ol(e,r,c),t.memoizedState=il,Jc(null,a)):(Uo(),t.child=e.child,t.flags|=128,null);if(Bo(t),Em(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,xa({value:a,source:null,stack:null})),ul(e,t,c)}if(Hc||ka(e,t,c,!1),r=(c&e.childLanes)!==0,Hc||r){if(No.current!==null)return ul(e,t,c);if(r=fd,r!==null&&(a=St(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Fi(e,a),Xd(r,e,a),Vc;return Tm(o)||lf(),ul(e,t,c)}return Tm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,M=Dm(o.nextSibling),da=t,N=!0,fa=null,pa=!1,e!==null&&ua(t,e),t=cl(t,a.children),t.flags|=134221824,t)}function fl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Da(e.return,t,n)}function pl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Jo(n)===null&&(t=e),e=e.sibling}return t}function ml(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 hl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function gl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Go.current;if(t.flags&128)return Ko(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ko(t,o),i===`backwards`&&e!==null?(hl(e),Uc(e,t,r,n),hl(e)):Uc(e,t,r,n),r=N?ea:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fl(e,n,t);else if(e.tag===19)fl(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`backwards`:n=pl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,hl(t)),ml(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ml(t,!0,n,null,a,r);break;case`together`:ml(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=pl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ml(t,!1,i,n,a,r)}return t.child}function _l(e,t,n){var r=t.pendingProps;return Ta(t,t.type,r.value),Uc(e,t,r.children,n),t.child}function vl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ka(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=Hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Aa(e)))}function bl(e,t,n){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),Ta(t,Ra,e.memoizedState.cache),ya();break;case 27:case 5:Me(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:Ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Bo(t),t.flags|=128,null;r=ka(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?sl(e,t,n):(Bo(t),e=vl(e,t,n),e===null?null:e.sibling)}Bo(t);break;case 19:if(t.flags&128)return gl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ka(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return gl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ko(t,Go.current),r)break;return null;case 22:return t.lanes=0,qc(e,t,n,t.pendingProps);case 24:Ta(t,Ra,e.memoizedState.cache)}return vl(e,t,n)}function xl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Hc=!0;else{if(!yl(e,n)&&!(t.flags&128))return Hc=!1,bl(e,t,n);Hc=!!(e.flags&131072)}}else Hc=!1,N&&t.flags&1048576&&sa(t,ea,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=co(t.elementType),t.type=e,typeof e==`function`)Vi(e)?(r=jc(e,r),t.tag=1,t=nl(null,t,e,r,n)):(t.tag=0,t=el(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ae){t.tag=11,t=Wc(null,t,e,r,n);break a}if(a===ce){t.tag=14,t=Gc(null,t,e,r,n);break a}if(a===O){t.tag=10,t.type=e,t=_l(null,t,n);break a}}throw t=ve(e)||e,Error(i(306,t,``))}}return t;case 0:return el(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=jc(r,t.pendingProps),nl(e,t,r,a,n);case 3:a:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Co(e,t),Ao(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ta(t,Ra,r),r!==o.cache&&Oa(t,[Ra],n,!0),ko(),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=rl(e,t,r,n);break a}if(r!==a){a=Xi(Error(i(424)),t),xa(a),t=rl(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(M=Dm(e.firstChild),da=t,N=!0,fa=null,pa=!0,n=bo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ya(),r===a){t=vl(e,t,n);break a}Uc(e,t,r,n)}t=t.child}return t;case 26:return $c(e,t),e===null?(n=Ym(t.type,null,t.pendingProps,null))?t.memoizedState=n:N||(t.stateNode=jp(t.type,t.pendingProps,Oe.current,t)):t.memoizedState=Ym(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Me(t),e===null&&N&&(r=t.stateNode=jm(t.type,t.pendingProps,Oe.current),da=t,pa=!0,a=M,Vp(t.type)?(Om=a,M=Dm(r.firstChild)):M=a),Uc(e,t,t.pendingProps.children,n),$c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&N&&((a=r=M)&&(r=Sm(r,t.type,t.pendingProps,pa),r===null?a=!1:(t.stateNode=r,da=t,M=Dm(r.firstChild),pa=!1,a=!0)),a||ha(t)),Me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Mp(a,o)?r=null:s!==null&&Mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=cs(e,t,ds,null,null,n),Ch._currentValue=a),$c(e,t),Uc(e,t,r,n),t.child;case 6:return e===null&&N&&((e=n=M)&&(n=Cm(n,t.pendingProps,pa),n===null?e=!1:(t.stateNode=n,da=t,M=null,e=!0)),e||ha(t)),null;case 13:return sl(e,t,n);case 4:return Ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yo(t,null,r,n):Uc(e,t,r,n),t.child;case 11:return Wc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,$c(e,t),Uc(e,t,r,n),t.child;case 8:return Uc(e,t,t.pendingProps.children,n),t.child;case 12:return Uc(e,t,t.pendingProps.children,n),t.child;case 10:return _l(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ja(t),a=Ma(a),r=r(a),t.flags|=1,Uc(e,t,r,n),t.child;case 14:return Gc(e,t,t.type,t.pendingProps,n);case 15:return Kc(e,t,t.type,t.pendingProps,n);case 19:return gl(e,t,n);case 31:return Qc(e,t,n);case 22:return qc(e,t,n,t.pendingProps);case 24:return ja(t),r=Ma(Ra),e===null?(a=$a(),a===null&&(a=fd,o=za(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},So(t),Ta(t,Ra,a)):((e.lanes&n)!==0&&(Co(e,t),Ao(t,null,null,n),ko()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ta(t,Ra,r),r!==a.cache&&Oa(t,[Ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ta(t,Ra,r))),Uc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:N&&ca(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:$c(e,t),Uc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Sl(e){e.flags|=4}function Cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?uh(t,r):uh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(of())e.flags|=8192;else throw lo=ao,ro}}else e.flags&=-16777217}function wl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!dh(t)){if(of())e.flags|=8192;else throw lo=ao,ro}}function Tl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:gt(),e.lanes|=t,Ed|=t)}function El(e,t){if(!N)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Dl(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&1206910976,r|=i.flags&1206910976,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 Ol(e,t,n){var r=t.pendingProps;switch(la(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dl(t),null;case 1:return Dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ea(Ra),je(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(va(t)?Sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ba())),Dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Sl(t),o===null?(Dl(t),Cl(t,a,null,r,n)):(Dl(t),wl(t,o))):o?o===e.memoizedState?(Dl(t),t.flags&=-16777217):(Sl(t),Dl(t),wl(t,o)):(e=e.memoizedProps,e!==r&&Sl(t),Dl(t),Cl(t,a,e,r,n)),null;case 27:if(Ne(t),n=Oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Dl(t),t.subtreeFlags&=-33554433,null}e=Ee.current,va(t)?ga(t,e):(e=jm(a,r,n),t.stateNode=e,Sl(t))}return Dl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ne(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Dl(t),t.subtreeFlags&=-33554433,null}if(o=Ee.current,va(t))ga(t,o);else{var s=Op(Oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ot]=t,o[kt]=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(xp(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&&Sl(t)}}return Dl(t),t.subtreeFlags&=-33554433,Cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Oe.current,va(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=da,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||vp(e.nodeValue,n)),e||ha(t,!0)}else e=Op(e).createTextNode(r),e[Ot]=t,t.stateNode=e}return Dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=va(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ot]=t}else ya(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dl(t),e=!1}else n=ba(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Wo(t),t):(Wo(t),null);if(t.flags&128)throw Error(i(558))}return Dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=va(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ot]=t}else ya(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dl(t),a=!1}else a=ba(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Wo(t),t):(Wo(t),null)}return Wo(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),Tl(t,t.updateQueue),Dl(t),null);case 4:return je(),e===null&&cp(t.stateNode.containerInfo),t.flags|=67108864,Dl(t),null;case 10:return Ea(t.type),Dl(t),null;case 19:if(qo(t),r=t.memoizedState,r===null)return Dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)El(r,!1);else{if(xd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Jo(e),o!==null){for(t.flags|=128,El(r,!1),e=o.updateQueue,t.updateQueue=e,Tl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ui(n,e),n=n.sibling;return Ko(t,Go.current&1|2),N&&oa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ke()>Md&&(t.flags|=128,a=!0,El(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Jo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Tl(t,e),El(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!N)return Dl(t),null}else 2*Ke()-r.renderingStartTime>Md&&n!==536870912&&(t.flags|=128,a=!0,El(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ke(),e.sibling=null,o=Go.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||N?Ko(t,o):(n=o,Te(Ro,t),Te(Go,n),zo===null&&(zo=t)),N&&oa(t,r.treeForkCount),e}return Dl(t),null;case 22:case 23:return Wo(t),Lo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Dl(t),t.subtreeFlags&6&&(t.flags|=8192)):Dl(t),n=t.updateQueue,n!==null&&Tl(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&&we(Qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ea(Ra),Dl(t),null;case 25:return null;case 30:return t.flags|=33554432,Dl(t),null}throw Error(i(156,t.tag))}function kl(e,t){switch(la(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ea(Ra),je(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ne(t),null;case 31:if(t.memoizedState!==null){if(Wo(t),t.alternate===null)throw Error(i(340));ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Wo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return je(),null;case 10:return Ea(t.type),null;case 22:case 23:return Wo(t),Lo(),e!==null&&we(Qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ea(Ra),null;case 25:return null;default:return null}}function Al(e,t){switch(la(t),t.tag){case 3:Ea(Ra),je();break;case 26:case 27:case 5:Ne(t);break;case 4:je();break;case 31:t.memoizedState!==null&&Wo(t);break;case 13:Wo(t);break;case 19:qo(t);break;case 10:Ea(t.type);break;case 22:case 23:Wo(t),Lo(),e!==null&&we(Qa);break;case 24:Ea(Ra)}}function jl(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){Af(t,t.return,e)}}function Ml(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){Af(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Af(t,t.return,e)}}function Nl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Mo(t,n)}catch(t){Af(e,e.return,t)}}}function Pl(e,t,n){n.props=jc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Af(e,t,n)}}function Fl(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:var i=e.stateNode,a=Ti(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=$p(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new em(e);p(e.child,!1,_m,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Af(e,t,n)}}function Il(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Af(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){Af(e,t,n)}else n.current=null}}function Ll(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)ym(e.stateNode,t[n])}function Rl(e){for(var t=e.return;t!==null&&(Vl(t)&&ym(e.stateNode,t.stateNode),!Bl(t));)t=t.return}function zl(e){for(var t=e.return;t!==null&&(Vl(t)&&bm(e.stateNode,t.stateNode),!Bl(t));)t=t.return}function Bl(e){return e.tag===5||e.tag===3||e.tag===27}function Vl(e){return e&&e.tag===7&&e.stateNode!==null}function Hl(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){Af(e,e.return,t)}}function Ul(e,t,n){try{var r=e.stateNode;Cp(r,e.type,n,t),r[kt]=t}catch(t){Af(e,e.return,t)}}function Wl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vp(e.type)||e.tag===4}function Gl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wl(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&&Vp(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 Kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tn)),Ll(e,r),Qt=!0;else if(i!==4&&(i===27&&(Ll(e,r),r=null,Vp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Kl(e,t,n,r),e=e.sibling;e!==null;)Kl(e,t,n,r),e=e.sibling}function ql(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ll(e,r),Qt=!0;else if(i!==4&&(i===27&&(Ll(e,r),r=null,Vp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(ql(e,t,n,r),e=e.sibling;e!==null;)ql(e,t,n,r),e=e.sibling}function Jl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);xp(t,r,n),t[Ot]=e,t[kt]=n}catch(t){Af(e,e.return,t)}}var Yl=!1,Xl=null;function Zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Yl=!0)}var Ql=null;function $l(){var e=Ql;return Ql=null,e}var eu=0;function tu(e,t,n,r,i){return eu=0,nu(e.child,t,n,r,i)}function nu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=qp(o);r.push(s),s.view&&(a=!0)}else a||qp(o).view&&(a=!0);Yl=!0,Wp(o,eu===0?t:t+`_`+eu,n),eu++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||nu(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function ru(e,t){for(;e!==null;)e.tag===5?Gp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ru(e.child,t)),e=e.sibling}function iu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(iu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Di(t.default,t.share),t!==`none`&&(tu(e,n,t,null,!1)||ru(e.child,!1))}e=e.sibling}}function au(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ti(r,n),a=Di(r.default,n.paired?r.share:r.enter);a===`none`?iu(e):tu(e,i,a,null,!1)?(iu(e),n.paired||t||Yd(e,r.onEnter)):ru(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e,t),e=e.sibling;else iu(e)}function ou(e){if(Xl!==null&&Xl.size!==0){var t=Xl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Di(n.default,n.share);if(a!==`none`&&(tu(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Yd(e,n.onShare)):ru(e.child,!1)),t.delete(r),t.size===0)break}}}ou(e)}e=e.sibling}}}function su(e){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode),r=Xl===null?void 0:Xl.get(n),i=Di(t.default,r===void 0?t.exit:t.share);i!==`none`&&(tu(e,n,i,null,!1)?r===void 0?Yd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Xl.delete(n),Yd(e,t.onShare)):ru(e.child,!1)),Xl!==null&&ou(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)su(e),e=e.sibling;else Xl!==null&&ou(e)}function cu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode);t=Di(t.default,t.update),e.flags&=-5,t!==`none`&&tu(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&cu(e);e=e.sibling}}function lu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,ru(e.child,!1))}lu(e)}e=e.sibling}}function uu(e){if(e.tag===30)e.stateNode.paired=null,ru(e.child,!1),lu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)uu(e),e=e.sibling;else lu(e)}function du(e){for(e=e.child;e!==null;)e.tag===30?ru(e.child,!1):e.subtreeFlags&33554432&&du(e),e=e.sibling}function fu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&eu<a.length){var l=a[eu],u=qp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Wp(c,eu===0?n:n+`_`+eu,i),s&&e.flags&4||(Ql===null&&(Ql=[]),Ql.push(c,eu===0?r:r+`_`+eu,t.memoizedProps)),eu++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:fu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function pu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ti(n,r),a=Di(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;eu=0,i=fu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Yd(e,n.onUpdate))}else e.subtreeFlags&33554432&&pu(e,t);e=e.sibling}}var mu=!1,hu=!1,gu=!1,_u=!1,vu=typeof WeakSet==`function`?WeakSet:Set,yu=null,bu=!1,xu=!1,Su=!1,Cu=!1;function wu(e,t,n){if(e=e.containerInfo,Ep=Mh,e=$r(e),ei(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(Dp={focusedElem:e,selectionRange:r},Mh=!1,n=(n&335544064)===n,yu=t,t=n?9270:1024;yu!==null;){if(e=yu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&su(r[a]);if(e.alternate===null&&e.flags&2)n&&Zl(e),Tu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&su(r),Tu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Zl(e),Tu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,yu=r):(n&&cu(e),Tu(n))}}Xl=null}function Tu(e){for(;yu!==null;){var t=yu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=jc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Af(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)xm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:xm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ti(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Di(a.default,a.update),a!==`none`&&tu(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,yu=r;break}yu=t.return}}function Eu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ku(e,n),r&4&&jl(5,n);break;case 1:if(Ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Af(n,n.return,e)}else{var i=jc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Af(n,n.return,e)}}}r&64&&Nl(n),r&512&&Fl(n,n.return);break;case 3:if(Ku(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{Mo(e,t)}catch(e){Af(n,n.return,e)}}break;case 27:t===null&&r&4&&Jl(n);case 26:case 5:Ku(e,n),t===null&&r&4&&Hl(n),r&512&&Fl(n,n.return);break;case 12:Ku(e,n);break;case 31:Ku(e,n),r&4&&Fu(e,n);break;case 13:Ku(e,n),r&4&&Iu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Pf.bind(null,n),F(e,n))));break;case 22:if(r=n.memoizedState!==null||mu,!r){var a=t!==null&&t.memoizedState!==null||hu;t=mu,i=hu,mu=r,(hu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ju(e,n,r)):Ku(e,n),mu=t,hu=i}break;case 30:Ku(e,n),r&512&&Fl(n,n.return);break;case 7:r&512&&Fl(n,n.return);default:Ku(e,n)}}function Du(e,t){for(e=e.child;e!==null;)Ou(e,t),e=e.sibling}function Ou(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Af(e,e.return,t)}ku(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Qt=!0}catch(t){Af(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Up(s,!0):Up(e.stateNode,!1)}catch(t){Af(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Du(e,t);break;default:Du(e,t)}}function ku(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Ou(n,r);break a;case 22:n.memoizedState===null&&ku(n,r);break a;default:ku(n,r)}}e=e.sibling}}function Au(e){var t=e.alternate;t!==null&&(e.alternate=null,Au(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Lt(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 ju=null,Mu=!1;function Nu(e,t,n){for(n=n.child;n!==null;)Pu(e,t,n),n=n.sibling}function Pu(e,t,n){if(nt&&typeof nt.onCommitFiberUnmount==`function`)try{nt.onCommitFiberUnmount(tt,n)}catch{}switch(n.tag){case 26:hu||Il(n,t),Nu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!hu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:hu||Il(n,t),zl(n);var r=ju,i=Mu;Vp(n.type)&&(ju=n.stateNode,Mu=!1),Nu(e,t,n),Mm(n.stateNode,n.type,n.memoizedProps),ju=r,Mu=i;break;case 5:hu||Il(n,t),zl(n);case 6:if(n.tag===6&&zl(n),r=ju,i=Mu,ju=null,Nu(e,t,n),ju=r,Mu=i,ju!==null){if(Mu)try{(ju.nodeType===9?ju.body:ju.nodeName===`HTML`?ju.ownerDocument.body:ju).removeChild(n.stateNode),Qt=!0}catch(e){Af(n,t,e)}else try{ju.removeChild(n.stateNode),Qt=!0}catch(e){Af(n,t,e)}}break;case 18:ju!==null&&(Mu?(e=ju,Hp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),ig(e)):Hp(ju,n.stateNode));break;case 4:r=ju,i=Mu,ju=n.stateNode.containerInfo,Mu=!0,Nu(e,t,n),ju=r,Mu=i;break;case 0:case 11:case 14:case 15:Ml(2,n,t),hu||Ml(4,n,t),Nu(e,t,n);break;case 1:hu||(Il(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Pl(n,t,r)),Nu(e,t,n);break;case 21:Nu(e,t,n);break;case 22:hu=(r=hu)||n.memoizedState!==null,Nu(e,t,n),hu=r;break;case 30:Il(n,t),Nu(e,t,n);break;case 7:hu||Il(n,t),Nu(e,t,n);break;default:Nu(e,t,n)}}function Fu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ig(e)}catch(e){Af(t,t.return,e)}}}function Iu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ig(e)}catch(e){Af(t,t.return,e)}}function Lu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vu),t;default:throw Error(i(435,e.tag))}}function Ru(e,t){var n=Lu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ff.bind(null,e,t);t.then(r,r)}})}function zu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Vp(l.type)){ju=l.stateNode,Mu=!1;break a}break;case 5:ju=l.stateNode,Mu=!1;break a;case 3:case 4:ju=l.stateNode.containerInfo,Mu=!0;break a}l=l.return}if(ju===null)throw Error(i(160));Pu(s,c,o),ju=null,Mu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vu(t,e,n),t=t.sibling}var Bu=null;function Vu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}zu(t,e,n),Hu(e),a&4&&(Ml(3,e,e.return),jl(3,e),Ml(5,e,e.return));break;case 1:zu(t,e,n),Hu(e),a&512&&(hu||r===null||Il(r,r.return)),a&64&&mu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Bu,zu(t,e,n),Hu(e),a&512&&(hu||r===null||Il(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(mu)e.stateNode=jp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ft]||r[Ot]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),xp(r,t,n),r[Ot]=e,Ht(r),t=r;break a;case`link`:if(o=sh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),xp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=sh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),xp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ot]=e,Ht(r),t=r}e.stateNode=t}}else mu||ch(o,e.type,e.stateNode)}else e.stateNode=nh(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ul(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||hu||t.parentNode.removeChild(t)):a.count--,n===null?mu||ch(o,e.type,e.stateNode):nh(o,n,e.memoizedProps))}break;case 27:zu(t,e,n),Hu(e),a&512&&(hu||r===null||Il(r,r.return)),r!==null&&a&4&&Ul(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=gu,gu=!1,zu(t,e,n),gu=o,Hu(e),a&512&&(hu||r===null||Il(r,r.return)),e.flags&32){t=e.stateNode;try{_n(t,``),Qt=!0}catch(t){Af(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ul(e,t,r===null?t:r.memoizedProps)),a&1024&&(_u=!0);break;case 6:if(zu(t,e,n),Hu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Qt=!0}catch(t){Af(e,e.return,t)}}break;case 3:if(Qt=!1,oh=null,o=Bu,Bu=Im(t.containerInfo),zu(t,e,n),Bu=o,Hu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ig(t.containerInfo)}catch(t){Af(e,e.return,t)}_u&&(_u=!1,Uu(e)),Qt=!1;break;case 4:a=gu,gu=mu,r=$t(),o=Bu,Bu=Im(e.stateNode.containerInfo),zu(t,e,n),Hu(e),Bu=o,Qt&&xu&&(Su=!0),Qt=r,gu=a;break;case 12:zu(t,e,n),Hu(e);break;case 31:zu(t,e,n),Hu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ru(e,t)));break;case 13:zu(t,e,n),Hu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Ad=Ke()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ru(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=mu,l=hu,u=gu;mu=c||o,gu=u||o,hu=l||s,zu(t,e,n),hu=l,gu=u,mu=c,Hu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||mu||hu||(t=s||hu,n=mu,r=hu,mu=o||mu,hu=t,qu(e,2),mu=n,hu=r),!o&&gu||Du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ru(e,n))));break;case 19:zu(t,e,n),Hu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ru(e,t)));break;case 30:a&512&&(hu||r===null||Il(r,r.return)),a=$t(),o=xu,s=(n&335544064)===n,c=e.memoizedProps,xu=s&&Di(c.default,c.update)!==`none`,zu(t,e,n),Hu(e),s&&r!==null&&Qt&&(e.flags|=4),xu=o,Qt=a;break;case 21:break;case 7:a&512&&(hu||r===null||Il(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:zu(t,e,n),Hu(e)}}function Hu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Vl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Bl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;ql(e,Gl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(_n(l,``),n.flags&=-33),ql(e,Gl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Kl(e,Gl(e),u,s);break;default:throw Error(i(161))}}catch(t){Af(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Uu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Uu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Mh=!0,t.reset(),Mh=!1),e=e.sibling}}function Wu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Gu(t,e),t=t.sibling;else pu(t,!1)}function Gu(e,t){var n=e.alternate;if(n===null)au(e,!1);else switch(e.tag){case 3:if(Cu=bu=!1,$l(),Wu(t,e),!bu&&!Su){if(e=Ql,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Gp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),Cu=!0}Ql=null;break;case 5:Wu(t,e);break;case 4:r=bu,bu=!1,Wu(t,e),bu&&(Su=!0),bu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Wu(t,e):au(e,!1));break;case 30:r=bu,i=$l(),bu=!1,Wu(t,e),bu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ti(a,o),o=Ti(n.memoizedProps,o);var s=Di(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,eu=0,t=fu(e,n,t,o,s,a,!0),eu!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Yd(e,e.memoizedProps.onUpdate),Ql=i):i!==null&&(i.push.apply(i,Ql),Ql=i),bu=e.flags&32?!0:r;break;default:Wu(t,e)}}function Ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eu(e,t.alternate,t),t=t.sibling}function qu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ml(4,n,n.return),qu(n,r);break;case 1:Il(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Pl(n,n.return,i),qu(n,r);break;case 27:r&2&&Mm(n.stateNode,n.type,n.memoizedProps);case 5:Il(n,n.return),n.tag!==5&&n.tag!==27||zl(n),qu(n,r);break;case 6:zl(n);break;case 26:Il(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||hu||i.parentNode.removeChild(i),qu(n,r);break;case 22:n.memoizedState===null&&qu(n,r);break;case 30:Il(n,n.return),qu(n,r);break;case 7:Il(n,n.return);default:qu(n,r)}e=e.sibling}}function Ju(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ju(i,a,n),jl(4,a);break;case 1:if(Ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Af(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)jo(l[i],c)}catch(e){Af(r,r.return,e)}}s&&o&64&&Nl(a),Fl(a,a.return);break;case 27:n&2&&Jl(a);case 5:a.tag!==5&&a.tag!==27||Rl(a),Ju(i,a,n),s&&r===null&&o&4&&Hl(a),Fl(a,a.return);break;case 6:Rl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||mu||ch(Im(c.ownerDocument),a.type,c),Ju(i,a,n),s&&r===null&&o&4&&Hl(a),Fl(a,a.return);break;case 12:Ju(i,a,n);break;case 31:Ju(i,a,n),s&&o&4&&Fu(i,a);break;case 13:Ju(i,a,n),s&&o&4&&Iu(i,a);break;case 22:a.memoizedState===null&&Ju(i,a,n),Fl(a,a.return);break;case 30:Ju(i,a,n),Fl(a,a.return);break;case 7:Fl(a,a.return);default:Ju(i,a,n)}t=t.sibling}}function Yu(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&&Ba(n))}function Xu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ba(e))}function Zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Qu(e,t,n,r),t=t.sibling;else i&&du(t)}function Qu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&uu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Zu(e,t,n,r),a&2048&&jl(9,t);break;case 1:Zu(e,t,n,r);break;case 3:Zu(e,t,n,r),i&&Cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ba(a)));break;case 12:if(a&2048){Zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Af(t,t.return,e)}}else Zu(e,t,n,r);break;case 31:Zu(e,t,n,r);break;case 13:Zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&uu(t),o._visibility&2?Zu(e,t,n,r):(o._visibility|=2,$u(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&uu(s),o._visibility&2?Zu(e,t,n,r):ed(e,t)),a&2048&&Yu(s,t);break;case 24:Zu(e,t,n,r),a&2048&&Xu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ru(a.child,!0),ru(t.child,!0))),Zu(e,t,n,r);break;default:Zu(e,t,n,r)}}function $u(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:$u(a,o,s,c,i),jl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,$u(a,o,s,c,i)):u._visibility&2?$u(a,o,s,c,i):ed(a,o),i&&l&2048&&Yu(o.alternate,o);break;case 24:$u(a,o,s,c,i),i&&l&2048&&Xu(o.alternate,o);break;default:$u(a,o,s,c,i)}t=t.sibling}}function ed(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:ed(n,r),i&2048&&Yu(r.alternate,r);break;case 24:ed(n,r),i&2048&&Xu(r.alternate,r);break;default:ed(n,r)}t=t.sibling}}var td=8192;function nd(e,t,n){if(e.subtreeFlags&td)for(e=e.child;e!==null;)rd(e,t,n),e=e.sibling}function rd(e,t,n){switch(e.tag){case 26:nd(e,t,n),e.flags&td&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ph(n,e)):mh(n,Bu,e.memoizedState,e.memoizedProps));break;case 5:nd(e,t,n),e.flags&td&&(e=e.stateNode,(t&335544128)===t&&ph(n,e));break;case 3:case 4:var r=Bu;Bu=Im(e.stateNode.containerInfo),nd(e,t,n),Bu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=td,td=16777216,nd(e,t,n),td=r):nd(e,t,n));break;case 30:if((e.flags&td)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Xl===null&&(Xl=new Map),Xl.set(r,i)}nd(e,t,n);break;default:nd(e,t,n)}}function id(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 ad(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];yu=r,cd(r,e)}id(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)od(e),e=e.sibling}function od(e){switch(e.tag){case 0:case 11:case 15:ad(e),e.flags&2048&&Ml(9,e,e.return);break;case 3:ad(e);break;case 12:ad(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,sd(e)):ad(e);break;default:ad(e)}}function sd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];yu=r,cd(r,e)}id(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ml(8,t,t.return),sd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,sd(t));break;default:sd(t)}e=e.sibling}}function cd(e,t){for(;yu!==null;){var n=yu;switch(n.tag){case 0:case 11:case 15:Ml(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:Ba(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,yu=r;else a:for(n=e;yu!==null;){r=yu;var i=r.sibling,a=r.return;if(Au(r),r===n){yu=null;break a}if(i!==null){i.return=a,yu=i;break a}yu=a}}}var ld={getCacheForType:function(e){var t=Ma(Ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ma(Ra).controller.signal}},ud=typeof WeakMap==`function`?WeakMap:Map,dd=0,fd=null,pd=null,md=0,hd=0,gd=null,_d=!1,vd=!1,yd=!1,bd=0,xd=0,Sd=0,Cd=0,wd=0,Td=0,Ed=0,Dd=null,Od=null,kd=!1,Ad=0,jd=0,Md=1/0,Nd=null,Pd=null,Fd=0,Id=null,Ld=null,Rd=0,zd=0,Bd=null,Vd=null,Hd=null,Ud=null,Wd=null,Gd=0,Kd=null;function qd(){return dd&2&&md!==0?md&-md:k.T===null?Tt():Zf()}function Jd(){if(Td===0){if(!(md&536870912)||N){var e=lt;lt<<=1,!(lt&3932160)&&(lt=262144),Td=e}else Td=536870912}return e=Ro.current,e!==null&&(e.flags|=32),Td}function Yd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=$p(Ti(e.memoizedProps,n))),Ud===null&&(Ud=[]),Ud.push(t.bind(null,r))}}function Xd(e,t,n){(e===fd&&(hd===2||hd===9)||e.cancelPendingCommit!==null)&&(rf(e,0),ef(e,md,Td,!1)),vt(e,n),(!(dd&2)||e!==fd)&&(e===fd&&(!(dd&2)&&(Cd|=n),xd===4&&ef(e,md,Td,!1)),Uf(e))}function Zd(e,t,n){if(dd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||pt(e,t),a=r?ff(e,t):uf(e,t,!0),o=r;do{if(a===0){vd&&!r&&ef(e,t,0,!1);break}if(n=e.current.alternate,o&&!$d(n))a=uf(e,t,!1),o=!1;else{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=Dd;var l=c.current.memoizedState.isDehydrated;if(l&&(rf(c,s).flags|=256),s=uf(c,s,!1),s!==2&&s!==6){if(yd&&!l){c.errorRecoveryDisabledLanes|=o,Cd|=o,a=4;break a}o=Od,Od=a,o!==null&&(Od===null?Od=o:Od.push.apply(Od,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){rf(e,0),ef(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&&(t&62914560)!==t)break;case 6:ef(r,t,Td,!_d);break a;case 2:Od=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ad+300-Ke(),10<a)){if(ef(r,t,Td,!_d),ft(r,0,!0)!==0)break a;Rd=t,r.timeoutHandle=Fp(Qd.bind(null,r,n,Od,Nd,kd,t,Td,Cd,Ed,_d,o,`Throttled`,-0,0),a);break a}Qd(r,n,Od,Nd,kd,t,Td,Cd,Ed,_d,o,null,-0,0)}break}}while(1);Uf(e)}function Qd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tn},Xl=null,rd(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=vh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Ad-Ke():(a&4194048)===a?jd-Ke():0,m=gh(d,m),m!==null)?(Rd=a,e.cancelPendingCommit=m(yf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),ef(e,a,o,!l)):yf(e,t,a,n,r,i,o,s,c,l,u,d)}function $d(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(!qr(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 ef(e,t,n,r){t=mt(e,t),t&=~wd,t&=~Cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-it(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&bt(e,n,t)}function tf(){return dd&6?!0:(Wf(0,!1),!1)}function nf(){if(pd!==null){if(hd===0)var e=pd.return;else e=pd,wa=Ca=null,ms(e),po=null,mo=0,e=pd;for(;e!==null;)Al(e.alternate,e),e=e.return;pd=null}}function rf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ip(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Rd=0,nf(),fd=e,pd=n=Hi(e.current,null),md=t,hd=0,gd=null,_d=!1,vd=pt(e,t),yd=!1,Ed=Td=wd=Cd=Sd=xd=0,Od=Dd=null,kd=!1,bd=mt(e,t),Mi(),n}function af(e,t){Xo=null,k.H=Cc,t===no||t===io?(t=uo(),hd=3):t===ro?(t=uo(),hd=4):hd=t===Vc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,gd=t,pd===null&&(xd=1,Fc(e,Xi(t,e.current)))}function of(){var e=Ro.current;return e===null?!0:(md&4194048)===md?zo===null:(md&62914560)===md||md&536870912?e===zo:!1}function sf(){var e=k.H;return k.H=Cc,e===null?Cc:e}function cf(){var e=k.A;return k.A=ld,e}function lf(){xd=4,_d||(md&4194048)!==md&&Ro.current!==null||(vd=!0),!(Sd&134217727)&&!(Cd&134217727)||fd===null||ef(fd,md,Td,!1)}function uf(e,t,n){var r=dd;dd|=2;var i=sf(),a=cf();(fd!==e||md!==t)&&(Nd=null,rf(e,t)),t=!1;var o=xd;a:do try{if(hd!==0&&pd!==null){var s=pd,c=gd;switch(hd){case 8:nf(),o=6;break a;case 3:case 2:case 9:case 6:Ro.current===null&&(t=!0);var l=hd;if(hd=0,gd=null,gf(e,s,c,l),n&&vd){o=0;break a}break;default:l=hd,hd=0,gd=null,gf(e,s,c,l)}}df(),o=xd;break}catch(t){af(e,t)}while(1);return t&&e.shellSuspendCounter++,wa=Ca=null,dd=r,k.H=i,k.A=a,pd===null&&(fd=null,md=0,Mi()),o}function df(){for(;pd!==null;)mf(pd)}function ff(e,t){var n=dd;dd|=2;var r=sf(),a=cf();fd!==e||md!==t?(Nd=null,Md=Ke()+500,rf(e,t)):vd=pt(e,t);a:do try{if(hd!==0&&pd!==null){t=pd;var o=gd;b:switch(hd){case 1:hd=0,gd=null,gf(e,t,o,1);break;case 2:case 9:if(oo(o)){hd=0,gd=null,hf(t);break}t=function(){hd!==2&&hd!==9||fd!==e||(hd=7),Uf(e)},o.then(t,t);break a;case 3:hd=7;break a;case 4:hd=5;break a;case 7:oo(o)?(hd=0,gd=null,hf(t)):(hd=0,gd=null,gf(e,t,o,7));break;case 5:var s=null;switch(pd.tag){case 26:s=pd.memoizedState;case 5:case 27:var c=pd;if(s?dh(s):c.stateNode.complete){hd=0,gd=null;var l=c.sibling;if(l!==null)pd=l;else{var u=c.return;u===null?pd=null:(pd=u,_f(u))}break b}}hd=0,gd=null,gf(e,t,o,5);break;case 6:hd=0,gd=null,gf(e,t,o,6);break;case 8:nf(),xd=6;break a;default:throw Error(i(462))}}pf();break}catch(t){af(e,t)}while(1);return wa=Ca=null,k.H=r,k.A=a,dd=n,pd===null?(fd=null,md=0,Mi(),xd):0}function pf(){for(;pd!==null&&!We();)mf(pd)}function mf(e){var t=xl(e.alternate,e,bd);e.memoizedProps=e.pendingProps,t===null?_f(e):pd=t}function hf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=tl(n,t,t.pendingProps,t.type,void 0,md);break;case 11:t=tl(n,t,t.pendingProps,t.type.render,t.ref,md);break;case 5:ms(t);var r=t;r===da&&(N?(_a(r),r.tag===5&&r.stateNode!=null&&(M=r.stateNode)):(_a(r),N=!0));default:Al(n,t),t=pd=Ui(t,bd),t=xl(n,t,bd)}e.memoizedProps=e.pendingProps,t===null?_f(e):pd=t}function gf(e,t,n,r){wa=Ca=null,ms(t),po=null,mo=0;var i=t.return;try{if(Bc(e,i,t,n,md)){xd=1,Fc(e,Xi(n,e.current)),pd=null;return}}catch(t){if(i!==null)throw pd=i,t;xd=1,Fc(e,Xi(n,e.current)),pd=null;return}t.flags&32768?(N||r===1?e=!0:vd||md&536870912?e=!1:(_d=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),vf(t,e)):_f(t)}function _f(e){var t=e;do{if(t.flags&32768){vf(t,_d);return}e=t.return;var n=Ol(t.alternate,t,bd);if(n!==null){pd=n;return}if(t=t.sibling,t!==null){pd=t;return}pd=t=e}while(t!==null);xd===0&&(xd=5)}function vf(e,t){do{var n=kl(e.alternate,e);if(n!==null){n.flags&=32767,pd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pd=e;return}pd=e=n}while(e!==null);xd=6,pd=null}function yf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Df();while(Fd!==0);if(dd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===fd&&(pd=fd=null,md=0),Ld=t,Id=e,Rd=n,Bd=a,Vd=r,bf(e,t,n,s,c,l,f)}}function bf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(zd=s,s|=ji,yt(e,n,s,r,i,a),Ud=null,(n&335544064)===n?(Wd=Ua(e),r=10262):(Wd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,If(Xe,function(){return Of(),null})):(e.callbackNode=null,e.callbackPriority=0),Yl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=k.T,k.T=null,i=A.p,A.p=2,a=dd,dd|=4;try{wu(e,t,n)}finally{dd=a,A.p=i,k.T=r}}Fd=1,Yl?Hd=Zp(o,e.containerInfo,Wd,Cf,wf,Sf,Tf,Of,xf,null,null):(Cf(),wf(),Tf())}function xf(e){if(Fd!==0){var t=Id.onRecoverableError;t(e,{componentStack:null})}}function Sf(){Fd===3&&(Fd=0,Gu(Ld,Id),Fd=4)}function Cf(){if(Fd===1){Fd=0;var e=Id,t=Ld,n=Rd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=k.T,k.T=null;var i=A.p;A.p=2;var a=dd;dd|=4;try{xu=Su=!1,Vu(t,e,n),n=Dp;var o=$r(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Qr(s.ownerDocument.documentElement,s)){if(c!==null&&ei(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 _=Zr(s,h),v=Zr(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}}Mh=!!Ep,Dp=Ep=null}finally{dd=a,A.p=i,k.T=r}}e.current=t,Fd=2}}function wf(){if(Fd===2){Fd=0;var e=Id,t=Ld,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=dd;dd|=4;try{Eu(e,t.alternate,t)}finally{dd=i,A.p=r,k.T=n}}Fd=3}}function Tf(){if(Fd===4||Fd===3){Fd=0;var e=Hd;Hd=null,Ge();var t=Id,n=Ld,r=Rd,i=Vd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Fd=5:(Fd=0,Ld=Id=null,Ef(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Pd=null),wt(r),n=n.stateNode,nt&&typeof nt.onCommitFiberRoot==`function`)try{nt.onCommitFiberRoot(tt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=k.T,a=A.p,A.p=2,k.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{k.T=n,A.p=a}}if(i=Ud,o=Wd,Wd=null,i!==null&&(Ud=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Rd&3&&Df(),Uf(t),a=t.pendingLanes,r&261930&&a&42?t===Kd?Gd++:(Gd=0,Kd=t):(Gd=0,Kd=null),Wf(0,!1)}}function Ef(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ba(t)))}function Df(){return Hd!==null&&(Hd.skipTransition(),Hd=null),Cf(),wf(),Tf(),Of()}function Of(){if(Fd!==5)return!1;var e=Id,t=zd;zd=0;var n=wt(Rd),r=k.T,a=A.p;try{A.p=32>n?32:n,k.T=null,n=Bd,Bd=null;var o=Id,s=Rd;if(Fd=0,Ld=Id=null,Rd=0,dd&6)throw Error(i(331));var c=dd;if(dd|=4,od(o.current),Qu(o,o.current,s,n),dd=c,Wf(0,!1),nt&&typeof nt.onPostCommitFiberRoot==`function`)try{nt.onPostCommitFiberRoot(tt,o)}catch{}return!0}finally{A.p=a,k.T=r,Ef(e,t)}}function kf(e,t,n){t=Xi(n,t),t=Lc(e.stateNode,t,2),e=To(e,t,2),e!==null&&(vt(e,2),Uf(e))}function Af(e,t,n){if(e.tag===3)kf(e,e,n);else for(;t!==null;){if(t.tag===3){kf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Pd===null||!Pd.has(r))){e=Xi(n,e),n=Rc(2),r=To(t,n,2),r!==null&&(zc(n,r,t,e),vt(r,2),Uf(r));break}}t=t.return}}function jf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ud;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)||(yd=!0,i.add(n),e=Mf.bind(null,e,t,n),t.then(e,e))}function Mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fd===e&&(md&n)===n&&(xd===4||xd===3&&(md&62914560)===md&&300>Ke()-Ad?dd&2?wd|=n:rf(e,0):wd|=n,Ed===md&&(Ed=0)),Uf(e)}function Nf(e,t){t===0&&(t=gt()),e=Fi(e,t),e!==null&&(vt(e,t),Uf(e))}function Pf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nf(e,n)}function Ff(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),Nf(e,n)}function If(e,t){return He(e,t)}var Lf=null,Rf=null,zf=!1,Bf=!1,Vf=!1,Hf=0;function Uf(e){e!==Rf&&e.next===null&&(Rf===null?Lf=Rf=e:Rf=Rf.next=e),Bf=!0,zf||(zf=!0,Xf())}function Wf(e,t){if(!Vf&&Bf){Vf=!0;do for(var n=!1,r=Lf;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-it(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Yf(r,a))}else a=md,a=ft(r,r===fd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||pt(r,a)||(n=!0,Yf(r,a))}r=r.next}while(n);Vf=!1}}function Gf(){Kf()}function Kf(){Bf=zf=!1;var e=0;Hf!==0&&Pp()&&(e=Hf);for(var t=Ke(),n=null,r=Lf;r!==null;){var i=r.next,a=qf(r,t);a===0?(r.next=null,n===null?Lf=i:n.next=i,i===null&&(Rf=n)):(n=r,(e!==0||a&3)&&(Bf=!0)),r=i}Fd!==0&&Fd!==5||Wf(e,!1),Hf!==0&&(Hf=0)}function qf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-it(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ht(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=fd,n=md,n=ft(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(hd===2||hd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ue(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||pt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ue(r),wt(n)){case 2:case 8:n=Ye;break;case 32:n=Xe;break;case 268435456:n=Qe;break;default:n=Xe}return r=Jf.bind(null,e),n=He(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ue(r),e.callbackPriority=2,e.callbackNode=null,2}function Jf(e,t){if(Fd!==0&&Fd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Df()&&e.callbackNode!==n)return null;var r=md;return r=ft(e,e===fd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Zd(e,r,t),qf(e,Ke()),e.callbackNode!=null&&e.callbackNode===n?Jf.bind(null,e):null)}function Yf(e,t){if(Df())return null;Zd(e,t,!0)}function Xf(){zp(function(){dd&6?He(Je,Gf):Kf()})}function Zf(){if(Hf===0){var e=Ka;e===0&&(e=ct,ct<<=1,!(ct&261888)&&(ct=256)),Hf=e}return Hf}function Qf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:wn(e)}function $f(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Qf((i[kt]||null).action),o=r.submitter;o&&(t=(t=o[kt]||null)?Qf(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(Hf!==0){var e=new FormData(i,o);lc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),lc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var ep=0;ep<Si.length;ep++){var tp=Si[ep];Ci(tp.toLowerCase(),`on`+(tp[0].toUpperCase()+tp.slice(1)))}Ci(pi,`onAnimationEnd`),Ci(hi,`onAnimationIteration`),Ci(gi,`onAnimationStart`),Ci(`dblclick`,`onDoubleClick`),Ci(`focusin`,`onFocus`),Ci(`focusout`,`onBlur`),Ci(_i,`onTransitionRun`),Ci(vi,`onTransitionStart`),Ci(yi,`onTransitionCancel`),Ci(bi,`onTransitionEnd`),qt(`onMouseEnter`,[`mouseout`,`mouseover`]),qt(`onMouseLeave`,[`mouseout`,`mouseover`]),qt(`onPointerEnter`,[`pointerout`,`pointerover`]),qt(`onPointerLeave`,[`pointerout`,`pointerover`]),Kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var np=`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(` `),rp=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(np));function ip(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(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){Oi(e)}i.currentTarget=null,a=c}}}}function ap(e,t){var n=t[jt];n===void 0&&(n=t[jt]=new Set);var r=e+`__bubble`;n.has(r)||(lp(t,e,2,!1),n.add(r))}function op(e,t,n){var r=0;t&&(r|=4),lp(n,e,r,t)}var sp=`_reactListening`+Math.random().toString(36).slice(2);function cp(e){if(!e[sp]){e[sp]=!0,Wt.forEach(function(t){t!==`selectionchange`&&(rp.has(t)||op(t,!1,e),op(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sp]||(t[sp]=!0,op(`selectionchange`,!1,t))}}function lp(e,t,n,r){switch(zh(t)){case 2:var i=Nh;break;case 8:i=Ph;break;default:i=Fh}n=i.bind(null,t,n,e),i=void 0,!Fn||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 up(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=Rt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Mn(function(){var r=a,i=Dn(n),s=[];a:{var c=xi.get(e);if(c!==void 0){var l=Gn,u=e;switch(e){case`keypress`:if(Bn(n)===0)break a;case`keydown`:case`keyup`:l=lr;break;case`focusin`:u=`focus`,l=er;break;case`focusout`:u=`blur`,l=er;break;case`beforeblur`:case`afterblur`:l=er;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=Qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=$n;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=fr;break;case pi:case hi:case gi:l=tr;break;case bi:l=pr;break;case`scroll`:case`scrollend`:l=qn;break;case`wheel`:l=mr;break;case`copy`:case`cut`:case`paste`:l=nr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ur;break;case`submit`:l=dr;break;case`toggle`:case`beforetoggle`:l=hr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Nn(m,p),g!=null&&d.push(dp(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==En&&(u=n.relatedTarget||n.fromElement)&&(Rt(u)||u[At]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Rt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ur,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Bt(c),h=l==null?u:Bt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Rt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,pp):null,c!==null&&mp(s,u,c,d,!1),l!==null&&f!==null&&mp(s,f,l,d,!0)))}a:{if(c=r?Bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Fr;else if(kr(c)){if(Ir)_=Gr;else{_=Ur;var v=Hr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&xn(r.elementType)&&(_=Fr):_=Wr;if(_&&=_(e,r)){Ar(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Bt(r):window,e){case`focusin`:(kr(v)||v.contentEditable===`true`)&&(ni=v,ri=r,ii=null);break;case`focusout`:ii=ri=ni=null;break;case`mousedown`:ai=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ai=!1,oi(s,n,i);break;case`selectionchange`:if(ti)break;case`keydown`:case`keyup`:oi(s,n,i)}var y;if(_r)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Tr?Cr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(br&&n.locale!==`ko`&&(Tr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Tr&&(y=zn()):(In=i,Ln=`value`in In?In.value:In.textContent,Tr=!0)),v=fp(r,b),0<v.length&&(b=new rr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=wr(n),y!==null&&(b.data=y)))),(y=yr?Er(e,n):Dr(e,n))&&(b=fp(r,`onBeforeInput`),0<b.length&&(v=new rr(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),$f(s,e,r,n,i)}ip(s,t)})}function dp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fp(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=Nn(e,n),i!=null&&r.unshift(dp(e,i,a)),i=Nn(e,t),i!=null&&r.push(dp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function pp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function mp(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=Nn(n,a),l!=null&&o.unshift(dp(n,l,c))):i||(l=Nn(n,a),l!=null&&o.push(dp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var hp=/\r\n?/g,gp=/\u0000|\uFFFD/g;function _p(e){return(typeof e==`string`?e:``+e).replace(hp,`
10
+ `).replace(gp,``)}function vp(e,t){return t=_p(t),_p(e)===t}function yp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||_n(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&_n(e,``+r);else return;break;case`className`:tn(e,`class`,r);break;case`tabIndex`:tn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:tn(e,n,r);break;case`style`:bn(e,r,o);return;case`data`:if(t!==`object`){tn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=wn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&yp(e,t,`name`,a.name,a,null),yp(e,t,`formEncType`,a.formEncType,a,null),yp(e,t,`formMethod`,a.formMethod,a,null),yp(e,t,`formTarget`,a.formTarget,a,null)):(yp(e,t,`encType`,a.encType,a,null),yp(e,t,`method`,a.method,a,null),yp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=wn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Tn);return;case`onScroll`:r!=null&&ap(`scroll`,e);return;case`onScrollEnd`:r!=null&&ap(`scrollend`,e);return;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));o?.__html!==n&&(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=wn(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`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`: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`:ap(`beforetoggle`,e),ap(`toggle`,e),en(e,`popover`,r);break;case`xlinkActuate`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:nn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:nn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:nn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:en(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Sn.get(n)||n,en(e,n,r);else return}Qt=!0}function bp(e,t,n,r,a,o){switch(n){case`style`:bn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)_n(e,r);else if(typeof r==`number`||typeof r==`bigint`)_n(e,``+r);else return;break;case`onScroll`:r!=null&&ap(`scroll`,e);return;case`onScrollEnd`:r!=null&&ap(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Tn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[kt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Qt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):en(e,n,r)}return}Qt=!0}function xp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:ap(`error`,e),ap(`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:yp(e,t,o,s,n,null)}}a&&yp(e,t,`srcSet`,n.srcSet,n,null),r&&yp(e,t,`src`,n.src,n,null);return;case`input`:ap(`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:yp(e,t,r,d,n,null)}}fn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in ap(`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:yp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&mn(e,!!r,n,!0):mn(e,!!r,t,!1);return;case`textarea`:for(s in ap(`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:yp(e,t,s,c,n,null)}gn(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:yp(e,t,l,r,n,null)}return;case`dialog`:ap(`beforetoggle`,e),ap(`toggle`,e),ap(`cancel`,e),ap(`close`,e);break;case`iframe`:case`object`:ap(`load`,e);break;case`video`:case`audio`:for(r=0;r<np.length;r++)ap(np[r],e);break;case`image`:ap(`error`,e),ap(`load`,e);break;case`details`:ap(`toggle`,e);break;case`embed`:case`source`:case`link`:ap(`error`,e),ap(`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:yp(e,t,u,r,n,null)}return;default:if(xn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&bp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&yp(e,t,c,r,n,null))}var Sp={};function Cp(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)||yp(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`:m!==f&&(Qt=!0),o=m;break;case`name`:m!==f&&(Qt=!0),a=m;break;case`checked`:m!==f&&(Qt=!0),u=m;break;case`defaultChecked`:m!==f&&(Qt=!0),d=m;break;case`value`:m!==f&&(Qt=!0),s=m;break;case`defaultValue`:m!==f&&(Qt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&yp(e,t,p,m,r,f)}}dn(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)||yp(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`:o!==l&&(Qt=!0),p=o;break;case`defaultValue`:o!==l&&(Qt=!0),c=o;break;case`multiple`:o!==l&&(Qt=!0),s=o;default:o!==l&&yp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?mn(e,!!n,n?[]:``,!1):mn(e,!!n,t,!0)):mn(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:yp(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`:a!==o&&(Qt=!0),p=a;break;case`defaultValue`:a!==o&&(Qt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&yp(e,t,s,a,r,o)}hn(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:yp(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`:p!==m&&(Qt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:yp(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)&&yp(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:yp(e,t,u,p,r,m)}return;default:if(xn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&bp(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||bp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&yp(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||yp(e,t,f,p,r,m)}function wp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Tp(){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&&wp(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&&wp(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 Ep=null,Dp=null;function Op(e){return e.nodeType===9?e:e.ownerDocument}function kp(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 Ap(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 jp(e,t,n,r){return n=Op(n).createElement(e),n[Ot]=r,n[kt]=t,xp(n,e,t),Ht(n),n}function Mp(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 Np=null;function Pp(){var e=window.event;return e&&e.type===`popstate`?e!==Np&&(Np=e,!0):(Np=null,!1)}var Fp=typeof setTimeout==`function`?setTimeout:void 0,Ip=typeof clearTimeout==`function`?clearTimeout:void 0,Lp=typeof Promise==`function`?Promise:void 0,Rp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Fp,zp=typeof queueMicrotask==`function`?queueMicrotask:Lp===void 0?Fp:function(e){return Lp.resolve(null).then(e).catch(Bp)};function Bp(e){setTimeout(function(){throw e})}function Vp(e){return e===`head`}function Hp(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),ig(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Nm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Nm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Nm(e.ownerDocument.body)}n=i}while(n);ig(t)}function Up(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 Wp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Gp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Kp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function qp(e){return Kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Kp(t,n,e)}function Yp(e){return e.documentElement.clientHeight}function Xp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Zp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Yp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=fh(f),u>hh){s.length=o;break}f=new Promise(Xp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Qp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Qp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Qp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Qp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function $p(e){return{name:e,group:new Qp(`group`,e),imagePair:new Qp(`image-pair`,e),old:new Qp(`old`,e),new:new Qp(`new`,e)}}function em(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}em.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(am(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=rm(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,tm,e,s,r)}this._eventListeners=a}};function tm(e,t,n,r){return v(e).addEventListener(t,n,r),!1}em.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=am(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=rm(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,nm,e,n,i),r.splice(t,1),a!==null&&a()}};function nm(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function rm(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function im(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function am(e,t,n,r){if(e.length===0)return-1;r=im(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&im(a.optionsOrUseCapture)===r)return i}return-1}em.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,rm(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,rm(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},em.prototype.focus=function(e){p(this._fragmentFiber.child,!0,om,e,void 0,void 0)};function om(e,t){return e.tag!==6&&(e=v(e),km(e,t))}em.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,sm,t,void 0,void 0);for(var n=t.length-1;0<=n&&!om(t[n],e);n--);};function sm(e,t){return t.push(e),!1}em.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=Op(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,cm,e,void 0,void 0))};function cm(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}em.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,lm,e,void 0,void 0)};function lm(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}em.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,um,e,void 0,void 0);for(var n=t=0;n<dm.length;n++){var r=dm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):dm[t++]=r}dm.length=t}};function um(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var dm=[],fm=!1;function pm(e,t,n){dm.push({fragmentInstance:e,observer:t,instance:n}),fm||(fm=!0,Am(function(){fm=!1;var e=dm;dm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}em.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,mm,e,void 0,void 0),e};function mm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}em.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},em.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,sm,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||hm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function hm(e,t,n,r,i){var a=Rt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function gm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}em.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,sm,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),gm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),gm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function _m(e,t){return e=v(e),vm(e,t),!1}function vm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function ym(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,rm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<dm.length;i++){var a=dm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(dm[r++]=a)}dm.length=r,n.observe(e)}),vm(e,t))}function bm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,rm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?pm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function xm(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`:xm(n),Lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function Sm(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[Ft])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=Dm(e.nextSibling),e===null)break}return null}function Cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Dm(e.nextSibling),e===null))return null;return e}function wm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Dm(e.nextSibling),e===null))return null;return e}function Tm(e){return e.data===`$?`||e.data===`$~`}function Em(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function F(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 Dm(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 Om=null;function I(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function L(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 km(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Am(e){Rp(function(){Rp(function(t){return e(t)})})}function jm(e,t,n){switch(t=Op(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 Mm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&yp(e,t,r,null,Sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Tn&&(e.onclick=null),Lt(e)}function Nm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Lt(e)}var Pm=new Map,Fm=new Set;function Im(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Lm=A.d;A.d={f:Rm,r:zm,D:Hm,C:Um,L:Wm,m:Gm,X:qm,S:Km,M:Jm};function Rm(){var e=Lm.f(),t=tf();return e||t}function zm(e){var t=zt(e);t!==null&&t.tag===5&&t.type===`form`?dc(t):Lm.r(e)}var Bm=typeof document>`u`?null:document;function Vm(e,t,n){var r=Bm;if(r&&typeof t==`string`&&t){var i=un(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Fm.has(i)||(Fm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),xp(t,`link`,e),Ht(t),r.head.appendChild(t)))}}function Hm(e){Lm.D(e),Vm(`dns-prefetch`,e,null)}function Um(e,t){Lm.C(e,t),Vm(`preconnect`,e,t)}function Wm(e,t,n){Lm.L(e,t,n);var r=Bm;if(r&&e&&t){var i=`link[rel="preload"][as="`+un(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+un(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+un(n.imageSizes)+`"]`)):i+=`[href="`+un(e)+`"]`;var a=i;switch(t){case`style`:a=Xm(e);break;case`script`:a=eh(e)}if(!(Pm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Pm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Zm(a))||t===`script`&&r.querySelector(th(a))))){var o=r.createElement(`link`);xp(o,`link`,e),t===`style`&&(o[It]=!0,o.onload=o.onerror=function(){Ut(o)}),Ht(o),r.head.appendChild(o)}}}function Gm(e,t){Lm.m(e,t);var n=Bm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+un(r)+`"][href="`+un(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=eh(e)}if(!Pm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Pm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(th(a)))return}r=n.createElement(`link`),xp(r,`link`,e),Ht(r),n.head.appendChild(r)}}}function Km(e,t,n){Lm.S(e,t,n);var r=Bm;if(r&&e){var i=Vt(r).hoistableStyles,a=Xm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Zm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Pm.get(a))&&ih(e,n);var c=o=r.createElement(`link`);Ht(c),xp(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,rh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function qm(e,t){Lm.X(e,t);var n=Bm;if(n&&e){var r=Vt(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(th(i)),a||(e=T({src:e,async:!0},t),(t=Pm.get(i))&&ah(e,t),a=n.createElement(`script`),Ht(a),xp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Jm(e,t){Lm.M(e,t);var n=Bm;if(n&&e){var r=Vt(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(th(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Pm.get(i))&&ah(e,t),a=n.createElement(`script`),Ht(a),xp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ym(e,t,n,r){var a=(a=Oe.current)?Im(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`?(n=Xm(n.href),t=Vt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Xm(n.href);var o=Vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Pm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pm.set(e,o)),$m(a,e,o,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`?(n=eh(n),t=Vt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Xm(e){return`href="`+un(e)+`"`}function Zm(e){return`link[rel="stylesheet"][`+e+`]`}function Qm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function $m(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[It]){r.loading=1;return}}else t=e.createElement(`link`),t[It]=!0,t.onload=t.onerror=Ut.bind(null,t),xp(t,`link`,n),Ht(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function eh(e){return`[src="`+un(e)+`"]`}function th(e){return`script[async]`+e}function nh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+un(n.href)+`"]`);if(r)return t.instance=r,Ht(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ht(r),xp(r,`style`,a),rh(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Xm(n.href);var o=e.querySelector(Zm(a));if(o)return t.state.loading|=4,t.instance=o,Ht(o),o;r=Qm(n),(a=Pm.get(a))&&ih(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}),xp(o,`link`,r),t.state.loading|=4,rh(o,n.precedence,e),t.instance=o;case`script`:return o=eh(n.src),(a=e.querySelector(th(o)))?(t.instance=a,Ht(a),a):(r=n,(a=Pm.get(o))&&(r=T({},n),ah(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ht(a),xp(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,rh(r,n.precedence,e));return t.instance}function rh(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 ih(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function ah(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var oh=null;function sh(e,t,n){if(oh===null){var r=new Map,i=oh=new Map;i.set(n,r)}else i=oh,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[Ft]||a[Ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ch(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function lh(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 uh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function dh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function fh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ph(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=fh(t),e.suspenseyImages.push(t)),e=yh.bind(e),t.decode().then(e,e))}function mh(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=Xm(r.href),a=t.querySelector(Zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=vh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ht(a);return}a=t.ownerDocument||t,r=Qm(r),(i=Pm.get(i))&&ih(r,i),a=a.createElement(`link`),Ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),xp(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=vh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var hh=0;function gh(e,t){return e.stylesheets&&e.count===0&&xh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&xh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&hh===0&&(hh=62500*Tp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>hh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function _h(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)xh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function vh(){this.count--,_h(this)}function yh(){this.imgCount--,_h(this)}var bh=null;function xh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bh=new Map,t.forEach(Sh,e),bh=null,vh.call(e))}function Sh(e,t){if(!(t.state.loading&4)){var n=bh.get(e);if(n)var r=n.get(null);else{n=new Map,bh.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=vh.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 Ch={$$typeof:O,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_threadCount:0};function wh(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=_t(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_t(0),this.hiddenUpdates=_t(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function Th(e,t,n,r,i,a,o,s,c,l,u,d){return e=new wh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Bi(3,null,null,t),e.current=a,a.stateNode=e,t=za(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},So(a),e}function Eh(e){return e?(e=Ri,e):Ri}function Dh(e,t,n,r,i,a){i=Eh(i),r.context===null?r.context=i:r.pendingContext=i,r=wo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=To(e,r,t),n!==null&&(Xd(n,e,t),Eo(n,e,t))}function Oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function kh(e,t){Oh(e,t),(e=e.alternate)&&Oh(e,t)}function Ah(e){if(e.tag===13||e.tag===31){var t=Fi(e,67108864);t!==null&&Xd(t,e,67108864),kh(e,67108864)}}function jh(e){if(e.tag===13||e.tag===31){var t=qd();t=Ct(t);var n=Fi(e,t);n!==null&&Xd(n,e,t),kh(e,t)}}var Mh=!0;function Nh(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,Fh(e,t,n,r)}finally{A.p=a,k.T=i}}function Ph(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,Fh(e,t,n,r)}finally{A.p=a,k.T=i}}function Fh(e,t,n,r){if(Mh){var i=Ih(r);if(i===null)up(e,t,r,Lh,n),Jh(e,r);else if(Xh(i,e,t,n,r))r.stopPropagation();else if(Jh(e,r),t&4&&-1<qh.indexOf(e)){for(;i!==null;){var a=zt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=dt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-it(o);s.entanglements[1]|=c,o&=~c}Uf(a),!(dd&6)&&(Md=Ke()+500,Wf(0,!1))}}break;case 31:case 13:s=Fi(a,2),s!==null&&Xd(s,a,2),tf(),kh(a,2)}if(a=Ih(r),a===null&&up(e,t,r,Lh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else up(e,t,r,null,n)}}function Ih(e){return e=Dn(e),Rh(e)}var Lh=null;function Rh(e){if(Lh=null,e=Rt(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 Lh=e,null}function zh(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`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(qe()){case Je:return 2;case Ye:return 8;case Xe:case Ze:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var Bh=!1,Vh=null,Hh=null,Uh=null,Wh=new Map,Gh=new Map,Kh=[],qh=`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 Jh(e,t){switch(e){case`focusin`:case`focusout`:Vh=null;break;case`dragenter`:case`dragleave`:Hh=null;break;case`mouseover`:case`mouseout`:Uh=null;break;case`pointerover`:case`pointerout`:Wh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Gh.delete(t.pointerId)}}function Yh(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=zt(t),t!==null&&Ah(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Xh(e,t,n,r,i){switch(t){case`focusin`:return Vh=Yh(Vh,e,t,n,r,i),!0;case`dragenter`:return Hh=Yh(Hh,e,t,n,r,i),!0;case`mouseover`:return Uh=Yh(Uh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Wh.set(a,Yh(Wh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Gh.set(a,Yh(Gh.get(a)||null,e,t,n,r,i)),!0}return!1}function Zh(e){var t=Rt(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,Et(e.priority,function(){jh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Et(e.priority,function(){jh(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 Qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ih(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);En=r,n.target.dispatchEvent(r),En=null}else return t=zt(n),t!==null&&Ah(t),e.blockedOn=n,!1;t.shift()}return!0}function $h(e,t,n){Qh(e)&&n.delete(t)}function eg(){Bh=!1,Vh!==null&&Qh(Vh)&&(Vh=null),Hh!==null&&Qh(Hh)&&(Hh=null),Uh!==null&&Qh(Uh)&&(Uh=null),Wh.forEach($h),Gh.forEach($h)}function tg(e,n){e.blockedOn===n&&(e.blockedOn=null,Bh||(Bh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,eg)))}var ng=null;function rg(e){ng!==e&&(ng=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ng===e&&(ng=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(Rh(r||n)===null)continue;break}var a=zt(n);a!==null&&(e.splice(t,3),t-=3,lc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ig(e){function t(t){return tg(t,e)}Vh!==null&&tg(Vh,e),Hh!==null&&tg(Hh,e),Uh!==null&&tg(Uh,e),Wh.forEach(t),Gh.forEach(t);for(var n=0;n<Kh.length;n++){var r=Kh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Kh.length&&(n=Kh[0],n.blockedOn===null);)Zh(n),n.blockedOn===null&&Kh.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[kt]||null;if(typeof a==`function`)o||rg(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[kt]||null)s=o.formAction;else if(Rh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),rg(n)}}}function ag(){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 og(e){this._internalRoot=e}sg.prototype.render=og.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Dh(n,qd(),e,t,null,null)},sg.prototype.unmount=og.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dh(e.current,2,null,e,null,null),tf(),t[At]=null}};function sg(e){this._internalRoot=e}sg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Kh.length&&t!==0&&t<Kh[n].priority;n++);Kh.splice(n,0,e),n===0&&Zh(e)}};var cg=n.version;if(cg!==`19.3.0`)throw Error(i(527,cg,`19.3.0`));A.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=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var lg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ug=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ug.isDisabled&&ug.supportsFiber)try{tt=ug.inject(lg),nt=ug}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Mc,s=Nc,c=Pc;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=Th(e,1,!1,null,null,n,r,null,o,s,c,ag),e[At]=t.current,cp(e),new og(t)}})),gi=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=hi()}))(),_i=`neko.appearance`,vi=[`sakura`,`light`,`dark`],yi=[`sans`,`serif`,`mono`],bi=[`13`,`14`,`16`,`18`],xi=[`regular`,`medium`,`semibold`],Si=[`compact`,`normal`,`relaxed`],Ci={theme:`sakura`,font:`sans`,size:`14`,weight:`regular`,leading:`normal`},wi={theme:`data-theme`,font:`data-chat-font`,size:`data-chat-size`,weight:`data-chat-weight`,leading:`data-chat-leading`},Ti={theme:vi,font:yi,size:bi,weight:xi,leading:Si},Ei=Object.keys(Ti);function Di(e,t){return Ti[e].includes(t)?t:Ci[e]}function Oi(e){let t;try{t=e?JSON.parse(e):void 0}catch{t=void 0}let n=typeof t==`object`&&t?t:{};return{theme:Di(`theme`,n.theme),font:Di(`font`,n.font),size:Di(`size`,n.size),weight:Di(`weight`,n.weight),leading:Di(`leading`,n.leading)}}function ki(e){return JSON.stringify({v:1,...e})}function Ai(e){return Ei.every(t=>e[t]===Ci[t])}function ji(e=localStorage){try{return Oi(e.getItem(_i))}catch{return Ci}}function Mi(e,t=localStorage){try{Ai(e)?t.removeItem(_i):t.setItem(_i,ki(e))}catch{}}function Ni(e,t=document){let n=t.documentElement;for(let t of Ei)e[t]===Ci[t]?n.removeAttribute(wi[t]):n.setAttribute(wi[t],e[t]);t.querySelector(`meta[name="color-scheme"]`)?.setAttribute(`content`,e.theme===`dark`?`dark`:`light`)}function Pi(e={}){let t=e.storage??localStorage,n=e.doc??document,r=e.target??window,i=ji(t),a=new Set;function o(e){if(!Ei.every(t=>e[t]===i[t])){i=e,Ni(i,n);for(let e of a)e()}}let s=e=>{let n=e.key;(n===null||n===`neko.appearance`)&&o(ji(t))};return{get:()=>i,set(e){let n=Oi(ki({...i,...e}));Mi(n,t),o(n)},reset(){Mi(Ci,t),o(Ci)},start(){i=ji(t),Ni(i,n),r.addEventListener(`storage`,s)},stop(){r.removeEventListener(`storage`,s)},subscribe(e){return a.add(e),()=>a.delete(e)}}}var Fi;function Ii(){return Fi??=Pi(),Fi}function Li(e=Ii()){return(0,d.useSyncExternalStore)(e.subscribe,e.get,()=>Ci)}var Ri=`0.5.4`;function zi(e){return typeof e==`string`&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(e)&&e.split(`.`).every(e=>Number.isSafeInteger(Number(e)))}function Bi(e,t){if(!zi(e)||!zi(t))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if(n[e]!==r[e])return n[e]>r[e];return!1}function Vi(e){let{gateway:t,frontend:n,installed:r,web:i}=e;if(t&&t.protocolVersion!==10)return`incompatible`;if(t&&(Bi(t.installedVersion,t.runningVersion)||Bi(r,t.runningVersion)||Bi(n,t.runningVersion))||i&&(Bi(i.installedVersion,i.runningVersion)||Bi(t?.runningVersion,i.runningVersion)||Bi(n,i.runningVersion)))return`restart-service`;if(i){if(Bi(i.runningVersion,n))return`refresh-page`}else if(Bi(r,n)||Bi(t?.runningVersion,n))return`restart-tui`;return t?.checkState===`ok`&&Bi(t.latestVersion,r)?`install`:`none`}var Hi=class extends Error{constructor(){super(`Application protocol incompatible. Update neko, then restart its TUI/Web or serve.`),this.name=`ApplicationProtocolError`}};function Ui(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function Wi(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}async function Gi(e,t){let n=await t.begin({name:e.name,mimeType:e.mimeType,size:e.bytes.length});try{for(let r=0;r<e.bytes.length;r+=262144)await t.append({id:n,offset:r,data:Ui(e.bytes.subarray(r,r+262144))});return await t.finish(n),n}catch(e){throw await t.release(n).catch(()=>{}),e}}async function Ki(e){let t=[],n=0,r=0,i=``;do{let a=await e(n);if(!Number.isSafeInteger(a.total)||a.total<=0||a.total>20971520||n>0&&(a.total!==r||a.mimeType!==i))throw Error(`Invalid image size or format`);if(r=a.total,i=a.mimeType,a.data.length>349528)throw Error(`Image chunk is too large`);let o=Wi(a.data);if(o.length>262144||n+o.length>r||!o.length&&n<r)throw Error(`Incomplete image`);t.push(o),n+=o.length}while(n<r);let a=new Uint8Array(n),o=0;for(let e of t)a.set(e,o),o+=e.length;return{name:`Image`,mimeType:i,bytes:a}}function qi(e){let t=/^\/compact(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}var Ji=(e,t=`New session`)=>e.title||e.firstPromptPreview||t,Yi=e=>e.lastMessageAt??e.createdAt,Xi=(e,t)=>Yi(t)-Yi(e)||Number(t.id)-Number(e.id),Zi=(e,t)=>t.lastUsedAt-e.lastUsedAt||Number(t.id)-Number(e.id),Qi=(e,t)=>`${e.title} ${e.firstPromptPreview} ${e.id}`.toLocaleLowerCase().includes(t.trim().toLocaleLowerCase());function $i(e,t,n=`en`){let r=Math.floor(Math.max(0,t-e)/6e4);if(r<1)return n===`zh`?`刚刚`:`now`;let i=Math.floor(r/60),a=Math.floor(i/24);if(a>=30)return new Date(e).toLocaleDateString(n===`zh`?`zh-CN`:`en-GB`);let o=a||i||r,s=a?[`天`,`d`]:i?[`小时`,`h`]:[`分钟`,`m`];return n===`zh`?`${o} ${s[0]}前`:`${o}${s[1]}`}function ea(e={}){return{type:`string`,...e}}function ta(e={}){return{type:`number`,...e}}function na(e={}){return{type:`integer`,...e}}function ra(e={}){return{type:`boolean`,...e}}function ia(e={}){return{type:`null`,...e}}function aa(e={}){return{...e}}function oa(e,t={}){return{const:e,...t}}function sa(e,t={}){return{enum:e,...t}}function ca(e,t={}){return{anyOf:e,...t}}function la(e,t={}){return{type:`array`,items:e,...t}}function ua(e,t={}){return{type:`object`,additionalProperties:e,...t}}var da=class{schema;constructor(e){this.schema=e}};function M(e){return new da(e)}function N(e,t={}){let{open:n,...r}=t,i={},a=[];for(let[t,n]of Object.entries(e))n instanceof da?i[t]=n.schema:(i[t]=n,a.push(t));return{type:`object`,properties:i,...a.length>0?{required:a}:{},...n===!0?{}:{additionalProperties:!1},...r}}var fa=`https://json-schema.invalid/root.json`,pa=class{draft;rootBase;baseOf=new Map;dynamicAnchors=new Map;root;options;registry=new Map;rejectUnresolved;unresolved=new Set;resources=new Map;anchors=new Map;indexed=!1;constructor(e,t){this.draft=t.draft===`7`?`7`:`2020-12`,this.root=e,this.options=t,this.rejectUnresolved=t.unresolvedRefs===`reject`,this.rootBase=_a(e)?this.baseFor(e,fa):fa}baseFor(e,t){let n=this.baseOf.get(e);if(n!==void 0)return n;let r=e.$id;return typeof r!=`string`||this.draft===`7`&&(typeof e.$ref==`string`||r.startsWith(`#`))?t:ya(va(r,t))}ensureIndexed(){if(!this.indexed){this.indexed=!0;for(let[e,t]of Object.entries(this.options.schemas??{}))this.registry.set(ya(va(e,fa)),t);this.resources.set(fa,this.root),this.index(this.root,fa)}}resolve(e,t){if(this.ensureIndexed(),!this.rejectUnresolved)return this.find(e,t);try{return this.find(e,t)}catch{return this.unresolved.add(va(e,t)),{node:!1,base:t}}}isUnresolved(e,t){return this.unresolved.has(va(e,t))}find(e,t){let n=va(e,t),r=ya(n),i=n.length>r.length?decodeURIComponent(n.slice(r.length+1)):``,a=this.resources.has(r)?this.resources.get(r):this.load(r);if(a===void 0)throw Error(`Unresolved $ref ${e} (no schema registered for ${r})`);if(i===``)return{node:a,base:r};if(i.startsWith(`/`))return this.pointer(a,r,i);let o=this.anchors.get(`${r}#${i}`);if(o===void 0)throw Error(`Unresolved $ref ${e} (no anchor ${i} in ${r})`);return{node:o,base:this.baseOf.get(o)??r}}isResource(e,t){return this.ensureIndexed(),this.resources.get(t)===e}index(e,t){if(!_a(e)||this.baseOf.has(e))return;let n=t,r=this.draft===`7`&&typeof e.$ref==`string`;if(!r&&typeof e.$id==`string`){if(this.draft===`7`&&e.$id.startsWith(`#`))this.anchors.set(ya(n)+e.$id,e);else{let t=va(e.$id,n);n=ya(t),this.resources.set(n,e),t.length>n.length+1&&this.anchors.set(t,e)}}if(this.baseOf.set(e,n),!r){this.draft!==`7`&&(typeof e.$anchor==`string`&&this.anchors.set(`${n}#${e.$anchor}`,e),typeof e.$dynamicAnchor==`string`&&(this.anchors.set(`${n}#${e.$dynamicAnchor}`,e),this.dynamicAnchors.set(`${n}#${e.$dynamicAnchor}`,e)));for(let t of ma)this.index(e[t],n);for(let t of ha){let r=e[t];if(_a(r))for(let e of Object.keys(r))this.index(r[e],n)}for(let t of ga){let r=e[t];if(Array.isArray(r))for(let e of r)this.index(e,n)}}}load(e){let t=this.registry.get(e);if(t!==void 0)return this.resources.set(e,t),this.index(t,e),t}pointer(e,t,n){let r=e,i=t;for(let e of n.split(`/`).slice(1)){let a=e.replace(/~1/g,`/`).replace(/~0/g,`~`);if(r=typeof r==`object`&&r&&Object.hasOwn(r,a)?r[a]:void 0,r===void 0)throw Error(`Unresolved $ref #${n} in ${t}`);typeof r==`object`&&r&&(i=this.baseOf.get(r)??i)}return{node:r,base:i}}},ma=[`additionalProperties`,`propertyNames`,`contains`,`not`,`if`,`then`,`else`,`unevaluatedProperties`,`unevaluatedItems`,`additionalItems`,`contentSchema`,`items`],ha=[`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`],ga=[`allOf`,`anyOf`,`oneOf`,`prefixItems`,`items`];function _a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function va(e,t){try{return new URL(e,t).href}catch{return e.startsWith(`#`)?ya(t)+e:e}}function ya(e){let t=e.indexOf(`#`);return t<0?e:e.slice(0,t)}function ba(e){let t=xa.get(e)?.deref();if(t!==void 0)return t;let n;try{n=new RegExp(e,`u`)}catch{n=new RegExp(e)}return xa.set(e,new WeakRef(n)),Sa.register(n,e),n}var xa=new Map,Sa=new FinalizationRegistry(e=>{xa.get(e)?.deref()===void 0&&xa.delete(e)}),Ca=class{c;schema;entered=[];cuts=0;memo=void 0;constructor(e,t){this.c=e,this.schema=t}coerce(e){let t=this.c.r.rootBase,n=this.dropOptionalNulls(e,this.schema,t);return this.coerceTypes(this.convertOnly(n),this.schema,t)}convertOnly(e){try{return this.convert(this.schema,this.c.r.rootBase,e)}finally{this.memo=void 0,this.cuts=0}}reenter(e,t,n,r){let i=this.entered;for(let t=0;t<i.length;t+=2)if(i[t]===e&&Object.is(i[t+1],n))return this.cuts++,n;let a=r?this.memo?.get(e):void 0;if(a?.has(n))return a.get(n);let o=this.cuts;i.push(e,n);let s;try{s=this.convert(e,t,n)}finally{i.length-=2}if(r&&this.cuts===o){this.memo??=new Map;let t=this.memo.get(e);t===void 0&&(t=new Map,this.memo.set(e,t)),t.set(n,s)}return s}passes(e,t,n){try{return this.c.check(e,this.baseOf(e,t))(n)}catch{return}}baseOf(e,t){return _a(e)?this.c.r.baseOf.get(e)??t:t}dropOptionalNulls(e,t,n){if(!_a(t))return e;let r=this.baseOf(t,n);if(Array.isArray(e))return Ta(e,(e,n)=>{let i=wa(t,n);return i===void 0?e:this.dropOptionalNulls(e,i,r)});if(!za(e))return e;let i=_a(t.properties)?t.properties:{},a=_a(t.patternProperties)?Object.entries(t.patternProperties).map(([e,t])=>[ba(e),t]):[],o=_a(t.additionalProperties)?t.additionalProperties:void 0;if(a.length===0&&o===void 0&&!_a(t.properties))return e;let s=new Set(Array.isArray(t.required)?t.required:[]),c,l=(t,n)=>{n!==(c??e)[t]&&(c??={...e},c[t]=n)};for(let[t,n]of Object.entries(i)){if(!Object.hasOwn(e,t))continue;let i=_a(n)&&typeof n.$ref==`string`;e[t]===null&&!s.has(t)&&!i&&this.passes(n,r,null)===!1?(c??={...e},delete c[t]):l(t,this.dropOptionalNulls(e[t],n,r))}if(a.length>0||o!==void 0)for(let t of Object.keys(e)){let n=Object.hasOwn(i,t);for(let[i,o]of a)i.test(t)&&(n=!0,l(t,this.dropOptionalNulls((c??e)[t],o,r)));!n&&o!==void 0&&l(t,this.dropOptionalNulls(e[t],o,r))}return c??e}convert(e,t,n){if(!_a(e))return n;let r=this.baseOf(e,t);if(typeof e.$ref==`string`){let t;try{t=this.c.r.resolve(e.$ref,r)}catch{return n}return _a(t.node)?this.reenter(t.node,t.base,n,!0):n}return this.convertNode(e,r,n)}convertNode(e,t,n){if(Object.hasOwn(e,`const`))return Da(e.const,n);if(Array.isArray(e.enum))return this.convertEnum(e,e.enum,t,n);if(Array.isArray(e.anyOf))return this.convertUnion(e,e.anyOf,t,n);if(Array.isArray(e.oneOf))return this.convertUnion(e,e.oneOf,t,n);if(Array.isArray(e.allOf)){let r=n;for(let n of e.allOf)r=this.convert(n,t,r);return this.convertMembers(e,t,r)}switch(e.type){case`string`:return Ea(Oa(n),n);case`number`:return Ea(ja(n),n);case`integer`:{let e=ja(n);return e===void 0?n:Math.trunc(e.value)}case`boolean`:return Ea(Na(n),n);case`null`:return Ea(Pa(n),n);case`array`:return this.convertArray(e,t,n);case`object`:return this.convertObject(e,t,n);case void 0:return e.properties!==void 0||e.patternProperties!==void 0?this.convertObject(e,t,n):e.items!==void 0||e.prefixItems!==void 0?this.convertArray(e,t,n):n;default:return n}}convertEnum(e,t,n,r){if(t.some(e=>e===r))return r;for(let i of t){let t=Da(i,r);if(t!==r&&this.passes(e,n,t)===!0)return t}return r}convertUnion(e,t,n,r){if(t.some(e=>this.passes(e,n,r)===!0))return this.convertMembers(e,n,r);for(let i of t){let t=this.convertMembers(e,n,this.convert(i,n,r));if(this.passes(e,n,t)===!0)return t}return this.convertMembers(e,n,r)}convertMembers(e,t,n){return e.properties!==void 0||e.patternProperties!==void 0||e.additionalProperties!==void 0?this.convertObject(e,t,n):n}convertArray(e,t,n){let r=Array.isArray(e.items)?e.items:Array.isArray(e.prefixItems)?e.prefixItems:void 0;if(r!==void 0){if(!Array.isArray(n))return n;let i=Array.isArray(e.items)?void 0:e.items;return Ta(n,(e,n)=>{let a=n<r.length?r[n]:i;return a===void 0?e:this.convert(a,t,e)})}if(Array.isArray(n))return e.items===void 0?n:Ta(n,n=>this.convert(e.items,t,n));let i=e.items;return[_a(i)?this.reenter(i,t,n,!1):n]}convertObject(e,t,n){if(!za(n))return n;let r=_a(e.properties)?e.properties:{},i=_a(e.patternProperties)?Object.entries(e.patternProperties).map(([e,t])=>[ba(e),t]):[],a=_a(e.additionalProperties)?e.additionalProperties:void 0,o;for(let e of Object.keys(n)){if(n[e]===void 0)continue;let s=n[e],c=Object.hasOwn(r,e);c&&(s=this.convert(r[e],t,s));for(let[n,r]of i)n.test(e)&&(c=!0,s=this.convert(r,t,s));!c&&a!==void 0&&(s=this.convert(a,t,s)),s!==n[e]&&(o??={...n},o[e]=s)}return o??n}coerceTypes(e,t,n){if(!_a(t))return e;let r=this.baseOf(t,n),i=e;if(Array.isArray(t.allOf))for(let e of t.allOf)i=this.coerceTypes(i,e,r);Array.isArray(t.anyOf)&&(i=this.coerceUnion(i,t.anyOf,r)),Array.isArray(t.oneOf)&&(i=this.coerceUnion(i,t.oneOf,r));let a=Ia(t),o=a.length>1&&a.some(e=>La(i,e));if(a.length>0&&!o)for(let e of a){let t=Ra(i,e);if(t!==i){i=t;break}}return a.includes(`object`)&&za(i)&&(i=this.coerceProperties(i,t,r)),a.includes(`array`)&&Array.isArray(i)&&(i=this.coerceItems(i,t,r)),i}coerceUnion(e,t,n){for(let r of t)if(this.passes(r,n,e)===!0)return e;for(let r of t){let t=this.coerceTypes(e,r,n);if(this.passes(r,n,t)===!0)return t}return e}coerceProperties(e,t,n){let r=_a(t.properties)?t.properties:{},i=_a(t.patternProperties)?Object.entries(t.patternProperties).map(([e,t])=>[ba(e),t]):[],a=_a(t.additionalProperties)?t.additionalProperties:void 0,o,s=(t,n)=>{n!==(o??e)[t]&&(o??={...e},o[t]=n)};for(let[t,i]of Object.entries(r))t in e&&s(t,this.coerceTypes(e[t],i,n));for(let t of Object.keys(e)){let c=Object.hasOwn(r,t);for(let[r,a]of i)r.test(t)&&(c=!0,s(t,this.coerceTypes((o??e)[t],a,n)));!c&&a!==void 0&&s(t,this.coerceTypes(e[t],a,n))}return o??e}coerceItems(e,t,n){return Ta(e,(e,r)=>{let i=wa(t,r);return _a(i)?this.coerceTypes(e,i,n):e})}};function wa(e,t){return Array.isArray(e.items)?e.items[t]:Array.isArray(e.prefixItems)&&t<e.prefixItems.length?e.prefixItems[t]:e.items}function Ta(e,t){let n;for(let r=0;r<e.length;r++){let i=t(e[r],r);i!==e[r]&&(n??=e.slice(),n[r]=i)}return n??e}function Ea(e,t){return e===void 0?t:e.value}function Da(e,t){if(e===t)return t;let n=typeof e==`string`?Oa(t):typeof e==`number`?ja(t):typeof e==`boolean`?Na(t):void 0;return n!==void 0&&n.value===e?n.value:t}function Oa(e){if(typeof e==`bigint`||typeof e==`boolean`||Fa(e))return{value:String(e)};if(e===null)return{value:`null`};if(typeof e==`string`)return{value:e};if(e===void 0)return{value:``}}var ka=BigInt(2**53-1),Aa=BigInt(-(2**53-1));function ja(e){if(typeof e==`bigint`)return e<=ka&&e>=Aa?{value:Number(e)}:void 0;if(typeof e==`boolean`)return{value:+!!e};if(Fa(e))return{value:e};if(e==null)return{value:0};if(typeof e!=`string`)return;let t=+e;if(Number.isFinite(t))return{value:t};let n=e.toLowerCase();if(n===`false`)return{value:0};if(n===`true`)return{value:1};let r=Ma(e);return r!==void 0&&r<=ka&&r>=Aa?{value:Number(r)}:void 0}function Ma(e){if(/^-?(0|[1-9]\d*)n$/.test(e))return BigInt(e.slice(0,-1));if(/^-?(0|[1-9]\d*)\.\d+$/.test(e))return BigInt(e.split(`.`)[0]);if(/^-?(0|[1-9]\d*)$/.test(e))return BigInt(e)}function Na(e){if(typeof e==`bigint`)return e===0n?{value:!1}:e===1n?{value:!0}:void 0;if(typeof e==`boolean`)return{value:e};if(Fa(e))return e===0?{value:!1}:e===1?{value:!0}:void 0;if(e==null)return{value:!1};if(typeof e!=`string`)return;let t=e.toLowerCase();if(t===`false`||e===`0`)return{value:!1};if(t===`true`||e===`1`)return{value:!0}}function Pa(e){if(typeof e==`bigint`)return e===0n?{value:null}:void 0;if(typeof e==`boolean`)return e===!1?{value:null}:void 0;if(Fa(e))return e===0?{value:null}:void 0;if(e==null)return{value:null};if(typeof e!=`string`)return;let t=e.toLowerCase();return t===`undefined`||t===`null`||e===``||e===`0`?{value:null}:void 0}function Fa(e){return typeof e==`number`&&Number.isFinite(e)}function Ia(e){return typeof e.type==`string`?[e.type]:Array.isArray(e.type)?e.type.filter(e=>typeof e==`string`):[]}function La(e,t){switch(t){case`number`:return typeof e==`number`;case`integer`:return typeof e==`number`&&Number.isInteger(e);case`boolean`:return typeof e==`boolean`;case`string`:return typeof e==`string`;case`null`:return e===null;case`array`:return Array.isArray(e);case`object`:return za(e);default:return!1}}function Ra(e,t){switch(t){case`number`:case`integer`:if(e===null)return 0;if(typeof e==`string`&&e.trim()!==``){let n=Number(e);if(t===`number`?Number.isFinite(n):Number.isInteger(n))return n}return typeof e==`boolean`?+!!e:e;case`boolean`:return e===null?!1:e===`true`||e===1?!0:e===`false`||e===0?!1:e;case`string`:return e===null?``:typeof e==`number`||typeof e==`boolean`?String(e):e;case`null`:return e===``||e===0||e===!1?null:e;default:return e}}function za(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ba=()=>!0,Va=()=>!1,Ha=e=>typeof e==`string`,Ua=e=>typeof e==`number`,Wa=e=>Number.isInteger(e),Ga=e=>typeof e==`boolean`,Ka=e=>e===null,qa=e=>Array.isArray(e),Ja=e=>e instanceof Uint8Array,Ya=e=>Xa(e);function Xa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Uint8Array)}var Za=new Map([[`string`,Ha],[`number`,Ua],[`integer`,Wa],[`boolean`,Ga],[`null`,Ka],[`array`,qa],[`object`,Ya],[`bytes`,Ja]]),Qa=new Map([[Ha,1],[Ua,2],[Wa,3],[Ga,4],[Ka,5],[Ba,6]]);function $a(e,t){switch(e){case 1:return typeof t==`string`;case 2:return typeof t==`number`;case 3:return Number.isInteger(t);case 4:return typeof t==`boolean`;case 5:return t===null;default:return!0}}function eo(e){switch(e.length){case 0:return Ba;case 1:return e[0];case 2:{let[t,n]=e;return e=>t(e)&&n(e)}case 3:{let[t,n,r]=e;return e=>t(e)&&n(e)&&r(e)}default:return t=>{for(let n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}}function to(e){return t=>e.check(t)}function no(e,t,n){return r=>{e.push(t);let i=n(r);return e.pop(),i}}function ro(e){let t=e.map(e=>(typeof e==`string`?Za.get(e):void 0)??Va);return t.length===1?t[0]:e=>{for(let n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}function io(e,t){return n=>n instanceof Uint8Array&&n.length>=e&&n.length<=t}function ao(e){let t=0;for(let n=0;n<e.length;n++,t++){let t=e.charCodeAt(n);if(t>=55296&&t<=56319&&n+1<e.length){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&n++}}return t}function oo(e,t,n){let r=e.length;return r<t||r<2*t&&ao(e)<t?!1:r<=n||ao(e)<=n}function so(e,t,n,r,i){return r!==void 0&&t===0&&n===1/0&&i===void 0?e?e=>typeof e==`string`&&r.test(e):e=>typeof e!=`string`||r.test(e):r===void 0&&i===void 0?e?e=>typeof e==`string`&&oo(e,t,n):e=>typeof e!=`string`||oo(e,t,n):a=>typeof a==`string`?oo(a,t,n)&&(r===void 0||r.test(a))&&(i===void 0||i(a)):!e}function co(e,t,n,r,i,a){return o=>typeof o==`number`?e===2&&!Number.isInteger(o)?!1:o>=t&&o<=n&&o>r&&o<i&&(a===void 0||lo(o,a)):e===0}function lo(e,t){let n=e/t;if(Number.isInteger(n))return!0;if(!Number.isFinite(n))return e%t===0;let[r,i]=uo(e),[a,o]=uo(t);return i>=o?r*10n**BigInt(i-o)%a==0n:r%(a*10n**BigInt(o-i))==0n}function uo(e){let[t,n=`0`]=Math.abs(e).toString().split(`e`),r=t.indexOf(`.`),i=r<0?0:t.length-r-1;return[BigInt(t.replace(`.`,``)),Number(n)-i]}function fo(e,t){return t?t=>Xa(t)&&e(t):t=>!Xa(t)||e(t)}function po(e,t){return t?t=>Array.isArray(t)&&e(t):t=>!Array.isArray(t)||e(t)}function mo(e,t,n,r){let i=e.length;return a=>{if(r!==0&&!Xa(a))return r===2;let o=a,s=0;for(let t in o){let r=0;for(;r<i&&e[r]!==t;)r+=3;if(r===i){if(n)return!1;continue}let a=o[t];if(a===void 0)continue;let c=e[r+2],l=c&7;if(l===0?!e[r+1](a):!$a(l,a))return!1;c&8&&s++}return s===t}}function ho(e,t,n,r,i,a){let o=r.length>0||i!==void 0?new Set(t):void 0;return t=>{if(a!==0&&!Xa(t))return a===2;let s=t;for(let t=0;t<e.length;t+=3){let n=e[t],r=s[n],i=e[t+2];if(r===void 0||i&16&&!Object.hasOwn(s,n)){if(i&8)return!1;continue}let a=i&7;if(a===0?!e[t+1](r):!$a(a,r))return!1}for(let e=0;e<n.length;e++)if(!Object.hasOwn(s,n[e]))return!1;if(o===void 0)return!0;for(let e of Object.keys(s)){let t=o.has(e);for(let n=0;n<r.length;n++)if(r[n][0].test(e)&&(t=!0,!r[n][1](s[e])))return!1;if(!t&&i!==void 0&&!i(s[e]))return!1}return!0}}function go(e){return t=>{for(let n in t)if(!e(n))return!1;return!0}}function _o(e,t){return n=>{let r=0;for(let e in n)r++;return r>=e&&r<=t}}function vo(e){return t=>{let n=t;for(let[t,r]of e)if(Object.hasOwn(n,t)){for(let e of r)if(!Object.hasOwn(n,e))return!1}return!0}}function yo(e){return t=>{for(let[n,r]of e)if(Object.hasOwn(t,n)&&!r(t))return!1;return!0}}function bo(e,t,n,r,i){let a=r.length,o=i===void 0?0:Qa.get(i)??0;return s=>{if(!Array.isArray(s))return e===2;let c=s.length;if(c<t||c>n)return!1;let l=c<a?c:a;for(let e=0;e<l;e++)if(!r[e](s[e]))return!1;if(i===void 0)return!0;if(o!==0){for(let e=a;e<c;e++)if(!$a(o,s[e]))return!1;return!0}for(let e=a;e<c;e++)if(!i(s[e]))return!1;return!0}}function xo(e,t){return bo(0,0,1/0,e,t)}function So(e,t){return n=>n.length>=e&&n.length<=t}function Co(e,t,n){return r=>{let i=r,a=0;for(let t=0;t<i.length;t++)if(e(i[t])&&++a>n)return!1;return a>=t}}function wo(e){let t=e;for(let e=1;e<t.length;e++)for(let n=0;n<e;n++)if(Mo(t[e],t[n]))return!1;return!0}function To(e){let t=e.filter(e=>typeof e!=`object`||!e);if(t.length===e.length&&t.length<=8)return e=>{for(let n=0;n<t.length;n++)if(t[n]===e)return!0;return!1};let n=new Set(t),r=e.filter(e=>typeof e==`object`&&!!e);return e=>n.has(e)||typeof e==`object`&&r.some(t=>Mo(e,t))}function Eo(e){return typeof e!=`object`||!e?t=>t===e:t=>Mo(t,e)}function Do(e){return t=>{for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function Oo(e){return t=>{let n=0;for(let r=0;r<e.length;r++)if(e[r](t)&&++n>1)return!1;return n===1}}function ko(e){return t=>!e(t)}function Ao(e,t,n){return r=>e(r)?t(r):n(r)}function jo(e,t,n){return r=>{if(!Xa(r))return!1;let i=r[e];for(let e=0;e<t.length;e++)if(t[e]===i)return n[e](r);return!1}}function Mo(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){let n=e,r=t;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(!Mo(n[e],r[e]))return!1;return!0}let r=e,i=t,a=Object.keys(r);if(a.length!==Object.keys(i).length)return!1;for(let e of a)if(!Object.hasOwn(i,e)||!Mo(r[e],i[e]))return!1;return!0}function No(){return{props:null,allProps:!1,items:0,allItems:!1,indexes:null}}function Po(e,t){if(t.props!==null)for(let n of t.props)Fo(e,n);if(e.allProps||=t.allProps,t.items>e.items&&(e.items=t.items),e.allItems||=t.allItems,t.indexes!==null)for(let n of t.indexes)Io(e,n)}function Fo(e,t){e.props===null&&(e.props=new Set),e.props.add(t)}function Io(e,t){e.indexes===null&&(e.indexes=new Set),e.indexes.add(t)}var Lo=()=>!0,Ro=()=>!1;function zo(e){return(t,n)=>e.check(t,n)}function Bo(e){return t=>e(t)}function Vo(e){return t=>e(t,No())}function Ho(e,t,n){return(r,i)=>{e.push(t);let a=n(r,i);return e.pop(),a}}function Uo(e){return(t,n)=>{let r=No();return e(t,r)?(Po(n,r),!0):!1}}function Wo(e,t){return(n,r)=>{if(!e(n))return!1;for(let e=0;e<t.length;e++)if(!t[e](n,r))return!1;return!0}}function Go(e,t,n){let r=new Set(e.map(([e])=>e));return(i,a)=>{if(!Xa(i))return!0;let o=[];for(let[t,n]of e)if(Object.hasOwn(i,t)){if(!n(i[t]))return!1;o.push(t)}for(let e of Object.keys(i)){let a=r.has(e);for(let[n,r]of t)if(n.test(e)){if(!r(i[e]))return!1;a=!0,o.push(e)}if(!a&&n!==void 0){if(!n(i[e]))return!1;o.push(e)}}for(let e of o)Fo(a,e);return!0}}function Ko(e,t,n,r,i){return(a,o)=>{if(!Array.isArray(a))return!0;let s=Math.min(a.length,e.length);for(let t=0;t<s;t++)if(!e[t](a[t]))return!1;if(t!==void 0){for(let n=e.length;n<a.length;n++)if(!t(a[n]))return!1;o.allItems=!0}if(s>o.items&&(o.items=s),n!==void 0){let e=0;for(let t=0;t<a.length;t++)n(a[t])&&(e++,Io(o,t));if(e<r||e>i)return!1}return!0}}function qo(e,t){return(n,r)=>{let i=0;for(let t of e){let e=No();t(n,e)&&(i++,Po(r,e))}return t?i===1:i>0}}function Jo(e,t,n){return(r,i)=>{let a=No();return e(r,a)?(Po(i,a),t===void 0||t(r,i)):n===void 0||n(r,i)}}function Yo(e,t){return(n,r)=>!Xa(n)||!Object.hasOwn(n,e)||t(n,r)}function Xo(e){return(t,n)=>{if(!Xa(t)||n.allProps)return!0;for(let r of Object.keys(t))if(!(n.props?.has(r)??!1)&&!e(t[r]))return!1;return n.allProps=!0,!0}}function Zo(e){return(t,n)=>{if(!Array.isArray(t)||n.allItems)return!0;for(let r=n.items;r<t.length;r++)if(!(n.indexes?.has(r)??!1)&&!e(t[r]))return!1;return n.allItems=!0,!0}}var Qo=Symbol(`restart`),$o=class{r;draft;formats;dynamic;schema;scope;cache=new Map;annotatingCache=new Map;constructor(e,t,n){this.schema=e,this.r=new pa(e,t),this.draft=this.r.draft,this.formats=t.formats,this.dynamic=n,this.scope=[]}root(){return this.check(this.schema,this.r.rootBase)}check(e,t){if(e===!0)return Ba;if(e===!1)return Va;if(!_a(e))throw Error(`A schema must be an object or a boolean, got ${JSON.stringify(e)}`);let n=this.cache.get(e);if(n!==void 0)return n;let r=this.bareType(e);if(r!==void 0)return r;let i={check:void 0};this.cache.set(e,to(i));let a=this.build(e,this.r.baseFor(e,t));return i.check=a,this.cache.set(e,a),a}build(e,t){if(this.draft===`7`&&typeof e.$ref==`string`)return this.ref(e.$ref,t);if(this.draft!==`7`&&(e.unevaluatedProperties!==void 0||e.unevaluatedItems!==void 0))return Vo(this.annotating(e,t));let n=this.plain(e,t);return this.dynamic&&this.r.isResource(e,t)?no(this.scope,t,n):n}bareType(e){let t;for(let n in e)if(n===`type`)t=e.type;else if(!es.has(n))return;return t===void 0?Ba:typeof t==`string`?Za.get(t):void 0}plain(e,t){let n=[],r=e.type===void 0?void 0:Array.isArray(e.type)?e.type:[e.type],i=r?.length===1?r[0]:void 0,a=!1;if(i===`bytes`)n.push(io(as(e.minLength)??0,as(e.maxLength)??1/0)),a=!0;else{let r=this.stringGroup(e,i===`string`);r!==void 0&&n.push(r);let o=i===`number`||i===`integer`,s=this.numberGroup(e,i===`number`?1:i===`integer`?2:0);s!==void 0&&n.push(s);let c=this.objectGroup(e,t,i===`object`);c!==void 0&&n.push(c);let l=this.arrayGroup(e,t,i===`array`);l!==void 0&&n.push(l),a=i===`string`&&r!==void 0||o&&s!==void 0||i===`object`&&c!==void 0||i===`array`&&l!==void 0}return r!==void 0&&!a&&n.unshift(ro(r)),this.inPlace(e,t,n),eo(n)}inPlace(e,t,n){if(Array.isArray(e.enum)&&n.push(To(e.enum)),Object.hasOwn(e,`const`)&&n.push(Eo(e.const)),Array.isArray(e.allOf)&&n.push(eo(e.allOf.map(e=>this.check(e,t)))),Array.isArray(e.anyOf)&&n.push(this.union(e.anyOf,t,!1)),Array.isArray(e.oneOf)&&n.push(this.union(e.oneOf,t,!0)),e.not!==void 0&&n.push(ko(this.check(e.not,t))),e.if!==void 0&&(e.then!==void 0||e.else!==void 0)){let r=e.then===void 0?Ba:this.check(e.then,t),i=e.else===void 0?Ba:this.check(e.else,t);n.push(Ao(this.check(e.if,t),r,i))}typeof e.$ref==`string`&&n.push(this.ref(e.$ref,t)),this.draft!==`7`&&typeof e.$dynamicRef==`string`&&n.push(this.dynamicRef(e.$dynamicRef,t))}union(e,t,n){let r=()=>e.map(e=>this.check(e,t));return rs(e,n)??this.tagged(e,t)??(n?Oo(r()):Do(r()))}ref(e,t){let n=this.r.resolve(e,t),r=this.check(n.node,n.base);return this.dynamic&&n.base!==t?no(this.scope,n.base,r):r}dynamicRef(e,t){let n=this.bookended(e,t);if(n===void 0)return this.ref(e,t);let{initial:r,name:i}=n,a=this.check(r.node,r.base),o=this.dynamicLookup(i,(e,t)=>this.check(e,t)),s=this.scope;return e=>{for(let t=0;t<s.length;t++){let n=o(s[t]);if(n!==null)return n(e)}return a(e)}}bookended(e,t){let n=this.r.resolve(e,t),r=va(e,t),i=r.slice(ya(r).length+1),a=_a(n.node)&&n.node.$dynamicAnchor===i;if(i!==``&&!i.startsWith(`/`)&&a){if(!this.dynamic)throw Qo;return{initial:n,name:i}}}dynamicLookup(e,t){let n=new Map;return r=>{let i=`${r}#${e}`,a=n.get(i);if(a===void 0){let e=this.r.dynamicAnchors.get(i);a=e===void 0?null:t(e,this.r.baseOf.get(e)??r),n.set(i,a)}return a}}tagged(e,t){if(e.length<2)return;let n=[];for(let r of e){if(!_a(r))return;let e=typeof r.$ref==`string`&&Object.keys(r).length===1?r.$ref:void 0,i=e===void 0?r:this.r.resolve(e,this.r.baseFor(r,t)).node;if(!_a(i))return;n.push(i)}let r=n[0].properties;if(_a(r))for(let i of Object.keys(r)){let r=n.map(e=>is(e,i));if(!(r.some(e=>e===void 0)||new Set(r).size!==r.length))return jo(i,r,e.map(e=>this.check(e,t)))}}stringGroup(e,t){let n=as(e.minLength)??0,r=as(e.maxLength)??1/0,i=typeof e.pattern==`string`?ba(e.pattern):void 0,a=this.formats!==void 0&&typeof e.format==`string`&&Object.hasOwn(this.formats,e.format)?this.formats[e.format]:void 0;if(n!==0||r!==1/0||i!==void 0||a!==void 0)return so(t,n,r,i,a)}numberGroup(e,t){let n=as(e.minimum),r=as(e.maximum),i=as(e.exclusiveMinimum),a=as(e.exclusiveMaximum),o=as(e.multipleOf);if([n,r,i,a,o].every(e=>e===void 0))return;let s=1/0;return co(t,n??-1/0,r??s,i??-1/0,a??s,o)}objectGroup(e,t,n){let r=ts.every(t=>e[t]===void 0),i=this.objectCore(e,t,r?n?1:2:0);if(i!==void 0&&r)return i;let a=i===void 0?[]:[i];e.propertyNames!==void 0&&a.push(go(this.check(e.propertyNames,t)));let o=as(e.minProperties),s=as(e.maxProperties);(o!==void 0||s!==void 0)&&a.push(_o(o??0,s??1/0));let c=[],l=[];if(this.draft!==`7`){for(let[t,n]of os(e.dependentRequired))Array.isArray(n)&&c.push([t,n]);for(let[n,r]of os(e.dependentSchemas))l.push([n,this.check(r,t)])}for(let[n,r]of os(e.dependencies))Array.isArray(r)?c.push([n,r]):l.push([n,this.check(r,t)]);return c.length>0&&a.push(vo(c)),l.length>0&&a.push(yo(l)),a.length===0?n?Ya:void 0:fo(eo(a),n)}objectCore(e,t,n){let r=_a(e.properties)?e.properties:{},i=Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[],a=_a(e.patternProperties)?e.patternProperties:{},o=e.additionalProperties,s=Object.keys(r),c=Object.keys(a);if(s.length+i.length+c.length===0&&(o===void 0||o===!0))return;let l=[];for(let e of s){let n=this.check(r[e],t),a=(Qa.get(n)??0)|(i.includes(e)?8:0)|(e in Object.prototype?16:0);l.push(e,n,a)}let u=i.filter(e=>!Object.hasOwn(r,e)),d=c.map(e=>[ba(e),this.check(a[e],t)]),f=o===void 0||o===!0?void 0:this.check(o,t);if(d.length===0&&u.length===0&&(f===void 0||o===!1)){let e=s.filter(e=>i.includes(e)).length;return mo(l,e,o===!1,n)}return ho(l,s,u,d,f,n)}arrayGroup(e,t,n){let r=[],i;Array.isArray(e.items)?(r=e.items,i=e.additionalItems):(this.draft!==`7`&&Array.isArray(e.prefixItems)&&(r=e.prefixItems),i=e.items);let a=r.map(e=>this.check(e,t)),o=i===void 0||i===!0?void 0:this.check(i,t),s=as(e.minItems),c=as(e.maxItems);if(e.contains===void 0&&e.uniqueItems!==!0&&(a.length>0||o!==void 0))return bo(n?1:2,s??0,c??1/0,a,o);let l=[];if((a.length>0||o!==void 0)&&l.push(xo(a,o)),(s!==void 0||c!==void 0)&&l.push(So(s??0,c??1/0)),e.contains!==void 0){let n=this.draft===`7`?1:as(e.minContains)??1,r=this.draft===`7`?1/0:as(e.maxContains)??1/0;l.push(Co(this.check(e.contains,t),n,r))}return e.uniqueItems===!0&&l.push(wo),l.length===0?n?qa:void 0:po(eo(l),n)}annotating(e,t){if(e===!0)return Lo;if(e===!1)return Ro;if(!_a(e))throw Error(`A schema must be an object or a boolean, got ${JSON.stringify(e)}`);let n=this.annotatingCache.get(e);if(n!==void 0)return n;let r={check:void 0};this.annotatingCache.set(e,zo(r));let i=this.buildAnnotating(e,this.r.baseFor(e,t));return r.check=i,this.annotatingCache.set(e,i),i}buildAnnotating(e,t){let n={},r=!1;for(let t of Object.keys(e))ns.has(t)?r=!0:n[t]=e[t];let i=this.plain(n,t),a=[];r&&this.annotatingParts(e,t,a);let o=a.length===0?Bo(i):Wo(i,a),s=e.unevaluatedProperties!==void 0||e.unevaluatedItems!==void 0?Uo(o):o;return this.dynamic&&this.r.isResource(e,t)?Ho(this.scope,t,s):s}annotatingParts(e,t,n){if(e.properties!==void 0||e.patternProperties!==void 0||e.additionalProperties!==void 0){let r=os(e.properties).map(([e,n])=>[e,this.check(n,t)]),i=os(e.patternProperties).map(([e,n])=>[ba(e),this.check(n,t)]),a=e.additionalProperties===void 0?void 0:this.check(e.additionalProperties,t);n.push(Go(r,i,a))}if(e.prefixItems!==void 0||e.items!==void 0||e.contains!==void 0){let r=Array.isArray(e.prefixItems)?e.prefixItems:Array.isArray(e.items)?e.items:[],i=Array.isArray(e.items)?e.additionalItems:e.items;n.push(Ko(r.map(e=>this.check(e,t)),i===void 0?void 0:this.check(i,t),e.contains===void 0?void 0:this.check(e.contains,t),as(e.minContains)??1,as(e.maxContains)??1/0))}if(Array.isArray(e.allOf))for(let r of e.allOf)n.push(this.annotating(r,t));if(Array.isArray(e.anyOf)&&n.push(qo(e.anyOf.map(e=>this.annotating(e,t)),!1)),Array.isArray(e.oneOf)&&n.push(qo(e.oneOf.map(e=>this.annotating(e,t)),!0)),e.if!==void 0){let r=e.then===void 0?void 0:this.annotating(e.then,t),i=e.else===void 0?void 0:this.annotating(e.else,t);n.push(Jo(this.annotating(e.if,t),r,i))}typeof e.$ref==`string`&&n.push(this.annotatingRef(e.$ref,t)),typeof e.$dynamicRef==`string`&&n.push(this.annotatingDynamicRef(e.$dynamicRef,t));for(let[r,i]of os(e.dependentSchemas))n.push(Yo(r,this.annotating(i,t)));e.unevaluatedProperties!==void 0&&n.push(Xo(this.check(e.unevaluatedProperties,t))),e.unevaluatedItems!==void 0&&n.push(Zo(this.check(e.unevaluatedItems,t)))}annotatingRef(e,t){let n=this.r.resolve(e,t),r=this.annotating(n.node,n.base);return this.dynamic&&n.base!==t?Ho(this.scope,n.base,r):r}annotatingDynamicRef(e,t){let n=this.bookended(e,t);if(n===void 0)return this.annotatingRef(e,t);let{initial:r,name:i}=n,a=this.annotating(r.node,r.base),o=this.dynamicLookup(i,(e,t)=>this.annotating(e,t)),s=this.scope;return(e,t)=>{for(let n=0;n<s.length;n++){let r=o(s[n]);if(r!==null)return r(e,t)}return a(e,t)}}},es=new Set([`$schema`,`$comment`,`title`,`description`,`default`,`examples`,`deprecated`,`readOnly`,`writeOnly`,`$defs`,`definitions`,`contentEncoding`,`contentMediaType`,`minContains`,`maxContains`,`$vocabulary`]),ts=[`propertyNames`,`minProperties`,`maxProperties`,`dependentRequired`,`dependentSchemas`,`dependencies`],ns=new Set([`properties`,`patternProperties`,`additionalProperties`,`prefixItems`,`items`,`additionalItems`,`contains`,`minContains`,`maxContains`,`allOf`,`anyOf`,`oneOf`,`if`,`then`,`else`,`$ref`,`$dynamicRef`,`dependentSchemas`,`unevaluatedProperties`,`unevaluatedItems`]);function rs(e,t){let n=[];for(let r of e){if(!_a(r)||!Object.hasOwn(r,`const`))return;for(let e of Object.keys(r))if(e!==`const`&&!es.has(e))return;if(typeof r.const==`object`&&r.const!==null||t&&n.includes(r.const))return;n.push(r.const)}return To(n)}function is(e,t){let n=e.properties;if(e.type!==`object`||!Array.isArray(e.required)||!e.required.includes(t))return;let r=_a(n)?n[t]:void 0;if(_a(r)&&Object.hasOwn(r,`const`))return typeof r.const==`object`&&r.const!==null?void 0:r.const}function as(e){return typeof e==`number`?e:void 0}function os(e){return _a(e)?Object.entries(e):[]}var ss=class{c;schema;memo=void 0;constructor(e,t){this.c=e,this.schema=t,e.root()}errors(e){let t=[];try{this.walk(this.schema,this.c.r.rootBase,e,``,t)}finally{this.memo=void 0}return t.length===0&&t.push({path:``,keyword:`schema`,message:`invalid`}),t}ok(e,t,n){return this.c.check(e,t)(n)}walk(e,t,n,r,i){if(e===!0)return;if(e===!1){i.push({path:r,keyword:`false`,message:`no value is allowed here`});return}if(!_a(e))return;let a=this.c.r.baseFor(e,t);if(this.ok(e,a,n))return;let o=i.length,s=(e,t,n=r)=>{i.push({path:n,keyword:e,message:t})};if(this.c.draft===`7`&&typeof e.$ref==`string`)this.walkRef(e.$ref,a,n,r,i);else{if(e.type!==void 0){let t=Array.isArray(e.type)?e.type:[e.type];if(!t.map(e=>(typeof e==`string`?Za.get(e):void 0)??Va).some(e=>e(n))){s(`type`,`expected ${t.join(` or `)}, got ${fs(n)}`);return}}if(Array.isArray(e.enum)&&!To(e.enum)(n)&&s(`enum`,`expected one of ${ls(e.enum)}`),Object.hasOwn(e,`const`)&&!Eo(e.const)(n)&&s(`const`,`expected ${JSON.stringify(e.const)}`),typeof n==`string`&&e.type!==`bytes`&&this.walkString(e,n,s),n instanceof Uint8Array&&e.type===`bytes`&&this.walkBytes(e,n,s),typeof n==`number`&&this.walkNumber(e,n,s),Xa(n)&&this.walkObject(e,a,n,r,i,s),Array.isArray(n)&&this.walkArray(e,a,n,r,i,s),Array.isArray(e.allOf))for(let t of e.allOf)this.walk(t,a,n,r,i);if(Array.isArray(e.anyOf)&&this.walkUnion(e.anyOf,a,n,r,i,!1),Array.isArray(e.oneOf)&&this.walkUnion(e.oneOf,a,n,r,i,!0),e.not!==void 0&&this.ok(e.not,a,n)&&s(`not`,`must not match the schema in not`),e.if!==void 0){let t=this.ok(e.if,a,n)?e.then:e.else;t!==void 0&&this.walk(t,a,n,r,i)}typeof e.$ref==`string`&&this.walkRef(e.$ref,a,n,r,i),i.length===o&&(e.unevaluatedProperties!==void 0||e.unevaluatedItems!==void 0)&&this.walkUnevaluated(e,a,n,r,i),i.length===o&&typeof e.$dynamicRef==`string`&&s(`$dynamicRef`,`does not match the dynamically referenced schema`)}}walkRef(e,t,n,r,i){let a=this.c.r.resolve(e,t);if(a.node===!1&&this.c.r.isUnresolved(e,t)){i.push({path:r,keyword:`$ref`,message:`unresolved reference ${e}`});return}if(!_a(a.node)||typeof n!=`object`||!n){this.walk(a.node,a.base,n,r,i);return}this.memo??=new Map;let o=this.memo.get(a.node),s=o?.get(n);if(s!==void 0&&s.path===r){i.push(...s.errors);return}let c=[];this.walk(a.node,a.base,n,r,c),o===void 0&&(o=new Map,this.memo.set(a.node,o)),o.set(n,{path:r,errors:c}),i.push(...c)}walkString(e,t,n){let r=ao(t);typeof e.minLength==`number`&&r<e.minLength&&n(`minLength`,`expected at least ${e.minLength} characters`),typeof e.maxLength==`number`&&r>e.maxLength&&n(`maxLength`,`expected at most ${e.maxLength} characters`),typeof e.pattern==`string`&&!ba(e.pattern).test(t)&&n(`pattern`,`expected to match ${e.pattern}`);let i=this.c.formats,a=i!==void 0&&typeof e.format==`string`&&Object.hasOwn(i,e.format)?i[e.format]:void 0;a!==void 0&&!a(t)&&n(`format`,`expected format ${e.format}`)}walkBytes(e,t,n){typeof e.minLength==`number`&&t.length<e.minLength&&n(`minLength`,`expected at least ${e.minLength} bytes`),typeof e.maxLength==`number`&&t.length>e.maxLength&&n(`maxLength`,`expected at most ${e.maxLength} bytes`)}walkNumber(e,t,n){typeof e.minimum==`number`&&t<e.minimum&&n(`minimum`,`expected >= ${e.minimum}`),typeof e.maximum==`number`&&t>e.maximum&&n(`maximum`,`expected <= ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&n(`exclusiveMinimum`,`expected > ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&n(`exclusiveMaximum`,`expected < ${e.exclusiveMaximum}`),typeof e.multipleOf==`number`&&!lo(t,e.multipleOf)&&n(`multipleOf`,`expected a multiple of ${e.multipleOf}`)}walkObject(e,t,n,r,i,a){let o=_a(e.properties)?e.properties:{},s=Array.isArray(e.required)?e.required:[];for(let e of s)typeof e==`string`&&(!Object.hasOwn(n,e)||n[e]===void 0)&&a(`required`,`missing`,ds(r,e));for(let e of Object.keys(o))Object.hasOwn(n,e)&&n[e]!==void 0&&this.walk(o[e],t,n[e],ds(r,e),i);let c=_a(e.patternProperties)?Object.entries(e.patternProperties):[];for(let s of Object.keys(n)){let l=Object.hasOwn(o,s);for(let[e,a]of c)ba(e).test(s)&&(l=!0,this.walk(a,t,n[s],ds(r,s),i));!l&&e.additionalProperties!==void 0&&(e.additionalProperties===!1?a(`additionalProperties`,`unknown field`,ds(r,s)):this.walk(e.additionalProperties,t,n[s],ds(r,s),i)),e.propertyNames!==void 0&&!this.ok(e.propertyNames,t,s)&&a(`propertyNames`,`invalid property name`,ds(r,s))}let l=Object.keys(n).length;typeof e.minProperties==`number`&&l<e.minProperties&&a(`minProperties`,`expected at least ${e.minProperties} properties`),typeof e.maxProperties==`number`&&l>e.maxProperties&&a(`maxProperties`,`expected at most ${e.maxProperties} properties`);let u={...this.c.draft===`7`||!_a(e.dependentRequired)?{}:e.dependentRequired,..._a(e.dependencies)?e.dependencies:{}};for(let[e,o]of Object.entries(u))if(Object.hasOwn(n,e)){if(!Array.isArray(o))this.walk(o,t,n,r,i);else for(let t of o)Object.hasOwn(n,t)||a(`dependentRequired`,`required when ${e} is present`,ds(r,t))}if(this.c.draft!==`7`&&_a(e.dependentSchemas))for(let[a,o]of Object.entries(e.dependentSchemas))Object.hasOwn(n,a)&&this.walk(o,t,n,r,i)}walkArray(e,t,n,r,i,a){let o=[],s;Array.isArray(e.items)?(o=e.items,s=e.additionalItems):(this.c.draft!==`7`&&Array.isArray(e.prefixItems)&&(o=e.prefixItems),s=e.items);for(let e=0;e<n.length;e++){let a=e<o.length?o[e]:s;a!==void 0&&this.walk(a,t,n[e],`${r}/${e}`,i)}if(typeof e.minItems==`number`&&n.length<e.minItems&&a(`minItems`,`expected at least ${e.minItems} items`),typeof e.maxItems==`number`&&n.length>e.maxItems&&a(`maxItems`,`expected at most ${e.maxItems} items`),e.uniqueItems===!0&&!wo(n)&&a(`uniqueItems`,`expected unique items`),e.contains!==void 0){let r=this.c.draft===`7`,i=r||typeof e.minContains!=`number`?1:e.minContains,o=r||typeof e.maxContains!=`number`?1/0:e.maxContains;Co(this.c.check(e.contains,t),i,o)(n)||a(`contains`,us(i,o))}}walkUnion(e,t,n,r,i,a){let o=e.filter(e=>this.ok(e,t,n)).length;if(o===1||!a&&o>0)return;let s=a?`oneOf`:`anyOf`;if(o>1){i.push({path:r,keyword:s,message:`matches more than one alternative`});return}let c=this.tagOf(e,t);if(c!==void 0&&Xa(n)){let a=c.values.indexOf(n[c.key]);a<0?i.push({path:ds(r,c.key),keyword:s,message:`expected one of ${ls(c.values)}`}):this.walk(e[a],t,n,r,i);return}let l;for(let i of e){let e=[];if(this.walk(i,t,n,r,e),e.length===0)continue;let a=Xa(n)?this.declaredKeys(i,t,n):0;(l===void 0||a>l.declared||a===l.declared&&e[0].path.length>l.errors[0].path.length)&&(l={errors:e,declared:a})}i.push(...l?.errors??[{path:r,keyword:s,message:`matches no alternative`}])}declaredKeys(e,t,n){let r=_a(e)&&typeof e.$ref==`string`?this.c.r.resolve(e.$ref,t).node:e,i=_a(r)&&_a(r.properties)?r.properties:{};return Object.keys(n).filter(e=>Object.hasOwn(i,e)).length}tagOf(e,t){let n=e.map(e=>_a(e)&&typeof e.$ref==`string`?this.c.r.resolve(e.$ref,t).node:e),r=n[0];if(_a(r)&&_a(r.properties))for(let e of Object.keys(r.properties)){let t=n.map(t=>{let n=_a(t)&&_a(t.properties)?t.properties[e]:void 0;return _a(n)?n.const:void 0});if(t.every(e=>e!==void 0&&(typeof e!=`object`||!e))&&new Set(t).size===t.length)return{key:e,values:t}}}walkUnevaluated(e,t,n,r,i){let{unevaluatedProperties:a,unevaluatedItems:o,...s}=e,c=No();if(this.c.annotating(s,t)(n,c),Xa(n)&&a!==void 0&&!c.allProps)for(let e of Object.keys(n))c.props?.has(e)||(a===!1?i.push({path:ds(r,e),keyword:`unevaluatedProperties`,message:`unknown field`}):this.walk(a,t,n[e],ds(r,e),i));if(Array.isArray(n)&&o!==void 0&&!c.allItems)for(let e=c.items;e<n.length;e++)c.indexes?.has(e)||(o===!1?i.push({path:`${r}/${e}`,keyword:`unevaluatedItems`,message:`unexpected item`}):this.walk(o,t,n[e],`${r}/${e}`,i))}},cs=20;function ls(e){return e.length<=cs?JSON.stringify(e):`${JSON.stringify(e.slice(0,cs)).slice(0,-1)}, ... and ${e.length-cs} more]`}function us(e,t){return t===1/0?`expected at least ${e} matching ${e===1?`item`:`items`}`:e===0?`expected at most ${t} matching ${t===1?`item`:`items`}`:`expected between ${e} and ${t} matching items`}function ds(e,t){return`${e}/${String(t).replace(/~/g,`~0`).replace(/\//g,`~1`)}`}function fs(e){return e===null?`null`:Array.isArray(e)?`array`:e instanceof Uint8Array?`bytes`:typeof e==`number`&&Number.isInteger(e)?`integer`:typeof e}function ps(e,t=ms){let n=_s(e,t);return t.coerce===!0?new gs(e,t,n):new hs(e,t,n)}var ms=Object.freeze({}),hs=class{check;schema;options;explainer=void 0;constructor(e,t,n){this.check=n,this.schema=e,this.options=t}errors(e){return this.check(e)?[]:(this.explainer??=new ss(vs(this.schema,this.options),this.schema),this.explainer.errors(e))}},gs=class extends hs{coercer=void 0;coerce(e){return this.coercer??=new Ca(vs(this.schema,this.options),this.schema),this.coercer.coerce(e)}parse(e){let t=this.coerce(e);return this.check(t)?{ok:!0,value:t}:{ok:!1,errors:this.errors(t)}}};function _s(e,t){return vs(e,t).root()}function vs(e,t){let n=new $o(e,t,!1);try{return n.root(),n}catch(n){if(n!==Qo)throw n;return new $o(e,t,!0)}}var ys=[`aborted`,`contract_mismatch`,`forbidden`,`gone`,`invalid`,`not_in_variant`,`not_ready`,`released`,`superseded`,`unavailable`,`upgrade_conflict`,`upgrade_required`],bs=new Set([`superseded`,`upgrade_conflict`]),P=class extends Error{code;reason;retryable;details;constructor(e,t,n){super(`${e}${n?.reason?`/${n.reason}`:``}: ${t}`,{cause:n?.cause}),this.name=`ChordError`,this.code=e,this.reason=n?.reason,this.retryable=bs.has(e),this.details=n?.details}},xs=(e,t)=>e instanceof P&&(t===void 0||e.code===t),Ss=(e,t,n)=>new P(`invalid`,t,{reason:e,details:n}),Cs=(e,t)=>e instanceof P?e:new P(`unavailable`,`${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e});async function ws(e,t){let n=[];for(let t of e)try{await t()}catch(e){n.push(e)}if(n.length===1)throw n[0];if(n.length>1)throw AggregateError(n,t)}var Ts=e=>typeof e==`object`&&e?e:e===!1?{not:{}}:{};function Es(e){return typeof e!=`object`||!e?JSON.stringify(e)??`null`:Array.isArray(e)?`[${e.map(e=>Es(e)).join(`,`)}]`:`{${Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${Es(e[t])}`).join(`,`)}}`}function Ds(e){let t=2166136261,n=1523705862;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,1540483477)^n>>>13}return(t>>>0).toString(16).padStart(8,`0`)+(n>>>0).toString(16).padStart(8,`0`)}function Os(e,t){return e===t||Es(e)===Es(t)}var ks=new WeakMap;function As(e){if(typeof e==`boolean`)return ps(e);let t=ks.get(e);return t===void 0&&(t=ps(e),ks.set(e,t)),t}function js(e,t){return As(e).check(t)}function Ms(e,t,n,r){let i=As(n);if(i.check(r))return;let a=i.errors(r).slice(0,3);throw Ss(e,`${t}: ${a.map(e=>`${e.path||`/`} ${e.message}`).join(`; `)}`,a)}function Ns(e,t,n){let r=Vs(Ts(e),Hs(Ts(e),Fs(t??{})));return Ms(`input`,n,e,r),r}function Ps(e,t){return Vs(Ts(e),Fs(t))}function Fs(e){if(Array.isArray(e))return e.map(Fs);if(e instanceof Uint8Array)return e.slice();if(typeof e!=`object`||!e)return e;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n={};for(let[t,r]of Object.entries(e))n[t]=Fs(r);return n}var Is=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Uint8Array),Ls=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Rs(e){if(!Array.isArray(e.allOf)||!e.allOf.every(e=>Ls(e.properties)))return;let t={},n=new Set;for(let r of e.allOf){Object.assign(t,r.properties);for(let e of r.required??[])n.add(e)}return{type:`object`,properties:t,required:[...n],...e.unevaluatedProperties===void 0?{}:{additionalProperties:e.unevaluatedProperties}}}function zs(e){if(!Ls(e.patternProperties)||Ls(e.properties))return;let[t]=Object.entries(e.patternProperties);return t===void 0?void 0:[new RegExp(t[0],`u`),t[1]]}var Bs=(e,t)=>e===!0||Ls(e)&&js(e,t);function Vs(e,t){let n=Rs(e);if(n!==void 0)return Vs(n,t);if(Array.isArray(e.anyOf)){for(let n of e.anyOf){let e=Vs(Ts(n),Fs(t));if(js(Ts(n),e))return e}return t}if(Array.isArray(t)){let n=Array.isArray(e.items)?e.items:Array.isArray(e.prefixItems)?e.prefixItems:void 0;if(n!==void 0){let e=Math.min(t.length,n.length);for(let r=0;r<e;r++)t[r]=Vs(Ts(n[r]),t[r]);return t.length>e?t.slice(0,e):t}return Ls(e.items)?t.map(t=>Vs(e.items,t)):t}if(!Is(t))return t;let r=zs(e),i=Ls(e.properties)?e.properties:void 0;if(i===void 0&&r===void 0&&!Ls(e.additionalProperties))return t;for(let n of Object.keys(t)){let a=(i!==void 0&&Object.hasOwn(i,n)?i[n]:void 0)??(r?.[0].test(n)?r[1]:void 0);a===void 0?Bs(e.additionalProperties,t[n])?t[n]=Vs(Ts(e.additionalProperties),t[n]):delete t[n]:t[n]=Vs(Ts(a),t[n])}return t}function Hs(e,t){let n=t===void 0&&`default`in e?Fs(e.default):t,r=Rs(e);if(r!==void 0)return Hs(r,n);if(Array.isArray(e.anyOf)){for(let t of e.anyOf){let e=Hs(Ts(t),Fs(n));if(js(Ts(t),e))return e}return n}if(Array.isArray(n)){let t=Array.isArray(e.items)?e.items:Array.isArray(e.prefixItems)?e.prefixItems:void 0;if(t!==void 0){for(let e=0;e<t.length;e++){let r=Hs(Ts(t[e]),n[e]);(e<n.length||r!==void 0)&&(n[e]=r)}return n}return Ls(e.items)?n.map(t=>Hs(e.items,t)):n}if(!Is(n))return n;let i=Ls(e.properties)?e.properties:void 0,a=zs(e);if(i!==void 0){let t=e.required??[];for(let[e,r]of Object.entries(i)){let i=Hs(Ts(r),n[e]);(i!==void 0||t.includes(e)&&`default`in Ts(r))&&(n[e]=i)}}else if(a!==void 0&&Ls(a[1])&&`default`in a[1])for(let e of Object.keys(n))a[0].test(e)&&(n[e]=Hs(a[1],n[e]));if(!Ls(e.additionalProperties))return n;for(let t of Object.keys(n))!(i!==void 0&&Object.hasOwn(i,t))&&!a?.[0].test(t)&&(n[t]=Hs(e.additionalProperties,n[t]));return n}function Us(e,t){return Es(Ws(Ts(e),t))}function Ws(e,t){if(Array.isArray(t)){let n=e.items;return Array.isArray(n)?t.map((e,t)=>Ws(Ts(n[t]),e)):t.map(e=>Ws(Ts(n),e))}if(typeof t!=`object`||!t)return t;let n=Ts(e.properties),r={};for(let[e,i]of Object.entries(t)){let t=Ts(n[e]);`default`in t&&Os(t.default,i)||(r[e]=Ws(t,i))}return r}var Gs=[`minLength`,`maxLength`,`pattern`,`format`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`minItems`,`maxItems`,`uniqueItems`,`minProperties`,`maxProperties`],Ks=e=>typeof e.type==`string`?[e.type]:Array.isArray(e.type)?e.type:void 0,qs=new Set([...Gs,`type`,`properties`,`required`,`additionalProperties`,`patternProperties`,`items`,`additionalItems`,`const`,`enum`,`anyOf`,`parameters`,`returnType`]),Js=new Set([`title`,`description`,`default`,`examples`,`$id`,`$schema`,`$comment`,`readOnly`,`writeOnly`,`deprecated`]),Ys=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!Js.has(e)));function Xs(e,t){let n=Ys(Ts(e)),r=Ys(Ts(t));if(Object.keys(r).length===0||Os(n,r))return!0;if(Object.keys(r).some(e=>!qs.has(e))||r.additionalProperties!==void 0&&typeof r.additionalProperties!=`boolean`)return!1;if(Array.isArray(n.anyOf))return n.anyOf.every(e=>Xs(e,r));if(Array.isArray(r.anyOf))return r.anyOf.some(e=>Xs(n,e));if(`const`in r)return`const`in n&&Os(n.const,r.const);if(Array.isArray(r.enum))return(`const`in n?[n.const]:Array.isArray(n.enum)?n.enum:void 0)?.every(e=>r.enum.some(t=>Os(t,e)))??!1;for(let e of Gs)if(e in r&&!Os(n[e],r[e]))return!1;let i=Ks(r),a=Ks(n);return i===void 0||a===void 0||!a.every(e=>i.includes(e)||e===`integer`&&i.includes(`number`))?!1:`const`in n||Array.isArray(n.enum)?!0:a.includes(`object`)&&!Zs(n,r)||a.includes(`array`)&&!Qs(n,r)?!1:!a.includes(`function`)||$s(n,r)}function Zs(e,t){let n=Ts(e.properties),r=Ts(t.properties),i=new Set(e.required??[]);for(let e of t.required??[])if(!i.has(e))return!1;for(let[t,i]of Object.entries(r))if(t in n){if(!Xs(n[t],i))return!1}else if(typeof e.additionalProperties==`object`&&!Xs(e.additionalProperties,i))return!1;if(t.additionalProperties===!1&&(e.additionalProperties!==!1||Object.keys(n).some(e=>!(e in r))))return!1;let a=Ts(t.patternProperties);if(Object.keys(a).length>0){let t=Ts(e.patternProperties);if(e.additionalProperties!==!1&&Object.keys(t).length===0)return!1;for(let[e,i]of Object.entries(a)){let a=new RegExp(e,`u`);for(let[e,t]of Object.entries(n))if(!(e in r)&&a.test(e)&&!Xs(t,i))return!1;if(Object.keys(t).length>0&&(!(e in t)||!Xs(t[e],i)))return!1}for(let e of Object.keys(t))if(!(e in a))return!1}return!0}function Qs(e,t){return Array.isArray(t.items)?!Array.isArray(e.items)||e.items.length!==t.items.length?!1:e.items.every((e,n)=>Xs(e,t.items[n])):Array.isArray(e.items)?e.items.every(e=>Xs(e,t.items)):Xs(e.items,t.items)}function $s(e,t){let n=e.parameters??[],r=t.parameters??[];return n.length>r.length||!n.every((e,t)=>Xs(r[t],e))?!1:Xs(e.returnType,t.returnType)}var ec=Symbol(`chord.member`);function tc(e,t){return{[ec]:`method`,args:e,result:t}}function nc(e){if(typeof e!=`string`||e===``)throw TypeError(`hostNamed needs a host name`);return{name:e}}function rc(e,t,n){if(`name`in t)return t.name;let r=typeof n==`object`&&n?n[t.key]:void 0;if(typeof r!=`string`||r===``)throw Ss(`placement`,`${e}: input field ${t.key} names no host`);return t.prefix+r}var ic=(e,t)=>`name`in e?e.name===t:t.startsWith(e.prefix)&&t.length>e.prefix.length,ac=e=>`name`in e?e.name:`${e.prefix}<${e.key}>`,oc=N({},{open:!0}),sc=ca([N({kind:oa(`method`),args:M(oc),result:M(oc)},{open:!0}),N({kind:oa(`state`),schema:oc},{open:!0}),N({kind:oa(`opaque`),id:ea()},{open:!0})]),cc=ca([N({name:ea({minLength:1})}),N({prefix:ea({minLength:1}),key:ea({minLength:1})})]),lc=N({name:ea({minLength:1}),scope:ca([oa(`remote`),oa(`local`)]),version:na(),input:oc,host:M(cc),variants:ua(ua(sc))},{open:!0}),uc=new Set([`variant`,`status`,`ready`,`shape`,`error`,`onShape`,`onStatus`,`release`,`then`,`contract`]);function dc(e,t,n){if(uc.has(e))throw TypeError(`member name is reserved: ${e}`);let r=t[ec];if(r===`method`){let e=t;return{kind:`method`,...e.args===void 0?{}:{args:e.args},...e.result===void 0?{}:{result:e.result}}}if(r===`opaque`){if(n===`remote`)throw TypeError(`remote contracts cannot expose opaque members: ${e}`);return{kind:`opaque`,id:t.id}}return{kind:`state`,schema:t}}function fc(e){return{...e,fingerprint:Ds(Es(e.description))}}function pc(e,t){if(!e)throw TypeError(`contract name is empty`);if(!Number.isInteger(t)||t<1)throw TypeError(`contract version must be a positive integer`)}function mc(e,t){pc(e,t.version);let n=t.host;if(n===void 0||!js(cc,n))throw TypeError(`remote contract ${e} needs \`host\`: hostNamed(…) or hostFamily(…)`);let r=`name`in n?{name:n.name}:{prefix:n.prefix,key:n.key},i={};if(Object.keys(t.variants).length===0)throw TypeError(`remote contract ${e} has no variants`);for(let[n,r]of Object.entries(t.variants)){let t={};for(let[e,n]of Object.entries(r.state??{}))t[e]=dc(e,n,`remote`);for(let[i,a]of Object.entries(r.methods??{})){if(i in t)throw TypeError(`member ${i} is both state and method in ${e}.${n}`);if(t[i]=dc(i,a,`remote`),t[i].kind!==`method`)throw TypeError(`methods.${i} is not a method()`)}i[n]=t}let a={name:e,scope:`remote`,version:t.version,input:t.input,host:r,variants:i};return fc({scope:`remote`,name:e,version:t.version,input:t.input,def:t,description:a})}function hc(e){let{name:t,scope:n,version:r,input:i,host:a}=e;if(typeof t!=`string`||n!==`remote`&&n!==`local`||!Number.isInteger(r)||n===`remote`!=(a!==void 0))throw new P(`invalid`,`malformed contract token`,{reason:`token`});let o={name:t,version:r,input:i,description:e,fingerprint:Ds(Es(e))};return n===`remote`?{...o,scope:n,def:{version:r,input:i,host:a,variants:{}}}:{...o,scope:n,def:{version:r,input:i}}}function gc(e,t){if(e.name!==t.name||e.scope!==t.scope)return`different type`;if(!_c(e,t))return`host`;if(!Xs(t.input,e.input))return`input`;for(let[n,r]of Object.entries(t.variants)){let t=e.variants[n];if(t===void 0)return`variant ${n} missing`;for(let[e,i]of Object.entries(r)){let r=t[e];if(r===void 0||r.kind!==i.kind)return`${n}.${e} missing or of another kind`;if(r.kind===`method`&&i.kind===`method`){if(i.args===void 0!=(r.args===void 0)||i.args!==void 0&&r.args!==void 0&&!Xs(i.args,r.args))return`${n}.${e} arguments`;if(i.result!==void 0&&(r.result===void 0||!Xs(r.result,i.result)))return`${n}.${e} result`}else if(r.kind===`state`&&i.kind===`state`){if(!Xs(r.schema,i.schema))return`${n}.${e} state`}else if(r.kind===`opaque`&&i.kind===`opaque`&&r.id!==i.id)return`${n}.${e} opaque ${r.id} != ${i.id}`}}}var _c=(e,t)=>Es(e.host??null)===Es(t.host??null),vc=e=>e.host===void 0?`(local)`:ac(e.host);function yc(e,t,n){if(e.fingerprint===n.fingerprint)return;if(!_c(e.description,n.description))throw new P(`contract_mismatch`,`${e.name} lives on ${vc(e.description)}, the consumer expects ${vc(n.description)}`);if(e.version===n.version){let t=gc(e.description,n.description);if(t===void 0)return;throw new P(`contract_mismatch`,`${e.name}@${e.version} does not cover the consumer's description (${t}); forgotten version bump?`)}let r=t?.[n.version];if(r===void 0)throw new P(`contract_mismatch`,`${e.name}: provider version ${e.version}, consumer version ${n.version}, no accepts adapter`);return r}function bc(e,t){for(let n of Object.values(e.description.variants)){let e=n[t];if(e?.kind===`method`)return e.args===void 0}return!1}var xc=65536,Sc=4096,Cc=new WeakSet,wc=(e,t)=>{Cc.has(e)||(e.length>=Sc?Cc.add(e):e.push(t))},Tc=e=>typeof e==`object`&&!!e,Ec=(e,t,n)=>{e.length===0?wc(n,[`r`,t]):wc(n,[`s`,e,t])},Dc=(e,t)=>{if(e===t)return!0;if(!Tc(e)||!Tc(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){let n=t;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Dc(e[t],n[t]))return!1;return!0}let n=t,r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(let t of r)if(!Object.hasOwn(n,t)||!Dc(e[t],n[t]))return!1;return!0},Oc=(e,t)=>{if(e.length!==t.length)return;let n=new Map;for(let t=0;t<e.length;t++){let r=e[t],i=n.get(r);i===void 0?n.set(r,{indices:[t],used:0}):i.indices.push(t)}let r=Array(t.length);for(let e=0;e<t.length;e++){let i=n.get(t[e]);if(i===void 0||i.used===i.indices.length)return;r[e]=i.indices[i.used++]}return r},kc=(e,t,n,r)=>{if(e===t)return;if(t.length>e.length&&t.slice(0,e.length)===e){wc(r,[`a`,n,Od(t,e.length)]);return}let i=Dd(e,t,xc);i===0?wc(r,[`s`,n,t]):(wc(r,[`t`,n,e.length-i]),t.length>i&&wc(r,[`a`,n,Od(t,i)]))},Ac=2e5,jc=65536,Mc=(e,t)=>e===t||Dc(e,t),Nc=(e,t,n,r)=>{if(e.length===0||t.length===0)return[];if(e.length*t.length>r)return;let i=t.length+1,a=new Uint32Array((e.length+1)*i);for(let r=e.length-1;r>=0;r--)for(let o=t.length-1;o>=0;o--){let s=r*i+o;a[s]=n(e[r],t[o])?a[(r+1)*i+o+1]+1:Math.max(a[(r+1)*i+o],a[r*i+o+1])}let o=[],s=0,c=0;for(;s<e.length&&c<t.length;)n(e[s],t[c])&&a[s*i+c]===a[(s+1)*i+c+1]+1?o.push([s++,c++]):a[(s+1)*i+c]>=a[s*i+c+1]?s+=1:c+=1;return o},Pc=(e,t)=>{if(Mc(e,t))return!0;if(!Tc(e)||!Tc(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.some((e,n)=>Tc(e)&&e===t[n]);let n=e,r=t;for(let e of Object.keys(n)){let t=n[e];if(Tc(t)&&Object.hasOwn(r,e)&&t===r[e])return!0}return!1},Fc=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n},Ic=(e,t,n,r,i,a)=>{let o=n-t,s=a-i,c=[];if(s<o){let o=t;for(let t=i;t<a;t++){for(;o<n&&e[o]!==r[t];)o+=1;if(o===n)return;c.push([o++,t])}return c}if(o<s){let o=i;for(let i=t;i<n;i++){for(;o<a&&e[i]!==r[o];)o+=1;if(o===a)return;c.push([i,o++])}return c}},Lc=(e,t,n,r)=>{let i=[],a=-1;for(let o=n;o<r;o++){let n=e.get(t[o]);if(n===void 0)continue;let r=n[Fc(n,a+1)];r!==void 0&&(i.push([r,o]),a=r)}return i},Rc=(e,t,n,r,i,a)=>{let o=new Map;for(let r=t;r<n;r++){let t=e[r],n=o.get(t);n===void 0?o.set(t,[r]):n.push(r)}let s=0;for(let e=i;e<a;e++)if(s+=o.get(r[e])?.length??0,s>Ac)return Lc(o,r,i,a);if(s===0)return[];let c=[],l=[],u=[];for(let e=i;e<a;e++){let t=o.get(r[e]);if(t!==void 0)for(let n=t.length-1;n>=0;n--){let r=t[n],i=Fc(u,r),a=c.length;c.push({before:r,after:e,previous:i===0?-1:l[i-1]}),l[i]=a,u[i]=r}}let d=[],f=l[l.length-1]??-1;for(;f>=0;){let e=c[f];d.push([e.before,e.after]),f=e.previous}return d.reverse(),d},zc=(e,t,n,r,i,a,o,s,c,l)=>{let u=i,d=o,f=c;for(let[i,a]of l){if(Cc.has(r))return;Bc(e,t,n,r,u,i,d,a,f),f+=a-d,Mc(e[i],t[a])||Uc(e[i],t[a],[...n,f],r),f+=1,u=i+1,d=a+1}Cc.has(r)||Bc(e,t,n,r,u,a,d,s,f)};function Bc(e,t,n,r,i,a,o,s,c){if(Cc.has(r))return;for(;i<a&&o<s&&Mc(e[i],t[o]);)i+=1,o+=1,c+=1;for(;i<a&&o<s&&Mc(e[a-1],t[s-1]);)--a,--s;let l=a-i,u=s-o;if(l===0&&u===0)return;if(l===0||u===0){wc(r,[`p`,n,c,l,t.slice(o,s)]);return}if(l===u){let u=[];for(let n=0;n<l;n++)Mc(e[i+n],t[o+n])&&u.push([i+n,o+n]);if(u.length>0){zc(e,t,n,r,i,a,o,s,c,u);return}}let d=Ic(e,i,a,t,o,s);if(d!==void 0&&d.length>0){zc(e,t,n,r,i,a,o,s,c,d);return}let f=Rc(e,i,a,t,o,s);if(f.length>0){zc(e,t,n,r,i,a,o,s,c,f);return}let p=Nc(e.slice(i,a),t.slice(o,s),Pc,jc);if(p!==void 0&&p.length>0){let l=p.map(([e,t])=>[i+e,o+t]);zc(e,t,n,r,i,a,o,s,c,l)}else l===1&&u===1?Uc(e[i],t[o],[...n,c],r):wc(r,[`p`,n,c,l,t.slice(o,s)])}var Vc=(e,t,n,r)=>{if(!(e===t||Dc(e,t))){if(e.length===t.length&&e.length>1&&!Mc(e[0],t[0])&&!Mc(e[e.length-1],t[t.length-1])){let i=Oc(e,t);if(i!==void 0){wc(r,[`m`,n,i]);return}}Bc(e,t,n,r,0,e.length,0,t.length,0)}},Hc=(e,t,n,r)=>{let i=Object.keys(e),a=Object.keys(t);if([...i,...a].some(e=>kd.has(e)))Dc(e,t)||Ec(n,t,r);else{for(let i of a){if(Cc.has(r))return;Object.hasOwn(e,i)?Uc(e[i],t[i],[...n,i],r):Ec([...n,i],t[i],r)}for(let e of i){if(Cc.has(r))return;Object.hasOwn(t,e)||wc(r,[`d`,[...n,e]])}}},Uc=(e,t,n,r)=>{e===t||Cc.has(r)||(typeof e==`string`&&typeof t==`string`&&n.length>0?kc(e,t,n,r):Array.isArray(e)&&Array.isArray(t)?Vc(e,t,n,r):Tc(e)&&Tc(t)&&!Array.isArray(e)&&!Array.isArray(t)?Hc(e,t,n,r):Ec(n,t,r))},Wc=e=>{if(e===null)return 4;if(typeof e==`string`)return e.length+2;if(typeof e==`number`)return String(e).length;if(typeof e==`boolean`)return e?4:5;if(Array.isArray(e)){let t=2;for(let n=0;n<e.length;n++)t+=Wc(e[n])+(n===0?0:1);return t}let t=2,n=0;for(let r of Object.keys(e))t+=r.length+3+Wc(e[r])+(n++===0?0:1);return t},Gc=e=>{let t=2;for(let n=0;n<e.length;n++){let r=e[n];t+=(typeof r==`string`?r.length+2:String(r).length)+(n===0?0:1)}return t},Kc=e=>{switch(e[0]){case`r`:return 6+Wc(e[1]);case`s`:return 7+Gc(e[1])+Wc(e[2]);case`d`:return 6+Gc(e[1]);case`a`:return 7+Gc(e[1])+e[2].length+2;case`t`:return 7+Gc(e[1])+String(e[2]).length;case`p`:return 10+Gc(e[1])+String(e[2]).length+String(e[3]).length+Wc(e[4]);case`m`:return 7+Gc(e[1])+Wc(e[2])}};function qc(e,t){let n=[];if(Uc(e,t,[],n),Cc.has(n))return[[`r`,t]];if(n.length===0||n[0]?.[0]===`r`)return n;let r=2;for(let e of n)r+=Kc(e)+1;if(r<65536)return n;let i=Wc(t)+6;return r>=i?[[`r`,t]]:n}var Jc={value:void 0,writable:!0,enumerable:!0,configurable:!0};function Yc(e,t){return Xc(e,void 0,t?.omitUndefinedProperties===!0)}function Xc(e,t,n){if(e===null||typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`){if(Number.isFinite(e))return e;throw TypeError(`Value contains a non-finite number and is not strict JSON`)}if(typeof e!=`object`)throw TypeError(`Value contains a non-JSON ${typeof e}; expected strict JSON`);let r=t??new Set;if(r.has(e))throw TypeError(`Value contains cycles and is not strict JSON`);r.add(e);try{if(Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype||Reflect.ownKeys(e).length!==e.length+1)throw TypeError(`Value must contain strict JSON dense plain arrays`);let t=Array(e.length);for(let i=0;i<e.length;i++){let a=Object.getOwnPropertyDescriptor(e,i);if(a===void 0||!a.enumerable||!(`value`in a))throw TypeError(`Value must contain strict JSON enumerable indexed data properties`);Zc(t,String(i),Xc(a.value,r,n))}return t}let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw TypeError(`Value must contain strict JSON plain objects or arrays`);let i=Object.create(t);for(let t of Reflect.ownKeys(e)){if(typeof t==`symbol`)throw TypeError(`Value contains a symbol key and is not strict JSON`);let a=Object.getOwnPropertyDescriptor(e,t);if(!a.enumerable||!(`value`in a))throw TypeError(`Value must contain strict JSON enumerable data properties`);a.value===void 0&&n||Zc(i,t,Xc(a.value,r,n))}return i}finally{r.delete(e)}}function Zc(e,t,n){Jc.value=n,Object.defineProperty(e,t,Jc),Jc.value=void 0}var Qc={value:void 0,writable:!0,enumerable:!0,configurable:!0};function $c(e,t){let n=e,r=new WeakSet;for(let e of t){if(e[0]===`r`){n=e[1];continue}if(e[0]===`p`||e[0]===`m`){let t=el(n,e[1],e[1].length,r);if(n=t.root,!Array.isArray(t.target))throw TypeError(`Trusted array operation target is not an array`);e[0]===`p`?il(t.target,e[2],e[3],e[4]):al(t.target,e[2]);continue}let t=e[1],i=el(n,t,t.length-1,r);n=i.root;let a=t[t.length-1];switch(e[0]){case`s`:rl(i.target,a,e[2]);break;case`d`:if(Array.isArray(i.target)){if(typeof a!=`number`)throw TypeError(`Trusted array deletion key is not numeric`);il(i.target,a,1,[])}else Reflect.deleteProperty(i.target,a);break;case`a`:{let t=nl(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted append target is not a string`);rl(i.target,a,`${t}${e[2]}`);break}case`t`:{let t=nl(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted truncate target is not a string`);rl(i.target,a,t.slice(e[2]));break}}}return n}function el(e,t,n,r){if(!ol(e))throw TypeError(`Trusted operation root is not a container`);let i=e;r.has(e)||(i=tl(e),r.add(i));let a=i;for(let e=0;e<n;e++){let n=t[e],i=nl(a,n);if(!ol(i))throw TypeError(`Trusted operation path is not a container`);if(r.has(i)){a=i;continue}let o=tl(i);rl(a,n,o),r.add(o),a=o}return{root:i,target:a}}function tl(e){return Array.isArray(e)?Array.from(e):Object.getPrototypeOf(e)===null?Object.assign(Object.create(null),e):{...e}}function nl(e,t){return e[t]}function rl(e,t,n){Qc.value=n,Object.defineProperty(e,t,Qc),Qc.value=void 0}function il(e,t,n,r){let i=e.length,a=r.length-n;a>0?(e.length=i+a,e.copyWithin(t+r.length,t+n,i)):a<0&&(e.copyWithin(t+r.length,t+n,i),e.length=i+a);for(let n=0;n<r.length;n++)rl(e,t+n,r[n])}function al(e,t){if(e.length!==t.length)throw TypeError(`Trusted permutation length mismatch`);let n=e.slice();for(let r=0;r<t.length;r++)e[r]=n[t[r]]}function ol(e){return typeof e==`object`&&!!e}var sl=Symbol(`chord.delta.overlay.node`),cl=new WeakMap,ll={},ul=new Set([`push`,`pop`,`shift`,`unshift`,`splice`,`reverse`,`sort`,`fill`,`copyWithin`]),dl=4096,fl=128,pl={value:void 0,writable:!0,enumerable:!0,configurable:!0},ml=class{#e;value;base;ops;constructor(e,t,n){this.#e=e,this.value=t,this.base=e.baseValue,this.ops=n,cl.set(this,e)}get baseRevision(){return this.#e.baseRevision}abort(){Sd(this.#e)}},hl=class{#e;#t;#n=!1;constructor(e){this.#e=e}get state(){let e=this.#e?.root?.proxy;if(e===void 0)throw TypeError(`Cannot use a settled overlay`);return e}prepare(){if(this.#n)throw Error(`Change has already been settled`);let e=this.#e;Pl(e),e.status.value=`prepared`;try{e.replacement||(e.ops=e.dirty.length===0?[]:qu(e));let t=yl(e);return this.#t=e.status,this.#n=!0,t}catch(t){throw e.status.value=`aborted`,wd(e),this.#n=!0,t}finally{this.#e=void 0}}abort(){this.#n?(this.#t?.value===`prepared`&&(this.#t.value=`aborted`),this.#t=void 0):(this.#n=!0,Sd(this.#e),this.#e=void 0)}},gl=class{#e={};#t;#n;#r;#i;#a=0;#o=256;constructor(e){this.#i=e,this.#r=new WeakRef(this)}get value(){return this.#i}get revision(){return this.#a}beginChange(){let e=xl(this.#r,this.#e,this.#a,this.#i,!1,this.#i);return this.#t!==void 0&&this.#s(this.#t),this.#t=e,new hl(e)}prepareReplace(e){let t=xl(this.#r,this.#e,this.#a,e,!0,this.#i);t.status.value=`prepared`;try{return yl(t)}catch(e){throw t.status.value=`aborted`,wd(t),e}}adopt(e){let t=cl.get(e);if(t?.owner!==this.#e)throw Error(`Prepared change belongs to a different tracker`);if(t.status.value===`consumed`)throw Error(`Prepared change has already been used`);if(t.status.value===`aborted`)throw Error(`Prepared change has been aborted`);if(t.status.value===`stale`)throw Error(`Prepared change is stale`);if(t.status.value!==`prepared`)throw Error(`Prepared change is not ready`);if(t.baseRevision!==this.#a)throw t.status.value=`stale`,wd(t),Error(`Prepared change is stale`);if(this.#i!==e.base)throw t.status.value=`stale`,Error(`Prepared change is stale`);this.#i=e.value,t.status.value=`consumed`,this.#a+=1,this.#c(t)}releaseContext(e){this.#t===e?this.#t=void 0:e.registryRef!==void 0&&this.#n?.delete(e.registryRef),e.registryRef=void 0}#s(e){let t=new WeakRef(e);if(e.registryRef=t,this.#n??=new Set,this.#n.add(t),--this.#o,this.#o===0){for(let e of this.#n)e.deref()===void 0&&this.#n.delete(e);this.#o=Math.max(256,this.#n.size)}}#c(e){let t=this.#t,n=this.#n;if(this.#t=void 0,this.#n=void 0,this.#o=256,t!==void 0&&_l(t,e),n!==void 0)for(let t of n){let n=t.deref();n!==void 0&&_l(n,e)}}replacementBase(e){return e.baseRevision===this.#a?this.#i:void 0}};function _l(e,t){e!==t&&((e.status.value===`open`||e.status.value===`prepared`)&&(e.status.value=`stale`),e.registryRef=void 0,Cd(e))}function vl(e){return new gl(e)}function yl(e){let t=bd(e),n=e.baseValue,r=new ml(e,t.length===0?n:e.simpleObjectMaterialization?Hu(e.root):bl(n,t),t);return e.nodes.length>4096?Cd(e):wd(e),r}function bl(e,t){for(let n of t)if(n[0]===`p`||n[0]===`m`)return zd(e,t);return $c(e,t)}function xl(e,t,n,r,i,a){let o={owner:t,tracker:e,baseRevision:n,status:{value:`open`},root:void 0,bases:[],stored:void 0,dirty:[],nodes:[],rawNodes:void 0,ops:void 0,replacement:i,replacementNoop:!1,baseValue:a,overlayReleased:!1,simpleObjectMaterialization:!1,registryRef:void 0};return o.root=wl(o,r,void 0),o}var Sl={deleteProperty(e,t){return Rl(jl(e),t)},defineProperty(e){throw Pl(jl(e).context),TypeError(`Defining overlay properties is not supported`)},get(e,t){if(t===`then`){let t=e[sl];if(t===void 0||Ml(t.context))return}let n=jl(e);return t===sl?n:Fl(n,t)},getOwnPropertyDescriptor(e,t){return Vl(jl(e),t)},getPrototypeOf(e){let t=jl(e);return Nl(t.context),Object.getPrototypeOf(Tl(t))},has(e,t){return zl(jl(e),t)},isExtensible(e){return Nl(jl(e).context),!0},ownKeys(e){return Bl(jl(e))},preventExtensions(e){throw Pl(jl(e).context),TypeError(`Overlays cannot be made non-extensible`)},set(e,t,n){return Ll(jl(e),t,n)},setPrototypeOf(e){throw Pl(jl(e).context),TypeError(`Changing an overlay prototype is not supported`)}},Cl=Sl;function wl(e,t,n,r=0,i=``,a=void 0,o=!1){let s=e.rawNodes?.get(t);if(s!==void 0)return s;let c=Array.isArray(t)?[]:{},l=e.bases.length,u=n?.baseIndex??-1;e.bases.push(t);let d={context:e,baseIndex:l,parentIndex:u,parentKind:r,parentKey:i,parentPlacement:o,target:c,proxy:c};return a!==void 0&&(d.parentSource=a),c[sl]=d,d.proxy=new Proxy(c,Array.isArray(t)?Cl:Sl),n!==void 0&&(e.rawNodes??=new WeakMap,e.rawNodes.set(t,d)),e.nodes.push(d),d}function Tl(e){return e.context.bases[e.baseIndex]}function El(e){return e.parentIndex<0?void 0:e.context.nodes[e.parentIndex]}function Dl(e,t){if(!Td(t))return t;e.stored??=[];let n=e.stored.length;return e.stored.push(t),{index:n}}function Ol(e,t){return typeof t==`object`&&t?e.stored[t.index]:t}function kl(e,t,n){return Td(n)?typeof t==`object`&&t?(e.stored[t.index]=n,t):Dl(e,n):(typeof t==`object`&&t&&(e.stored[t.index]=ll),n)}function Al(e,t){typeof t==`object`&&t&&(e.stored[t.index]=ll)}function jl(e){let t=e[sl];if(t===void 0)throw TypeError(`Cannot use a settled overlay`);return t}function Ml(e){return e.overlayReleased||e.status.value===`consumed`||e.status.value===`aborted`||e.status.value===`stale`}function Nl(e){if(Ml(e))throw TypeError(`Cannot use a settled overlay`)}function Pl(e){if(Nl(e),e.status.value!==`open`)throw TypeError(`Prepared overlays are read-only`)}function Fl(e,t){if(Nl(e.context),Array.isArray(Tl(e))){let n=Zl(e);if(t===`length`)return mu(n);if(ul.has(t))return ju[t];let r=gu(t);return r===void 0?Reflect.get(Array.prototype,t,e.proxy):Il(e,r)}if(typeof t==`symbol`)return Reflect.get(Tl(e),t,e.proxy);let n=String(t);if(!Jl(e,n))return Gl(e,n)||Object.hasOwn(Tl(e),n)?void 0:Reflect.get(Tl(e),t,e.proxy);let r=Yl(e,n);return Td(r)?wl(e.context,r,e,0,n,void 0,Hl(e,n)).proxy:r}function Il(e,t){let n=Zl(e);if(t>=mu(n))return;let r=hu(n,t),i=r.start+r.step*n.locatedOffset,a=_u(e,r,i);return Td(a)?wl(e.context,a,e,r.kind===`base`?1:2,i,r.kind===`insert`?r.source:void 0,r.kind===`insert`||vu(n,r,i)).proxy:a}function Ll(e,t,n){if(Pl(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(Tl(e))){if(t===`length`)return Eu(e,Du(n)),!0;let r=gu(t);if(r===void 0)throw TypeError(`Only array indices and length can be written`);if(r>mu(Zl(e)))throw TypeError(`Overlay arrays cannot contain holes`);return Tu(e,r,Vu(n)),!0}let r=String(t);if(n===void 0)return Rl(e,r);let i=Vu(n),a=Yl(e,r),o=Gl(e,r);return!o&&!Td(i)&&a===i||(e.appends?.delete(r),Ul(e,r,i),o&&Object.hasOwn(Tl(e),r)&&(e.readded===void 0&&(e.readded=new Set),e.readded.add(r)),ql(e,r),Xl(e)),!0}function Rl(e,t){if(Pl(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(Tl(e)))throw TypeError(`Overlay arrays cannot contain holes`);let n=String(t);return Jl(e,n)&&(e.appends?.delete(n),Wl(e,n),e.readded?.delete(n),Kl(e,n),Xl(e)),!0}function zl(e,t){if(Nl(e.context),Array.isArray(Tl(e))){if(t===`length`)return!0;let n=gu(t);return n===void 0?t in Array.prototype:n<mu(Zl(e))}return typeof t==`symbol`?t in Tl(e):Jl(e,String(t))}function Bl(e){if(Nl(e.context),Array.isArray(Tl(e))){let t=mu(Zl(e)),n=Array(t+1);for(let e=0;e<t;e++)n[e]=String(e);return n[t]=`length`,n}let t=e.deleteKey===void 0&&e.deletes===void 0&&e.readded===void 0&&(e.writeKey===void 0||Object.hasOwn(Tl(e),e.writeKey));if(t&&e.writes!==void 0){for(let n of e.writes.keys())if(!Object.hasOwn(Tl(e),n)){t=!1;break}}if(t)return Object.keys(Tl(e));let n=Object.keys(Tl(e)).filter(t=>!Gl(e,t)&&!e.readded?.has(t)),r=new Set(n);if(e.writeKey!==void 0&&!r.has(e.writeKey)&&(n.push(e.writeKey),r.add(e.writeKey)),e.writes!==void 0)for(let t of e.writes.keys())r.has(t)||(n.push(t),r.add(t));let i=[],a=[];for(let e of n){let t=gu(e);t===void 0?a.push(e):i.push(t)}return i.sort((e,t)=>e-t),[...i.map(String),...a]}function Vl(e,t){if(Nl(e.context),Array.isArray(Tl(e))){if(t===`length`){let t=mu(Zl(e));return e.target.length=t,Reflect.getOwnPropertyDescriptor(e.target,`length`)}let n=gu(t);if(n===void 0||n>=mu(Zl(e)))return}else if(typeof t==`symbol`||!Jl(e,String(t)))return;return{configurable:!0,enumerable:!0,writable:e.context.status.value===`open`,value:Fl(e,t)}}function Hl(e,t){return e.writeKey===t||(e.writes?.has(t)??!1)}function Ul(e,t,n){if(e.writes!==void 0){let r=e.writes.get(t);e.writes.set(t,r===void 0?Dl(e.context,n):kl(e.context,r,n))}else e.writeKey===void 0||e.writeKey===t?(e.writeKey=t,e.writeValue=e.writeValue===void 0?Dl(e.context,n):kl(e.context,e.writeValue,n)):(e.writes=new Map,e.writes.set(e.writeKey,e.writeValue),e.writes.set(t,Dl(e.context,n)),e.writeKey=void 0,e.writeValue=void 0)}function Wl(e,t){if(e.writeKey===t)e.writeKey=void 0,Al(e.context,e.writeValue),e.writeValue=void 0;else{let n=e.writes?.get(t);n!==void 0&&Al(e.context,n),e.writes?.delete(t)}}function Gl(e,t){return e.deleteKey===t||(e.deletes?.has(t)??!1)}function Kl(e,t){e.deletes===void 0?e.deleteKey===void 0||e.deleteKey===t?e.deleteKey=t:(e.deletes=new Set,e.deletes.add(e.deleteKey),e.deletes.add(t),e.deleteKey=void 0):e.deletes.add(t)}function ql(e,t){e.deleteKey===t?e.deleteKey=void 0:e.deletes?.delete(t)}function Jl(e,t){return Gl(e,t)?!1:Hl(e,t)||Object.hasOwn(Tl(e),t)}function Yl(e,t){if(e.writeKey===t)return Ol(e.context,e.writeValue);let n=e.writes?.get(t);return n===void 0?Tl(e)[t]:Ol(e.context,n)}function Xl(e){if(!e.dirty){e.dirty=!0,e.context.dirty.push(e);for(let t=El(e);t!==void 0;t=El(t))t.subtreeDirty=!0}}function Zl(e){if(e.array!==void 0)return e.array;let t=Tl(e),n={root:void 0,pieces:void 0,baseOverrides:void 0,insertOverrides:void 0,structural:!1,generation:0,plan:void 0,seed:2654435769,locatedOffset:0,baseLocations:void 0,insertLocations:void 0};return t.length>0&&(n.root=ru(n,{kind:`base`,start:0,length:t.length,step:1})),e.array=n,n}function Ql(e){return e.baseOverrides===void 0&&(e.baseOverrides=new Map),e.baseOverrides}function $l(e){return e.insertOverrides===void 0&&(e.insertOverrides=new Map),e.insertOverrides}function eu(e){let t=e.seed;return t^=t<<13,t^=t>>>17,t^=t<<5,e.seed=t>>>0,e.seed}function tu(e){return e?.elements??0}function nu(e){e.elements=tu(e.left)+e.piece.length+tu(e.right)}function ru(e,t){return{piece:t,left:void 0,right:void 0,priority:eu(e),elements:t.length}}function iu(e,t){return e===void 0?t:t===void 0?e:e.priority>=t.priority?(e.right=iu(e.right,t),nu(e),e):(t.left=iu(e,t.left),nu(t),t)}function au(e,t,n){if(t===void 0)return[void 0,void 0];let r=tu(t.left);if(n<r){let[r,i]=au(e,t.left,n);return t.left=i,nu(t),[r,t]}let i=r+t.piece.length;if(n>i){let[r,a]=au(e,t.right,n-i);return t.right=r,nu(t),[t,a]}if(n===r){let e=t.left;return t.left=void 0,nu(t),[e,t]}if(n===i){let e=t.right;return t.right=void 0,nu(t),[t,e]}let a=n-r,o={...t.piece,length:a},s={...t.piece,start:t.piece.start+t.piece.step*a,length:t.piece.length-a};return[iu(t.left,ru(e,o)),iu(ru(e,s),t.right)]}function ou(e){for(;e.left!==void 0;)e=e.left;return e}function su(e){for(;e.right!==void 0;)e=e.right;return e}function cu(e,t){return e.kind!==t.kind||e.kind===`insert`&&e.source!==t.source?!1:e.length===1&&t.length===1?Math.abs(t.start-e.start)===1:e.step===t.step&&e.start+e.step*e.length===t.start}function lu(e,t,n){if(t===void 0)return n;if(n===void 0)return t;let r=su(t).piece,i=ou(n).piece;if(!cu(r,i))return iu(t,n);let[a]=au(e,t,tu(t)-r.length),[,o]=au(e,n,i.length),s=r.length===1?i.start-r.start:r.step;return lu(e,lu(e,a,ru(e,r.kind===`base`?{kind:`base`,start:r.start,length:r.length+i.length,step:s}:{kind:`insert`,source:r.source,start:r.start,length:r.length+i.length,step:s})),o)}function uu(e,t){e!==void 0&&(uu(e.left,t),t.push(e.piece),uu(e.right,t))}function du(e){return e.pieces===void 0&&(e.pieces=[],uu(e.root,e.pieces)),e.pieces}function fu(e,t){Su(t);let n;for(let r of t)n=iu(n,ru(e,r));return n}function pu(e,t){e.root=fu(e,t),e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0}function mu(e){return tu(e.root)}function hu(e,t){let n=e.root;for(;n!==void 0;){let r=tu(n.left);if(t<r)n=n.left;else if(t>=r+n.piece.length)t-=r+n.piece.length,n=n.right;else return e.locatedOffset=t-r,n.piece}throw RangeError(`Array overlay index is out of range`)}function gu(e){if(typeof e!=`string`||e.length===0||e.length>10)return;if(e===`0`)return 0;let t=e.charCodeAt(0);if(t<49||t>57)return;let n=t-48;for(let t=1;t<e.length;t++){let r=e.charCodeAt(t)-48;if(r<0||r>9||(n=n*10+r,n>=4294967295))return}return n}function _u(e,t,n){let r=Zl(e);if(t.kind===`base`){let t=r.baseOverrides?.get(n);return t===void 0?Tl(e)[n]:Ol(e.context,t)}let i=r.insertOverrides?.get(t.source),a=i?.has(n)?i.get(n):t.source.refs[n];return Ol(e.context,a)}function vu(e,t,n){return t.kind===`base`?e.baseOverrides?.has(n)??!1:e.insertOverrides?.get(t.source)?.has(n)??!1}function yu(e,t){e.right===void 0?e.piece.length+=t:yu(e.right,t),nu(e)}function bu(e){e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0,e.plan=void 0}function xu(e,t,n,r){if(n===0&&r.length===0)return;let i=Zl(e);if(n===0&&t===mu(i)&&r.length===1&&i.root!==void 0){let t=r[0],n=su(i.root).piece;if(t.kind===`insert`&&n.kind===`insert`&&n.step===1&&n.start+n.length===n.source.refs.length){for(let e=0;e<t.length;e++)n.source.refs.push(t.source.refs[t.start+e]);yu(i.root,t.length),bu(i),i.structural=!0,i.generation+=1,Xl(e);return}}let[a,o]=au(i,i.root,t),[,s]=au(i,o,n);i.root=lu(i,lu(i,a,fu(i,r)),s),bu(i),i.structural=!0,i.generation+=1,Xl(e)}function Su(e){for(let t=1;t<e.length;){let n=e[t-1],r=e[t],i=n.kind===r.kind&&(n.kind===`base`||n.source===r.source);i&&n.length===1&&r.length===1&&Math.abs(r.start-n.start)===1?(n.step=r.start-n.start,n.length=2,e.splice(t,1)):i&&n.step===r.step&&n.start+n.step*n.length===r.start?(n.length+=r.length,e.splice(t,1)):t+=1}}function Cu(e,t,n=0){if(t.length===n)return[];let r=[];for(let i=n;i<t.length;i++)r.push(Dl(e.context,t[i]));return[{kind:`insert`,source:{refs:r},start:0,length:r.length,step:1}]}function wu(e,t,n=0){if(t.length===n)return[];let r=e.context.stored?.length??0;try{for(let r=n;r<t.length;r++)t[r]=Dl(e.context,Vu(t[r]))}catch(t){throw e.context.stored!==void 0&&(e.context.stored.length=r),t}return[{kind:`insert`,source:{refs:t},start:n,length:t.length-n,step:1}]}function Tu(e,t,n){let r=Zl(e),i=mu(r);if(t===i){xu(e,i,0,Cu(e,[n]));return}let a=hu(r,t),o=a.start+a.step*r.locatedOffset,s=_u(e,a,o);if(Td(n)||s!==n){if(a.kind===`base`){let t=r.baseOverrides?.get(o);!Td(n)&&n===Tl(e)[o]?(t!==void 0&&Al(e.context,t),r.baseOverrides?.delete(o)):t===void 0?Ql(r).set(o,Dl(e.context,n)):r.baseOverrides.set(o,kl(e.context,t,n))}else{let t=r.insertOverrides?.get(a.source),i=t?.get(o);!Td(n)&&n===Ol(e.context,a.source.refs[o])?(i!==void 0&&Al(e.context,i),t?.delete(o),t?.size===0&&r.insertOverrides?.delete(a.source)):(t===void 0&&(t=new Map,$l(r).set(a.source,t)),i===void 0?t.set(o,Dl(e.context,n)):t.set(o,kl(e.context,i,n)))}Xl(e)}}function Eu(e,t){let n=mu(Zl(e));t!==n&&(t<n?xu(e,t,n-t,[]):xu(e,n,0,Cu(e,Array.from({length:t-n},()=>null))))}function Du(e){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=4294967296)throw RangeError(`Invalid array length`);return t}function Ou(e){let t=Number(e);return Number.isNaN(t)||t===0?0:Number.isFinite(t)?Math.trunc(t):t}function ku(e,t){return e===-1/0?0:e<0?Math.max(t+e,0):Math.min(e,t)}function Au(e){if(!Td(e))return;let t=Reflect.get(e,sl);if(t!==void 0){if(!Array.isArray(Tl(t)))throw TypeError(`Array mutator called on incompatible receiver`);return Pl(t.context),t}}var ju={push(...e){let t=Au(this);if(t===void 0)return Reflect.apply(Array.prototype.push,this,e);let n=mu(Zl(t));return xu(t,n,0,wu(t,e)),n+e.length},pop(){let e=Au(this);if(e===void 0)return Reflect.apply(Array.prototype.pop,this,[]);let t=mu(Zl(e));if(t===0)return;let n=Il(e,t-1);return xu(e,t-1,1,[]),n},shift(){let e=Au(this);if(e===void 0)return Reflect.apply(Array.prototype.shift,this,[]);if(mu(Zl(e))===0)return;let t=Il(e,0);return xu(e,0,1,[]),t},unshift(...e){let t=Au(this);return t===void 0?Reflect.apply(Array.prototype.unshift,this,e):(xu(t,0,0,wu(t,e)),mu(Zl(t)))},splice(...e){let t=Au(this);if(t===void 0)return Reflect.apply(Array.prototype.splice,this,e);let n=mu(Zl(t)),r=e.length===0?0:ku(Ou(e[0]),n),i=e.length===0?0:e.length===1?n-r:Math.min(Math.max(Ou(e[1]),0),n-r),a=Array.from({length:i},(e,n)=>Il(t,r+n)),o=Math.min(2,e.length),s=Math.max(e.length-2,0);return xu(t,r,i,wu(t,e,o)),Eu(t,n-i+s),a},reverse(){let e=Au(this);if(e===void 0)return Reflect.apply(Array.prototype.reverse,this,[]);let t=Zl(e);if(mu(t)<2)return e.proxy;let n=[...du(t)].reverse();for(let e of n)e.start+=e.step*(e.length-1),e.step=e.step===1?-1:1;return pu(t,n),t.structural=!0,t.generation+=1,t.plan=void 0,Xl(e),e.proxy},sort(e){let t=Au(this);if(t===void 0)return Reflect.apply(Array.prototype.sort,this,[e]);if(e!==void 0&&typeof e!=`function`)throw TypeError(`Comparator must be a function`);let n=Zl(t),r=[],i=[],a=[],o=Array(Tl(t).length),s=[];for(let e of du(n))for(let n=0;n<e.length;n++){let c=e.start+e.step*n;if(e.kind===`base`)s.push(c),o[c]=Pu(t,c,r,i);else{r.push(e.source),i.push(c);let n=-r.length;s.push(n),a.push(Pu(t,n,r,i))}}let c=new Map;for(let[e,r]of n.baseOverrides??[])c.set(e,Ol(t.context,r));let l=new Map;for(let[e,r]of n.insertOverrides??[]){let n=new Map;for(let[e,i]of r)n.set(e,Ol(t.context,i));l.set(e,n)}let u=n.generation;if(s.sort((t,n)=>{let r=t<0?a[-t-1]:o[t],i=n<0?a[-n-1]:o[n];if(typeof e==`function`)return Number(e(r,i));let s=String(r),c=String(i);return s<c?-1:+(s>c)}),c.size>0||l.size>0||(n.baseOverrides?.size??0)>0||(n.insertOverrides?.size??0)>0)for(let e of s)Fu(t,e,r,i,c,l);let d=n.generation!==u,f=mu(n);return f>=s.length&&s.every((e,t)=>Iu(n,t,e,r,i))||xu(t,0,Math.min(s.length,f),Ru(s,r,i)),d&&Lu(t),t.proxy},fill(e,t,n){let r=Au(this);if(r===void 0)return Reflect.apply(Array.prototype.fill,this,[e,t,n]);let i=mu(Zl(r)),a=t===void 0?0:ku(Ou(t),i),o=n===void 0?i:ku(Ou(n),i);if(o<=a)return r.proxy;let s=Array.from({length:o-a},()=>Vu(e));return xu(r,a,o-a,Cu(r,s)),r.proxy},copyWithin(e,t,n){let r=Au(this);if(r===void 0)return Reflect.apply(Array.prototype.copyWithin,this,[e,t,n]);let i=mu(Zl(r)),a=ku(Ou(e),i),o=ku(Ou(t),i),s=n===void 0?i:ku(Ou(n),i),c=Math.min(Math.max(s-o,0),i-a);return xu(r,a,c,Cu(r,Array.from({length:c},(e,t)=>Vu(Il(r,o+t))))),r.proxy}};function Mu(e,t){return e<0?t[-e-1]:void 0}function Nu(e,t){return e<0?t[-e-1]:e}function Pu(e,t,n,r){let i=Zl(e),a=Mu(t,n),o=Nu(t,r),s=a===void 0?i.baseOverrides?.get(o):i.insertOverrides?.get(a)?.get(o),c=s===void 0?a===void 0?Tl(e)[o]:Ol(e.context,a.refs[o]):Ol(e.context,s);return Td(c)?wl(e.context,c,e,a===void 0?1:2,o,a,a!==void 0||(i.baseOverrides?.has(o)??!1)).proxy:c}function Fu(e,t,n,r,i,a){let o=Zl(e),s=Mu(t,n),c=Nu(t,r);if(s===void 0){let t=o.baseOverrides?.get(c),n=i.get(c);n===void 0?(t!==void 0&&Al(e.context,t),o.baseOverrides?.delete(c)):t===void 0?Ql(o).set(c,Dl(e.context,n)):o.baseOverrides.set(c,kl(e.context,t,n));return}let l=o.insertOverrides?.get(s),u=l?.get(c),d=a.get(s)?.get(c);d===void 0?(u!==void 0&&Al(e.context,u),l?.delete(c),l?.size===0&&o.insertOverrides?.delete(s)):(l===void 0&&(l=new Map,$l(o).set(s,l)),u===void 0?l.set(c,Dl(e.context,d)):l.set(c,kl(e.context,u,d)))}function Iu(e,t,n,r,i){let a=hu(e,t),o=a.start+a.step*e.locatedOffset,s=Mu(n,r);return o===Nu(n,i)&&(a.kind===`base`&&s===void 0||a.kind===`insert`&&a.source===s)}function Lu(e){let t=Zl(e),n=new Set,r=new Map,i=[],a=!1;for(let o of du(t))for(let t=0;t<o.length;t++){let s=o.start+o.step*t,c;if(o.kind===`base`)c=n.has(s),n.add(s);else{let e=r.get(o.source);e===void 0&&(e=new Set,r.set(o.source,e)),c=e.has(s),e.add(s)}c?(a=!0,zu(i,Cu(e,[Gu(_u(e,o,s),e.context)])[0])):zu(i,Bu(o,s))}a&&(pu(t,i),t.structural=!0,t.generation+=1,t.plan=void 0,Xl(e))}function Ru(e,t,n){let r=[];for(let i of e){let e=i<0?t[-i-1]:void 0,a=i<0?n[-i-1]:i,o=r.at(-1),s=o!==void 0&&(e===void 0&&o.kind===`base`||e!==void 0&&o.kind===`insert`&&o.source===e);if(o!==void 0&&s){if(o.length===1){let e=a-o.start;if(e===1||e===-1){o.step=e,o.length=2;continue}}else if(o.start+o.step*o.length===a){o.length+=1;continue}}r.push(e===void 0?{kind:`base`,start:a,length:1,step:1}:{kind:`insert`,source:e,start:a,length:1,step:1})}return r}function zu(e,t){let n=e.at(-1),r=n!==void 0&&n.kind===t.kind&&(n.kind===`base`||n.source===t.source);if(n!==void 0&&r&&n.length===1&&t.length===1){let e=t.start-n.start;if(e===1||e===-1){n.step=e,n.length=2;return}}n!==void 0&&r&&n.step===t.step&&n.start+n.step*n.length===t.start?n.length+=t.length:e.push(t)}function Bu(e,t){return e.kind===`base`?{kind:`base`,start:t,length:1,step:1}:{kind:`insert`,source:e.source,start:t,length:1,step:1}}function Vu(e){let t=Td(e)?Reflect.get(e,sl):void 0;return t===void 0?Yc(e):Wu(t)}function Hu(e){if(Nl(e.context),Array.isArray(Tl(e))){let t=Zl(e),n=[];for(let r of du(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(Uu(_u(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(Tl(e)));for(let n of Bl(e))Ku(t,n,Uu(Yl(e,n),e.context));return t}function Uu(e,t){if(!Td(e))return e;let n=t.rawNodes?.get(e);return n===void 0||!n.dirty&&!n.subtreeDirty?e:Hu(n)}function Wu(e){if(Nl(e.context),Array.isArray(Tl(e))){let t=Zl(e),n=[];for(let r of du(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(Gu(_u(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(Tl(e)));for(let n of Bl(e))Ku(t,n,Gu(Yl(e,n),e.context));return t}function Gu(e,t){if(!Td(e))return Yc(e);let n=t.rawNodes?.get(e);return n===void 0?Yc(e):Wu(n)}function Ku(e,t,n){pl.value=n,Object.defineProperty(e,t,pl),pl.value=void 0}function qu(e){let t=Ju(e);if(t!==void 0)return t;let n=[],r=new Map,i=new Map,a=new Map;for(let t of e.dirty)if(ed(t,a),Array.isArray(Tl(t))){let e=Zl(t);if(!e.structural&&(e.baseOverrides?.size??0)>0){let n=a.get(t);n===void 0&&(n={indices:[],bits:void 0,length:Tl(t).length},a.set(t,n));for(let t of e.baseOverrides.keys())$u(n,t)}}let o=new Map;for(let[e,t]of a){let n=_d(e);if(n===void 0||n.some(e=>typeof e==`string`&&kd.has(e)))continue;let r=td(t);r.length>0&&o.set(e,r)}for(let t of e.dirty){let e=_d(t);if(e===void 0||Qu(t,e,o))continue;i.set(t,e),!Array.isArray(Tl(t))&&rd(t)&&r.set(t,e);let n=e.findIndex(e=>typeof e==`string`&&kd.has(e));if(n>=0){let i=t;for(let t=e.length;t>n;t--)i=El(i);r.set(i,e.slice(0,n))}}for(let[e,t]of r)i.set(e,t);for(let e of o.keys()){let t=_d(e);t!==void 0&&!Qu(e,t,o)&&i.set(e,t)}let s=0;for(let e of i.values())s=Math.max(s,e.length);let c=Array.from({length:s+1},()=>[]);for(let[e,t]of i)c[t.length].push(e);let l=new Set;for(let t of c)for(let a of t){let t=i.get(a);if(!(ad(a)||id(a,l))){if(r.has(a))gd(n,t,Hu(a)),l.add(a);else if(Array.isArray(Tl(a))?pd(a,t,n,o.get(a)):sd(a,t,n),n.length>dl)return Yu=void 0,[[`r`,Hu(e.root)]]}}return Yu=void 0,n}function Ju(e){let t=[];for(let n of e.dirty){if(Array.isArray(Tl(n))||rd(n)||ad(n))return;for(let e=El(n);e!==void 0;e=El(e))if(Array.isArray(Tl(e)))return;let e=_d(n);if(e!==void 0){for(let t of e)if(typeof t==`string`&&kd.has(t))return;if(t.push(n),t.length>fl)return}}for(let e=1;e<t.length;e++){let n=t[e],r=n.preparedPath.length,i=e;for(;i>0&&t[i-1].preparedPath.length>r;)t[i]=t[i-1],--i;t[i]=n}let n=[],r=!0;for(let i of t)if(sd(i,i.preparedPath,n)&&(r=!1),n.length>dl)return[[`r`,Hu(e.root)]];return e.simpleObjectMaterialization=r,n}var Yu,Xu=0;function Zu(e){let t=e;for(let e=El(t);e!==void 0;e=El(t)){if(Array.isArray(Tl(e))){let n=Zl(e);if(t.parentKind!==1||n.structural)return!1;let r=t.parentKey,i=n.baseOverrides?.get(r);return(i===void 0?Tl(e)[r]:Ol(e.context,i))===Tl(t)&&(Yu=e,Xu=r,!0)}t=e}return!1}function Qu(e,t,n){for(let r=El(e);r!==void 0;r=El(r)){let e=n.get(r);if(e===void 0)continue;let i=_d(r);if(i===void 0||t.length<=i.length)continue;let a=!0;for(let e=0;e<i.length;e++)if(t[e]!==i[e]){a=!1;break}if(!a)continue;let o=t[i.length];if(typeof o==`number`&&nd(e,o))return!0}return!1}function $u(e,t){if(e.bits!==void 0)e.bits[t]=1;else if(e.indices.push(t),!(e.indices.length<256)){e.bits=new Uint8Array(e.length);for(let t of e.indices)e.bits[t]=1;e.indices.length=0}}function ed(e,t){if(!Zu(e))return;let n=t.get(Yu);n===void 0&&(n={indices:[],bits:void 0,length:Tl(Yu).length},t.set(Yu,n)),$u(n,Xu)}function td(e){if(e.bits===void 0)return[];let t=[],n=e.bits;for(let e=0;e<n.length;){for(;e<n.length&&n[e]===0;)e+=1;if(e===n.length)break;let r=e,i=e,a=0,o=0;for(;e<n.length;){if(n[e]!==0)a+=1,i=e,o=0;else if(++o>1)break;e+=1}let s=i-r+1;a>=256&&a*2>=s&&t.push({start:r,length:s})}return t}function nd(e,t){for(let n of e)if(t>=n.start&&t<n.start+n.length)return!0;return!1}function rd(e){if(e.writeKey!==void 0&&kd.has(e.writeKey)||e.deleteKey!==void 0&&kd.has(e.deleteKey))return!0;if(e.writes!==void 0){for(let t of e.writes.keys())if(kd.has(t))return!0}if(e.deletes!==void 0){for(let t of e.deletes)if(kd.has(t))return!0}return!1}function id(e,t){for(let n=El(e);n!==void 0;n=El(n))if(t.has(n))return!0;return!1}function ad(e){for(let t=e;t!==void 0;t=El(t))if(El(t)!==void 0&&t.parentPlacement)return!0;return!1}function od(e,t,n,r,i){let a=[...t,r],o=e.appends?.get(r);if(o!==void 0)return n.push([`a`,a,o]),!1;let s=e.readded?.has(r)||!Object.hasOwn(Tl(e),r)?void 0:Tl(e)[r],c=Uu(i,e.context),l=hd(n,a,s,c);return Td(s)&&Td(c)&&!l}function sd(e,t,n){if(e.readded!==void 0)for(let r of e.readded)Object.hasOwn(Tl(e),r)&&n.push([`d`,[...t,r]]);let r=!1;if(e.writeKey!==void 0&&(r=od(e,t,n,e.writeKey,Yl(e,e.writeKey))),e.writes!==void 0)for(let[i,a]of e.writes){if(n.length>dl)return r;od(e,t,n,i,Ol(e.context,a))&&(r=!0)}if(e.deleteKey!==void 0&&Object.hasOwn(Tl(e),e.deleteKey)&&n.push([`d`,[...t,e.deleteKey]]),e.deletes!==void 0)for(let i of e.deletes){if(n.length>dl)return r;Object.hasOwn(Tl(e),i)&&n.push([`d`,[...t,i]])}return r}function cd(e){let t=Zl(e);if(t.plan!==void 0)return t.plan;let n=Tl(e),r=du(t);return t.plan=ld(n.length,r)??ud(n.length,r),t.plan}function ld(e,t){let n=[];for(let e of t)if(e.kind===`base`&&e.length!==0){if(e.step!==1&&e.length>1||n.length>0&&e.start<=n[n.length-1])return;n.push(e.start,e.start+e.length-1)}let r=[],i=e;for(let e=n.length-2;e>=-2;e-=2){let t=e>=0?n[e+1]+1:0;i>t&&r.push(t,i-t),e>=0&&(i=n[e])}return{removeRuns:r,permutation:void 0,insertRuns:dd(t)}}function ud(e,t){let n=new Uint8Array(e),r=[];for(let e of t)if(e.kind===`base`)for(let t=0;t<e.length;t++){let i=e.start+e.step*t;n[i]=1,r.push(i)}let i=[];for(let t=e;t>0;){if(n[t-1]!==0){--t;continue}let e=t-1;for(;e>0&&n[e-1]===0;)--e;i.push(e,t-e),t=e}let a=[];for(let e=0;e<n.length;e++)n[e]!==0&&a.push(e);let o;if(r.some((e,t)=>e!==a[t])){let e=new Map(a.map((e,t)=>[e,t]));o=r.map(t=>e.get(t))}return{removeRuns:i,permutation:o,insertRuns:dd(t)}}function dd(e){let t=[],n=0;for(let r=0;r<e.length;){let i=e[r];if(i.kind===`base`){n+=i.length,r+=1;continue}let a=r;for(;r<e.length&&e[r].kind===`insert`;)n+=e[r].length,r+=1;t.push(n-fd(e,a,r),a,r)}return t}function fd(e,t,n){let r=0;for(let i=t;i<n;i++)r+=e[i].length;return r}function pd(e,t,n,r){let i=Zl(e),a=Tl(e);if(r!==void 0)for(let i of r){if(n.length>dl)return;n.push([`p`,t,i.start,i.length,md(e,i)])}if(i.structural){let r=cd(e);for(let e=0;e<r.removeRuns.length;e+=2){if(n.length>dl)return;n.push([`p`,t,r.removeRuns[e],r.removeRuns[e+1],[]])}r.permutation!==void 0&&n.push([`m`,t,r.permutation]);let a=du(i);for(let i=0;i<r.insertRuns.length;i+=3){if(n.length>dl)return;let o=r.insertRuns[i],s=[];for(let t=r.insertRuns[i+1];t<r.insertRuns[i+2];t++){let n=a[t];for(let t=0;t<n.length;t++){let r=n.start+n.step*t;s.push(Uu(_u(e,n,r),e.context))}}n.push([`p`,t,o,0,s])}}for(let[o,s]of i.baseOverrides??[]){if(n.length>dl)return;let c=yd(i,1,o,void 0);c===void 0||r!==void 0&&nd(r,c)||hd(n,[...t,c],a[o],Uu(Ol(e.context,s),e.context))}}function md(e,t){let n=Zl(e),r=[];for(let i=t.start;i<t.start+t.length;i++){let t=hu(n,i),a=t.start+t.step*n.locatedOffset;r.push(Uu(_u(e,t,a),e.context))}return r}function hd(e,t,n,r){if(!Td(r)&&n===r||Td(n)&&Td(r)&&xd(n,r))return!1;if(typeof n==`string`&&typeof r==`string`){if(r.length>n.length&&r.slice(0,n.length)===n)return e.push([`a`,t,Od(r,n.length)]),!0;let i=Dd(n,r,65536);if(i>0)return e.push([`t`,t,n.length-i]),r.length>i&&e.push([`a`,t,Od(r,i)]),!0}return e.push([`s`,t,r]),!0}function gd(e,t,n){t.length===0?e.push([`r`,n]):e.push([`s`,t,n])}function _d(e){if(e.preparedPath!==void 0)return e.preparedPath;let t=El(e);if(t===void 0)return e.preparedPath=[],e.preparedPath;let n=_d(t);if(n===void 0)return;if(e.parentKind===0){let r=e.parentKey;return!Jl(t,r)||Yl(t,r)!==Tl(e)?void 0:(e.preparedPath=[...n,r],e.preparedPath)}let r=Zl(t),i=yd(r,e.parentKind,e.parentKey,e.parentSource);if(i!==void 0&&_u(t,hu(r,i),e.parentKey)===Tl(e))return e.preparedPath=[...n,i],e.preparedPath}function vd(e){if(e.baseLocations!==void 0)return;e.baseLocations=[],e.insertLocations=new Map;let t=0;for(let n of du(e)){let r=n.start+n.step*(n.length-1),i={piece:n,logicalStart:t,minimum:Math.min(n.start,r),maximum:Math.max(n.start,r)};if(n.kind===`base`)e.baseLocations.push(i);else{let t=e.insertLocations.get(n.source);t===void 0&&(t=[],e.insertLocations.set(n.source,t)),t.push(i)}t+=n.length}let n=(e,t)=>e.minimum-t.minimum;e.baseLocations.sort(n);for(let t of e.insertLocations.values())t.sort(n)}function yd(e,t,n,r){if(t===1&&!e.structural)return n;vd(e);let i=t===1?e.baseLocations:e.insertLocations.get(r);if(i===void 0)return;let a=0,o=i.length;for(;a<o;){let e=a+o>>>1;i[e].minimum<=n?a=e+1:o=e}let s=i[a-1];if(s===void 0||n>s.maximum)return;let c=(n-s.piece.start)/s.piece.step;return c>=0&&c<s.piece.length?s.logicalStart+c:void 0}function bd(e){if(e.ops!==void 0)return e.ops;if(Nl(e),e.replacement){let t=e.tracker.deref()?.replacementBase(e);e.replacementNoop=t!==void 0&&xd(t,Tl(e.root)),e.ops=e.replacementNoop?[]:[[`r`,Tl(e.root)]]}else e.ops=qu(e);return e.ops}function xd(e,t){if(e===t)return!0;if(!Td(e)||!Td(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){let n=t;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!xd(e[t],n[t]))return!1;return!0}let n=t,r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(let t of r)if(!Object.hasOwn(n,t)||!xd(e[t],n[t]))return!1;return!0}function Sd(e){e.status.value!==`aborted`&&e.status.value!==`consumed`&&e.status.value!==`stale`&&(e.status.value=`aborted`,wd(e))}function Cd(e){e.tracker.deref()?.releaseContext(e),Yu?.context===e&&(Yu=void 0),e.overlayReleased=!0,e.dirty.length=0,e.nodes.length=0,e.rawNodes=void 0,e.ops=void 0,e.root=void 0,e.bases=void 0,e.stored=void 0,e.baseValue=void 0}function wd(e){e.tracker.deref()?.releaseContext(e),Yu?.context===e&&(Yu=void 0);for(let t of e.nodes)Array.isArray(t.target)&&(t.target.length=0),Reflect.deleteProperty(t.target,sl),t.writes?.clear(),t.deletes?.clear(),t.readded?.clear(),t.array?.pieces!==void 0&&(t.array.pieces.length=0),t.array!==void 0&&(t.array.root=void 0,t.array.baseLocations=void 0,t.array.insertLocations=void 0),t.array?.baseOverrides?.clear(),t.array?.insertOverrides?.clear(),t.parentSource=void 0,t.target=ll,t.proxy=ll,t.writeKey=void 0,t.writeValue=void 0,t.writes=void 0,t.deleteKey=void 0,t.deletes=void 0,t.readded=void 0,t.array=void 0,t.subtreeDirty=void 0,t.preparedPath=void 0;e.dirty.length=0,e.nodes.length=0,e.rawNodes=void 0,e.ops=void 0,e.root=void 0,e.bases=void 0,e.stored=void 0,e.baseValue=void 0,e.overlayReleased=!0}function Td(e){return typeof e==`object`&&!!e}var Ed=e=>typeof e==`object`&&!!e;function Dd(e,t,n,r=64,i=8){if(e.length===0||t.length===0||n===0)return 0;let a=e.length>n?e.slice(e.length-n):e;for(let e of[Math.min(r,t.length),1]){let n=t.slice(0,e),r=0;for(let e=a.indexOf(n);e!==-1&&!(++r>i);e=a.indexOf(n,e+1)){let n=a.length-e;if(n<=t.length&&a.slice(e)===t.slice(0,n))return n}if(e===1)break}return 0}function Od(e,t,n=e.length){return`${e.slice(t,n)} `.slice(0,-1)}var kd=new Set([`__proto__`,`constructor`,`prototype`]),Ad=class extends Error{segment;constructor(e){super(`unsafe path segment: ${String(e)}`),this.segment=e,this.name=`UnsafePathError`}};function jd(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);switch(e[0]){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length!==3)throw TypeError(`s arity`);Md(e[1],!0);return;case`d`:if(e.length!==2)throw TypeError(`d arity`);Md(e[1],!0);return;case`a`:if(e.length!==3||typeof e[2]!=`string`)throw TypeError(`a shape`);Md(e[1],!0);return;case`t`:if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t shape`);Md(e[1],!0);return;case`p`:if(e.length!==5)throw TypeError(`p arity`);if(Md(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`p index`);if(!Number.isInteger(e[3])||e[3]<0)throw TypeError(`p remove`);if(!Array.isArray(e[4]))throw TypeError(`p items`);return;case`m`:if(e.length!==3)throw TypeError(`m arity`);Md(e[1]),Nd(e[2]);return;default:throw TypeError(`unknown op verb: ${String(e[0])}`)}}function Md(e,t=!1){if(!Array.isArray(e))throw TypeError(`path is not an array`);if(t&&e.length===0)throw TypeError(`path is empty`);Fd(e)}function Nd(e){if(!Array.isArray(e))throw TypeError(`m permutation is not an array`);let t=new Uint8Array(e.length);for(let n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw TypeError(`m permutation is not a bijection`);t[n]=1}}function Pd(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);let[t]=e,n=e=>{if(typeof e==`number`){if(!Number.isInteger(e)||e<0)throw TypeError(`bad path id`)}else{if(!Array.isArray(e))throw TypeError(`path is not an array`);Fd(e)}};switch(t){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`s arity`);return;case`d`:if(e.length===2)n(e[1]);else if(e.length!==1)throw TypeError(`d arity`);return;case`a`:if(e.length===3){if(n(e[1]),typeof e[2]!=`string`)throw TypeError(`a value`)}else if(e.length===2){if(typeof e[1]!=`string`)throw TypeError(`a value`)}else throw TypeError(`a arity`);return;case`t`:if(e.length===3){if(n(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t count`)}else if(e.length===2){if(!Number.isInteger(e[1])||e[1]<0)throw TypeError(`t count`)}else throw TypeError(`t arity`);return;case`p`:{let[t,r,i]=e.length===5?[e[2],e[3],e[4]]:e.length===4?[e[1],e[2],e[3]]:[];if(i===void 0)throw TypeError(`p arity`);if(e.length===5&&n(e[1]),!Number.isInteger(t)||t<0)throw TypeError(`p index`);if(!Number.isInteger(r)||r<0)throw TypeError(`p remove`);if(!Array.isArray(i))throw TypeError(`p items`);return}case`m`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`m arity`);Nd(e[e.length-1]);return;case`#`:if(e.length!==3||!Number.isInteger(e[1])||e[1]<0||!Array.isArray(e[2]))throw TypeError(`# shape`);Fd(e[2]);return;default:throw TypeError(`unknown op verb: ${String(t)}`)}}function Fd(e){for(let t of e)if(typeof t==`string`){if(kd.has(t))throw new Ad(t)}else if(!Number.isInteger(t)||t<0)throw new Ad(t)}function Id(e,t){if(t>e.length)throw new Ad(t)}var Ld=class extends Error{path;constructor(e){super(`unresolvable path: ${JSON.stringify(e)}`),this.path=e,this.name=`PathError`}};function Rd(e,t){let n=e;for(let e of t){if(jd(e),e[0]===`r`){n=e[1];continue}let t=e[1];if(Fd(t),e[0]===`p`){let r=t.length===0?n:Wd(n,t);if(!Array.isArray(r))throw new Ld(t);r.splice(e[2],e[3]);let i=1e4;for(let t=0;t<e[4].length;t+=i)r.splice(e[2]+t,0,...e[4].slice(t,t+i));continue}if(e[0]===`m`){let r=t.length===0?n:Wd(n,t);if(!Array.isArray(r)||r.length!==e[2].length)throw new Ld(t);let i=r.slice();for(let t=0;t<e[2].length;t++)r[t]=i[e[2][t]];continue}let r=Wd(n,t.slice(0,-1)),i=t[t.length-1];if(Array.isArray(r)){if(typeof i!=`number`)throw new Ad(i);Id(r,i)}let a=e=>{Object.defineProperty(r,i,{value:e,writable:!0,enumerable:!0,configurable:!0})},o=()=>Object.hasOwn(r,i)?r[i]:void 0;switch(e[0]){case`s`:a(e[2]);break;case`d`:if(Array.isArray(r)){if(typeof i!=`number`||i>=r.length)throw new Ld(t);r.splice(i,1)}else delete r[i];break;case`a`:{let n=o();if(typeof n!=`string`)throw new Ld(t);a(`${n}${e[2]}`);break}case`t`:{let n=o();if(typeof n!=`string`)throw new Ld(t);a(n.slice(e[2]));break}}}return n}function zd(e,t){return Bd(e,[t])}function Bd(e,t){let n=e,r=new WeakSet;for(let e of t)for(let t of e)if(jd(t),t[0]===`r`)n=t[1];else{if(t[0]===`p`){let e=Vd(n,t,r);if(e!==void 0){n=e;continue}}n=Hd(n,t[0]===`p`||t[0]===`m`?t[1]:t[1].slice(0,-1),r),n=Rd(n,[t])}return n}function Vd(e,t,n){let[,r,i,a,o]=t;if(a!==0)return;let s=e;for(let e of r){if(!(typeof e==`string`?!kd.has(e)&&Ed(s)&&!Array.isArray(s):Number.isInteger(e)&&e>=0&&Array.isArray(s))||!Object.hasOwn(s,e))return;s=s[e]}if(!Array.isArray(s)||n.has(s)||i!==s.length)return;let c=s.concat(o);if(n.add(c),r.length===0)return c;let l=r.slice(0,-1),u=Hd(e,l,n);return Object.defineProperty(Wd(u,l),r[r.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),u}function Hd(e,t,n){let r=e=>{if(Array.isArray(e))return e.slice();if(!Ed(e))throw new Ld(t);return Object.getPrototypeOf(e)===null?Object.assign(Object.create(null),e):{...e}};if(!Ed(e))throw new Ld(t);let i;n.has(e)?i=e:(i=r(e),n.add(i));let a=i;for(let e of t){if(!Object.hasOwn(a,e))throw new Ld(t);if(Array.isArray(a)&&typeof e!=`number`)throw new Ad(e);let i=a[e];if(!Ed(i))throw new Ld(t);if(n.has(i)){a=i;continue}let o=r(i);Object.defineProperty(a,e,{value:o,writable:!0,enumerable:!0,configurable:!0}),n.add(o),a=o}return i}function Ud(e,t){let n=e;for(let e of t){if(!Ed(n))throw new Ld(t);if(Array.isArray(n)&&typeof e!=`number`)throw new Ad(e);if(!Object.hasOwn(n,e))throw new Ld(t);n=n[e]}return n}function Wd(e,t){let n=Ud(e,t);if(!Ed(n))throw new Ld(t);return n}var Gd=e=>JSON.stringify(e);function Kd(){let e=new Set,t=new Map,n=0,r;return{encode(i){r=void 0;let a=[];for(let o of i){if(o[0]===`r`){a.push(o),e.clear(),t.clear(),n=0,r=void 0;continue}let i=o[1],s=Gd(i);if(s===r){switch(o[0]){case`s`:a.push([`s`,o[2]]);break;case`d`:a.push([`d`]);break;case`a`:a.push([`a`,o[2]]);break;case`t`:a.push([`t`,o[2]]);break;case`p`:a.push([`p`,o[2],o[3],o[4]]);break;case`m`:a.push([`m`,o[2]])}continue}let c=i,l=t.get(s);if(l!==void 0)c=l;else if(e.has(s)){let e=n++;t.set(s,e),a.push([`#`,e,i]),c=e}else e.add(s);switch(o[0]){case`s`:a.push([`s`,c,o[2]]);break;case`d`:a.push([`d`,c]);break;case`a`:a.push([`a`,c,o[2]]);break;case`t`:a.push([`t`,c,o[2]]);break;case`p`:a.push([`p`,c,o[2],o[3],o[4]]);break;case`m`:a.push([`m`,c,o[2]])}r=s}return a}}}function qd(){let e=new Map;return{decode(t){let n,r=[];for(let i of t){if(Pd(i),i[0]===`#`){Fd(i[2]),e.set(i[1],i[2]);continue}if(i[0]===`r`){r.push(i),e.clear(),n=void 0;continue}let t=i[0]===`d`&&i.length===1||i[0]!==`d`&&i[0]!==`p`&&i.length===2||i[0]===`p`&&i.length===4,a;if(t){if(n===void 0)throw new Ld([]);a=n}else{let t=i[1];if(typeof t==`number`){let n=e.get(t);if(n===void 0)throw new Ld(t);a=n}else a=t;n=a}if(i[0]!==`p`&&i[0]!==`m`&&a.length===0)throw new Ld(a);switch(i[0]){case`s`:r.push([`s`,a,t?i[1]:i[2]]);break;case`d`:r.push([`d`,a]);break;case`a`:r.push([`a`,a,t?i[1]:i[2]]);break;case`t`:r.push([`t`,a,t?i[1]:i[2]]);break;case`p`:{let[e,n,o]=t?[i[1],i[2],i[3]]:[i[2],i[3],i[4]];r.push([`p`,a,e,n,o]);break}case`m`:r.push([`m`,a,t?i[1]:i[2]])}}return r}}}var Jd=[],Yd=0,Xd=!1;function Zd(e){Jd.push(e),$d()}function Qd(e){Yd++;try{return e()}finally{Yd--,$d()}}function $d(){if(!(Xd||Yd>0)){Xd=!0;try{for(let e=Jd.shift();e!==void 0;e=Jd.shift())e()}finally{Xd=!1}}}var ef=0,tf=class{#e=new Set;#t=new Set;#n;constructor(e){this.#n=e}subscribe(e,t){return this.#e.add(e),this.#r(e,t),()=>this.#e.delete(e)}events(e,t){return this.#t.add(e),this.#r(e,{type:`snap`,value:t}),()=>this.#t.delete(e)}emit(e){let t=[...this.#t],n=[...this.#e];Zd(()=>{for(let n of t)this.#t.has(n)&&this.#r(n,e);for(let t of n)this.#e.has(t)&&this.#r(t,e.value)})}#r(e,t){try{e(t)}catch(e){this.#n(e)}}},nf=Symbol(`chord.hydration`);function rf(e){if(typeof e==`object`&&e)return e[nf]}var af=e=>[...e].map(rf).filter(e=>e?.hydrated===!1),of=class{key;seq=++ef;dependents=new Set;schemas=[];options;fanout;constructor(e,t){this.key=e,this.options=t,this.fanout=new tf(t.report)}subscribe(e){return this.fanout.subscribe(e,this.value)}events(e){return this.fanout.events(e,this.value)}validate(e){if(this.options.dev){for(let t of this.ownSchemas())Ms(`state`,`state ${this.key}`,t,e);for(let t of this.schemas)Ms(`state`,`state ${this.key}`,t,e)}}ownSchemas(){return[]}};function sf(e,t){let n=[];for(let r of e){if(r[0]===`r`||r[1].length===0)return[[`r`,t]];let e=r[1].slice(1);switch(r[0]){case`p`:n.push([`p`,e,r[2],r[3],r[4]]);break;case`m`:n.push([`m`,e,r[2]]);break;default:if(e.length===0)return[[`r`,t]];r[0]===`d`?n.push([`d`,e]):n.push([r[0],e,r[2]])}}return n}var cf=class extends of{schema;#e;#t;#n;constructor(e,t,n,r,i){super(e,i),n!==void 0&&Ms(`state`,`initial value of state ${e}`,t,n.value),this.schema=t,this.#e=vl({v:n?.value??null}),this.#t=r,this.#n=n!==void 0}initialize(e){if(this.#n)throw Error(`state ${this.key} is already initialized`);Ms(`state`,`initial value of state ${this.key}`,this.schema,e),this.#e=vl({v:e}),this.#n=!0}ownSchemas(){return[this.schema]}get value(){if(!this.#n)throw mf(`state ${this.key} (its init has not run)`);return this.#e.value.v}change(e,t){if(this.#t(e),!this.#n)throw mf(`state ${this.key} (its init has not run)`);let n=this.#e.beginChange(),r;try{let e=n.state,i=t(e.v);if(i instanceof Promise)throw TypeError(`cell.change callbacks must be synchronous`);i!==void 0&&(i!==e.v&&Ms(`state`,`state ${this.key}`,this.schema,i),e.v=i),r=n.prepare()}catch(e){throw n.abort(),e}this.#r(r,`ops`)}replace(e,t,n={}){if(this.#t(e),!this.#n)throw mf(`state ${this.key} (its init has not run)`);let r=this.value,i=n.diff??lf(r,t)?qc(r,t):void 0;this.#r(this.#e.prepareReplace({v:t}),`ops`,!0,i)}reset(e,t){this.schema=t,this.#r(this.#e.prepareReplace({v:e}),`reset`,!1)}#r(e,t,n=!0,r){if(e.ops.length===0&&t===`ops`){this.#e.adopt(e);return}let i=e.value.v,a;try{n&&this.validate(i),a=uf(this,i,n)}catch(t){throw e.abort(),t}Qd(()=>{this.#e.adopt(e);let n=r!==void 0&&r.length>0?r:sf(e.ops,i);this.fanout.emit(t===`reset`?{type:t,value:i}:{type:t,ops:n,value:i});for(let[e,t]of a)e.install(t)})}};function lf(e,t){if(e===null||t===null||typeof e!=`object`||typeof t!=`object`||e===t||Array.isArray(e)!==Array.isArray(t))return!1;for(let[n,r]of Object.entries(t))if(typeof r==`object`&&r&&e[n]===r)return!0;return!1}function uf(e,t,n=!0){let r=new Set,i=e=>{for(let t of e.dependents)r.has(t)||(r.add(t),i(t))};i(e);let a=new Map([[e,t]]),o=new Map;for(let e of[...r].sort((e,t)=>e.seq-t.seq)){let t=e.compute(e=>a.has(e)?a.get(e):e.value);n&&e.validate(t),a.set(e,t),o.set(e,t)}return o}var df=e=>typeof e==`object`&&!!e&&typeof e.subscribe==`function`&&`value`in e,ff=class extends of{sources;#e;#t;#n=[];constructor(e,t,n,r){super(e,r),this.sources=t.map(t=>{if(!df(t))throw TypeError(`derive ${e}: sources must be readables`);return t}),this.#e=n,this.#t=void 0}get value(){return this.#t}get[nf](){let e=af(this.sources);if(e.length!==0)return{hydrated:!1,whenHydrated:()=>Promise.all(e.map(e=>e.whenHydrated())).then(()=>{})}}attach(e){this.#t=e?.has(this)?e.get(this):this.compute(e=>e.value);for(let e of this.sources)e instanceof of?e.dependents.add(this):this.#n.push(e.subscribe(()=>this.refresh()))}detach(){for(let e of this.sources)e instanceof of&&e.dependents.delete(this);for(let e of this.#n.splice(0))e()}compute(e){let t=this.#e(...this.sources.map(e));if(t instanceof Promise)throw TypeError(`derive ${this.key}: fn must be synchronous`);return t}refresh(){try{let e=this.compute(e=>e.value),t=uf(this,e);Qd(()=>{this.install(e);for(let[e,n]of t)e.install(n)})}catch(e){this.options.report(e)}}install(e){let t=this.#t;this.#t=e;let n=t===void 0||e===void 0?[[`r`,e??null]]:qc(t,e);n.length>0&&this.fanout.emit({type:`ops`,ops:n,value:e})}},pf=e=>e instanceof of,mf=e=>new P(`not_ready`,`${e} is not ready`),hf=()=>{},gf=(e,t,n,r)=>(vf(e,n),{contract:e,factory:t,options:n,facet:r}),_f=e=>e.options.lifetime===`host`;function vf(e,t){let n=t.lifetime??`referenced`;if(n!==`referenced`&&n!==`host`)throw TypeError(`${e.name}: unknown lifetime ${String(n)}`);if(n===`host`){if(e.scope!==`local`)throw TypeError(`${e.name}: lifetime "host" needs a local type (remote types are referenced)`);if(t.linger!==void 0)throw TypeError(`${e.name}: an object of lifetime "host" does not linger (it lives as long as the host)`);try{Ns(e.input,{},`${e.name} input`)}catch{throw TypeError(`${e.name}: lifetime "host" needs an input that accepts {} (the object's one address)`)}}}var yf=class{resource;constructor(e){this.resource=e}},bf=class{key;spec;deps;state=`closed`;#e;constructor(e,t,n){this.key=e,this.spec=t,this.deps=n}get value(){if(this.state===`unavailable`)throw new P(`unavailable`,`resource ${this.key} could not be restored`);if(this.state!==`open`)throw mf(`resource ${this.key}`);return this.#e}get exclusive(){return this.spec.exclusive===!0}async open(e,t){if(this.state!==`closed`)return;this.state=`opening`;let n;try{n=await this.spec.open({signal:e})}catch(e){throw this.state=`closed`,e}if(e.aborted)throw this.state=`closed`,await this.spec.close?.(n),new P(`aborted`,`resource ${this.key} opened after abort`);this.#e=n,this.state=`open`,t.push(this)}async close(e){if(this.state!==`open`)return;this.state=`closed`;let t=e.indexOf(this);t!==-1&&e.splice(t,1);let n=this.#e;this.#e=void 0,await this.spec.close?.(n)}markUnavailable(){this.state=`unavailable`,this.#e=void 0}adopt(e){this.spec=e}},xf=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,Sf.set(this,e)}get key(){return this.#e.key}get value(){if(this.#t.inFactory>0)throw mf(`resource ${this.key} (inside a factory)`);return this.#e.value}},Sf=new WeakMap,Cf=e=>e instanceof bf?e:typeof e==`object`&&e?Sf.get(e):void 0,wf=class{cells=new Map;cellSchemas=new Map;cellVersions=new Map;cellMigrations=new Map;refs=new Map;resources=new Map;adopted=new Map;listeners=new Map;tasks=new Map;derives=new Map;registrations=new Map},Tf=e=>typeof e==`object`&&!!e&&typeof e.init==`function`,Ef=class e{host;signal;rootId;codeVersion;principal;holder;#e=[];#t;#n=new AbortController;#r=!1;get closed(){return this.#r}check(e){if(this.host!==e)throw Ss(`foreign_ctx`,`ctx belongs to another host`);if(this.#r)throw new P(`aborted`,`ctx expired: its call already settled`,{reason:`expired`});if(this.signal.aborted){let e=this.signal.reason;throw e instanceof P&&e.code===`superseded`?new P(`superseded`,e.message,{cause:e}):new P(`aborted`,`ctx aborted`,{cause:e})}}constructor(e,t){this.host=e;let n=Df(t.signals);this.signal=n.signal,this.#t=n.release,this.rootId=t.rootId,this.codeVersion=t.codeVersion,this.principal=t.principal,this.holder=t.holder??!1}async get(e,t,n){this.check(this.host);let r=this.host.acquire(e,t,{principal:this.principal,...n},`call`);return this.#e.push(r),await Of(r,[this.signal,this.#n.signal],this.host.readyTimeout),r.proxy}child(t){return new e(this.host,{signals:[this.signal,t.callAbort.signal],rootId:this.rootId,codeVersion:this.codeVersion,principal:this.host.principal})}close(){this.#r=!0,this.#n.abort(new P(`aborted`,`ctx expired: its call already settled`,{reason:`expired`})),this.#t();for(let e of this.#e.splice(0))e.release()}};function Df(e){let t=new AbortController,n=[],r=()=>{for(let e of n.splice(0))e()};for(let i of e){if(i.aborted){r(),t.abort(i.reason);break}let e=()=>{r(),t.abort(i.reason)};i.addEventListener(`abort`,e,{once:!0}),n.push(()=>i.removeEventListener(`abort`,e))}return{signal:t.signal,release:r}}async function Of(e,t,n){let r=new AbortController,i=Number.isFinite(n)?setTimeout(()=>r.abort(new P(`unavailable`,`${e.address} was not ready after ${n} ms`,{reason:`ready_timeout`})),n):void 0;i?.unref?.();let a=Df([...t,r.signal]);try{await kf(e.ready,a.signal)}catch(t){e.release();let n=a.signal.reason;throw n instanceof P&&n.reason===`ready_timeout`?n:t}finally{clearTimeout(i),a.release()}}async function kf(e,t){if(t.aborted)throw new P(`aborted`,`call aborted`,{cause:t.reason});let n=hf,r=new Promise((e,r)=>{n=()=>r(new P(`aborted`,`call aborted`,{cause:t.reason})),t.addEventListener(`abort`,n,{once:!0})});try{return await Promise.race([e,r])}finally{t.removeEventListener(`abort`,n)}}var Af=new Set([`contract`,`status`,`ready`,`variant`,`shape`,`error`,`onShape`,`onStatus`,`release`]);function jf(e,t,n,r){if(e.size===0)return;let i=[...e];Zd(()=>{for(let e of i)try{e(t,n)}catch(e){r(e)}})}var Mf=new WeakMap,Nf=e=>typeof e==`object`&&e?Mf.get(e):void 0,Pf=class{#e;#t;#n=new Set;#r=new Set;#i=new Set;#a;#o=hf;#s;constructor(e,t){this.#e=e,this.#t=t}get value(){let e=this.#e;if(e.status===`released`||e.status===`gone`)throw e.terminalError();if(e.status!==`live`)throw mf(`${e.address}.${this.#t}`);let t=e.currentView();if(t===void 0)throw mf(`${e.address}.${this.#t}`);let n=this.#c();if(n===void 0)throw new P(`not_in_variant`,`${e.address}: ${this.#t} is not a state member of variant ${If(t)??`(local)`}`);return n.value}get[nf](){let e=this.#e;return e.status===`live`?rf(this.#c()):{hydrated:!1,whenHydrated:async()=>{await e.ready,await rf(this.#c())?.whenHydrated()}}}subscribe(e){this.#n.add(e);let t=this.#l();return t!==void 0&&(this.#s={value:t.value},this.#d(()=>e(t.value))),this.bind(),()=>this.#u(this.#n,e)}events(e){this.#r.add(e);let t=this.#l();if(t!==void 0){let n=t.value;this.#s={value:n},this.#d(()=>e({type:`snap`,value:n}))}else this.#i.add(e);return this.bind(),()=>{this.#i.delete(e),this.#u(this.#r,e)}}bind(){let e=this.#n.size+this.#r.size>0?this.#c():void 0;if(e===this.#a||(this.#o(),this.#o=hf,this.#a=e,e===void 0))return;let t=!0;this.#o=e.events(e=>{let n=t;if(t=!1,n&&this.#i.size===0&&this.#s!==void 0&&e.value===this.#s.value)return;this.#s={value:e.value};let r=n?{type:`reset`,value:e.value}:e,i=[...this.#r],a=[...this.#n],o=new Set(this.#i);this.#i.clear(),Zd(()=>{for(let t of i){if(!this.#r.has(t))continue;let n=o.has(t)?{type:`snap`,value:e.value}:r;this.#d(()=>t(n))}for(let t of a)this.#n.has(t)&&this.#d(()=>t(e.value))})})}stop(){this.#n.clear(),this.#r.clear(),this.#i.clear(),this.bind()}#c(){let e=this.#e.currentView();if(e===void 0||!this.#e.inVariant(e,this.#t))return;let t=e[this.#t];return pf(t)||zf(t)?t:void 0}#l(){let e=this.#c();return e===void 0||rf(e)?.hydrated===!1?void 0:e}#u(e,t){e.delete(t),this.bind()}#d(e){try{e()}catch(e){this.#e.object.host.report(e)}}},Ff=class{object;contract;owner;address;proxy;ready;status;error;shapeListeners=new Set;goneListeners=new Set;readables=new Map;bindings=new WeakMap;views=new WeakMap;callers=new Map;constructor(e,t,n){this.object=e,this.contract=t,this.owner=n,this.address=e.address,this.status=e.status===`live`?`live`:`loading`,this.ready=e.ready.then(()=>{if(this.status===`gone`)throw this.error;if(this.status===`released`)throw new P(`released`,`reference ${this.address} released`)}),this.ready.catch(hf),this.proxy=new Proxy(this,{get:(e,t)=>{if(Af.has(t)){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}if(typeof t==`string`&&t!==`then`)return e.member(t)},has:(e,t)=>Af.has(t)||e.member(String(t))!==void 0}),Mf.set(this.proxy,this)}get variant(){let e=this.currentView();return e===void 0?void 0:If(e)}get shape(){let e=this.status===`live`?this.object.currentInstalled():void 0,t=e===void 0?void 0:this.#n(e);if(e!==void 0&&t!==void 0)return{variant:If(t),members:Object.keys(t).filter(e=>e!==`variant`),contract:e.service.contract.fingerprint}}onShape(e){return this.shapeListeners.add(e),()=>this.shapeListeners.delete(e)}onStatus(e){return this.#e.add(e),()=>this.#e.delete(e)}#e=new Set;#t(){jf(this.#e,this.status,this.error,e=>this.object.host.report(e))}release(){this.status!==`released`&&this.status!==`gone`&&(this.status=`released`,this.#r(),this.#t(),this.object.release(this))}live(){this.status===`loading`&&(this.status=`live`,this.#t(),this.shapeChanged())}gone(e){if(this.status!==`released`&&this.status!==`gone`){this.status=`gone`,this.error=e,this.#r(),this.#t();for(let t of[...this.goneListeners])t(e)}}shapeChanged(){for(let e of this.readables.values())e.bind();let e=this.shape;if(e===void 0)return;let t=[...this.shapeListeners];Zd(()=>{for(let n of t)try{n(e)}catch(e){this.object.host.report(e)}})}terminalError(){return this.status===`gone`?this.error:new P(`released`,`reference ${this.address} released`)}viewOf(e){let t=this.bindings.get(e.service);if(this.bindings.has(e.service)||(t=yc(e.service.contract,e.service.options.accepts,this.contract),this.bindings.set(e.service,t)),t===void 0)return e.implementation;let n=this.views.get(e.implementation);return n===void 0&&(n=t(e.implementation),this.views.set(e.implementation,n)),n}currentView(){if(this.status!==`live`)return;let e=this.object.currentInstalled();return e===void 0?void 0:this.#n(e)}#n(e){try{return this.viewOf(e)}catch(e){this.object.host.report(e);return}}describe(e,t){let n=this.contract.description.variants;if(e!==void 0)return n[e]?.[t];for(let e of Object.values(n))if(e[t]!==void 0)return e[t]}inVariant(e,t){return this.contract.scope!==`remote`||this.describe(If(e),t)!==void 0}member(e){let t=this.describe(void 0,e),n=this.currentView(),r=n?.[e];if(t?.kind===`method`||t===void 0&&typeof r==`function`)return this.caller(e);if(t?.kind===`state`||t===void 0&&(pf(r)||zf(r))){let t=this.readables.get(e);return t===void 0&&(t=new Pf(this,e),this.readables.set(e,t)),t}if(n!==void 0&&this.inVariant(n,e))return r instanceof yf?r.resource.value:r}caller(e){let t=this.callers.get(e);if(t===void 0){let n=bc(this.contract,e);t=(...t)=>{let[r,i]=n?[void 0,t[0]]:t;if(this.object.host.inFactory>0)throw new P(`not_ready`,`${this.address}.${e} called inside a factory`);if(i!==void 0&&!(i instanceof Ef))return Promise.reject(Ss(`foreign_ctx`,`ctx must come from a Chord host`));if(i===void 0||i.holder){try{i?.check(this.object.host)}catch(e){return Promise.reject(e)}return this.object.host.root(t=>this.object.call(this,e,r,t),{signal:i?.signal})}return this.object.call(this,e,r,i)},this.callers.set(e,t)}return t}#r(){for(let e of this.readables.values())e.stop()}},If=e=>typeof e.variant==`string`?e.variant:void 0,Lf=(e,t)=>e===t||e!==void 0&&t!==void 0&&String(e)===String(t),Rf=class{host;address;typeName;input;principal;hostLifetime;status=`activating`;ready=Promise.resolve();service;minCodeVersion=0;decls=new wf;pending=new Set;implementations=new Map;refs=new Set;leases=new Map;openOrder=[];callAbort=new AbortController;activationAbort=new AbortController;gate;deferredRuntime=!1;#e=new Map;#t=new Set;#n=new Map;#r=new Set;#i=0;#a;#o;constructor(e,t){this.host=e,this.address=t.address,this.typeName=t.typeName,this.input=t.input,this.principal=t.principal,this.hostLifetime=t.hostLifetime}start(e){this.ready=this.#s(e).then(()=>{for(let e of this.refs)e.live();this.#p()},e=>{this.status===`activating`&&(this.status=`failed`),this.host.forget(this);let t=Cs(e,`activating ${this.address}`);for(let e of this.refs)e.gone(t);throw t}),this.ready.catch(hf)}async#s(e){await e?.catch(hf);let t=this.activationAbort.signal,n=()=>new P(`aborted`,`${this.address} abandoned`);if(t.aborted)throw n();let r=this.host.service(this.typeName);if(r===void 0)throw new P(`unavailable`,`${this.typeName} is not served`,{reason:`unknown_type`});this.service=r;let i=this.run(r,void 0);try{if(await this.open(i.created.resources,i.created.refs,t),t.aborted||(await this.waitHydrated(i),t.aborted)||(await this.initCells(i,t),t.aborted))throw n();this.host.checkRegistrations(this,i.decls),this.decls=i.decls;for(let[e,t]of this.host.retainedCodeVersions())t.get(this.typeName)===r&&this.implementations.set(e,{codeVersion:e,service:r,implementation:i.implementation,decls:i.decls});let e=this.host.pendingCodeVersion();if(!this.implementations.has(this.host.currentCodeVersion())&&(e===void 0||!this.implementations.has(e)))throw new P(`superseded`,`${this.address}: code changed during activation`);for(let e of i.created.derives)e.attach();if(this.refreshSchemas(),this.deferredRuntime=!this.implementations.has(this.host.currentCodeVersion()),this.deferredRuntime||(i.decls.registrations.size>0&&this.host.registriesChanged(this),this.startRuntime()),t.aborted)throw n();this.status=`live`}catch(e){this.callAbort.abort(e),this.stopListeners(),this.stopTasks();let t=this.decls.registrations.size>0&&!this.deferredRuntime;throw this.implementations.clear(),this.decls=new wf,t&&this.host.registriesChanged(),await Promise.allSettled([...this.#t,...this.#r]),await this.unwind(i).catch(e=>this.host.report(e)),e}finally{this.pending.delete(i.decls)}}run(e,t){let n=new Hf(this,t),r=e=>{this.pending.delete(e.decls),this.unwind(e).catch(e=>this.host.report(e))};this.pending.add(n.run(void 0).decls),this.host.inFactory++;let i;try{i=e.factory(this.input,this.principal,n)}catch(e){throw this.host.inFactory--,r(n.run(void 0)),e}this.host.inFactory--;let a=n.run(i);try{if(i instanceof Promise)throw Ss(`implementation`,`${this.typeName}: factories must be synchronous`);Vf(e,a.implementation)}catch(e){throw r(a),e}return a}async open(e,t,n){let r=new Map,i=t=>{let a=r.get(t);return a===void 0&&(a=(async()=>{await Promise.all(t.deps.map(t=>t instanceof bf?e.includes(t)?i(t):void 0:t.ready)),await t.open(n,this.openOrder)})(),r.set(t,a)),a},a=this.withinReadyTimeout(Promise.all(t.map(e=>e.ready)),()=>t.filter(e=>e.status===`loading`).map(e=>e.address)),o=(await Promise.allSettled([...e.map(i),a])).find(e=>e.status===`rejected`);if(o!==void 0)throw o.reason}async waitHydrated(e){let t=Object.entries(e.implementation??{}),n=af([...e.created.derives,...t.map(([,e])=>e)]);n.length!==0&&await this.withinReadyTimeout(Promise.all(n.map(e=>e.whenHydrated())),()=>[...t.filter(([,e])=>rf(e)?.hydrated===!1).map(([e])=>`${this.address}.${e}`),...e.created.derives.filter(e=>rf(e)!==void 0).map(e=>`derive ${e.key}`)])}async withinReadyTimeout(e,t){let n=this.host.readyTimeout;if(!Number.isFinite(n))return e;let r,i=new Promise((e,i)=>{r=setTimeout(()=>{let e=t();i(new P(`unavailable`,`${this.address} was not ready after ${n} ms${e.length===0?``:`, waiting on ${e.join(`, `)}`} (a reference cycle across hosts?)`,{reason:`ready_timeout`}))},n),r.unref?.()});i.catch(hf);try{return await Promise.race([e,i])}finally{clearTimeout(r)}}async initCells(e,t){if(e.created.inits.length===0)return;let n=(await Promise.allSettled(e.created.inits.map(async([e,n])=>{let r=await this.host.root(e=>n(e),{signal:t});t.aborted||e.initialize(r)}))).find(e=>e.status===`rejected`);if(n!==void 0)throw n.reason}async unwind(e){for(let t of e.created.derives)t.detach();await ws([...[...e.created.resources].sort((e,t)=>this.openOrder.indexOf(t)-this.openOrder.indexOf(e)).map(e=>()=>e.close(this.openOrder)),...e.created.refs.map(e=>()=>e.release())],`${this.address}: cleanup failed`)}currentInstalled(){return this.implementations.get(this.host.currentCodeVersion())??[...this.implementations.values()].at(-1)}refreshSchemas(){let e=new Map;for(let t of this.implementations.values())for(let[n,r]of Bf(t.service,t.implementation))e.set(n,[...e.get(n)??[],...r]);for(let t of this.allDecls())for(let n of[...t.cells.values(),...t.derives.values()])n.schemas=e.get(n)??[]}allDecls(){let e=new Set([this.decls,...this.pending]);for(let t of this.implementations.values())e.add(t.decls);return e}#c(e){return Cf(e.source)??e.source}#l(e,t){let n=Cf(t.source),r=n===void 0?t.source:n.value,i=t.select===void 0?r:t.select(r);if(typeof i?.subscribe!=`function`)throw Ss(`implementation`,`listener ${e}: source has no subscribe()`);return i}stageListeners(e){let t=new Map,n=new Set;try{for(let[r,i]of e.listeners){let e=this.#c(i),a=this.#e.get(r);if(a!==void 0&&a.origin===e&&Lf(a.select,i.select)){n.add(r);continue}let o=this.#l(r,i),s={origin:e,select:i.select,unsubscribe:hf,buffer:[]};t.set(r,s),pf(o)||zf(o)?(s.buffer=void 0,s.subscribe=()=>{s.unsubscribe=o.subscribe(e=>this.#d(r,e))}):s.unsubscribe=o.subscribe(e=>{s.buffer===void 0?this.#d(r,e):s.buffer.push(e)})}}catch(e){for(let e of t.values())e.unsubscribe();throw e}return{activate:()=>{for(let[e,t]of this.#e)n.has(e)||(t.unsubscribe(),this.#e.delete(e));for(let[e,n]of t){this.#e.set(e,n),n.subscribe?.();let t=n.buffer??[];n.buffer=void 0;for(let n of t)this.#d(e,n)}},discard:()=>{for(let e of t.values())e.unsubscribe()}}}startRuntime(){this.stageListeners(this.decls).activate(),this.startTasks()}startTasks(){let e=++this.#i,t=()=>{for(let e of this.decls.tasks.keys())this.#u(e,this.host.currentCodeVersion())};if(this.#r.size===0){t();return}let n=this.host.taskStopDeadline,r,i=new Promise(e=>{r=setTimeout(()=>e(!0),n)}),a=Promise.allSettled([...this.#r]).then(()=>!1);Promise.race([a,i]).then(i=>{clearTimeout(r),e===this.#i&&this.status===`live`&&(i&&this.host.report(new P(`aborted`,`${this.address}: aborted tasks still running after ${n} ms; starting their replacements anyway`)),t())})}stopListeners(){for(let e of this.#e.values())e.unsubscribe();this.#e.clear()}#u(e,t){let n=this.decls.tasks.get(e);if(n===void 0)return;let r=new AbortController,i=new Ef(this.host,{signals:[r.signal,this.callAbort.signal],rootId:`task:${this.address}:${e}`,codeVersion:t,principal:this.host.principal,holder:!0}),a=(async()=>{try{await n(i)}catch(e){i.signal.aborted||this.host.report(e)}finally{i.close(),this.#n.get(e)?.controller===r&&this.#n.delete(e)}})();this.#n.set(e,{controller:r,done:a})}stopTasks(){this.#i++;for(let e of this.#n.values()){e.controller.abort(new P(`aborted`,`task stopped`));let t=e.done;this.#r.add(t),t.finally(()=>this.#r.delete(t))}this.#n.clear()}#d(e,t){Zd(()=>{if(this.gate!==void 0){this.gate.queue.push({key:e,event:t});return}let n=this.decls.listeners.get(e);n===void 0||this.status!==`live`&&this.status!==`activating`||this.host.root(e=>{this.lease(e);let r=e.child(this);return this.#f(async()=>{try{await n.fn(t,r)}finally{r.close()}})}).catch(e=>this.host.report(e))})}openGate(){let e=this.gate;this.gate=void 0;for(let{key:t,event:n}of e?.queue??[])this.#d(t,n)}admit(e){if(this.host.failed!==void 0)throw new P(`unavailable`,`${this.host.name} failed and admits no work`,{reason:`host_failed`});if(!this.host.hasCodeVersion(e.codeVersion))throw new P(`superseded`,`code version ${e.codeVersion} is retired`);if(e.codeVersion<this.minCodeVersion)throw new P(`upgrade_conflict`,`${this.address} was upgraded in code version ${this.minCodeVersion}`);if(this.gate!==void 0&&!this.gate.grandfathered.has(e.rootId))throw new P(`upgrade_conflict`,`${this.address} is being upgraded`)}lease(e){this.leases.has(e.rootId)||(this.leases.set(e.rootId,e.codeVersion),this.host.touch(e.rootId,this))}guard=e=>{if(this.host.inFactory>0)throw Ss(`read_only`,`cells cannot be written while a factory runs`);if(e instanceof Ef&&e.check(this.host),e.signal.aborted)throw new P(`aborted`,`write with an aborted ctx`);if(this.status===`disposed`)throw new P(`gone`,`${this.address} is disposed`);e.rootId.startsWith(`task:`)||this.admit(e)};async call(e,t,n,r){if(r.check(this.host),e.status===`released`||e.status===`gone`)throw e.terminalError();if(e.status===`loading`&&await kf(e.ready,r.signal),e.status!==`live`||this.status!==`live`)throw e.status===`live`?new P(`gone`,`${this.address} is ${this.status}`):e.terminalError();this.admit(r);let i=this.implementations.get(r.codeVersion);if(i===void 0)throw new P(`superseded`,`${this.address} has no implementation for code version ${r.codeVersion}`);let a=e.viewOf(i),o=If(a),s=e.describe(e.contract.scope===`remote`?o:``,t),c=a[t];if(typeof c!=`function`||e.contract.scope===`remote`&&s?.kind!==`method`)throw new P(`not_in_variant`,`${this.address}: ${t} is not a method of variant ${o??`(local)`}`);let l=a===i.implementation?i.service.contract.description.variants[o??``]?.[t]:s,u=l?.kind===`method`?l:void 0,d=e.contract.scope===`remote`?u:void 0,f=u===void 0||u.args!==void 0,p=u===void 0||u.result!==void 0,m;if(f){let r=e.contract.scope===`remote`&&s?.kind===`method`?s.args:void 0,i=r===void 0?n:Ps(r,n);m=d?.args?Ps(d.args,i):i,d?.args&&Ms(`args`,`${this.address}.${t} args`,d.args,m)}this.lease(r);let h=r.child(this),g;try{g=await this.#f(()=>f?c(m,h):c(h))}finally{h.close()}if(p)return d?.result&&Ms(`result`,`${this.address}.${t} result`,d.result,g),g}#f(e){let t=(async()=>e())();this.#t.add(t);let n=()=>{this.#t.delete(t),this.#t.size===0&&this.#p()};return t.then(n,n),t}rootEnded(e){this.leases.delete(e);let t=this.gate;t?.grandfathered.delete(e)&&t.grandfathered.size===0&&t.drained()}addRef(e){this.refs.add(e),this.#a!==void 0&&clearTimeout(this.#a),this.#a=void 0}release(e){this.refs.delete(e)&&this.#p()}#p(){if(this.refs.size>0||this.#t.size>0||this.#a!==void 0)return;if(this.status===`activating`){this.#m(this.dispose(!1));return}if(this.status!==`live`)return;let e=this.service?.options.linger??0;e<=0?this.#m(this.dispose(!1)):(this.#a=setTimeout(()=>{this.#a=void 0,this.refs.size===0&&this.#t.size===0&&this.status===`live`&&this.#m(this.dispose(!1))},e),this.#a.unref?.())}#m(e){e.catch(e=>this.host.report(e))}dispose(e,t){return this.#o??=this.#h(e,t),this.#o}async#h(e,t){let n=this.status===`activating`;this.status=`disposing`,this.host.forget(this),this.#a!==void 0&&clearTimeout(this.#a),this.#a=void 0;let r=t??new P(`gone`,`${this.address} was disposed`);if(e){for(let e of this.refs)e.gone(r);this.callAbort.abort(r)}this.activationAbort.abort(r),n&&await this.ready.catch(hf);for(let e of this.refs)e.gone(r);let i=this.allDecls();this.stopTasks(),this.stopListeners(),await Promise.allSettled([...this.#t]);let a=[...i].some(e=>e.registrations.size>0)&&!this.deferredRuntime;this.implementations.clear(),this.decls=new wf,a&&this.host.registriesChanged();let o=new Set;for(let e of i){for(let t of e.derives.values())t.detach();for(let t of e.refs.values())o.add(t)}try{await ws([()=>Promise.allSettled([...this.#r]),...[...this.openOrder].reverse().map(e=>()=>e.close(this.openOrder)),...[...o].map(e=>()=>e.release())],`${this.address}: disposal failed`)}finally{this.status=`disposed`,this.host.disposed(this)}}},zf=e=>typeof e==`object`&&!!e&&typeof e.events==`function`&&typeof e.subscribe==`function`;function Bf(e,t){let n=new Map,r=e.contract;if(r.scope!==`remote`)return n;let i=r.description.variants[If(t)??``]??{};for(let[e,r]of Object.entries(i)){let i=t[e];r.kind===`state`&&pf(i)&&n.set(i,[...n.get(i)??[],r.schema])}return n}function Vf(e,t){let n=e.contract,r=e=>{throw Ss(`implementation`,`${n.name}: ${e}`)};(typeof t!=`object`||!t)&&r(`factory must return an object`);let i;if(n.scope===`remote`){let e=t.variant;(typeof e!=`string`||n.description.variants[e]===void 0)&&r(`unknown variant ${String(e)}`),i=n.description.variants[e];for(let n of Object.keys(t))n!==`variant`&&i[n]===void 0&&r(`${n} is not in variant ${String(e)}`)}else i=n.description.variants[``]??{};for(let[e,n]of Object.entries(i)){let i=t[e];n.kind===`method`&&typeof i!=`function`&&r(`${e} must be a method`),n.kind===`state`&&!pf(i)&&!zf(i)&&r(`${e} must be a cell, a derivation or a held object's state member`),n.kind===`opaque`&&i===void 0&&r(`${e} is missing`)}}var Hf=class{#e;#t;#n=new wf;#r={refs:[],resources:[],derives:[],inits:[]};constructor(e,t){this.#e=e,this.#t=t}run(e){return{implementation:e,decls:this.#n,created:this.#r}}#i(e,t,n){if(typeof n!=`string`||n===``)throw TypeError(`${t} needs a name`);if(e.has(n))throw Ss(`duplicate`,`${this.#e.typeName}: duplicate ${t} name ${n}`)}state(e,t,n,r={}){this.#i(this.#n.cells,`state`,e);let i=r.version??1;if(!Number.isInteger(i)||i<1)throw TypeError(`state ${e}: version must be a positive integer`);let a=this.#e.host,o=Tf(n)?n.init:void 0,s=this.#t?.cells.get(e);return s===void 0&&(s=new cf(e,t,o===void 0?{value:n}:void 0,this.#e.guard,{dev:a.dev,report:e=>a.report(e)}),o!==void 0&&this.#r.inits.push([s,o])),this.#n.cells.set(e,s),this.#n.cellSchemas.set(e,t),this.#n.cellVersions.set(e,i),r.migrate!==void 0&&this.#n.cellMigrations.set(e,r.migrate),s}get(e,t,n){let r=this.#e.host,i=this.#t!==void 0,a=r.addressOf(e,t,n?.principal??r.principal,i),o=this.#n.refs.get(a);if(o!==void 0){if(o.contract.fingerprint!==e.fingerprint)throw Ss(`duplicate`,`${this.#e.typeName}: ${e.name} held twice with different contracts`);return o.proxy}let s=this.#t?.refs.get(a);if(s!==void 0&&s.contract.fingerprint===e.fingerprint&&s.status!==`gone`&&s.status!==`released`)return this.#n.refs.set(a,s),s.proxy;let c=r.acquire(e,t,n,`object`,this.#e,i);return this.#n.refs.set(a,c),this.#r.refs.push(c),c.proxy}resource(e,t){if(this.#i(this.#n.resources,`resource`,e),!Number.isInteger(t.version))throw TypeError(`resource ${e}: version must be an integer`);let n=(t.deps??[]).map(t=>{let n=Nf(t)??Cf(t);if(n===void 0)throw TypeError(`resource ${e}: deps must be references or resources of this object`);return n}),r=this.#t?.resources.get(e),i=r!==void 0&&r.spec.version===t.version&&r.exclusive===(t.exclusive===!0)&&r.deps.length===n.length&&r.deps.every((e,t)=>e===n[t]),a=i?r:new bf(e,t,n);return i?this.#n.adopted.set(r,t):this.#r.resources.push(a),this.#n.resources.set(e,a),new xf(a,this.#e.host)}on(e,t,...n){this.#i(this.#n.listeners,`listener`,e);let[r,i]=n.length===1?[void 0,n[0]]:[n[0],n[1]];if(typeof i!=`function`)throw TypeError(`listener ${e}: the handler must be a function`);if(r!==void 0&&typeof r!=`function`)throw TypeError(`listener ${e}: select must be a function`);this.#n.listeners.set(e,{source:t,select:r,fn:i})}task(e){if(typeof e!=`function`)throw TypeError(`a task must be a function`);this.#n.tasks.set(`#${this.#n.tasks.size}`,e)}derive(e,t){if(typeof t!=`function`)throw TypeError(`a derivation needs a function`);let n=this.#e.host,r=`#${this.#n.derives.size}`,i=new ff(r,e,t,{dev:n.dev,report:e=>n.report(e)});return this.#r.derives.push(i),this.#n.derives.set(r,i),i}expose(e){let t=Cf(e);if(t===void 0||![...this.#n.resources.values()].includes(t))throw TypeError(`expose takes a resource declared by this object`);return new yf(t)}register(e,t){if(!this.#e.hostLifetime)throw Ss(`not_host_lifetime`,`${this.#e.typeName}: only objects of lifetime "host" may register`);for(let[n,r]of Object.entries(t)){let t=`${e.name}\u0000${n}`;this.#i(this.#n.registrations,`register`,t),this.#n.registrations.set(t,{registry:e,key:n,value:r})}}};function Uf(e){let{run:t,migrated:n,service:r,object:i}=e,a=Bf(r,t.implementation);for(let[e,t]of n)for(let n of a.get(e)??[])Ms(`state`,`${i.address}: migrated state ${e.key}`,n,t);let o=new Map(n),s=[...t.decls.derives].sort(([,e],[,t])=>e.seq-t.seq);for(let[e,t]of s){let n=t.compute(e=>o.has(e)?o.get(e):Wf(e));for(let r of a.get(t)??[])Ms(`state`,`${i.address}: derivation ${e}`,r,n);o.set(t,n)}e.derived=o}function Wf(e){try{return e.value}catch(e){if(xs(e,`not_ready`)||xs(e,`not_in_variant`))return;throw e}}function Gf(e){let t=Cs(e,`reload`);return/^reload aborted/.test(t.message.replace(/^[^:]*: /,``))?t:new P(t.code,`reload aborted: ${t.message}`,{cause:t,reason:t.reason,details:t.details})}async function Kf(e,t,n){let r=await qf(e,t,n);try{return await r.prepare(),r.commit()}finally{Jf(e)}}async function qf(e,t,n,r){if(e.reloading)throw new P(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.reloading=!0;try{return new Zf(e,await e.resolve(t),n,r)}catch(t){throw e.reloadEnded(),Gf(t)}}function Jf(e){e.reloadEnded()}var Yf=1e3;function Xf(e,t,n){return t()?Promise.resolve(!0):new Promise(r=>{let i=setTimeout(()=>{a(),r(!1)},n),a=e.watchRetirement(()=>{t()&&(clearTimeout(i),a(),r(!0))})})}var Zf=class{host;facets;options;codeVersion;candidates=new Map;abort=new AbortController;closed=[];services=new Map;changed=new Set;removed=new Set;tables=new Map;gated=[];rolledBack=!1;deferred=new Map;facetRuns=new Map;constructor(e,t,n,r){this.host=e,this.facets=t,this.options=n,this.codeVersion=r}async prepare(){try{await this.waitForRetirement(),this.load(),this.checkProviders(),await this.prepareAll(),this.host.gating=this.changed,await this.withDeadline(this.prepareAll(),`activations in flight did not finish`),this.checkRefs(),this.tables=this.host.buildTables(this.entries()),await this.gate(),this.#e(),this.#t()}catch(e){throw await this.rollback(),Gf(e)}}summary(){let e=[...this.candidates.values()].filter(({object:e})=>e.status===`live`);return{codeVersion:this.host.pending?.id??this.host.current.id,previous:this.host.current.id,changed:[...this.changed],removed:[...this.removed],prepared:e.map(({object:e})=>e.address),gated:this.gated.map(({object:e})=>e.address)}}#e(){if(this.rolledBack)throw new P(`aborted`,`reload aborted while preparing`,{reason:`aborted`})}#t(){for(let e of this.candidates.values())e.object.status===`live`&&(e.staged=e.object.stageListeners(e.run.decls));for(let e of this.host.objects.values())e.status===`live`&&e.deferredRuntime&&this.deferred.set(e,e.stageListeners(e.decls))}async waitForRetirement(){let e=this.host,t=e.previous;if(t===void 0)return;let n=this.options.retireDeadline??5e3,r=()=>e.previous!==t;!await Xf(e,()=>r()||e.retirable(),n)&&!r()&&(t.abort.abort(new P(`superseded`,`code version ${t.id} was retired`)),await Xf(e,()=>r()||t.roots.size===0,Math.min(n,Yf))),r()||e.retire()}load(){let e=new Set([...this.facets.map(e=>e.name),...this.options.remove??[]]),t=this.host.current.services;this.services=new Map([...t].filter(([,t])=>!e.has(t.facet)));for(let e of this.facets){let t=new AbortController;this.facetRuns.set(e.name,t),e.setup(this.host.facetApi(((t,n,r={})=>this.host.serveInto(this.services,gf(t,n,r,e.name))),t.signal))}for(let[e,n]of this.services)t.get(e)!==n&&this.changed.add(e);for(let e of t.keys())this.services.has(e)||this.removed.add(e);this.host.pending={id:this.host.nextCodeVersionId(this.codeVersion),services:this.services,tables:new Map,roots:new Map,abort:new AbortController}}async withDeadline(e,t){let n=this.options.gateDeadline??5e3,r,i=new Promise((e,i)=>{r=setTimeout(()=>i(new P(`aborted`,`${t} within ${n} ms`,{reason:`deadline`})),n)});try{return await Promise.race([e,i])}finally{clearTimeout(r)}}checkProviders(){for(let e of this.changed){let t=this.services.get(e).contract,n=this.host.current.services.get(e)?.contract;if(n===void 0||n.version!==t.version)continue;let r=gc(t.description,n.description);if(r!==void 0)throw new P(`contract_mismatch`,`${e}@${t.version} changed incompatibly without a version bump (${r})`)}let e=new Map(this.host.facets);for(let t of this.facets)e.set(t.name,t);for(let t of this.options.remove??[])e.delete(t);for(let t of e.values())for(let e of t.uses??[]){let t=this.services.get(e.name);t!==void 0&&this.changed.has(e.name)&&yc(t.contract,t.options.accepts,e)}}async prepareAll(){for(;;){let e=[...this.host.objects.values()].filter(e=>this.changed.has(e.typeName)&&!this.candidates.has(e)&&e.service!==this.services.get(e.typeName)&&(e.status===`live`||e.status===`activating`));if(e.length===0)return;await Promise.allSettled(e.map(e=>e.ready)),this.#e();for(let t of e)t.status===`live`&&t.service!==this.services.get(t.typeName)&&(await this.prepareObject(t),this.#e())}}async prepareObject(e){let t=this.services.get(e.typeName),n=e.run(t,e.decls),r={object:e,service:t,run:n,reasons:[],atGate:[],replaced:[],migrated:new Map,derived:new Map,staged:void 0};this.candidates.set(e,r);for(let[t,i]of n.decls.cells){if(e.decls.cells.get(t)!==i)continue;let a=e.decls.cellVersions.get(t)??1,o=n.decls.cellVersions.get(t)??1;if(o<a)throw Ss(`state`,`${e.address}: version of state ${t} lowered from ${a} to ${o}`);if(o>a)r.reasons.push(`state ${t} version ${a} -> ${o}`);else if(!Os(i.schema,n.decls.cellSchemas.get(t)))throw Ss(`state`,`${e.address}: schema of state ${t} changed without a version bump`)}let i=new Set;for(let e of n.created.resources)(e.exclusive||e.deps.some(e=>i.has(e)))&&i.add(e);for(let t of i){r.atGate.push(t);let n=e.decls.resources.get(t.key);t.exclusive&&n?.exclusive&&n.state===`open`&&r.replaced.push(n)}i.size>0&&r.reasons.push(`exclusive resource replaced`),await e.open(n.created.resources.filter(e=>!i.has(e)),n.created.refs,this.abort.signal),await e.waitHydrated(n),r.reasons.length===0&&(await e.initCells(n,this.abort.signal),Uf(r))}checkRefs(){let e=new Set;for(let{object:t,run:n}of this.candidates.values())for(let r of t.decls.refs.values())[...n.decls.refs.values()].includes(r)||e.add(r);for(let t of this.host.objects.values()){let n=this.services.get(t.typeName);if(n!==void 0&&this.changed.has(t.typeName))for(let r of t.refs)r!==this.host.hostObjects.get(t.typeName)&&!e.has(r)&&r.owner!==`client`&&yc(n.contract,n.options.accepts,r.contract)}}entries(){return this.host.liveDecls(!0).filter(([e])=>!this.removed.has(e.typeName)).map(([e,t])=>[e,this.candidates.get(e)?.run.decls??t])}async gate(){this.gated=[...this.candidates.values()].filter(e=>e.reasons.length>0&&e.object.status===`live`);let e=this.gated.map(({object:e})=>{let t=new Set(e.leases.keys());return new Promise(n=>{e.gate={grandfathered:t,queue:[],drained:n},e.stopTasks(),t.size===0&&n()})}),t=this.options.gateDeadline??5e3,n,r=await Promise.race([Promise.all(e).then(()=>!1),new Promise(e=>{n=setTimeout(()=>e(!0),t)})]);if(clearTimeout(n),r){let e=this.gated.flatMap(({object:e})=>[...e.gate?.grandfathered??[]]);throw new P(`aborted`,`gate deadline (${t} ms) missed; blocking roots: ${e.join(`, `)}`,{reason:`gate_deadline`,details:{blocking:e}})}this.#e();for(let e of this.gated){let{object:t}=e;for(let n of e.replaced)this.closed.push([t,n]),await n.close(t.openOrder);await t.open(e.atGate,[],this.abort.signal),this.#e(),await t.initCells(e.run,this.abort.signal),this.#e()}for(let e of this.gated)this.migrate(e)}migrate(e){let{object:t,run:n}=e;for(let[r,i]of n.decls.cells){if(t.decls.cells.get(r)!==i)continue;let a=n.decls.cellSchemas.get(r),o=t.decls.cellVersions.get(r)??1,s=n.decls.cellMigrations.get(r),c;if((n.decls.cellVersions.get(r)??1)>o&&s!==void 0)c=s(structuredClone(i.value),o);else if(!Os(i.schema,a))c=i.value;else continue;Ms(`state`,`${t.address}: migrated state ${r}`,a,c),e.migrated.set(i,c)}Uf(e)}async rollback(){if(this.rolledBack)return;this.rolledBack=!0,this.abort.abort(new P(`aborted`,`reload aborted`));for(let e of this.facetRuns.values())e.abort(new P(`aborted`,`reload aborted`));let e=e=>this.host.report(e);for(let e of this.candidates.values())e.staged?.discard();for(let e of this.deferred.values())e.discard();for(let{object:t,run:n}of this.candidates.values())t.pending.delete(n.decls),await t.unwind(n).catch(e);for(let[t,n]of this.closed)n.state===`closed`&&await n.open(new AbortController().signal,t.openOrder).catch(r=>{n.markUnavailable(),e(new P(`unavailable`,`${t.address}: resource ${n.key} could not be restored`,{cause:r}))});for(let{object:e}of this.gated)e.gate!==void 0&&(e.openGate(),e.startTasks());let t=new P(`gone`,`reload aborted; type not served`);for(let n of[...this.host.objects.values()])this.host.current.services.has(n.typeName)||await n.dispose(!0,t).catch(e);this.host.pending=void 0,this.host.gating=void 0}commit(e){try{return Qd(()=>{let t=this.#r();e?.();for(let e of this.#n.splice(0))e();return t})}catch(e){throw this.host.fail(e),Gf(e)}}#n=[];#r(){let e=this.host,t=e.current,n=e.pending;e.pending=void 0,e.codeVersions.set(n.id,n),e.previous=t,e.current=n;let r=[];for(let i of[...e.objects.values()]){if(this.removed.has(i.typeName))continue;let e=this.candidates.get(i);if(e===void 0){let e=i.implementations.get(t.id);e!==void 0&&i.implementations.set(n.id,{...e,codeVersion:n.id})}else i.status===`live`&&(this.install(e,n.id),r.push(i.address))}for(let{object:t,run:n,staged:r}of this.candidates.values())t.status!==`live`&&(r?.discard(),t.pending.delete(n.decls),t.unwind(n).catch(t=>e.report(t)));for(let[e,t]of this.deferred)e.status===`live`?(e.deferredRuntime=!1,t.activate(),this.#n.push(()=>e.startTasks())):t.discard();e.installTables(n,this.tables,!0);let i=new P(`gone`,`type no longer served`);for(let t of[...e.objects.values()])this.removed.has(t.typeName)&&t.dispose(!0,i).catch(t=>e.report(t));for(let t of this.removed)e.hostObjects.delete(t);for(let t of this.facets)e.facets.set(t.name,t);for(let t of this.options.remove??[])e.facets.delete(t);for(let[t,n]of this.facetRuns)this.#n.push(()=>e.facetRunChanged(t,n));for(let t of this.options.remove??[])this.#n.push(()=>e.facetRunChanged(t,void 0));e.gating=void 0;for(let[t,n]of this.services){_f(n)&&this.changed.has(t)&&e.hostObjects.get(t)?.object?.status!==`live`&&this.#n.push(()=>e.startHostObject(n));let r=e.hostObjects.get(t);!_f(n)&&r!==void 0&&(e.hostObjects.delete(t),this.#n.push(()=>r.release()))}return{codeVersion:n.id,previous:t.id,changed:[...this.changed],removed:[...this.removed],prepared:r,gated:this.gated.map(({object:e})=>e.address)}}install(e,t){let{object:n,run:r,service:i}=e,a=e.reasons.length>0;if(n.pending.delete(r.decls),n.stopTasks(),a){let e=new Set(r.decls.derives.values());for(let t of n.decls.derives.values())e.has(t)||t.detach()}n.decls=r.decls,n.service=i;for(let[e,t]of r.decls.adopted)e.adopt(t);if(n.implementations.set(t,{codeVersion:t,service:i,implementation:r.implementation,decls:r.decls}),a){n.minCodeVersion=t;for(let e of[...n.implementations.keys()])e!==t&&this.host.retireImplementation(n,e)}n.refreshSchemas();for(let[t,n]of r.decls.cells){let i=r.decls.cellSchemas.get(t);e.migrated.has(n)?n.reset(e.migrated.get(n),i):n.schema=i}let o=new Set(r.created.derives);for(let t of r.created.derives)t.attach(e.derived);for(let e of r.decls.derives.values())o.has(e)||e.refresh();e.staged?.activate(),this.#n.push(()=>n.startTasks()),n.openGate();let s=this.host.hostObjects.get(n.typeName);if(s?.object===n&&s.contract.fingerprint!==i.contract.fingerprint){let e=new Ff(n,i.contract,`host`);n.addRef(e),this.host.hostObjects.set(n.typeName,e),s.release()}for(let e of[...n.refs]){if(e.owner===`client`)try{yc(i.contract,i.options.accepts,e.contract)}catch(t){e.gone(new P(`upgrade_required`,`${n.typeName} changed; reload the web facets`,{cause:t})),n.release(e);continue}e.shapeChanged()}}},Qf=na({minimum:1}),$f=ea({minLength:1}),ep=na({minimum:1}),tp=e=>la(e),np=e=>N(e,{open:!0}),rp=np({rootId:$f,codeVersion:na({minimum:1})}),ip=np({code:sa(ys),message:ea(),reason:M(ea())}),ap=np({remove:M(tp(ea())),gateDeadline:M(ta()),retireDeadline:M(ta())}),op=np({codeVersion:na(),previous:na(),changed:tp(ea()),removed:tp(ea()),prepared:tp(ea()),gated:tp(ea())}),sp=ps(ca([np({t:oa(`hello`),protocol:M(na({minimum:1})),name:$f,kind:ca([oa(`host`),oa(`client`)]),codeVersion:na({minimum:0}),acks:M(ra())}),np({t:oa(`ack`),n:na({minimum:1})}),np({t:oa(`hold`),id:Qf,at:$f,token:lc,input:aa(),principal:M(aa()),origin:M($f),state:M(oa(!1)),again:M(oa(!0))}),np({t:oa(`release`),id:Qf}),np({t:oa(`shape`),id:Qf,variant:M(ea()),members:tp(ea()),contract:ea(),state:tp($f)}),np({t:oa(`gone`),id:Qf,error:ip}),np({t:oa(`call`),id:Qf,hold:Qf,member:$f,args:M(aa()),root:M(rp)}),np({t:oa(`result`),id:Qf,value:M(aa()),error:M(ip)}),np({t:oa(`cancel`),id:Qf}),np({t:oa(`sub`),hold:Qf}),np({t:oa(`unsub`),hold:Qf}),np({t:oa(`resync`),hold:Qf,m:$f}),np({t:oa(`state`),hold:Qf,m:$f,as:ca([oa(`snap`),oa(`reset`),oa(`ops`),oa(`error`)]),value:M(aa()),ops:M(tp(tp(aa()))),error:M(ip)}),np({t:oa(`ping`),n:na()}),np({t:oa(`pong`),n:na()}),np({t:oa(`bye`),reason:M(ea())}),np({t:oa(`root_end`),rootId:$f}),np({t:oa(`invalidate`),pattern:ua(aa())}),np({t:oa(`prepare`),reload:ep,codeVersion:na({minimum:1}),plugins:tp(ea()),options:ap}),np({t:oa(`vote`),reload:ep,error:M(ip),report:M(op)}),np({t:oa(`commit`),reload:ep}),np({t:oa(`retire`),codeVersion:na({minimum:1})}),np({t:oa(`abort`),reload:ep})])).check;function cp(e){return e instanceof P?e.reason===void 0?{code:e.code,message:e.message}:{code:e.code,message:e.message,reason:e.reason}:{code:`unavailable`,message:e instanceof Error?e.message:String(e)}}var lp=e=>new P(e.code,e.message.replace(/^[a-z_]+(\/[a-z_]+)?: /,``),{reason:e.reason}),up=0,dp=(e,t)=>{let n;for(let r of Object.entries(e??{}))t?.startsWith(r[0])&&(n===void 0||r[0].length>n[0].length)&&(n=r);return[...n?.[1]??[]]};function fp(e,t,n){let r;return new Promise((i,a)=>{e.votes.set(t,{resolve:i,reject:a}),r=setTimeout(()=>{e.votes.delete(t),a(new P(`aborted`,`votes missing after ${n} ms`,{reason:`vote_deadline`}))},n)}).finally(()=>clearTimeout(r))}async function pp(e,t,n){let r=[...e.connections].filter(e=>e.role===`downstream`&&e.peer.kind===`host`&&e.open&&e.synced),i=e.peekNextCodeVersion(),a=await qf(e,t,n,i);try{await a.waitForRetirement();let t=r.filter(e=>e.open),o=++up,s=n.voteDeadline??(n.gateDeadline??5e3)+(n.retireDeadline??5e3)+5e3,c=t.map(e=>{let t=e.name??`child`,r=fp(e,o,s);return e.send({t:`prepare`,reload:o,codeVersion:i,plugins:dp(n.remote,t),options:{remove:dp(n.remoteRemove,t),gateDeadline:n.gateDeadline,retireDeadline:n.retireDeadline}}),r.then(e=>[t,e],e=>{let n=Gf(e);throw new P(n.code,`${t}: ${n.message}`,{cause:n,reason:n.reason})})}),l=!1,u=await Promise.allSettled([a.prepare().then(()=>{l=!0}),...c]),d=u.find(e=>e.status===`rejected`);if(d!==void 0){for(let e of t)e.votes.delete(o),e.send({t:`abort`,reload:o});throw l&&await a.rollback(),d.reason}let f=a.commit(()=>{for(let e of t)e.send({t:`commit`,reload:o}),e.peerCodeVersion=i});e.rememberRemoteModules(n.remote,n.remoteRemove);let p={};for(let e of u.slice(1)){if(e.status!==`fulfilled`)continue;let[t,n]=e.value;n!==void 0&&(p[t]=n)}return{...f,children:p}}finally{Jf(e)}}async function mp(e,t){for(;;){if(!t.open)return;if(e.reloading){await e.whenReloadEnded();continue}let n=e.current.id;if(t.peerCodeVersion===n){t.markSynced(n),e.announceRetired(t);return}e.announceRetired(t);let r=++up,i=fp(t,r,3e4);t.send({t:`prepare`,reload:r,codeVersion:n,plugins:dp(e.remoteModules,t.name),options:{remove:dp(e.remoteRemoved,t.name)}}),await i,e.current.id===n?(t.send({t:`commit`,reload:r}),t.peerCodeVersion=n):t.send({t:`abort`,reload:r})}}var hp=class{#e;#t;constructor(e){this.#e=e}handle(e,t){if(t.t===`prepare`){if(this.#t!==void 0){let n=new P(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.send({t:`vote`,reload:t.reload,error:cp(n)});return}let n={id:t.reload,reload:void 0,state:`loading`,cancelled:!1};this.#t=n,this.#r(n,e,t).catch(e=>this.#e.report(e));return}let n=this.#t;if(n!==void 0&&n.id===t.reload){if(t.t===`abort`)this.#n(n);else if(n.state===`prepared`){this.#t=void 0;try{n.reload?.commit()}finally{Jf(this.#e)}}}}parentLost(){this.#t!==void 0&&this.#n(this.#t)}#n(e){e.cancelled=!0,e.state===`prepared`?(this.#t=void 0,e.reload?.rollback().catch(e=>this.#e.report(e)).finally(()=>Jf(this.#e))):e.reload?.rollback().catch(e=>this.#e.report(e))}async#r(e,t,n){let r=()=>new P(`aborted`,`reload aborted by the server`,{reason:`aborted`});try{if(e.reload=await qf(this.#e,n.plugins,n.options,n.codeVersion),e.cancelled||(e.state=`preparing`,await e.reload.prepare(),e.cancelled))throw r();e.state=`prepared`,t.send({t:`vote`,reload:n.reload,report:e.reload.summary()})}catch(r){e.reload!==void 0&&(await e.reload.rollback().catch(e=>this.#e.report(e)),Jf(this.#e)),this.#t===e&&(this.#t=void 0),e.cancelled||t.send({t:`vote`,reload:n.reload,error:cp(r)})}}},gp=class{#e;#t=[];#n=new Set;#r=!1;#i;get closed(){return this.#r}send(e){if(!this.#r)return this.transmit(e)}receive(e){this.#e=e;for(let t of this.#t.splice(0))e(t)}onClose(e){this.#r?e(`closed`):this.#n.add(e)}close(e=`closed`){if(!this.#r){try{this.transmit({t:`bye`,reason:e})}catch{}this.ended(e)}}deliver(e){this.#i===void 0?this.#a(e):this.deliverLater(Promise.resolve(e))}deliverLater(e){let t=(this.#i??Promise.resolve()).then(()=>e).then(e=>this.#a(e),()=>this.close(`protocol error`)).finally(()=>{this.#i===t&&(this.#i=void 0)});this.#i=t}#a(e){this.#r||(e.t===`bye`?this.ended(e.reason??`peer closed`):this.#e===void 0?this.#t.push(e):this.#e(e))}ended(e){if(!this.#r){this.#r=!0,this.#t=[];try{this.shutdown()}finally{for(let t of this.#n)t(e);this.#n.clear()}}}},_p=globalThis.process?.getBuiltinModule?.(`node:zlib`),vp=class{bytes;constructor(e){this.bytes=e}};function yp(e){if(!(e instanceof vp))return e;if(_p===void 0)throw TypeError(`packed payload without zlib`);return JSON.parse(_p.inflateRawSync(e.bytes).toString(`utf8`))}var bp=new Set([`args`,`value`]);function xp(e){if(e.t===`call`)return e.args===void 0?void 0:`args`;if(e.t===`result`||e.t===`state`)return e.value===void 0?void 0:`value`}function Sp(e,t){let n={...e};return delete n[t],n}function Cp(e,t,n){if(e instanceof vp)return e.bytes;if(!(!t||_p===void 0||n===void 0||n.length<=65536))return _p.deflateRawSync(n,{level:1})}function wp(e){if(typeof e!=`object`||!e||!(`z`in e))return e;let{z:t,...n}=e;if(!Array.isArray(t)||!bp.has(t[0])||typeof t[1]!=`string`)throw TypeError(`bad packed payload`);return{...n,[t[0]]:new vp(Buffer.from(t[1],`base64`))}}var Tp=new TextEncoder,Ep=new TextDecoder;function Dp(e,t){let n=xp(e);if(n===void 0)return JSON.stringify(e);let r=e[n],i=r instanceof vp?void 0:JSON.stringify(r),a=Cp(r,t,i),o=Sp(e,n);if(a===void 0)return`${JSON.stringify(o).slice(0,-1)},${JSON.stringify(n)}:${i}}`;let s=Tp.encode(JSON.stringify({...o,z:n})),c=new Uint8Array(4+s.byteLength+a.byteLength);return new DataView(c.buffer).setUint32(0,s.byteLength),c.set(s,4),c.set(a,4+s.byteLength),c}function Op(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0),n=JSON.parse(Ep.decode(e.subarray(4,4+t)));if(typeof n!=`object`||!n)throw TypeError(`bad envelope`);let{z:r,...i}=n;if(typeof r!=`string`||!bp.has(r))throw TypeError(`bad packed payload`);return{envelope:i,field:r,bytes:e.slice(4+t)}}async function kp(e){let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate-raw`));return JSON.parse(await new Response(t).text())}function Ap(e){let t=wp(JSON.parse(e));if(typeof t!=`object`||!t||typeof t.t!=`string`)throw TypeError(`not a frame`);return t}var jp=1,Mp=class extends gp{#e;#t;#n=[];constructor(e,t={}){super(),this.#e=e,this.#t=t.compress??!1;let n=t.acceptPacked??!0;`binaryType`in e&&(e.binaryType=`arraybuffer`),e.addEventListener(`open`,()=>{for(let t of this.#n.splice(0))e.send(t)}),e.addEventListener(`message`,e=>{try{let t=e.data;if(typeof t==`string`){this.deliver(Ap(t));return}if(!n)throw TypeError(`packed frames are not accepted`);let r=t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):void 0;if(r===void 0)throw TypeError(`unknown message type`);let{envelope:i,field:a,bytes:o}=Op(r);_p===void 0?this.deliverLater(kp(o).then(e=>({...i,[a]:e}))):this.deliver({...i,[a]:new vp(o)})}catch{this.close(`protocol error`)}}),e.addEventListener(`close`,()=>this.ended(`socket closed`))}transmit(e){let t=Dp(e,this.#t);return this.#e.readyState===jp?this.#e.send(t):this.#n.push(t),typeof t==`string`?t.length:t.byteLength}shutdown(){this.#n=[],this.#e.readyState<=jp&&this.#e.close(1e3)}},Np=(e,t)=>new Mp(e,t),Pp=262144,Fp=4,Ip=e=>new P(`unavailable`,e),Lp=class{origin;frame;principal;originTag;generation;down;downId=0;closed=!1;stateWanted;urgent;#e=!1;awaiting=new Set;calls=new Map;#t=new Set;constructor(e,t,n,r){this.origin=e,this.frame=t,this.principal=n,this.originTag=r,this.stateWanted=t.state!==!1,this.generation=e.generation}get originId(){return this.frame.id}get client(){return this.originTag!==void 0}get current(){return!this.closed&&this.origin.open&&this.origin.generation===this.generation}ready(){return this.closed?Promise.reject(new P(`gone`,`relayed hold closed`)):this.down===void 0?new Promise((e,t)=>{this.#t.add({resolve:e,reject:t})}):Promise.resolve(this.down)}open(e){if(this.closed)return;this.down=e,this.downId=e.nextId(),e.relayedRefs.set(this.downId,this);let{at:t,token:n,input:r}=this.frame;e.send({t:`hold`,id:this.downId,at:t,token:n,input:r,principal:this.principal,...this.originTag===void 0?{}:{origin:this.originTag},...this.stateWanted?{}:{state:!1},...this.frame.again===!0?{again:!0}:{}});for(let t of this.#t)t.resolve(e);this.#t.clear()}wantState(e){this.closed||e===this.stateWanted||(this.stateWanted=e,e||(this.origin.dropHoldState(this.originId),this.awaiting.clear()),this.down?.send({t:e?`sub`:`unsub`,hold:this.downId}))}resync(e){this.closed||(this.awaiting.add(e),this.down?.send({t:`resync`,hold:this.downId,m:e}))}shape(e){this.closed||(this.#e||(this.#e=!0,this.frame.again!==!0&&(this.urgent=new Set(e.state))),this.origin.send({...e,id:this.originId}))}state(e){if(this.closed)return;let t=e.m;if(this.awaiting.has(t)){if(e.as===`ops`)return;this.awaiting.delete(t)}let n={...e,hold:this.originId};this.urgent?.delete(t)===!0?this.origin.send(n):this.origin.sendState(n,{resync:()=>this.resync(t)})}close(e,t){if(!this.closed){this.closed=!0;for(let n of[...this.calls.values()])n.cancel(e,t.releaseDown);this.origin.dropHoldState(this.originId),this.origin.served.get(this.originId)?.kind===`relay`&&this.origin.served.delete(this.originId),this.down!==void 0&&(this.down.relayedRefs.delete(this.downId),t.releaseDown&&this.down.send({t:`release`,id:this.downId}));for(let t of this.#t)t.reject(e);this.#t.clear(),t.notify&&this.origin.send({t:`gone`,id:this.originId,error:cp(e)})}}},Rp=class{relay;originId;downId;#e;#t=!1;constructor(e,t,n,r){this.relay=e,this.originId=t,this.downId=n,this.#e=r,e.calls.set(t,this),e.down?.relayedCalls.set(n,this)}finish(e,t){this.#t||(this.#t=!0,this.relay.calls.delete(this.originId),this.relay.down?.relayedCalls.delete(this.downId),e===void 0?this.#e.resolve(t):this.#e.reject(e))}cancel(e,t){this.#t||(t&&this.relay.down?.send({t:`cancel`,id:this.downId}),this.finish(e))}},zp=class{host;link;role;peer;originId;principal;restamp;generation=0;peerCodeVersion;synced;fencedCodeVersions=new Set;#e=new Map;#t;#n=new Set;#r=1;#i=Date.now();#a;#o;#s;#c;#l;#u=0;#d=0;#f=[];#p=0;#m=new Map;#h=0;#g=0;#_;#v;#y=!1;remotes=new Map;calls=new Map;served=new Map;incoming=new Map;relayedRefs=new Map;relayedCalls=new Map;votes=new Map;constructor(e,t,n){this.host=e,this.link=t,this.role=n.role,this.peer=n.peer,this.originId=n.originId,this.principal=n.principal,this.restamp=n.restamp,this.synced=this.role!==`downstream`||this.peer.kind!==`host`,this.#s=n.window??Pp,this.#c=n.pendingCap??this.#s*Fp,this.#o=n.maxCalls??1/0,this.#v=n.onProtocolMismatch,t.onClose(e=>this.#Q(e)),t.receive(e=>this.#A(e)),this.send({t:`hello`,protocol:4,name:e.name,kind:e.kind,codeVersion:e.current.id,acks:!0});let r=n.pingInterval??15e3,i=n.pingTimeout??45e3;if(t.closed)return;let a=0;this.#a=setInterval(()=>{Date.now()-this.#i>i?t.close(`ping timeout`):this.send({t:`ping`,n:++a})},r),this.#a.unref?.()}get open(){return!this.link.closed}get name(){return this.role===`upstream`?this.#t:this.peer.name}send(e){let t=this.link.send(e)??0;this.#l!==!1&&(this.#u++,this.#f.push(t),this.#p+=t)}sendState(e,t){let n=Bp(e.hold,e.m),r=this.#m.get(n);if(r===void 0&&!this.#w){this.send(e);return}if(r?.kind===`unit`)return;if(r===void 0&&(r={kind:`state`,hold:e.hold,m:e.m,base:void 0,ops:[],size:0,lazy:!1,overflow:t},this.#m.set(n,r)),e.as!==`ops`){this.#h-=r.size,r.base=e,r.ops=[],r.size=0,r.lazy=!1;return}if(r.lazy)return;let i=JSON.stringify(e.ops).length;if(this.#h+i>this.#c&&this.#b(i,r),!(r.lazy||this.#m.get(n)!==r)){for(let t of e.ops??[])r.ops.push(t);r.size+=i,this.#h+=i}}#b(e,t){for(let n of[...this.#m.values()]){if(this.#h+e<=this.#c)return;n.kind===`state`&&n!==t&&n.size>0&&this.#x(n)}this.#h+e>this.#c&&this.#x(t)}#x(e){this.#h-=e.size,e.base=void 0,e.ops=[],e.size=0,`resend`in e.overflow?e.lazy=!0:(this.#m.delete(Bp(e.hold,e.m)),e.overflow.resync())}#S(e,t,n){let r=Bp(e,t),i=this.#m.get(r);i?.kind!==`unit`&&(i===void 0?(i={kind:`state`,hold:e,m:t,base:void 0,ops:[],size:0,lazy:!0,overflow:{resend:n}},this.#m.set(r,i)):(this.#h-=i.size,i.base=void 0,i.ops=[],i.size=0,i.lazy=!0),this.#E())}#C(e,t){let n=Vp(e);this.#m.has(n)||this.#m.set(n,{kind:`unit`,hold:e,flush:t}),this.#E()}dropState(e,t){let n=this.#m.get(Bp(e,t));n?.kind===`state`&&(this.#h-=n.size,this.#m.delete(Bp(e,t)))}dropHoldState(e){for(let[t,n]of this.#m)n.hold===e&&(n.kind===`state`&&(this.#h-=n.size),this.#m.delete(t))}get waiting(){return{slots:this.#m.size,bytes:this.#h}}get#w(){return this.#l===!0&&this.#p>=this.#s}#T(e){if(this.#l!==!0||e<this.#d||e>this.#u)this.#k(`ack ${e} outside ${this.#d}..${this.#u}`);else{for(let t of this.#f.splice(0,e-this.#d))this.#p-=t;this.#d=e,this.#E()}}#E(){for(let[e,t]of this.#m){if(this.#w)return;this.#m.delete(e),t.kind===`unit`?t.flush():(this.#h-=t.size,t.lazy?`resend`in t.overflow&&t.overflow.resend():(t.base!==void 0&&this.send(t.base),t.ops.length>0&&this.send({t:`state`,hold:t.hold,m:t.m,as:`ops`,ops:t.ops})))}}#D(){this.#l===!0&&this.#_===void 0&&this.open&&(this.#_=setTimeout(()=>{this.#_=void 0,this.link.send({t:`ack`,n:this.#g})},0),this.#_.unref?.())}nextId(){return this.#r++}whenSynced(){return this.open?this.synced?Promise.resolve():new Promise((e,t)=>this.#n.add({resolve:e,reject:t})):Promise.reject(Ip(`link to ${this.name??`peer`} closed`))}markSynced(e){this.peerCodeVersion=e,this.synced=!0;for(let e of this.#n)e.resolve(void 0);this.#n.clear()}revoke(e){this.generation++;let t=new P(`gone`,`principal invalidated`);for(let e of[...this.served.values()])e.kind===`relay`&&e.relay.close(t,{releaseDown:!0,notify:!0});e===void 0?this.link.close(`principal invalidated`):this.principal=e}#O(e,t=!0){if(!this.#y){this.#y=!0;try{this.#v?.({local:4,peer:e})}catch(e){this.host.report(e)}t&&this.link.close(`protocol-version 4`)}}#k(e){this.host.report(new P(`invalid`,`link to ${this.name??`peer`}: ${e}`,{reason:`protocol`})),this.link.close(`protocol error: ${e}`)}hold(e,t){let n=this.nextId();this.remotes.set(n,e),e.bound(this,n);let r=e.principal;return this.send({t:`hold`,id:n,at:e.at,token:e.contract.description,input:e.input,...r===void 0?{}:{principal:r},...e.stateOn?{}:{state:!1},...t?{again:!0}:{}}),n}release(e){this.remotes.delete(e),this.send({t:`release`,id:e})}wantState(e,t){this.remotes.has(e)&&this.send({t:t?`sub`:`unsub`,hold:e})}call(e,t,n,r,i){let a=this.nextId();return new Promise((o,s)=>{if(i.aborted){s(new P(`aborted`,`call aborted`));return}let c=()=>{this.calls.delete(a),this.send({t:`cancel`,id:a}),s(new P(`aborted`,`call aborted`,{cause:i.reason}))};i.addEventListener(`abort`,c,{once:!0});let l=()=>i.removeEventListener(`abort`,c);this.calls.set(a,{resolve:e=>{l(),o(e)},reject:e=>{l(),s(e)}});let u=r!==void 0&&this.host.kind===`host`;u&&this.host.rootSent(r.rootId,this),this.send({t:`call`,id:a,hold:e,member:t,args:n,...u?{root:r}:{}})})}#A(e){if(!this.#y){if(this.#i=Date.now(),!sp(e))this.#k(`malformed frame`);else if(e.t===`ack`)this.#T(e.n);else{this.#g++;try{this.#j(e)}catch(e){this.host.report(e)}this.#D()}}}#j(e){switch(e.t){case`hello`:this.#M(e);return;case`ping`:this.send({t:`pong`,n:e.n});return;case`pong`:case`bye`:case`ack`:return;case`hold`:this.#F(e);return;case`release`:this.#K(e.id,!0);return;case`call`:this.#q(e);return;case`cancel`:this.incoming.get(e.id)?.abort(new P(`aborted`,`cancelled by caller`));return;case`sub`:case`unsub`:this.#W(e.hold,e.t===`sub`);return;case`resync`:this.#G(e.hold,e.m);return;case`shape`:case`gone`:this.#Y(e);return;case`result`:this.#X(e);return;case`state`:this.#Z(e);return;case`root_end`:this.#e.delete(e.rootId),this.host.foreignRootEnded(e.rootId,this);return;case`invalidate`:case`prepare`:case`commit`:case`abort`:case`retire`:if(this.role!==`upstream`){this.#k(`${e.t} from a child`);return}e.t===`invalidate`?this.host.invalidatePrincipal(e.pattern).catch(e=>this.host.report(e)):e.t===`retire`?this.host.allowRetire(e.codeVersion):this.host.onReloadFrame(this,e);return;case`vote`:{if(this.role!==`downstream`||this.peer.kind!==`host`){this.#k(`vote from a non-participant`);return}let t=this.votes.get(e.reload);this.votes.delete(e.reload),e.error===void 0?t?.resolve(e.report):t?.reject(lp(e.error));return}}}#M(e){if((e.protocol??1)!==4)this.#O(e.protocol??1);else if(this.#l===void 0&&(this.#l=e.acks===!0,this.#l||(this.#f=[],this.#p=0)),this.role===`upstream`){if(e.kind!==`host`){this.#k(`parent is not a host`);return}this.#t??=e.name}else e.kind!==this.peer.kind||this.peer.name!==void 0&&e.name!==this.peer.name?this.#k(`hello ${e.kind} ${e.name} does not match the accepted ${this.peer.kind} ${this.peer.name??``}`):this.peer.kind===`host`&&this.host.peerHello(this,e.codeVersion)}#N(e){return this.role===`downstream`?this.principal:e.principal??this.principal}#P(e){return this.role===`downstream`?this.originId:e.origin}#F(e){if(this.served.has(e.id)){this.#k(`duplicate hold id ${e.id}`);return}let t=this.#N(e),n=this.#P(e),r=n!==void 0;if(e.at!==this.host.name){if(this.role===`upstream`){this.send({t:`gone`,id:e.id,error:cp(Ip(`${this.host.name} does not relay`))});return}let r=new Lp(this,e,t,n);this.served.set(e.id,{kind:`relay`,relay:r}),this.host.relay(r).catch(e=>r.close(e,{releaseDown:!0,notify:!0}));return}let i;try{let n=hc(e.token);if(n.scope!==`remote`)throw Ss(`token`,`${n.name} is local; only remote types cross links`);if(rc(n.name,n.description.host,e.input)!==this.host.name)throw Ss(`placement`,`${n.name} with this input does not live on ${this.host.name}`);let a=this.host.acquire(n,e.input,{principal:t},r?`client`:`connection`);if(!(a instanceof Ff))throw Ip(`not a local reference`);i=a}catch(t){this.send({t:`gone`,id:e.id,error:cp(r?Wp(t):t)});return}let a={kind:`local`,id:e.id,ref:i,principal:t,origin:n,wantsState:e.state!==!1,again:e.again===!0,unitSent:!1,feeds:new Map};this.served.set(e.id,a),i.onShape(()=>this.#L(a)),i.goneListeners.add(t=>{this.served.get(e.id)===a&&(this.#K(e.id,!1),this.send({t:`gone`,id:e.id,error:cp(t)}))}),i.status===`live`&&this.#L(a)}#I(e,t){return t.members.filter(n=>e.describe(t.variant,n)?.kind===`state`)}#L(e){if(this.served.get(e.id)!==e)return;let t=e.ref.shape;if(t===void 0)return;let n=new Set(e.wantsState?this.#I(e.ref,t):[]);for(let[t,r]of e.feeds)n.has(t)||(r.unsubscribe(),e.feeds.delete(t),this.dropState(e.id,t));e.feeds.size===0&&(!e.again||e.unitSent)?this.#R(e):this.#C(e.id,()=>this.#R(e))}#R(e){if(this.#m.delete(Vp(e.id)),this.served.get(e.id)!==e)return;let t=e.ref.shape;if(t===void 0)return;e.unitSent=!0;let n=(e.wantsState?this.#I(e.ref,t):[]).filter(t=>!e.feeds.has(t)),r=[],i=[];for(let t of n){let n=this.#z(e,t);n!==void 0&&(r.push(n.frame),i.push([t,n.feed]))}this.send({t:`shape`,id:e.id,...t.variant===void 0?{}:{variant:t.variant},members:t.members,contract:t.contract,state:r.map(e=>e.m)});for(let e of r)this.send(e);for(let[t,n]of i)this.#B(e,t,n)}#z(e,t,n=`snap`){let r=e.ref.member(t);if(r===void 0||typeof r.events!=`function`)return;let i={unsubscribe:()=>{},encoder:Kd(),buffer:[]},a;return i.unsubscribe=r.events(n=>{a===void 0?a=n:i.buffer===void 0?this.#H(e,t,i,n):i.buffer.push(n)}),e.feeds.set(t,i),{frame:this.#V(e,t,n,a?.value),feed:i}}#B(e,t,n){let r=n.buffer??[];n.buffer=void 0;for(let i of r)this.#H(e,t,n,i)}#V(e,t,n,r){try{Up(e.ref,t,r)}catch(n){return{t:`state`,hold:e.id,m:t,as:`error`,error:cp(n)}}return{t:`state`,hold:e.id,m:t,as:n,...r===void 0?{}:{value:r}}}#H(e,t,n,r){if(e.feeds.get(t)!==n)return;let i={resend:()=>this.#U(e,t)};r.type===`ops`?this.sendState({t:`state`,hold:e.id,m:t,as:`ops`,ops:n.encoder.encode(r.ops)},i):(n.encoder=Kd(),this.sendState(this.#V(e,t,`reset`,r.value),i))}#U(e,t){let n=e.feeds.get(t);if(n===void 0||this.served.get(e.id)!==e)return;n.unsubscribe(),e.feeds.delete(t);let r=this.#z(e,t,`reset`);r!==void 0&&(this.send(r.frame),this.#B(e,t,r.feed))}#W(e,t){let n=this.served.get(e);if(n!==void 0){if(n.kind===`relay`)n.relay.wantState(t);else if(n.wantsState!==t){if(n.wantsState=t,t)this.#L(n);else{for(let e of n.feeds.values())e.unsubscribe();n.feeds.clear(),this.dropHoldState(e)}}}}#G(e,t){let n=this.served.get(e);n!==void 0&&(n.kind===`relay`?n.relay.resync(t):n.feeds.has(t)&&this.#S(e,t,()=>this.#U(n,t)))}#K(e,t){let n=this.served.get(e);if(n!==void 0){if(this.served.delete(e),n.kind===`relay`)n.relay.close(new P(`released`,`relayed hold released`),{releaseDown:t,notify:!1});else{for(let e of n.feeds.values())e.unsubscribe();n.feeds.clear(),this.dropHoldState(e),t&&n.ref.release()}}}#q(e){if(this.incoming.has(e.id)){this.#k(`duplicate call id ${e.id}`);return}if(this.incoming.size>=this.#o){let t=new P(`unavailable`,`Too many calls in progress on this connection (${this.#o}); wait for earlier ones to finish`,{reason:`too_many_calls`});this.send({t:`result`,id:e.id,error:cp(t)});return}let t=this.served.get(e.hold);if(t===void 0){this.send({t:`result`,id:e.id,error:cp(new P(`gone`,`unknown hold`))});return}let n=new AbortController;this.incoming.set(e.id,n);let r=this.peer.kind===`host`?this.#J(e.root):void 0,i={principal:t.kind===`local`?t.principal:t.relay.principal,signal:n.signal},a=t.kind===`local`?n=>t.ref.object.call(t.ref,e.member,yp(e.args),n):n=>Hp(t.relay,e,{rootId:n.rootId,codeVersion:n.codeVersion},n.signal,this.host);(r===void 0?this.host.root(a,i):this.host.joinRoot(r.rootId,r.codeVersion,a,{...i,from:this})).then(t=>this.send({t:`result`,id:e.id,value:t}),t=>this.send({t:`result`,id:e.id,error:cp(t)})).finally(()=>this.incoming.delete(e.id))}#J(e){if(e===void 0||this.role!==`downstream`||!this.fencedCodeVersions.has(e.codeVersion)||this.host.hasCodeVersion(e.codeVersion))return e;let t=this.#e.get(e.rootId);return t===void 0&&(t=this.host.current.id,this.#e.set(e.rootId,t)),{rootId:e.rootId,codeVersion:t}}#Y(e){let t=this.relayedRefs.get(e.id);if(t!==void 0){e.t===`gone`?t.close(lp(e.error),{releaseDown:!1,notify:!0}):t.shape(e);return}let n=this.remotes.get(e.id);n!==void 0&&(e.t===`gone`?(this.remotes.delete(e.id),n.gone(lp(e.error))):n.shaped({variant:e.variant,members:e.members,contract:e.contract},e.state))}#X(e){let t=this.relayedCalls.get(e.id);if(t!==void 0){t.finish(e.error===void 0?void 0:lp(e.error),e.value);return}let n=this.calls.get(e.id);if(this.calls.delete(e.id),e.error!==void 0){n?.reject(lp(e.error));return}let r;try{r=yp(e.value)}catch(e){n?.reject(e);return}n?.resolve(r)}#Z(e){let t=this.relayedRefs.get(e.hold);if(t!==void 0){t.state(e);return}let n=this.remotes.get(e.hold);if(n===void 0)return;if(!(e.value instanceof vp)){n.state(e.m,e);return}let r;try{r=yp(e.value)}catch(t){n.state(e.m,{as:`error`,error:cp(t)});return}n.state(e.m,{...e,value:r})}#Q(e){let t=/^protocol-version (\d+)$/.exec(e);t!==null&&Number(t[1])!==4&&this.#O(Number(t[1]),!1),this.#a!==void 0&&clearInterval(this.#a),this.#_!==void 0&&clearTimeout(this.#_),this.#m.clear(),this.#h=0;let n=Ip(`link to ${this.name??`peer`} closed: ${e}`);for(let e of[...this.served.keys()])this.#K(e,!0);for(let e of this.incoming.values())e.abort(n);this.incoming.clear();for(let e of this.calls.values())e.reject(n);this.calls.clear();for(let e of this.votes.values())e.reject(n);this.votes.clear();for(let e of this.#n)e.reject(n);this.#n.clear();for(let e of[...this.relayedRefs.values()])e.close(n,{releaseDown:!1,notify:!0});this.relayedRefs.clear(),this.relayedCalls.clear();let r=[...this.remotes.values()];this.remotes.clear();for(let e of r)this.role===`upstream`?e.detached():e.gone(n);this.host.connectionClosed(this)}},Bp=(e,t)=>`s${e}\u0000${t}`,Vp=e=>`u${e}`;async function Hp(e,t,n,r,i){let a=()=>new P(`aborted`,`call cancelled`,{cause:r.reason});if(r.aborted)throw a();let o=()=>{},s=()=>{},c=new Promise((e,t)=>{o=()=>t(a()),r.addEventListener(`abort`,o,{once:!0})});c.catch(()=>{});try{let o=await Promise.race([e.ready(),c]);if(e.closed)throw new P(`gone`,`relayed hold closed`);return await new Promise((c,l)=>{let u=new Rp(e,t.id,o.nextId(),{resolve:c,reject:l});s=()=>u.cancel(a(),!0),r.addEventListener(`abort`,s,{once:!0}),i.rootSent(n.rootId,o),o.send({t:`call`,id:u.downId,hold:e.downId,member:t.member,args:t.args,root:n})})}finally{r.removeEventListener(`abort`,o),r.removeEventListener(`abort`,s)}}function Up(e,t,n){if(n===void 0)return;let r=e.object.currentInstalled();if(r===void 0)return;let i=e.currentView(),a=If(i===void 0?r.implementation:i),o=i!==void 0&&i!==r.implementation?e.contract.description.variants[a??``]?.[t]:r.service.contract.description.variants[If(r.implementation)??``]?.[t];o?.kind===`state`&&Ms(`state`,`${e.address}.${t}`,o.schema,n)}function Wp(e){return e instanceof P&&e.code===`contract_mismatch`?new P(`upgrade_required`,e.message,{cause:e}):e}var Gp=()=>{};function Kp(){let e=Gp,t=Gp,n=new Promise((n,r)=>{e=n,t=r});return n.catch(Gp),{promise:n,resolve:e,reject:t}}var qp=class{host;key;contract;at;input;principal;status=`loading`;error;shape;hydrated=!1;hold;stateOn=!1;views=new Set;members=new Map;lingerTimer;#e=new Map;#t;#n=Kp();#r=!1;#i=new Set;constructor(e,t){this.host=e,this.key=t.key,this.contract=t.contract,this.at=t.at,this.input=t.input,this.principal=t.principal}get ended(){return this.status===`ended`}get stateViews(){let e=0;for(let t of this.views)t.wantsState&&e++;return e}get wantsState(){return this.views.size===0?this.stateOn:this.stateViews>0}get applied(){return this.#r}addView(e){this.views.add(e),this.lingerTimer!==void 0&&(clearTimeout(this.lingerTimer),this.lingerTimer=void 0),this.#a(),e.update()}removeView(e){if(this.views.delete(e)){for(let t of this.#e.values())for(let n of t)n.view===e&&t.delete(n);this.views.size===0?this.host.bindingIdle(this):this.#a()}}#a(){if(this.ended||this.views.size===0)return;let e=this.stateViews>0;if(e!==this.stateOn){this.stateOn=e,e||(this.hydrated=!1,this.members.clear(),this.#t!==void 0&&this.#t.missing.clear()),this.hold!==void 0&&this.hold.channel.wantState(this.hold.id,e);for(let e of this.views)e.update()}}listen(e,t){let n=this.#e.get(e);n===void 0&&(n=new Set,this.#e.set(e,n)),n.add(t)}unlisten(e,t){this.#e.get(e)?.delete(t)}inVariant(e){let t=this.shape?.variant;return t!==void 0&&this.contract.description.variants[t]?.[e]?.kind===`state`}read(e){if(this.status===`ended`)throw this.terminalError();if(!this.hydrated)throw new P(`not_ready`,`${this.key}.${e} is not hydrated yet`);if(!this.inVariant(e))throw new P(`not_in_variant`,`${this.key}: ${e} is not a state member of variant ${this.shape?.variant}`);return this.members.get(e)?.value}whenHydrated(){return this.hydrated?Promise.resolve():this.ended?Promise.reject(this.terminalError()):new Promise((e,t)=>this.#i.add({resolve:e,reject:t}))}#o(e){let t=[...this.#i];this.#i.clear();for(let n of t)e===void 0?n.resolve():n.reject(e)}readable(e){return this.status!==`ended`&&this.hydrated&&this.inVariant(e)}terminalError(){return this.error??new P(`released`,`reference ${this.key} released`)}bound(e,t){this.hold={channel:e,id:t},this.stateOn=this.wantsState}shaped(e,t){if(this.ended)return;let n=this.#t,r=new Set(t);if(n!==void 0)for(let e of n.missing)r.add(e);let i=new Set(this.#s(e));for(let e of[...r])(!i.has(e)||!this.stateOn)&&r.delete(e);this.#t={shape:e,missing:r,values:n?.values??new Map},r.size===0&&this.#c()}state(e,t){if(this.ended)return;if(t.as===`error`){let e=lp(t.error);!this.hydrated&&this.stateOn?(this.gone(e),this.close()):this.host.report(e);return}let n=this.#t;if(t.as===`ops`){let r=n?.values.get(e)??this.members.get(e);if(r===void 0)return;let i=r.decoder.decode(t.ops??[]);r.value=zd(r.value,i),r===this.members.get(e)&&this.#l(e,{type:`ops`,ops:i,value:r.value});return}let r={value:t.value,decoder:qd()};n!==void 0&&(n.missing.has(e)||n.values.has(e))?(n.values.set(e,r),n.missing.delete(e),n.missing.size===0&&this.#c()):this.inVariant(e)&&(this.members.set(e,r),this.#l(e,{type:`reset`,value:r.value}))}gone(e){if(!this.ended){this.status=`ended`,this.error=e,this.hold=void 0,this.#t=void 0,this.#n.reject(e),this.#o(e);for(let t of[...this.views])t.end(e);this.#e.clear(),this.host.forgetBinding(this)}}detached(){if(!this.ended){this.hold=void 0,this.#t=void 0,this.status===`live`&&(this.status=`loading`,this.#n=Kp());for(let e of this.views)e.update()}}close(){if(this.lingerTimer!==void 0&&clearTimeout(this.lingerTimer),this.lingerTimer=void 0,this.hold!==void 0&&this.hold.channel.release(this.hold.id),this.hold=void 0,this.status!==`ended`){this.status=`ended`;let e=new P(`released`,`reference ${this.key} released`);this.#n.reject(e),this.#o(e);for(let t of[...this.views])t.end(e)}this.#t=void 0,this.#e.clear(),this.host.forgetBinding(this)}async call(e,t,n){for(;;){if(this.ended)throw this.terminalError();(this.status!==`live`||this.hold===void 0)&&await kf(this.#n.promise,n.signal);let r=this.hold;if(r===void 0||this.status!==`live`)continue;let i=this.shape?.variant,a=i===void 0?void 0:this.contract.description.variants[i]?.[e];if(a?.kind!==`method`)throw new P(`not_in_variant`,`${this.key}: ${e} is not a method of variant ${i}`);let o=a.args===void 0?void 0:Ps(a.args,t);return r.channel.call(r.id,e,o,{rootId:n.rootId,codeVersion:n.codeVersion},n.signal)}}#s(e){let t=e.variant===void 0?void 0:this.contract.description.variants[e.variant];return t===void 0?[]:e.members.filter(e=>t[e]?.kind===`state`)}#c(){let e=this.#t;if(e===void 0)return;this.#t=void 0,this.shape=e.shape;let t=new Set(this.#s(e.shape));for(let e of[...this.members.keys()])t.has(e)||this.members.delete(e);for(let[n,r]of e.values)t.has(n)&&this.members.set(n,r);this.hydrated=this.stateOn&&[...t].every(e=>this.members.has(e)),this.hydrated&&this.#o(),this.status=`live`,this.#r=!0,this.#n.resolve();for(let e of this.views)e.update();for(let[n,r]of e.values)t.has(n)&&this.#l(n,{type:`reset`,value:r.value});for(let e of[...this.views])e.shapeChanged()}#l(e,t){let n=this.#e.get(e);if(n!==void 0)for(let e of[...n])e.deliver(t)}},Jp=class{view;#e;#t=new Set;#n=new Set;#r=new Set;constructor(e,t){this.view=e,this.#e=t}get value(){if(this.view.ended)throw this.view.terminalError();return this.view.binding.read(this.#e)}get[nf](){let e=this.view.binding;if(!e.hydrated)return{hydrated:!1,whenHydrated:()=>e.whenHydrated()}}subscribe(e){return this.#t.add(e),this.#a(),this.#i()&&this.#s(()=>e(this.view.binding.members.get(this.#e)?.value)),()=>this.#o(this.#t,e)}events(e){if(this.#n.add(e),this.#a(),this.#i()){let t=this.view.binding.members.get(this.#e)?.value;this.#s(()=>e({type:`snap`,value:t}))}else this.#r.add(e);return()=>{this.#r.delete(e),this.#o(this.#n,e)}}deliver(e){for(let t of[...this.#n])this.#r.delete(t)?e.type!==`ops`&&this.#s(()=>t({type:`snap`,value:e.value})):this.#s(()=>t(e));for(let t of[...this.#t])this.#s(()=>t(e.value))}stop(){this.#t.clear(),this.#n.clear(),this.#r.clear(),this.view.binding.unlisten(this.#e,this)}#i(){return!this.view.ended&&this.view.binding.readable(this.#e)}#a(){this.view.ended||this.view.binding.listen(this.#e,this)}#o(e,t){e.delete(t),this.#t.size+this.#n.size===0&&this.view.binding.unlisten(this.#e,this)}#s(e){try{e()}catch(e){this.view.binding.host.report(e)}}},Yp=class{object=void 0;binding;owner;wantsState;proxy;ready;status=`loading`;error;shapeListeners=new Set;#e=new Set;#t=new Map;#n=new Map;#r;constructor(e,t,n){this.binding=e,this.owner=t,this.wantsState=n;let r=Kp();this.ready=r.promise,this.#r=r,this.proxy=new Proxy(this,{get:(e,t)=>{if(Af.has(t)){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}if(typeof t==`string`&&t!==`then`)return e.member(t)}}),Mf.set(this.proxy,this)}get contract(){return this.binding.contract}get address(){return this.binding.key}get ended(){return this.status===`released`||this.status===`gone`}get variant(){return this.binding.shape?.variant}get shape(){return this.binding.shape}onShape(e){return this.shapeListeners.add(e),()=>this.shapeListeners.delete(e)}onStatus(e){return this.#e.add(e),()=>this.#e.delete(e)}terminalError(){return this.status===`gone`?this.error:new P(`released`,`reference ${this.address} released`)}release(){if(!this.ended){this.status=`released`,this.#i(),this.#r?.reject(new P(`released`,`reference ${this.address} released`)),this.#r=void 0;for(let e of this.#t.values())e.stop();this.binding.removeView(this)}}update(){if(this.ended)return;let e=this.binding,t=e.status===`live`&&e.hold!==void 0&&(!this.wantsState||e.hydrated),n=t?`live`:`loading`;n!==this.status&&(this.status=n,this.#i(),t&&(this.#r?.resolve(),this.#r=void 0))}end(e){if(this.ended)return;let t=e instanceof P&&e.code===`released`;this.status=t?`released`:`gone`,t||(this.error=e),this.#i(),this.#r?.reject(e),this.#r=void 0;for(let e of this.#t.values())e.stop()}shapeChanged(){let e=this.binding.shape;if(!(e===void 0||this.ended))for(let t of[...this.shapeListeners])try{t(e)}catch(e){this.binding.host.report(e)}}#i(){jf(this.#e,this.status,this.error,e=>this.binding.host.report(e))}member(e){let t=Object.values(this.contract.description.variants).map(t=>t[e]).find(e=>e!==void 0);if(t?.kind===`method`)return this.#a(e);if(t?.kind===`state`){let t=this.#t.get(e);return t===void 0&&(t=new Jp(this,e),this.#t.set(e,t)),t}}#a(e){let t=this.#n.get(e);if(t===void 0){let n=bc(this.contract,e);t=(...t)=>{let[r,i]=n?[void 0,t[0]]:t,a=this.binding.host;if(a.inFactory>0)throw new P(`not_ready`,`${this.address}.${e} called inside a factory`);if(i!==void 0&&!(i instanceof Ef))return Promise.reject(Ss(`foreign_ctx`,`ctx must come from a Chord host`));try{i?.check(a)}catch(e){return Promise.reject(e)}return i===void 0||i.holder?a.root(t=>this.#o(e,r,t),{signal:i?.signal}):this.#o(e,r,i)},this.#n.set(e,t)}return t}#o(e,t,n){return this.ended?Promise.reject(this.terminalError()):this.binding.call(e,t,n)}},Xp=e=>typeof e==`object`&&!(e instanceof URL),Zp=new Map;function Qp(e){return new $p(e)}var $p=class{name;dev;principal;inFactory=0;failed;objects=new Map;codeVersions=new Map;facets=new Map;hostObjects=new Map;kind;connections=new Set;upstream;bindings=new Map;#e=new Map;#t;#n;#r=0;#i=new Map;#a=new hp(this);remoteModules={};remoteRemoved={};#o=0;#s=new Map;#c=new Set;#l=Math.random().toString(36).slice(2,8);#u=new Map;current;previous;pending;gating;reloading=!1;taskStopDeadline;readyTimeout;#d;#f;#p=new Set;#m=new Map;#h=[];#g=new Map;#_;#v;#y=new Map;#b=new Map;#x=new Map;#S=new Map;#C=1;#w=0;constructor(e){if(this.name=e.name??`host`,this.dev=e.dev??!1,!(`self`in e))throw TypeError("createHost needs `self`: the principal of the host's own code");this.principal=e.self,this.#d=e.principalKey??Es,this.#f=this.#d(e.self),this.#_=e.onError??(e=>console.error(`chord:`,e)),this.#v=e.loader,this.taskStopDeadline=e.taskStopDeadline??5e3,this.readyTimeout=e.readyTimeout??6e4,this.#t=e.linger?.types??{},this.#n=e.linger?.cap??4,this.current={id:this.#C,services:new Map,tables:new Map,roots:new Map,abort:new AbortController},this.codeVersions.set(this.current.id,this.current),this.kind=e.kind??`host`,e.upstream!==void 0&&this.connect(e.upstream.link,e.upstream)}isSelf(e){return e===this.principal||this.#d(e)===this.#f}get codeVersion(){return this.current.id}get previousCodeVersion(){return this.previous?.id}nextCodeVersionId(e){if(e!==void 0&&e<=this.current.id)throw Error(`code version ${e} is not newer than ${this.current.id}`);return this.#C=e??this.#C+1,this.#C}report(e){this.#_(e)}serve=((e,t,n={})=>{if(this.reloading)throw Error(`host.serve during a reload; serve from a facet passed to reload()`);this.serveInto(this.current.services,gf(e,t,n,``)),n.lifetime===`host`&&this.startHostObject(this.current.services.get(e.name))});install(e,t={}){if(this.reloading)throw Error(`host.install during a reload`);if(this.facets.has(e.name))throw Error(`facet ${e.name} is already installed; use reload()`);let n=[],r=new AbortController;try{e.setup(this.facetApi(((t,r,i={})=>{let a=gf(t,r,i,e.name);this.serveInto(this.current.services,a),n.push(a)}),r.signal))}catch(e){throw r.abort(e),e}this.facets.set(e.name,e),this.facetRunChanged(e.name,r);let i=n.filter(_f).map(e=>this.startHostObject(e));return t.awaitHostObjects===!1?Promise.resolve():this.#T(i)}async load(e,t={}){let n=await this.resolve(e);await Promise.all(n.map(e=>this.install(e,t)))}ready(){return this.#T(this.hostObjects.values())}#T(e){let t=Promise.all([...e].map(e=>e.ready)).then(()=>{});return t.catch(()=>{}),t}async resolve(e){let t=e.filter(e=>!Xp(e));if(t.length>0&&this.#v===void 0)throw Error(`loading modules needs createHost({ loader }), e.g. nodeLoader from @earendil-works/chord/node`);let n=t.length>0&&this.#v!==void 0?await this.#v(t):[];return e.map(e=>Xp(e)?e:n.shift())}facetApi(e,t){return{serve:e,name:this.name,root:(e,t)=>this.root(e,t),registry:e=>this.registry(e),signal:t}}facetRunChanged(e,t){let n=this.#g.get(e);t===void 0?this.#g.delete(e):this.#g.set(e,t),n!==t&&n?.abort(new P(`gone`,`facet ${e} was replaced or removed`))}serveInto(e,t){if(e.has(t.contract.name))throw Error(`${t.contract.name} is already served`);let n=t.contract.description.host;if(n!==void 0&&!ic(n,this.name))throw TypeError(`${t.contract.name} is declared for ${ac(n)}, but ${this.name} serves it`);e.set(t.contract.name,t)}startHostObject(e){let t=this.acquire(e.contract,{},void 0,`host`);return this.hostObjects.set(e.contract.name,t),t.ready.catch(e=>this.report(e)),t}currentCodeVersion(){return this.current.id}hasCodeVersion(e){return this.codeVersions.has(e)}*retainedCodeVersions(){for(let[e,t]of this.codeVersions)yield[e,t.services];this.pending!==void 0&&(yield[this.pending.id,this.pending.services])}pendingCodeVersion(){return this.pending?.id}service(e){return this.current.services.get(e)??this.pending?.services.get(e)}addressOf(e,t,n,r=!1){let i=this.#E(e,t);if(i!==void 0)return this.#k(e,i.input,n);let a=this.#j(e.name,r);if(a===void 0)throw rm(e.name,this.name);return this.#D(a,t,n).address}#E(e,t){let n=e.description.host;if(e.scope!==`remote`||n===void 0)return;let r=Ns(e.input,t,`${e.name} input`),i=rc(e.name,n,r);return i===this.name?void 0:{at:i,input:r}}#D(e,t,n){let{name:r,input:i}=e.contract,a=Ns(i,t,`${r} input`),o=Us(i,a);if(_f(e)){if(o!==Us(i,Ns(i,{},`${r} input`)))throw Ss(`input`,`${r} has lifetime "host": its one object has the empty input`);n=this.principal}return{address:`${r}\u0000${o}\u0000${this.#O(n)}`,normalized:a,principal:n}}#O(e){return this.isSelf(e)?`host`:`p:${this.#d(e)}`}#k(e,t,n){let r=Us(e.input,t);return`@${e.name}\u0000${r}\u0000${this.#O(n)}\u0000${e.fingerprint}`}acquire(e,t,n,r,i,a=!1){let o=this.#E(e,t);if(o!==void 0)return this.#P(e,o.at,o.input,n,r);let s=this.#j(e.name,a);if(s===void 0)throw rm(e.name,this.name);yc(s.contract,s.options.accepts,e);let{address:c,normalized:l,principal:u}=this.#D(s,t,n?.principal??this.principal),d=s.contract.description.host;if(d!==void 0&&rc(e.name,d,l)!==this.name)throw Ss(`placement`,`${e.name} with this input lives on ${rc(e.name,d,l)}, not ${this.name}`);let f=this.objects.get(c);if(i!==void 0&&f!==void 0&&(f===i||im(f,i)))throw Ss(`cycle`,`${i.address} -> ${c} would create a ref cycle`);if(f===void 0){if(this.gating?.has(e.name))throw new P(`upgrade_conflict`,`${e.name} is being upgraded; retry`,{reason:`gate`});let t=this.#y.get(c);t?.status===`disposed`&&this.#y.delete(c),f=new Rf(this,{address:c,typeName:e.name,input:l,principal:u,hostLifetime:_f(s)}),this.objects.set(c,f),f.start(t?.status===`disposing`?t.dispose(!1):void 0)}let p=new Ff(f,e,r);return f.addRef(p),p}forget(e){this.objects.get(e.address)===e&&this.objects.delete(e.address),e.status===`disposing`&&this.#y.set(e.address,e)}disposed(e){this.#y.get(e.address)===e&&this.#y.delete(e.address)}touch(e,t){let n=this.#b.get(e);n===void 0&&(n=new Set,this.#b.set(e,n)),n.add(t)}async root(e,t={}){let n=`${this.name}#${this.#l}:${++this.#w}`;return this.#c.add(n),this.joinRoot(n,t.codeVersion??this.current.id,e,t)}async joinRoot(e,t,n,r={}){let i=this.codeVersions.get(t);if(i===void 0)throw this.#c.delete(e),new P(`superseded`,`code version ${t} is not retained by ${this.name}`);if(r.from!==void 0&&!this.#c.has(e)){let t=this.#s.get(e);t===void 0&&(t=new Set,this.#s.set(e,t)),t.add(r.from)}i.roots.set(e,(i.roots.get(e)??0)+1);let a=new Ef(this,{signals:r.signal===void 0?[i.abort.signal]:[r.signal,i.abort.signal],rootId:e,codeVersion:i.id,principal:r.principal??this.principal});try{return await n(a)}finally{a.close();let t=(i.roots.get(e)??1)-1;t>0?i.roots.set(e,t):(i.roots.delete(e),this.#s.has(e)||this.endRoot(e),this.maybeRetire(),this.#A())}}rootSent(e,t){let n=this.#u.get(e);n===void 0&&(n=new Set,this.#u.set(e,n)),n.add(t)}endRoot(e){this.#c.delete(e),this.#s.delete(e);for(let t of this.#b.get(e)??[])t.rootEnded(e);this.#b.delete(e);for(let t of this.#u.get(e)??[])t.send({t:`root_end`,rootId:e});this.#u.delete(e)}foreignRootEnded(e,t){let n=this.#s.get(e);n===void 0||!n.delete(t)||n.size>0||([...this.codeVersions.values()].some(t=>t.roots.has(e))?this.#s.delete(e):this.endRoot(e))}maybeRetire(){this.retirable()&&this.retire()}retirable(){let e=this.previous;return e===void 0||e.roots.size>0?!1:this.kind===`client`||this.upstream===void 0||e.id<=this.#o}allowRetire(e){this.#o=Math.max(this.#o,e),this.maybeRetire(),this.#A()}watchRetirement(e){return this.#p.add(e),()=>this.#p.delete(e)}#A(){for(let e of[...this.#p])e()}announceRetired(e){let t=(this.previous??this.current).id-1;t>0&&e.send({t:`retire`,codeVersion:t})}retire(){let e=this.previous;if(e!==void 0){this.previous=void 0,this.codeVersions.delete(e.id);for(let t of[...this.objects.values()])this.retireImplementation(t,e.id);for(let t of this.connections)t.role===`downstream`&&t.peer?.kind===`host`&&t.send({t:`retire`,codeVersion:e.id});this.#A()}}retireImplementation(e,t){let n=e.implementations.get(t);if(e.implementations.delete(t),n===void 0||n.decls===e.decls)return;let r=e.allDecls(),i=e=>new Set([...r].flatMap(t=>[...e(t)])),a=i(e=>e.refs.values()),o=i(e=>e.resources.values()),s=i(e=>e.derives.values());for(let e of n.decls.derives.values())s.has(e)||e.detach();let c=[...n.decls.resources.values()].filter(e=>!o.has(e)).sort((t,n)=>e.openOrder.indexOf(n)-e.openOrder.indexOf(t)),l=[...n.decls.refs.values()].filter(e=>!a.has(e));e.refreshSchemas(),ws([...c.map(t=>()=>t.close(e.openOrder)),...l.map(e=>()=>e.release())],`${e.address}: retiring code version ${t} failed`).catch(e=>this.report(e))}registry(e){let t=t=>{let n=t===void 0?this.current:this.codeVersions.get(t.codeVersion);if(n===void 0)throw new P(`superseded`,`code version ${t?.codeVersion} is retired`);return n.tables.get(e.name)??Zp};return{table:t,get:(e,n)=>t(n).get(e),subscribe:n=>{let r=this.#S.get(e.name);r===void 0&&(r=new Set,this.#S.set(e.name,r));let i=n;return r.add(i),i(t(),this.current.id),()=>r.delete(i)}}}buildTables(e){let t=new Map;for(let[n,r]of e)for(let{registry:e,key:i,value:a}of r.registrations.values()){let r=t.get(e.name);r===void 0&&(r=new Map,t.set(e.name,r));let o=r.get(i);if(o!==void 0&&o.object!==n&&e.conflict===`error`)throw Ss(`registry_conflict`,`${e.name}: ${i} registered by ${o.object.address} and ${n.address}`);r.set(i,{value:a,object:n});let s=this.#x.get(e.name);s===void 0&&(s=new Map,this.#x.set(e.name,s)),s.has(i)||s.set(i,s.size)}let n=new Map;for(let[e,r]of t){let t=this.#x.get(e),i=[...r].sort(([e],[n])=>t.get(e)-t.get(n));n.set(e,new Map(i.map(([e,t])=>[e,t.value])))}return n}#j(e,t){return(t?this.pending?.services.get(e):void 0)??this.service(e)}liveDecls(e=!1){return[...this.objects.values()].filter(t=>t.status===`live`&&(e||!t.deferredRuntime)).map(e=>[e,e.decls])}checkRegistrations(e,t){t.registrations.size!==0&&this.buildTables([...this.liveDecls().filter(([t])=>t!==e),[e,t]])}registriesChanged(e){let t=this.liveDecls().filter(([t])=>t!==e);e!==void 0&&t.push([e,e.decls]),this.installTables(this.current,this.buildTables(t))}fail(e){this.failed??=e,this.report(e)}installTables(e,t,n=!1){let r=e.tables;if(e.tables=t,e===this.current)for(let[i,a]of this.#S){let o=t.get(i)??Zp;if(!n&&tm(r.get(i)??Zp,o))continue;let s=[...a];Zd(()=>{for(let t of s)try{t(o,e.id)}catch(e){this.report(e)}})}}async get(e,t,n){let r=this.acquire(e,t,n,`external`);return await Of(r,n?.signal===void 0?[]:[n.signal],this.readyTimeout),r.proxy}hold(e,t,n){return this.acquire(e,t,n,`external`).proxy}async invalidatePrincipal(e){let t=typeof e==`function`?e:t=>nm(e,t),n=new P(`gone`,`principal invalidated`);for(let e of[...this.connections])e.role===`downstream`&&t(e.principal)&&e.revoke(e.restamp?.(e.principal));if(typeof e!=`function`)for(let t of this.connections)t.role===`downstream`&&t.peer.kind===`host`&&t.send({t:`invalidate`,pattern:e});await em([...this.objects.values()].filter(e=>!this.isSelf(e.principal)&&t(e.principal)),n,`invalidatePrincipal: disposal failed`)}accept(e,t){let n=t.kind??`client`;if(n===`host`&&t.name===void 0)throw TypeError(`accepting a host link needs its name`);this.#M(e,{...t,role:`downstream`,principal:t.principal,peer:{kind:n,name:n===`host`?t.name:void 0},...n===`client`?{originId:`${this.#l}:${++this.#r}`}:{}})}connect(e,t){if(!(`principal`in t))throw TypeError("connect needs `principal`: what the parent's own requests act as");this.upstream?.open&&this.upstream.link.close(`replaced`);let n=this.#M(e,{...t,role:`upstream`,principal:t.principal,peer:{kind:`host`,name:void 0}});this.upstream=n;for(let e of this.bindings.values())e.hold===void 0&&!e.ended&&n.hold(e,e.applied)}#M(e,t){let n=new zp(this,e,t);return n.open&&this.connections.add(n),n}route(e,t){if(typeof t.principal!=`function`)throw TypeError(`route ${e} needs \`principal\`: what the routed hosts act as when they call back`);this.#i.set(e,t)}peerHello(e,t){t>this.current.id?(this.report(new P(`invalid`,`${e.name} runs code version ${t}, ahead of ${this.current.id}`)),e.link.close(`code version ahead of parent`)):this.reloading?(e.peerCodeVersion=t,t<this.current.id&&e.fencedCodeVersions.add(t),this.#m.set(e,t)):t===this.current.id?(e.markSynced(t),this.announceRetired(e)):(e.peerCodeVersion=t,e.fencedCodeVersions.add(t),mp(this,e).catch(t=>{this.report(t),e.link.close(`reconciliation failed`)}))}reloadEnded(){this.reloading=!1;let e=[...this.#m];this.#m.clear();for(let[t,n]of e)t.open&&this.peerHello(t,n);for(let e of this.#h.splice(0))e();this.maybeRetire()}whenReloadEnded(){return this.reloading?new Promise(e=>this.#h.push(e)):Promise.resolve()}connectionClosed(e){this.connections.delete(e),this.#m.delete(e);for(let[t,n]of[...this.#s])n.has(e)&&this.foreignRootEnded(t,e);for(let t of this.#u.values())t.delete(e);this.upstream===e&&(this.upstream=void 0,this.#a.parentLost())}bindingIdle(e){let t=Object.hasOwn(this.#t,e.contract.name)?this.#t[e.contract.name]:0;if(t<=0||e.ended||!e.applied||this.#n<=0)e.close();else{e.lingerTimer=setTimeout(()=>e.close(),t),e.lingerTimer.unref?.(),this.#e.set(e.key,e);for(let e of this.#e.values()){if(this.#e.size<=this.#n)break;e.close()}}}forgetBinding(e){this.bindings.get(e.key)===e&&this.bindings.delete(e.key),this.#e.get(e.key)===e&&this.#e.delete(e.key)}#N(e){return[...this.connections].find(t=>t.open&&t.role===`downstream`&&t.peer.kind===`host`&&t.peer.name===e)}#P(e,t,n,r,i){let a=r?.principal===void 0||this.isSelf(r.principal)?void 0:r.principal,o=this.#k(e,n,a??this.principal),s=this.bindings.get(o),c=s===void 0||s.ended;(s===void 0||s.ended)&&(s=new qp(this,{key:o,contract:e,at:t,input:n,principal:a}),this.bindings.set(o,s));let l=new Yp(s,i,r?.state!==!1);return this.#e.delete(o),s.addView(l),c&&this.#F(s),l}#F(e){let t=t=>{t.then(t=>{!e.ended&&e.hold===void 0&&t.hold(e,!1)},t=>e.gone(t))},n=this.#N(e.at);if(this.upstream!==void 0)this.upstream.hold(e,!1);else if(n!==void 0)t(n.whenSynced().then(()=>n));else{let n=this.#I(e.at);n===void 0?e.gone(new P(`unavailable`,`no route to ${e.at}`)):t(this.#L(n,e.at,e.principal??this.principal))}}#I(e){let t;for(let n of this.#i)e.startsWith(n[0])&&(t===void 0||n[0].length>t[0].length)&&(t=n);return t?.[1]}async#L(e,t,n,r=()=>!0){let i=()=>new P(`forbidden`,`${t} refused for this principal`),a=()=>new P(`gone`,`principal invalidated while resolving`);if(!await e.authorize(n,t))throw i();if(!r())throw a();let o=await e.resolve(t),s=[...this.connections].find(e=>e.link===o);if(s??=this.#M(o,{role:`downstream`,principal:e.principal(t),peer:{kind:`host`,name:t}}),!r())throw a();if(!await e.authorize(n,t))throw i();if(!r()||(await s.whenSynced(),!r()))throw a();return s}async relay(e){let t=e.frame.at,n=hc(e.frame.token).description.host;if(n===void 0||rc(e.frame.token.name,n,e.frame.input)!==t)throw Ss(`placement`,`${e.frame.token.name} with this input does not live on ${t}`);let r=this.#I(t);if(r===void 0)throw this.#N(t)===void 0?new P(`unavailable`,`no route to ${t}`):new P(`forbidden`,`no route authorizes ${t}`);let i=await this.#L(r,t,e.principal,()=>e.current);e.current&&e.open(i)}reload(e,t={}){return this.kind!==`client`&&this.upstream!==void 0?Promise.reject(new P(`unavailable`,`reloads are coordinated by the server`,{reason:`not_coordinator`})):[...this.connections].some(e=>e.role===`downstream`&&e.peer.kind===`host`)||t.remote!==void 0||t.remoteRemove!==void 0?pp(this,e,t):Kf(this,e,t)}onReloadFrame(e,t){this.#a.handle(e,t)}rememberRemoteModules(e,t){for(let n of new Set([...Object.keys(e??{}),...Object.keys(t??{})])){let r=e?.[n]??[],i=t?.[n]??[];this.remoteModules[n]=[...new Set([...this.remoteModules[n]??[],...r])].filter(e=>!i.includes(e)),this.remoteRemoved[n]=[...new Set([...this.remoteRemoved[n]??[],...i])].filter(e=>!r.includes(e))}}peekNextCodeVersion(){return this.#C+1}async close(){for(let e of[...this.#e.values()])e.close();this.hostObjects.clear();for(let e of[...this.#g.keys()])this.facetRunChanged(e,void 0);let e=new P(`gone`,`host ${this.name} closed`);try{await em([...this.objects.values()],e,`host close: disposal failed`)}finally{for(let e of[...this.connections])e.link.close(`host closed`)}}};async function em(e,t,n){let r=new Set(e),i=e=>{let t=new Set;for(let n of e.allDecls())for(let e of n.refs.values())e.object!==void 0&&t.add(e.object);return t},a=new Map(e.map(e=>[e,i(e)])),o=[];for(;r.size>0;){let e=new Set;for(let t of r)for(let n of a.get(t)??[])e.add(n);let n=[...r].filter(t=>!e.has(t));n.length===0&&(n=[...r]);for(let e of n)r.delete(e);let i=await Promise.allSettled(n.map(e=>e.dispose(!0,t)));for(let e of i)e.status===`rejected`&&o.push(e.reason)}if(o.length===1)throw o[0];if(o.length>1)throw AggregateError(o,n)}function tm(e,t){if(e.size!==t.size)return!1;let n=[...e.keys()];return[...t].every(([t,r],i)=>n[i]===t&&e.get(t)===r)}var nm=(e,t)=>typeof t==`object`&&!!t&&Object.entries(e).every(([e,n])=>Os(t[e],n)),rm=(e,t)=>new P(`unavailable`,`${e} is not served by ${t}`,{reason:`unknown_type`});function im(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;if(!n.has(e)){n.add(e);for(let t of e.allDecls())for(let e of t.refs.values())e.object!==void 0&&r.push(e.object)}}return!1}var am=[`off`,`on`,`only`],om={maxItems:100,idChars:64,textChars:256,itemsBytes:65536},sm={questionChars:2e3,maxOptions:12,optionIdChars:64,labelChars:200,descriptionChars:500,textChars:4e3,questionBytes:16384,responseBytes:16384,maxPending:8,previewChars:256,recordBytes:65536},cm={titleChars:120,maxSteps:30,stepChars:500,noteChars:4e3,feedbackChars:2e3},lm=class extends Error{name=`InteractionInputError`},um=new TextEncoder,dm=e=>um.encode(JSON.stringify(e)).length,fm=e=>e.trim()===``,pm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),mm=e=>{throw new lm(e)};function hm(e,t,n){for(let r of Object.keys(e))t.includes(r)||mm(`${n} has an unknown field "${r}".`)}function gm(e,t){if(!pm(t))return mm(`Response must be an object.`);if(dm(t)>sm.responseBytes&&mm(`Response is too large (limit ${sm.responseBytes} bytes).`),t.kind===`skip`)return hm(t,[`kind`],`Response`),{kind:`skip`};if(t.kind!==`answer`)return mm(`Response kind must be "answer" or "skip".`);hm(t,[`kind`,`optionIds`,`text`],`Response`);let n=t.optionIds===void 0?[]:t.optionIds;if(!Array.isArray(n))return mm(`optionIds must be an array.`);n.length>sm.maxOptions&&mm(`Too many selected options (limit ${sm.maxOptions}).`);let r=new Set;for(let t of n)(typeof t!=`string`||t===``)&&mm(`optionIds must contain non-empty strings.`),r.has(t)&&mm(`Option "${t}" was selected twice.`),e.options.some(e=>e.id===t)||mm(`Unknown option "${t}".`),r.add(t);!e.options.length&&r.size&&mm(`This question has no options.`),!e.multiple&&r.size>1&&mm(`This question accepts only one option.`);let i=null;if(t.text!==void 0){typeof t.text!=`string`&&mm(`text must be a string.`);let e=t.text;e.length>sm.textChars&&mm(`text is too long (limit ${sm.textChars} characters).`),fm(e)||(i=e)}return!r.size&&i===null&&mm(`Choose an option or enter text.`),{kind:`answer`,optionIds:e.options.filter(e=>r.has(e.id)).map(e=>e.id),text:i}}function _m(e,t){return t.optionIds.map(t=>e.options.find(e=>e.id===t)?.label??t)}var vm=e=>({completed:e.filter(e=>e.status===`completed`).length,total:e.length}),ym=()=>({optionIds:[],text:``});function bm(e,t,n){let r=t.optionIds.includes(n);return e.multiple?{...t,optionIds:r?t.optionIds.filter(e=>e!==n):[...t.optionIds,n]}:{...t,optionIds:r?[]:[n]}}function xm(e){let t=fm(e.text)?void 0:e.text;return!e.optionIds.length&&t===void 0?null:{kind:`answer`,...e.optionIds.length?{optionIds:[...e.optionIds]}:{},...t===void 0?{}:{text:t}}}function Sm(e,t){let n=xm(t);if(!n)return`Choose an option or enter text.`;try{return gm(e,n),null}catch(e){return e instanceof Error?e.message:`Invalid answer.`}}function Cm(e){if(e.status===`answered`&&e.answer){let t=_m(e,e.answer);return e.answer.text!==null&&t.push(e.answer.text),t.join(`, `)}return e.status===`skipped`?`Skipped`:e.status===`cancelled`?`Cancelled`:`Waiting for your answer`}var wm=`neko`,Tm=(e,t)=>[e,t];function Em(e,t){let n=Object.fromEntries(Object.entries(t.variants).map(([e,t])=>[e,{...t,methods:Object.fromEntries(Object.entries(t.methods??{}).map(([e,[t,n]])=>[e,tc(t,n)]))}]));return mc(e,{...t,host:nc(wm),variants:n})}var F=ea(),Dm=ta(),Om=ra(),I=ia(),L=na({minimum:0,maximum:2**53-1}),km=ca([F,I]),Am=sa([`pending`,`running`,`done`]),jm=sa([`project`,`user`,`builtin`]),Mm=sa([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]),Nm=N({provider:F,modelId:F},{open:!0}),Pm={model:M(Nm),thinkingLevel:M(Mm)},Fm=N(Pm),Im=N({input:Dm,output:Dm,cacheRead:Dm,cacheWrite:Dm,cost:Dm},{open:!0}),Lm=N({name:F,mimeType:F,width:L,height:L,bytes:L,entryId:L,contentIndex:L},{open:!0}),Rm=N({name:F,location:F,body:F,args:F},{open:!0}),zm=N({calls:la(N({id:L,name:F,args:F,status:sa([`running`,`ok`,`error`,`cancelled`]),durationMs:ca([Dm,I]),error:km},{open:!0})),omitted:L,fullOutputPath:km},{open:!0}),Bm=N({callId:F,name:F,summary:F,detail:km,phase:Am,output:km,diff:km,diffAdded:ca([Dm,I]),diffRemoved:ca([Dm,I]),diffTruncated:M(Om),codemode:M(zm)},{open:!0}),Vm=N({parentId:L,agentId:M(F),round:M(L),runnerId:M(L),inputEntryId:M(L),answerEntryId:M(L),roundUsage:M(ca([Im,I])),taskId:L,callId:F,childId:L,role:sa([`explore`,`plan`,`coder`]),title:F,createdAt:Dm,startedAt:ca([Dm,I]),endedAt:ca([Dm,I]),status:sa([`queued`,`running`,`completed`,`failed`,`cancelled`]),report:km,approvalCount:M(L),historyThrough:M(L),historyUsage:M(Im)},{open:!0}),Hm=N({agentId:F,parentId:L,childId:L,role:sa([`explore`,`plan`,`coder`]),title:F,status:sa([`idle`,`queued`,`running`]),activeRoundId:ca([L,I]),lastRoundId:L,lastReport:M(km),roundCount:L,taskTitle:F,approvalCount:L,createdAt:Dm,historyThrough:M(L),historyUsage:M(Im)},{open:!0}),Um=N({jobId:F,title:F,command:F,cwd:F,status:sa([`running`,`exited`,`failed`,`stopped`,`lost`]),startedAt:Dm,endedAt:ca([Dm,I]),exitCode:ca([Dm,I]),reason:M(sa([`timeout`,`spawn-error`,`restart`,`aborted`])),timeoutSeconds:M(Dm),outputBytes:L},{open:!0}),Wm=N({job:Um,text:F,offset:L,truncated:Om,dropped:L},{open:!0}),Gm=N({id:L,mode:sa([`steer`,`followUp`]),preview:F,images:L,skill:M(N({name:F,args:F},{open:!0}))},{open:!0}),Km=N({result:sa([`withdrawn`,`placed`,`settled`,`unknown`]),text:M(F),images:M(L)},{open:!0}),qm=N({result:sa([`steered`,`withdrawn`,`placed`,`settled`,`unknown`]),id:M(L),text:M(F),images:M(L)},{open:!0}),Jm=N({revision:L,items:la(N({id:ea({minLength:1,maxLength:om.idChars}),text:ea({minLength:1,maxLength:om.textChars}),status:sa([`pending`,`in_progress`,`completed`])}),{maxItems:om.maxItems})},{open:!0}),Ym=N({id:ea({minLength:1,maxLength:sm.optionIdChars}),label:ea({minLength:1,maxLength:sm.labelChars}),description:M(ea({maxLength:sm.descriptionChars})),recommended:M(Om)}),Xm=sa([`pending`,`answered`,`skipped`,`cancelled`]),Zm=N({id:L,version:F,preview:ea({maxLength:sm.previewChars}),multiple:Om,optionCount:L,createdAt:Dm},{open:!0}),Qm=N({path:F,entries:la(N({name:F,path:F,kind:sa([`file`,`directory`,`symlink`]),protected:M(oa(!0))}),{maxItems:1e3}),limited:Om,incomplete:Om},{open:!0}),$m=N({path:F,size:Dm,mtimeMs:Dm,kind:sa([`text`,`binary`,`protected`]),content:M(F),truncated:Om},{open:!0}),eh=N({revision:L,files:L,added:L,removed:L},{open:!0}),th=N({revision:L,files:la(N({path:F,outside:M(oa(!0)),ops:L,added:L,removed:L,agents:la(F,{maxItems:64}),lastSeq:L}),{maxItems:500}),truncated:Om},{open:!0}),nh=N({seq:L,agent:F,tool:sa([`edit`,`write`]),diff:F,added:L,removed:L,truncated:Om}),rh=N({path:F,outside:M(oa(!0)),ops:la(nh,{maxItems:50}),truncated:Om},{open:!0}),ih=N({revision:L,pending:la(Zm,{maxItems:sm.maxPending})},{open:!0}),ah=N({id:L,callId:F,version:F,question:ea({maxLength:sm.questionChars}),multiple:Om,options:la(Ym,{maxItems:sm.maxOptions}),status:Xm,answer:ca([N({optionIds:la(ea(),{maxItems:sm.maxOptions}),text:ca([ea({maxLength:sm.textChars}),I])},{open:!0}),I]),createdAt:Dm,settledAt:ca([Dm,I])},{open:!0}),oh=ca([N({kind:oa(`answer`),optionIds:M(la(ea(),{maxItems:sm.maxOptions})),text:M(ea({maxLength:sm.textChars}))}),N({kind:oa(`skip`)})]),sh=N({version:F,title:ea({maxLength:cm.titleChars}),steps:la(ea({maxLength:cm.stepChars}),{maxItems:cm.maxSteps}),note:ea({maxLength:cm.noteChars}),status:sa([`awaiting_approval`,`approved`,`revision_requested`,`superseded`,`cancelled`]),feedback:ca([ea({maxLength:cm.feedbackChars}),I]),createdAt:Dm,settledAt:ca([Dm,I])},{open:!0}),ch=N({mode:sa([`normal`,`plan`]),revision:L,current:ca([sh,I])},{open:!0}),lh=ca([N({kind:oa(`approve`)}),N({kind:oa(`revise`),feedback:ea({minLength:1,maxLength:cm.feedbackChars})})]),uh=ca([N({kind:oa(`ask_user`),id:L,question:F,multiple:Om,options:la(N({id:F,label:F,recommended:M(Om)},{open:!0})),status:Xm,optionIds:M(la(F)),labels:M(la(F)),text:M(ca([F,I]))},{open:!0}),N({kind:oa(`todo`),action:sa([`list`,`replace`]),revision:L,completed:L,total:L},{open:!0}),N({kind:oa(`submit_plan`),version:F,title:F,steps:la(F),note:F},{open:!0})]),dh=N({historyBefore:M(ca([L,I])),agents:M(la(Hm)),jobs:M(la(Um)),queued:M(la(Gm)),todos:M(Jm),questions:M(ih),plan:M(ch),changes:M(eh),rounds:M(la(Vm)),subagents:M(la(Vm)),taskUsage:M(Im),model:F,agent:N({model:ca([Nm,I]),thinkingLevel:ca([Mm,I])},{open:!0}),cwd:F,busy:Om,status:km,usage:Im,contextUsage:M(N({tokens:ca([Dm,I]),window:Dm,percent:ca([Dm,I])},{open:!0})),compaction:M(N({failure:M(N({taskId:L,reason:sa([`manual`,`threshold`,`overflow`]),error:F},{open:!0})),active:la(N({taskId:L,reason:sa([`manual`,`threshold`,`overflow`]),blocking:Om,attempt:L,retry:M(N({at:Dm,error:F},{open:!0}))},{open:!0})),latest:ca([I,N({taskId:L,phase:sa([`summarizing`,`waiting-to-apply`,`applied`,`nothing`,`skipped`,`cancelled`,`failed`]),at:Dm},{open:!0})])},{open:!0})),runFailure:M(N({reason:F,detail:M(F)},{open:!0})),continuable:M(oa(!0)),items:la(ca([N({type:oa(`user`),order:M(Dm),key:F,id:L,text:F,images:M(la(Lm)),skill:M(Rm),defaultImagePrompt:M(N({version:na({minimum:1}),text:F},{open:!0}))},{open:!0}),N({type:oa(`assistant`),order:M(Dm),key:F,id:L,thinking:F,text:F,stopReason:km,errorMessage:km,note:km},{open:!0}),N({type:oa(`tool`),order:M(Dm),key:F,images:M(la(Lm)),callId:F,name:F,summary:F,detail:km,phase:Am,isError:Om,output:km,result:km,durationMs:ca([Dm,I]),note:km,diff:km,diffAdded:ca([Dm,I]),diffRemoved:ca([Dm,I]),diffTruncated:M(Om),interaction:M(uh),codemode:M(zm)},{open:!0}),N({type:oa(`system`),order:M(Dm),key:F,id:L,text:F,jobId:M(F),planDecision:M(N({version:F,kind:sa([`approve`,`revise`])}))},{open:!0})])),streaming:ca([I,N({thinking:F,text:F,toolCalls:la(Bm)},{open:!0})])},{open:!0}),fh=N({workspaceRoot:F,lastUsedAt:Dm,title:F,firstPromptPreview:F,createdAt:Dm,lastMessageAt:ca([Dm,I]),model:ca([Nm,I]),status:sa([`idle`,`running`,`error`]),awaitingAnswer:M(Om),awaitingPlan:M(Om),id:F},{open:!0}),ph=N({revision:L,sessions:la(fh)},{open:!0}),mh=N({path:F,createdAt:Dm},{open:!0}),hh=N({revision:L,workspaces:la(mh)},{open:!0}),gh=N({revision:L,statuses:ua(N({savedConfigured:Om,environmentConfigured:Om,source:sa([`saved`,`environment`,`runtime`,`keyless`,`none`]),enabled:M(Om)},{open:!0}))},{open:!0}),_h=N({sessionId:F,attachmentId:F},{open:!0}),vh=N({sessionId:F,attachmentId:F}),yh=Em(`neko.session-directory`,{version:1,input:N({}),variants:{ready:{state:{state:ph}}}}),bh=Em(`neko.session-management`,{version:1,input:N({}),variants:{ready:{methods:{create:Tm(N({...Pm,cwd:M(F)}),fh),archive:Tm(F,I),attach:Tm(F,_h),detach:Tm(I,I),fork:Tm(F,fh)}}}}),xh=N({maxWidth:M(L),maxHeight:M(L),maxBytes:M(L),jpegQuality:M(L)},{open:!0}),Sh=N({maxRequestBytes:M(L),images:M(N({resize:M(xh),maxPerMessage:M(L),maxPerRequest:M(L)},{open:!0}))},{open:!0}),Ch=N({provider:F,modelId:F,name:F,available:Om,contextWindow:Dm,input:la(F),inputLimits:M(Sh),reasoning:Om,supportedThinkingLevels:la(Mm),thinkingLevelAdjustments:N({off:Mm,minimal:Mm,low:Mm,medium:Mm,high:Mm,xhigh:Mm,max:Mm},{open:!0})},{open:!0}),wh=Em(`neko.models`,{version:1,input:N({}),variants:{ready:{methods:{list:Tm(I,la(Ch))}}}}),Th=N({data:F,total:L,mimeType:F},{open:!0}),Eh=Em(`neko.subagent`,{version:1,input:N({sessionId:F,attachmentId:F,taskId:M(L),agentId:M(F)},{open:!0}),variants:{ready:{state:{revision:L},methods:{chunk:Tm(N({kind:sa([`view`,`history`]),before:M(L),token:M(L),offset:L},{open:!0}),N({token:L,data:F,next:ca([L,I])},{open:!0})),getImage:Tm(N({entryId:L,contentIndex:L,offset:L},{open:!0}),Th),decideApproval:Tm(N({id:L,version:F,decision:sa([`allowed`,`denied`])},{open:!0}),sa([`pending`,`allowed`,`denied`,`cancelled`])),stop:Tm(ca([I,N({taskId:L},{open:!0})]),I)}}}}),Dh=Em(`neko.chat`,{version:1,input:vh,variants:{ready:{state:{view:dh},methods:{submit:Tm(N({content:F,images:M(la(F,{maxItems:4})),requestId:M(F),whenBusy:M(sa([`steer`,`followUp`]))}),I),abort:Tm(I,I),continueRun:Tm(I,I),withdraw:Tm(N({id:L}),Km),steer:Tm(N({id:L}),qm),questionGet:Tm(N({id:L}),ca([ah,I])),questionRespond:Tm(N({id:L,version:F,response:oh}),ah),planGet:Tm(N({version:F}),ca([sh,I])),planRespond:Tm(N({version:F,decision:lh}),sh),planMode:Tm(N({mode:sa([`normal`,`plan`])}),ch),usage:Tm(I,Im),workspaceDir:Tm(N({path:F}),Qm),workspaceFile:Tm(N({path:F}),$m),changesList:Tm(I,th),changeGet:Tm(N({path:F}),ca([rh,I])),skills:Tm(I,la(N({name:F,description:F,location:F,level:jm},{open:!0}))),jobOutput:Tm(N({jobId:F,since:M(L)}),Wm),jobStop:Tm(N({jobId:F}),Um),configure:Tm(Fm,I),compact:Tm(N({instructions:M(F)}),I),importImage:Tm(F,N({id:F,name:F},{open:!0})),draftImage:Tm(N({id:F,offset:L}),Th),beginImage:Tm(N({name:F,mimeType:F,size:na({minimum:1,maximum:20971520})}),F),appendImage:Tm(N({id:F,offset:L,data:ea({maxLength:35e4})}),I),finishImage:Tm(F,I),releaseImage:Tm(F,I),getImage:Tm(N({entryId:L,contentIndex:L,offset:L}),Th)}}}}),Oh=N({path:F,query:M(F),showHidden:M(Om),cursor:M(F)}),kh=N({path:F,parent:km,entries:la(N({name:F,path:F,error:M(F)},{open:!0})),next:km},{open:!0}),Ah=Em(`neko.workspaces`,{version:2,input:N({}),variants:{ready:{state:{state:hh},methods:{add:Tm(N({path:F}),mh),remove:Tm(N({path:F}),ia()),browse:Tm(Oh,kh)}}}}),jh=ea({minLength:1,maxLength:64}),Mh=Em(`neko.credentials`,{version:2,input:N({}),variants:{ready:{state:{state:gh},methods:{save:Tm(N({provider:jh,key:ea({minLength:1,maxLength:8192})}),I),remove:Tm(N({provider:jh}),I),setEnabled:Tm(N({provider:jh,enabled:Om}),I)}}}}),Nh=N({revision:L,selected:sa([`tavily`,`deepseek`])},{open:!0}),Ph=Em(`neko.search-settings`,{version:1,input:N({}),variants:{ready:{state:{state:Nh},methods:{set:Tm(N({provider:sa([`tavily`,`deepseek`])}),I)}}}}),Fh=sa([`default`,`config`,`saved`]),Ih=N({revision:L,effective:N({compaction:N({enabled:Om,triggerPercent:ca([L,I]),keepRecentTokens:L},{open:!0}),pruning:N({enabled:Om,triggerPercent:L,keepRecent:L,minChars:L,minSavePercent:L},{open:!0})},{open:!0}),sources:N({compaction:N({enabled:Fh,triggerPercent:Fh,keepRecentTokens:Fh},{open:!0}),pruning:N({enabled:Fh,triggerPercent:Fh,keepRecent:Fh,minChars:Fh,minSavePercent:Fh},{open:!0})},{open:!0})},{open:!0}),Lh=e=>ca([e,I]),Rh=N({compaction:M(N({enabled:M(Lh(Om)),triggerPercent:M(Lh(L)),keepRecentTokens:M(Lh(L))})),pruning:M(N({enabled:M(Lh(Om)),triggerPercent:M(Lh(L)),keepRecent:M(Lh(L)),minChars:M(Lh(L)),minSavePercent:M(Lh(L))}))}),zh=Em(`neko.context-settings`,{version:1,input:N({}),variants:{ready:{state:{state:Ih},methods:{set:Tm(Rh,I),reset:Tm(N({}),I)}}}}),Bh=N({revision:L,effective:N({mode:sa([...am])},{open:!0}),source:sa([`default`,`config`,`saved`])},{open:!0}),Vh=Em(`neko.codemode-settings`,{version:1,input:N({}),variants:{ready:{state:{state:Bh},methods:{set:Tm(N({mode:sa([...am])}),I),reset:Tm(N({}),I)}}}}),Hh=N({effective:Nm,source:sa([`cli`,`saved`,`config`,`default`])},{open:!0}),Uh=Em(`neko.default-model`,{version:1,input:N({}),variants:{ready:{state:{state:Hh},methods:{set:Tm(Nm,I),clear:Tm(I,I)}}}}),Wh=N({entries:la(N({name:F,path:F,kind:sa([`file`,`directory`])},{open:!0}),{maxItems:100}),limited:Om,incomplete:Om},{open:!0}),Gh=Em(`neko.workspace-files`,{version:1,input:N({}),variants:{ready:{methods:{search:Tm(N({workspaceRoot:F,query:F}),Wh)}}}}),Kh=N({name:F,description:F,category:F,source:F,license:F,version:F,sha256:F,sizeBytes:L,uploadedAt:F,installed:N({project:Om,user:Om,builtin:Om},{open:!0}),activeLevel:ca([jm,I])},{open:!0}),qh=N({body:F,files:la(F)},{open:!0}),Jh=sa([`user`,`project`]),Yh=N({name:F,scope:Jh,path:F,shadowedBy:M(Jh)},{open:!0}),Xh=Em(`neko.skill-market`,{version:1,input:N({}),variants:{ready:{methods:{list:Tm(N({query:M(F),workspaceRoot:M(F)}),la(Kh)),detail:Tm(N({name:F,workspaceRoot:M(F)}),Kh),preview:Tm(N({name:F}),qh),install:Tm(N({name:F,scope:Jh,workspaceRoot:M(F),overwrite:M(Om)}),Yh),uninstall:Tm(N({name:F,scope:Jh,workspaceRoot:M(F)}),I)}}}}),Zh=ca([N({status:oa(`ready`),path:F,source:sa([`config`,`auto`])},{open:!0}),N({status:oa(`missing`),reason:sa([`not_found`,`invalid_config`]),detail:M(F)},{open:!0})]),Qh=N({runningVersion:F,installedVersion:km,protocolVersion:na({minimum:1}),latestVersion:km,checkedAt:ca([L,I]),checkState:sa([`unknown`,`checking`,`ok`,`failed`,`development`]),serverId:F,shell:M(Zh)},{open:!0}),$h=Em(`neko.application-info`,{version:1,input:N({},{open:!0}),variants:{ready:{state:{info:Qh},methods:{check:Tm(I,Qh)}}}}),eg=16777216,tg=e=>e instanceof Uint8Array?e:new Uint8Array(e),ng=e=>typeof e==`string`?new TextEncoder().encode(e).byteLength:e.byteLength;function rg(e,t=eg,n){let r=0,i=0,a=!1,o;return o=Np({get readyState(){return e.readyState},send(n){if(ng(n)+e.bufferedAmount>t)throw e.close(1009,`byte limit`),Error(`Link pending byte limit exceeded`);e.send(n)},close:(t,n)=>e.close(t,n),addEventListener(n,s){if(n===`message`){let n=e=>{let n=ng(e);a||(i+=n),n>t||i>t?o.close(`frame limit exceeded`):s({data:e})};e.on?e.on(`message`,(e,t)=>n(t?tg(e):new TextDecoder().decode(tg(e)))):e.addEventListener(`message`,e=>n(typeof e.data==`string`||e.data instanceof Uint8Array?e.data:String(e.data)))}else e.addEventListener(n,()=>{n===`open`&&(r=0);try{s()}catch{o.close(`socket error`)}})}},n),e.addEventListener(`error`,()=>o.close(`socket error`)),{get closed(){return o.closed},send(n){if(o.closed)return;if(e.readyState>1){o.close(`socket closed`);return}let i=ng(JSON.stringify(n));if(i>t||i+e.bufferedAmount+r>t)throw o.close(`pending byte limit exceeded`),Error(`Link byte limit exceeded`);return e.readyState===0&&(r+=i),o.send(n)},receive(e){a=!0,i=0,o.receive(e)},onClose:e=>o.onClose(e),close:e=>o.close(e)}}function ig(e,t={}){return Qp({kind:`client`,self:{kind:`client`},upstream:{link:e,principal:{kind:`server`},...t.onProtocolMismatch?{onProtocolMismatch:t.onProtocolMismatch}:{}},onError:()=>{}})}function ag(e){let t,n,r,i,a=()=>(n||(n=e(),i=n.onStatus((e,n)=>{if(e===`gone`){r=String(n??`Subagent unavailable`);for(let e of s)e(t)}})),n),o=()=>{i?.(),i=void 0,n?.release(),n=void 0},s=new Set,c,l=0,u=0,d=!1;async function f(e,t,n=()=>!0){let r,i=0,o=[];for(;;){if(!n())throw Error(`Transcript subscription closed`);let s=await a().chunk({kind:e,before:t,token:r,offset:i});if(!n())throw Error(`Transcript subscription closed`);if(o.push(s.data),r=s.token,s.next===null)return JSON.parse(o.join(``));i=s.next}}let p=async()=>{if(d||!s.size||!u)return;d=!0;let e=l,n=0;try{do{n=u;try{let n=await f(`view`,void 0,()=>l===e&&s.size>0);if(l!==e)return;r=void 0,t=n;for(let e of s)e(t)}catch(i){if(l!==e)return;if(u===n){r=String(i);for(let e of s)e(t)}}}while(u!==n)}finally{d=!1,l!==e&&s.size&&p()}};return{get error(){return r},view:{get value(){return t},subscribe(e){return s.add(e),e(t),c||=a().revision.subscribe(e=>{u=e??0,p()}),()=>{s.delete(e),s.size||(l++,c?.(),c=void 0,o())}}},history:async e=>{let t=l;try{return await f(`history`,e.before,()=>t===l)}finally{s.size||o()}},getImage:async(e,t)=>{try{return await a().getImage(e,t)}finally{s.size||o()}},decideApproval:async(e,t)=>{try{return await a().decideApproval(e,t)}finally{s.size||o()}},stop:async(e,t)=>{try{return await a().stop(e,t)}finally{s.size||o()}}}}var og=class{#e=new Map;#t;#n;constructor(e,t){this.#t=e,this.#n=t}get pending(){return[...this.#e.values()].flatMap(({service:e,title:t})=>(e.view.value?.approvals??[]).filter(e=>e.status===`pending`).map(n=>({item:n,title:t,service:e}))).sort((e,t)=>e.item.createdAt-t.item.createdAt||e.item.id-t.item.id)}get error(){return[...this.#e.values()].find(({service:e})=>e.error)?.service.error}update(e){let t=e.filter(e=>e.approvalCount&&e.historyThrough===void 0);for(let[e,n]of this.#e)t.some(t=>(t.agentId??t.taskId)===e)||(this.#e.delete(e),n.stop());for(let e of t){let t=e.agentId??e.taskId;if(this.#e.has(t))continue;let n=this.#t(t),r={service:n,title:e.title,stop:()=>{}};this.#e.set(t,r),r.stop=n.view.subscribe(()=>this.#n())}this.#n()}close(){for(let e of this.#e.values())e.stop();this.#e.clear(),this.#n()}},sg=class extends Error{constructor(){super(`Gateway identity mismatch`),this.name=`GatewayIdentityError`}},cg=`This gateway does not support background jobs. Restart the gateway to enable them.`;function lg(e){let t=()=>e.view.value?.jobs!==void 0,n=()=>{if(!t())throw Error(cg)};return{get supported(){return t()},list:()=>e.view.value?.jobs??[],async output(t,r){return n(),e.jobOutput({jobId:t,...r===void 0?{}:{since:r}})},async stop(t){return n(),e.jobStop({jobId:t})}}}var ug=`This gateway does not support queued message controls. Restart the gateway to enable them.`;function dg(e){let t=()=>e.view.value?.queued!==void 0;return{get supported(){return t()},list:()=>e.view.value?.queued??[],async steer(n){if(!t())throw Error(ug);return e.steer({id:n})},async withdraw(n){if(!t())throw Error(ug);return e.withdraw({id:n})}}}var fg=`This gateway does not support questions. Restart the gateway to enable them.`,pg={revision:0,pending:[]};function mg(e){let t=()=>e.view.value?.questions??pg,n=()=>e.view.value?.questions!==void 0;return{get supported(){return n()},get revision(){return t().revision},pending:()=>t().pending,async get(t){if(!n())throw Error(fg);return e.questionGet({id:t})},async respond(t){if(!n())throw Error(fg);return e.questionRespond(t)}}}var hg=`This gateway does not support plan mode. Restart the gateway to enable it.`;function gg(e){let t=()=>e.view.value?.plan!==void 0;return{get supported(){return t()},view:()=>e.view.value?.plan,async get(n){if(!t())throw Error(hg);return e.planGet({version:n})},async respond(n){if(!t())throw Error(hg);return e.planRespond(n)},async setMode(n){if(!t())throw Error(hg);return e.planMode({mode:n})}}}var _g=`This gateway cannot continue a run. Restart the gateway to enable it.`;function vg(e){let t=()=>e.view.value?.continuable===!0;return{get supported(){return t()},failure:()=>t()?e.view.value?.runFailure:void 0,async continueRun(){if(!t())throw Error(_g);await e.continueRun(null)}}}var yg=`This gateway does not support the workspace browser. Restart the gateway to enable it.`;function bg(e,t){let n=()=>e.view.value?.changes!==void 0,r=()=>{if(!n())throw Error(yg)},i=(e,n)=>e&&t?t.root(e=>n(e),{signal:e}):n();return{get supported(){return n()},summary:()=>e.view.value?.changes,async dir(t,n){return r(),i(n,n=>e.workspaceDir({path:t},n))},async file(t,n){return r(),i(n,n=>e.workspaceFile({path:t},n))},async changes(){return r(),e.changesList(null)},async change(t){return r(),e.changeGet({path:t})}}}function xg(e,t,n={}){let r=n.readyTimeoutMs??Sg,i=!1,a=new AbortController,o=``;e.onClose(e=>{o=e,a.abort(Error(`Gateway connection closed: ${e}`))});let s=ig(e,{onProtocolMismatch:()=>{i=!0}}),c=e=>s.hold(e,{}),l=c($h),u=[l.info.subscribe(()=>{})],d,f=!1;function p(){let e=c(yh),t=c(bh),n=c(wh),r=c(Ah),i=c(Gh),a=c(Mh),o=c(Ph),s=c(zh),l=c(Vh),d=c(Uh),f=c(Xh);return u.push(e.state.subscribe(()=>{}),r.state.subscribe(()=>{}),a.state.subscribe(()=>{}),o.state.subscribe(()=>{}),s.state.subscribe(()=>{}),l.state.subscribe(()=>{}),d.state.subscribe(()=>{})),{directory:e,management:t,models:n,workspaces:r,workspaceFiles:i,credentials:a,searchSettings:o,contextSettings:s,codemodeSettings:l,defaultModel:d,skillMarket:f}}let m=()=>{if(!f)throw Error(`Gateway protocol not checked`);return d||=p(),d},h=async e=>{await Cg(l.ready,e,r);let n=l.info.value;if(n.serverId!==t)throw new sg;if(n.protocolVersion!==10)throw new Hi;f=!0;let{directory:i,management:a,models:o,workspaces:s,credentials:c,searchSettings:u,contextSettings:d,codemodeSettings:p,defaultModel:h,workspaceFiles:g,skillMarket:_}=m();await Cg(Promise.all([i.ready,a.ready,o.ready,s.ready,c.ready,u.ready,d.ready,p.ready,h.ready,g.ready,_.ready]),e,r)},g,_,v,y=!1,b,x={application:l,subagent(e){if(!_)throw Error(`No active session`);let t={..._,...typeof e==`string`?{agentId:e}:{taskId:e}};return ag(()=>s.hold(Eh,t))},host:s,link:e,get directory(){return m().directory},get management(){return m().management},get models(){return m().models},get workspaces(){return m().workspaces},get workspaceFiles(){return m().workspaceFiles},get credentials(){return m().credentials},get searchSettings(){return m().searchSettings},get contextSettings(){return m().contextSettings},get codemodeSettings(){return m().codemodeSettings},get defaultModel(){return m().defaultModel},get skillMarket(){return m().skillMarket},get attachment(){return _},async ready(e){try{await h(e?AbortSignal.any([e,a.signal]):a.signal)}catch(e){throw i||o.startsWith(`protocol`)?new Hi:e}},async attach(e,t){let n=await x.management.attach(e,t);if(g?.status===`live`&&g.view.value!==void 0&&_?.attachmentId===n.attachmentId)return g;v?.(),g?.release(),_=n;let i=s.hold(Dh,n);g=i,v=i.view.subscribe(()=>{});try{if(await Cg(i.ready,t?.signal,r),i!==g)throw Error(`Attachment changed`);return i}catch(e){throw i.release(),i===g&&(v?.(),v=void 0,g=void 0,_=void 0),e}},async detach(){v?.(),v=void 0,g?.release(),g=void 0,_=void 0,y||await x.management.detach(null)},async close(){return b||(y=!0,b=(async()=>{v?.(),g?.release();for(let e of u)e();await s.close()})(),b)}};return e.onClose(()=>{x.close().catch(()=>{})}),x}var Sg=5e3;function Cg(e,t,n){let r,i=()=>{};return Promise.race([e,new Promise((e,a)=>{r=setTimeout(()=>a(Error(`Gateway readiness timed out`)),n),i=()=>a(t?.reason??Error(`Cancelled`)),t?.addEventListener(`abort`,i,{once:!0}),t?.aborted&&i()})]).finally(()=>{clearTimeout(r),t?.removeEventListener(`abort`,i)})}var wg=`neko.language`,Tg=[`zh`,`en`],Eg={zh:`zh-CN`,en:`en`};function Dg(e){return e===`zh`||e===`en`?e:`zh`}function Og(e=jg()){try{return Dg(e?.getItem(wg))}catch{return`zh`}}function kg(e,t=jg()){try{e===`zh`?t?.removeItem(wg):t?.setItem(wg,e)}catch{}}function Ag(e,t=Mg()){t?.documentElement.setAttribute(`lang`,Eg[e])}function jg(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function Mg(){return typeof document>`u`?void 0:document}function Ng(e={}){let t=e.storage??jg(),n=e.doc??Mg(),r=e.target??(typeof window>`u`?void 0:window),i=Og(t),a=new Set;function o(e){if(e!==i){i=e,Ag(i,n);for(let e of a)e()}}let s=e=>{let n=e.key;(n===null||n===`neko.language`)&&o(Og(t))};return{get:()=>i,set(e){let n=Dg(e);kg(n,t),o(n)},reset(){kg(`zh`,t),o(`zh`)},start(){i=Og(t),Ag(i,n),r?.addEventListener(`storage`,s)},stop(){r?.removeEventListener(`storage`,s)},subscribe(e){return a.add(e),()=>a.delete(e)}}}var Pg;function Fg(){return Pg??=Ng(),Pg}function Ig(){return Fg().get()}function Lg(e=Fg()){return(0,d.useSyncExternalStore)(e.subscribe,e.get,()=>`zh`)}var Rg={zh:{"common.connected":`已连接`,"common.connecting":`连接中…`,"common.loading":`读取中…`,"settings.menuLabel":`设置菜单`,"settings.backToChat":`← 返回聊天`,"settings.title":`设置`,"settings.menu.credentials":`模型服务`,"settings.menu.search":`联网搜索`,"settings.menu.context":`上下文`,"settings.menu.codemode":`Codemode`,"settings.menu.appearance":`外观`,"settings.menu.language":`语言 / Language`,"settings.menu.mobile":`手机配对`,"settings.menu.about":`关于与更新`,"settings.credentials.title":`模型服务`,"settings.credentials.intro":`启用要使用的模型服务并配置 API Key;保存值优先于环境变量,所有工作区共用。DeepSeek 始终启用。`,"settings.credentials.providerLabel":`模型服务商`,"settings.credentials.disabled":`未启用`,"settings.credentials.configured":`已配置`,"settings.credentials.keyMissing":`未配置 Key`,"settings.credentials.enabledCount":`已启用 {enabled} / {total}`,"settings.search.title":`联网搜索`,"settings.search.intro":`选择助手联网搜索使用的服务,并管理 Tavily 与 DeepSeek 的 API Key。`,"settings.search.deepseekNote":`与「模型服务」共用同一个 DeepSeek Key,在任一页面保存或移除都会同步。`,"settings.context.title":`上下文`,"settings.context.intro":`管理长对话如何节省上下文。点选即保存、立即生效,所有工作区共用;不选“默认”则沿用原有行为。`,"settings.codemode.title":`Codemode`,"settings.codemode.intro":`让模型写一小段 JavaScript 脚本,一次调用多个工具,只把结果带回对话。选择即保存,所有工作区共用。`,"codemode.modeTitle":`使用方式`,"codemode.newSessionsOnly":`只对之后新建的会话生效,已有会话保持原样。`,"codemode.mode.off.label":`关闭`,"codemode.mode.off.description":`模型逐个调用工具,与以前完全一致。`,"codemode.mode.on.label":`开启`,"codemode.mode.on.description":`在原有工具之外增加 codemode,模型按需选用。`,"codemode.mode.only.label":`仅 codemode`,"codemode.mode.only.description":`文件和命令类工具只能通过脚本使用,todo、提问与子 agent 仍可直接调用。`,"codemode.current":`当前生效:{mode} · {source}`,"codemode.fromConfig":`来自配置文件,选择其他选项会覆盖它。`,"codemode.saved":`已保存,对新建的会话生效`,"codemode.restored":`已恢复默认`,"codemode.restore":`恢复默认`,"codemode.saveFailed":`保存失败,请检查连接后重试。`,"settings.mobile.title":`手机配对`,"settings.mobile.intro":`在手机 App 上控制电脑上的 Agent;配对管理仅限电脑本机。`,"settings.appearance.title":`外观`,"settings.appearance.intro":`选择主题与聊天排版。点选即保存、立即生效,只保存在当前浏览器,不影响终端界面与手机端。`,"language.title":`语言 / Language`,"language.intro":`选择界面语言。点选即保存、立即生效,只保存在当前浏览器,不影响终端界面与手机端,也不改变对话内容。`,"language.legend":`界面语言`,"language.option.zh":`中文`,"language.option.en":`English`,"appearance.theme":`主题`,"appearance.theme.sakura":`樱花`,"appearance.theme.sakuraBlurb":`蓝粉白浅色,默认`,"appearance.theme.light":`纸白`,"appearance.theme.lightBlurb":`中性冷灰白,克制`,"appearance.theme.dark":`夜墨`,"appearance.theme.darkBlurb":`深蓝灰深色,夜间友好`,"appearance.previewUser":`你好`,"appearance.previewAssistant":`你好,有什么可以帮你?`,"appearance.typography":`聊天排版`,"appearance.typographyBlurb":`只影响聊天里的消息正文与输入框;代码块、工具卡与侧栏保持不变。`,"appearance.font":`字体`,"appearance.fontHint":`使用本机已安装的系统字体,实际效果取决于你的设备;缺少时自动回退。`,"appearance.font.sans":`无衬线`,"appearance.font.serif":`衬线`,"appearance.font.mono":`等宽`,"appearance.size":`字号`,"appearance.size.13":`小 13px`,"appearance.size.14":`默认 14px`,"appearance.size.16":`大 16px`,"appearance.size.18":`特大 18px`,"appearance.weight":`字重`,"appearance.weight.regular":`常规`,"appearance.weight.medium":`中等`,"appearance.weight.semibold":`偏粗`,"appearance.leading":`行高`,"appearance.leading.compact":`紧凑`,"appearance.leading.normal":`标准`,"appearance.leading.relaxed":`宽松`,"appearance.sample":`示例`,"appearance.sampleBlurb":`随上面的选择即时变化。`,"appearance.sampleUser":`帮我看看这个函数为什么返回了 undefined?`,"appearance.sampleAssistantIntro":"这是一段**示例回答**,用来预览当前排版。行内代码如 `const total = items.length`,下面是代码块:","appearance.sampleItem1":`列表项一`,"appearance.sampleItem2":`列表项二`,"appearance.isDefault":`当前为默认外观`,"appearance.customized":`已自定义`,"appearance.reset":`恢复默认`,"credential.source.saved":`使用已保存密钥`,"credential.source.environment":`使用环境变量`,"credential.source.runtime":`使用运行时配置`,"credential.source.keyless":`keyless(限流)`,"credential.source.none":`尚未配置`,"credential.failed":`操作失败,请检查连接后重试。`,"credential.removed":`已移除保存的密钥`,"credential.saved":`已保存,下次请求生效`,"credential.enableAria":`启用 {name}`,"credential.enabledDone":`已启用`,"credential.disabledDone":`已取消启用`,"credential.alwaysOn":`始终启用`,"credential.enable":`启用`,"credential.envVar":`环境变量:{state}({envVar})`,"credential.envConfigured":`已配置`,"credential.envMissing":`未配置`,"credential.keylessNote":` · 未配置时以 keyless 限流模式运行`,"credential.keyLabel":`{name} API Key`,"credential.placeholderReplace":`输入新密钥以替换`,"credential.placeholderNew":`粘贴你的 API Key`,"credential.working":`处理中…`,"credential.save":`保存密钥`,"credential.remove":`移除已保存密钥`,"credential.getKey":`获取 {name} API Key ↗`,"search.switched":`已切换为{name},下次搜索生效`,"search.saveFailed":`保存失败,请检查连接后重试。`,"search.service":`搜索服务`,"search.current":`当前使用:{name}`,"search.intro":`选择助手联网搜索与读取网页使用的服务;保存后下一次调用生效。`,"search.source.saved":`已保存密钥`,"search.source.environment":`环境变量`,"search.source.runtime":`运行时配置`,"search.source.keyless":`keyless 限流`,"search.source.none":`未配置密钥`,"search.tavilyDescription":`使用 Tavily 搜索与抓取({source}),默认选项`,"search.deepseekDescription":`使用 DeepSeek 搜索与抓取,共用 DeepSeek 密钥({source})`,"search.deepseekWarning":`尚未配置 DeepSeek 密钥,搜索将不可用。请在下方 DeepSeek 卡片配置密钥,或改选 Tavily。`,"providerCombo.placeholder":`选择服务商`,"providerCombo.empty":`没有匹配的服务商。`,"model.context":`{size} 上下文`,"model.images":`支持图片`,"model.textOnly":`仅文本`,"model.reasoning":`支持思考`,"model.noReasoning":`无思考`,"context.row.compactionTrigger.label":`触发时机`,"context.row.compactionTrigger.description":`上下文达到模型窗口的这个比例时自动压缩。默认接近窗口上限。`,"context.row.keepRecentTokens.label":`保留近期`,"context.row.keepRecentTokens.description":`压缩时逐字保留的近期内容,越多越不容易丢细节。`,"context.row.pruningTrigger.label":`触发时机`,"context.row.pruningTrigger.description":`上下文达到模型窗口的这个比例时裁剪旧结果。`,"context.row.keepRecent.label":`保留最近结果`,"context.row.keepRecent.description":`最新的这些工具结果永远保持完整。`,"context.row.minChars.label":`最小结果长度`,"context.row.minChars.description":`短于这个长度的结果不会被裁剪。`,"context.row.minSave.label":`单次最小释放量`,"context.row.minSave.description":`单次裁剪预计释放的上下文达到模型窗口的这个比例才会执行。每次裁剪都会使提示词缓存失效,比例越大,裁剪越少、越集中。`,"context.source.default":`默认`,"context.source.config":`配置文件`,"context.source.saved":`已保存`,"context.value.chars":`{value} 字符`,"context.value.charsK":`{value}k 字符`,"context.value.count":`{value} 个`,"context.chipDefault":`默认`,"context.chipCustom":`{value} · 自定义`,"context.nearLimit":`接近窗口上限`,"context.current":`当前生效 {value} · {source}`,"context.marker.pruning":`裁剪`,"context.marker.compaction":`压缩`,"context.group.compaction.title":`上下文压缩`,"context.group.compaction.blurb":`对话变长时,把较早的内容整理成摘要,腾出空间继续聊。手动 /compact 始终可用。`,"context.group.pruning.title":`工具结果裁剪`,"context.group.pruning.blurb":`把较早的大段工具输出在模型眼中换成一行说明;界面里的完整结果和历史记录不受影响。每次裁剪会让提示词缓存失效,所以按批量进行。`,"context.threshold.aria":`触发位置预览`,"context.threshold.title":`触发位置`,"context.threshold.window":`模型上下文窗口`,"context.threshold.allOff":`自动压缩与裁剪均已关闭。`,"context.fromConfig":`来自配置文件,选择其他档位会覆盖它。`,"context.saveFailed":`保存失败,请检查连接后重试。`,"context.restored":`{label}已恢复默认`,"context.saved":`已保存`,"context.switch.compaction":`自动压缩`,"context.switch.pruning":`裁剪工具结果`,"context.allRestored":`已全部恢复默认`,"context.restoreAll":`全部恢复默认`,"context.saving":`保存中…`,"common.close":`关闭`,"about.intro":`查看 neko 系统版本状态及软件更新。`,"about.checkDone":`检查完成`,"about.checkDevelopment":`开发版本不检查发布更新`,"about.checkFailedRetry":`检查失败,请重试`,"about.checking":`检查中…`,"about.badge.incompatible":`协议不兼容`,"about.badge.install":`发现新版本`,"about.badge.restart":`已就绪 · 待重启`,"about.badge.refresh":`页面待更新`,"about.badge.development":`开发版本`,"about.badge.failed":`检查失败`,"about.badge.latest":`已是最新`,"about.versionStatus":`版本状态`,"about.currentVersion":`当前版本`,"about.latestStable":`最新稳定版`,"about.runUpdate":`可运行 neko update 升级`,"about.installedNew":`已安装新版本`,"about.newVersion":`新版本`,"about.afterRestart":`重启 neko 进程后生效`,"about.staticUpdated":`静态服务已更新`,"about.afterRefresh":`刷新页面后生效`,"about.checkUpdates":`检查更新`,"about.copyUpdate":`复制 neko update`,"about.refreshPage":`刷新页面`,"about.commandShell":`命令 shell`,"about.upgradeTitle":`升级说明`,"about.upgradeBefore":`在终端运行`,"about.upgradeAfter":`,完成后重启 neko 即可生效。`,"about.draftKept":`升级前保留的草稿`,"update.copied":`已复制 neko update,在运行 neko 的电脑上执行`,"update.copyManually":`请复制命令:neko update`,"update.install":`发现新版本 · 运行 neko update`,"update.refreshPage":`页面已更新`,"update.incompatible":`版本不兼容 · 更新并重启 neko`,"update.restart":`已升级 · 请重新启动本地 neko`,"update.copyCommand":`复制命令`,"update.refresh":`刷新`,"update.viewSteps":`查看步骤`,"update.dismiss":`关闭更新提示`,"shell.dismiss":`关闭 shell 提示`,"shell.invalid":`{detail}bash 与后台任务不可用,请修正 neko.config.json 中的 shell.path。`,"shell.invalidDefault":`shell.path 配置无效。`,"shell.missing":`未找到 Git Bash:bash 与后台任务不可用。请安装 Git for Windows,或在 neko.config.json 中设置 shell.path。`,"shell.ready":`已就绪`,"shell.unavailable":`不可用`,"shell.sourceConfig":`{path}(配置 shell.path)`,"shell.sourceAuto":`{path}(自动检测)`,"pairing.qrTitle":`手机配对二维码`,"pairing.getFailed":`GET {path} 失败({status})`,"pairing.requestFailed":`请求失败({status})`,"pairing.disabledNotice":`手机访问已关闭,已受理的任务继续运行。`,"pairing.addressRequired":`请选择要监听的局域网地址。`,"pairing.portInvalid":`端口必须是 1-65535 的整数。`,"pairing.enabledNotice":`手机访问已开启:{address}`,"pairing.qrGenerated":`二维码已生成,120 秒内有效。`,"pairing.certRotated":`证书已重新生成({fingerprint}…),手机需重新扫码配对。`,"pairing.revoked":`已撤销设备授权,该设备已受理的任务继续运行。`,"pairing.revokeMissing":`设备不存在或已撤销。`,"pairing.unsupported":`当前 gateway 版本不支持手机配对。请更新或重启电脑端后刷新本页;聊天功能不受影响。`,"pairing.stateOn":`已开启 · https://{address}{relay}`,"pairing.relayed":`(经 Windows 中继)`,"pairing.stateError":`开启失败`,"pairing.stateOff":`已关闭`,"pairing.intro":`允许手机控制电脑上的 Agent。配对仅限本机管理,请只在可信网络中开启。`,"pairing.wslNote":`当前在 WSL 中运行:这里列出的是 Windows 的局域网地址,开启后由 Windows 侧的转发进程接入手机连接(无需管理员权限,关闭手机访问或退出 neko 时自动停止)。`,"pairing.startFailed":`开启失败:{error}。请检查所选地址与端口是否被占用。`,"pairing.allow":`允许手机控制电脑上的 Agent`,"pairing.address":`地址`,"pairing.noAddressWindows":`未发现 Windows 局域网地址`,"pairing.noAddress":`未发现局域网地址`,"pairing.lastConnected":`{address}(上次连接成功)`,"pairing.port":`端口`,"pairing.noUsableWindows":`未发现可用的 Windows 局域网地址,请确认 Windows 已连接网络且 WSL 互操作可用。`,"pairing.noUsable":`未发现可用的局域网地址,请确认电脑已连接网络(本机回环地址不可用于手机访问)。`,"pairing.qrRemaining":`二维码剩余 {seconds} 秒`,"pairing.copyText":`复制配对文本`,"pairing.refreshQr":`刷新二维码`,"pairing.qrExpired":`二维码已过期,请刷新后重新扫码。`,"pairing.generateQr":`生成二维码`,"pairing.scanHint":`用手机 App 扫码,或点击「复制配对文本」后在 App 中粘贴。请确保手机与电脑在同一网络,防火墙放行所选端口{relay}。`,"pairing.relayFirewall":`(WSL 下需在 Windows 防火墙放行 powershell.exe)`,"pairing.certificate":`证书`,"pairing.certInfo":`{fingerprint}… · 到期 {date}`,"pairing.regenerate":`重新生成证书`,"pairing.certExpiring":`证书即将到期,建议尽快重新生成;重新生成后全部手机需重新扫码。`,"pairing.regenerateWarning":`重新生成会断开全部手机并撤销全部设备授权,电脑上已受理的任务继续运行。`,"pairing.devices":`已配对设备`,"pairing.noDevices":`暂无已配对设备。`,"pairing.online":`在线`,"pairing.offline":`离线`,"pairing.lastSeen":`最后连接 {time}`,"pairing.revoke":`撤销`,"pairing.spawnedBefore":`本页面通过 neko web 启动了 gateway;退出本页面会同时停止 gateway 与手机入口。需要手机长期连接时,请改用`,"pairing.spawnedAfter":`或保持 TUI 运行。`,"pairing.regenerateConfirm":`将生成新的自签名证书:全部手机断开、全部设备授权失效,需要重新扫码配对。电脑上已受理的任务继续运行。`,"pairing.confirmRegenerate":`确认重新生成`,"pairing.revokeTitle":`撤销设备「{name}」`,"pairing.revokeConfirm":`撤销后该手机立即断开且无法重新连接;电脑上已受理的任务继续运行,停止任务需在电脑上单独操作。`,"pairing.confirmRevoke":`确认撤销`,"common.cancel":`取消`,"gw.notConnected":`网关未连接`,"gw.sessionNotReady":`会话未就绪`,"gw.sessionChangedDraft":`会话已切换,草稿已保留`,"gw.sessionChanged":`会话已切换`,"gw.sessionChangedOrNotReady":`会话已切换或未就绪`,"gw.sessionChangedAnswerDraft":`会话已切换或未就绪,答案草稿已保留`,"gw.sessionChangedFeedbackDraft":`会话已切换或未就绪,反馈草稿已保留`,"gw.connectionChanged":`连接已变化,请重试`,"gw.busy":`操作进行中或网关未连接,请稍后重试`,"gw.workspaceMissing":`工作区不存在`,"gw.sessionNotInWorkspace":`会话不属于当前工作区或已归档`,"gw.workspaceNotReady":`工作区未就绪`,"gw.incompatible":`版本不兼容,请运行 neko update 后重新启动本地 neko。`,"gw.infoFailed":`GET /api/info 失败({status})`,"gw.invalidInfo":`无效的网关信息`,"gw.infoLoadFailed":`获取网关信息失败:{error}`,"gw.sessionGone":`原会话不可用,升级草稿保留在关于与更新中`,"gw.notReady":`网关连接未就绪,请稍候或刷新页面。`,"gw.sessionChangedRetry":`会话已变化,请重试`,"gw.notStarted":`网关尚未连接`,"core.status.thinking":`思考中…`,"core.status.running":`运行 {tool}…`,"core.status.retrying":`重试中(第 {attempt} 次)…`,"core.row.compacted":`[上下文已压缩]`,"core.row.newContext":`[新上下文]`,"core.note.notRun":`未运行:响应被中断。`,"core.error.providerDisabled":`PROVIDER_DISABLED: {provider} 未启用。请在 /login 或 Web 设置中启用,或切换模型。`,"core.error.providerKeyRequired":`PROVIDER_KEY_REQUIRED: 请在 /login 或 Web 设置中配置 {provider} 的 API Key。`,"core.error.planBusy":`PLAN_BUSY: 请等待当前运行结束,或先停止它。`,"core.error.continueBusy":`CONTINUE_BUSY: 会话正在运行,请等待它结束。`,"core.error.continueUnavailable":`CONTINUE_UNAVAILABLE: 上一轮已得到回答,没有可继续的内容。`,"runFailure.section":`上一轮未完成`,"runFailure.reason.model_error":`模型请求失败`,"runFailure.reason.no_model":`没有可用的模型`,"runFailure.reason.aborted":`已停止`,"runFailure.reason.reset":`已开始新的上下文`,"runFailure.reason.faulted":`运行出错`,"runFailure.reason.orphaned":`运行无法继续`,"runFailure.reason.interrupted":`运行被中断`,"runFailure.reason.restart_limit":`多次崩溃后已停止`,"runFailure.reason.nothing_to_answer":`没有需要回答的内容`,"runFailure.reason.turn_limit":`已达到轮次上限`,"runFailure.continue":`继续`,"runFailure.continueAria":`在现有上下文上继续上一轮`,"runFailure.continueFailed":`无法继续`,"core.error.workspaceUnknown":`WORKSPACE_UNKNOWN: 该工作区不在列表中。`,"core.error.workspaceLast":`WORKSPACE_LAST: 至少需要保留一个工作区。`,"core.error.workspaceBusy":`WORKSPACE_BUSY: 请先停止或处理该工作区中正在运行、等待回答或等待批准的会话。`,"plan.status.awaiting_approval":`待批准`,"plan.status.approved":`已批准`,"plan.status.revision_requested":`要求修改`,"plan.status.superseded":`已取代`,"plan.status.cancelled":`已取消`,"plan.modeLabel":`规划模式(只读)`,"plan.unsupported":`当前网关不支持规划模式,请重启网关后再试`,"plan.settle.approved":`已批准,开始执行计划`,"plan.settle.revised":`已提交修改要求,仍在规划模式`,"plan.settle.superseded":`该计划已被新的输入取代,没有保存你的决定。`,"plan.settle.cancelled":`该计划已取消(运行已停止或已离开规划模式),没有保存你的决定。`,"plan.settle.pending":`决定尚未保存,请重试。`,"plan.settle.other":`该计划已由其他端先处理,以已保存的结果为准:{status}`,"plan.busy":`会话运行中,请先等待回答结束或停止后再试`,"title.answerPrefix":`({count}) 等待回答 · `,"title.planPrefix":`等待批准 · `,"todo.status.pending":`待办`,"todo.status.in_progress":`进行中`,"todo.status.completed":`已完成`,"question.status.pending":`等待回答`,"question.status.answered":`已回答`,"question.status.skipped":`已跳过`,"question.status.cancelled":`已取消`,"question.settle.answeredWith":`已回答:{answer}`,"question.settle.answered":`已回答`,"question.settle.skipped":`已跳过,未提供答案`,"question.settle.cancelled":`已取消(运行已停止或会话已归档)`,"session.suffix.awaitingAnswer":` · 等待回答`,"session.suffix.awaitingPlan":` · 等待批准`,"session.suffix.running":` · 运行中`,"session.suffix.error":` · 出错`,"composer.input":`消息输入`,"composer.upgrade.sending":`发送中,请稍后刷新`,"composer.upgrade.attachments":`先发送或移除附件,再刷新`,"composer.upgrade.notReady":`连接未就绪,请稍后重试`,"composer.upgrade.otherDrafts":`其他会话有草稿,请先发送或清空`,"composer.upgrade.saveFailed":`草稿保存失败,请先复制文字`,"composer.attach.type":`仅支持 PNG、JPEG、WebP`,"composer.attach.size":`单图不能超过 20 MiB`,"composer.attach.decode":`无法解码图片,请重新选择`,"composer.attach.limit":`每条消息最多 4 张图片,总大小不超过 40 MiB`,"composer.attach.removeUnsupported":`请先移除不支持的附件`,"composer.attach.checking":`检查图片…`,"composer.attach.remove":`移除 {name}`,"composer.skills.newSession":`新建会话后可选择工作区技能`,"composer.skills.waiting":`等待会话连接…`,"composer.skills.loading":`正在加载技能…`,"composer.skills.empty":`当前工作区暂无可用技能`,"composer.skills.failed":`技能加载失败,请关闭菜单后重试`,"composer.image.reading":`正在读取图片…`,"composer.image.readFailed":`图片读取失败,请重试`,"composer.workspaceChanged":`工作区已切换`,"composer.workspaceChangedDraft":`工作区已切换,草稿已保留`,"composer.compaction.retrying":`压缩重试中`,"composer.compaction.waiting":`等待上下文压缩`,"composer.compaction.running":`正在压缩上下文`,"composer.compaction.failure":`压缩失败:{error}`,"composer.compaction.applied":`上下文已压缩`,"composer.compaction.nothing":`当前无需压缩`,"composer.compaction.skipped":`已跳过过期摘要`,"composer.compaction.cancelled":`压缩已取消`,"composer.compaction.failed":`压缩失败,可重试`,"composer.compaction.applying":`等待应用压缩摘要`,"composer.compaction.nothingTitle":`保留近期上下文,暂无可压缩的旧内容;默认保留最近约 20,000 tokens`,"composer.compactFailed":`压缩失败,请重试`,"composer.plan.noArgs":`/plan 不接受参数;先切换到规划模式,再正常描述需求`,"composer.plan.needSession":`请先开始会话,再切换规划模式`,"composer.plan.busy":`会话运行中,请先等待回答结束或停止后再切换规划模式`,"composer.planModeTitle":`只读调研并提交计划;批准后自动退出并开始执行。输入 /plan 可退出`,"composer.sendFailed":`发送失败,请重试`,"composer.queue.steerWithdrawn":`无法改为引导,消息已撤回到输入框`,"composer.queue.gone":`该消息已不在队列中`,"composer.queue.sentNoSteer":`该消息已发送,无法引导`,"composer.queue.steerFailed":`引导失败,请重试`,"composer.queue.imagesNotRestored":`图片未恢复,请重新添加`,"composer.queue.sentNoWithdraw":`该消息已发送,无法撤回`,"composer.queue.withdrawFailed":`撤回失败,请重试`,"composer.questionHint":`助手正在等待你的回答。此处发送的消息仍会排队(含引导),回答或跳过后才进入上下文,不会当作答案。`,"composer.openQuestion":`打开问题`,"composer.dropHint":`松开以添加图片,不会自动发送`,"composer.provider.disabled":`模型服务 {provider} 已取消启用,请重新启用或切换模型。`,"composer.provider.keyMissing":`尚未配置 {provider} Key。`,"composer.provider.goSettings":`前往设置`,"composer.noVision":`当前模型不支持图片,请切换模型或移除附件。`,"composer.noHistoryImages":`当前模型无法查看历史原图,仍可使用已有文字分析。`,"composer.placeholder.waiting":`助手在等你回答,此处消息将排队`,"composer.placeholder.busy":`运行中:消息将在回答结束后排队,可在排队条中引导或撤回`,"composer.placeholder.idle":`输入消息,@ 引用文件,/ 命令`,"composer.addImage":`添加图片`,"composer.addImageTitle":`添加图片(最多 4 张)`,"composer.menu":`输入操作菜单`,"composer.ctx.none":`暂无有效用量;首次回答或压缩后的新回答完成后更新`,"composer.ctx.usage":`最近一次成功回答的上下文用量:{tokens} / {window} tokens;非会话累计用量`,"composer.usage.aria":`任务总用量:输入 {input},输出 {output},缓存读 {cacheRead},成本 {cost}`,"composer.usage.detail":`输入 {input} · 输出 {output} · 缓存读 {cacheRead} · {cost}`,"composer.working":`处理中`,"composer.queue":`排队`,"composer.send":`发送`,"composer.stopTitle":`中止当前会话运行及可中止任务`,"composer.stop":`停止`,"composer.commandTitle":`输入命令`,"composer.noCommands":`没有匹配的命令或技能`,"common.retry":`重试`,"common.loadingEllipsis":`加载中…`,"common.workspace":`工作区`,"common.newSession":`新会话`,"approval.status.pending":`等待审批`,"approval.status.allowed":`已允许本次`,"approval.status.denied":`已拒绝`,"approval.status.cancelled":`已取消`,"approval.section":`Bash 审批`,"approval.timeout":`超时:{value}`,"approval.timeoutDefault":`默认`,"approval.command":`完整命令`,"approval.allow":`允许本次`,"approval.deny":`拒绝`,"approval.inbox":`待审批命令`,"askUser.answer":`回答:{answer}`,"askUser.skipped":`已跳过,未提供答案`,"askUser.cancelled":`问题已取消,没有收到回答`,"askUser.record":`助手提问记录`,"askUser.badge":`助手提问`,"askUser.locate":`定位到问题`,"suggest.hint":`↑↓ 选择 · Enter / Tab 确认 · Esc 关闭`,"suggest.retryFiles":`重试文件查询`,"copy.copied":`已复制`,"copy.failed":`复制失败`,"copy.label":`复制`,"export.busy":`导出中…`,"export.empty":`当前会话还没有内容可导出`,"export.title":`导出会话`,"export.failed":`导出失败:{error}`,"export.button":`导出`,"export.format":`导出格式`,"export.thinking":`包含思考过程`,"export.cancelled":`会话已切换,导出已取消`,"export.done":`已导出 {name}`,"export.doneSkipped":`已导出 {name},{count} 张图片未能内嵌`,"mention.searching":`正在查找文件…`,"mention.incomplete":`文件索引未完整,请输入子目录缩小范围`,"mention.limited":`结果较多,请继续输入路径缩小范围`,"mention.empty":`没有匹配的文件或目录`,"mention.errorWith":`查询失败:{error}`,"mention.error":`查询失败,请重试`,"mention.title":`工作区文件`,"tree.symlinkTitle":`符号链接(不跟随)`,"tree.symlink":`符号链接`,"tree.protectedTitle":`受保护文件,不提供查看`,"tree.protected":`受保护文件`,"tree.emptyDir":`空目录`,"tree.readFailed":`读取失败:{error}`,"tree.incomplete":`列表不完整:{reason}`,"tree.limitedDir":`该目录子项过多,仅显示部分。`,"tree.limitedWorkspace":`工作区文件过多,枚举已被截断。`,"tree.readOnly":`只读浏览`,"tree.refreshAria":`刷新文件树`,"tree.refresh":`刷新`,"tree.aria":`工作区文件树`,"viewer.content":`文件内容`,"viewer.zoom":`代码缩放`,"viewer.zoomOut":`缩小代码`,"viewer.zoomReset":`重置缩放`,"viewer.zoomResetTitle":`重置为 100%`,"viewer.zoomIn":`放大代码`,"viewer.refreshAria":`刷新文件内容`,"viewer.refreshing":`刷新中…`,"viewer.refresh":`刷新`,"viewer.workspaceRoot":`(工作区根目录)`,"viewer.stale":`agent 修改了此文件,当前显示的内容可能已过期。`,"viewer.reload":`刷新内容`,"viewer.missing":`文件不存在`,"viewer.missingDetail":`该文件可能已被删除或移出工作区。`,"viewer.readFailed":`读取失败:{error}`,"viewer.protected":`受保护文件,不提供查看`,"viewer.protectedDetail":`凭据类文件(如 .env、私钥)的内容不会通过浏览器下发,以免经网络泄露。`,"viewer.binary":`二进制文件,不提供预览`,"viewer.binarySize":`大小 {size}`,"viewer.refreshFailed":`刷新失败:{error}`,"viewer.truncated":`已截断,仅显示开头部分,文件共 {size}`,"changes.scopeNote":`仅列出 agent 通过 edit / write 工具造成的改动,不含命令行(如 bash)造成的改动,也不代表磁盘或 git 的实际差异。`,"changes.listFailed":`读取改动列表失败:{error}`,"changes.empty":`本会话还没有 agent 的 edit / write 改动。`,"changes.ops":`{count} 次`,"changes.outside":`工作区外`,"changes.root":`(根目录)`,"changes.listIncomplete":`列表不完整:改动文件过多,已超出上限,仅显示部分。`,"changes.truncated":`已截断`,"changes.backToList":`← 改动列表`,"changes.viewCurrent":`查看当前内容`,"changes.detailFailed":`读取改动详情失败:{error}`,"changes.noRecords":`该文件没有可显示的改动记录。`,"changes.detailIncomplete":`改动记录不完整:该文件的操作过多,已超出上限,仅显示部分。`,"agent.main":`主 agent`,"job.status.running":`运行中`,"job.status.exited":`已退出`,"job.status.failed":`失败`,"job.status.stopped":`已停止`,"job.status.lost":`已丢失`,"job.reason.timeout":`超时`,"job.reason.spawnError":`无法启动`,"job.reason.exitCode":`退出码 {code}`,"job.reason.restart":`网关重启`,"job.stopping":`正在停止…`,"job.stop":`停止任务`,"job.dropped":`… 已省略更早的 {count} 字节输出`,"job.reading":`读取中…`,"job.noOutput":`暂无输出`,"job.toBottom":`回到底部 ↓`,"job.panel":`后台任务`,"job.panelEmpty":`这个会话还没有后台任务。`,"job.reportTitle":`后台任务 {id}`,"job.reportCurrent":`当前:{status}`,"image.loadFailed":`图片加载失败,点击重试`,"image.view":`查看图片 {name}`,"image.loading":`加载图片…`,"image.save":`保存图片`,"task.status.idle":`空闲`,"task.status.queued":`排队中`,"task.status.running":`运行中`,"task.status.completed":`已完成`,"task.status.failed":`失败`,"task.status.cancelled":`已停止`,"message.cat":`neko 小猫`,"message.defaultImagePrompt":`默认图片提示`,"message.copyAnswer":`复制回答`,"message.welcome":`输入消息开始吧 ✦`,"message.round":`任务 {round} · {title} · {status}`,"message.roundUsage":"本轮 ↑{input} ↓{output} · 缓存 {cacheRead}/{cacheWrite} · ${cost}","message.roundUsageMissing":`本轮用量未记录`,"message.approvalsPending":`· 待审批 {count}`,"message.viewProcess":`· 查看完整过程`,"message.approvalLine":`审批 · {status}`,"message.toBottom":`回到底部 ↓`,"picker.aria":`模型与思考强度:{label} {level}`,"picker.badgeImage":`图`,"picker.badgeReasoning":`思`,"picker.providerModels":`{count} 个模型`,"picker.keyMissing":`未配置 Key`,"picker.applyFailed":`配置失败,请重试。`,"picker.defaultFailed":`默认模型保存失败,请重试。`,"picker.title":`模型与思考强度`,"picker.issueDisabled":`当前会话的模型服务 {provider} 已取消启用,请切换到其他模型,或在设置中重新启用。`,"picker.issueKey":`尚未配置 {provider} 的 API Key,请先配置或切换到其他模型。`,"picker.goSettings":`前往设置`,"picker.providerLabel":`模型服务商`,"picker.searchLabel":`搜索模型`,"picker.searchPlaceholder":`搜索模型名称、ID 或服务商`,"picker.models":`模型`,"picker.keyMissingDot":`未配置 Key ·`,"picker.configure":`去配置`,"picker.unsetDefault":`取消默认`,"picker.setDefault":`设为默认`,"picker.unsetDefaultTitle":`取消默认模型(只影响新建会话)`,"picker.setDefaultTitle":`设为默认模型(只影响新建会话)`,"picker.noMatch":`没有匹配的模型。`,"picker.noModels":`没有可选模型,请先在设置中启用模型服务。`,"picker.thinking":`思考强度`,"picker.cliNote":`默认模型当前由 --model 启动参数指定并覆盖保存值;移除该参数后,此处保存的默认才会生效。`,"picker.scopeNote":`仅当前会话,从下一次请求生效;☆ 设为新建会话的默认模型(不影响当前会话)。`,"picker.applying":`应用中…`,"picker.apply":`应用`,"open.explorer":`资源管理器`,"open.fileManager":`文件管理器`,"open.noVscodeExe":`未找到 VS Code(Code.exe)`,"open.noVscodeCommand":`未找到 VS Code(命令 code 不在 PATH 中)`,"open.noExplorer":`未找到 explorer.exe(需启用 Windows 互操作)`,"open.noXdg":`未找到 xdg-open`,"open.title":`打开工作区`,"open.withTarget":`用 {target} 打开`,"open.noTargets":`本机没有可用的打开方式`,"open.pickSession":`请先选择会话`,"open.notReady":`连接未就绪`,"open.failed":`打开失败:{error}`,"open.disabledTitle":`{label}({reason})`,"open.unavailable":`不可用`,"open.choose":`选择打开方式`,"open.forbidden":`没有权限打开,请刷新页面后重试`,"open.invalidPath":`工作区目录不存在或不可访问`,"open.requestFailedStatus":`请求失败({status})`,"open.requestFailed":`请求失败:{error}`,"plan.card.gone":`该计划已不在等待批准:{status}`,"plan.card.goneOther":`该计划已不在等待批准,可能已在其他端处理或已被新的计划取代。`,"plan.card.section":`计划审批`,"plan.card.dismiss":`关闭结果提示`,"plan.card.notSaved":`决定尚未保存,请重试`,"plan.card.submitFailed":`提交失败:{error}`,"plan.card.draftKept":`(反馈草稿已保留,请手动重试)`,"plan.card.exitFailed":`退出失败:{error}`,"plan.card.awaiting":`待批准计划`,"plan.card.badge":`计划`,"plan.card.offline":` · 离线`,"plan.card.feedback":`修改意见`,"plan.card.offlineNote":`离线:批准、修改与退出已停用,重新连接后需要手动操作。`,"plan.card.submitting":`提交中…`,"plan.card.submitFeedback":`提交修改意见`,"plan.card.needFeedback":`请填写修改意见`,"plan.card.approve":`批准并执行`,"plan.card.revise":`要求修改`,"plan.card.processing":`处理中…`,"plan.card.exit":`取消并退出计划模式`,"plan.card.hint":`不决定也可继续输入,新的消息会取代这份计划。`,"plan.row.section":`助手提交的计划`,"question.card.cancelledElsewhere":`该问题已取消(运行已停止或会话已归档),没有保存新的回答。`,"question.card.handledElsewhere":`该问题已由其他端先处理,以已保存的结果为准:{result}`,"question.card.gone":`该问题已不在等待列表中,可能已在其他端处理或已取消。`,"question.card.notFound":`找不到这个问题,它可能已结算。`,"question.card.dock":`待回答问题`,"question.card.dismiss":`关闭结果提示`,"question.card.count":`共 {total} 个待回答问题,当前第 {index} 个`,"question.card.prev":`上一个`,"question.card.next":`下一个`,"question.card.notSaved":`回答尚未保存,请重试`,"question.card.submitFailed":`提交失败:{error}(答案草稿已保留,请手动重试)`,"question.card.section":`助手提问`,"question.card.awaiting":`等待回答`,"question.card.offline":` · 离线`,"question.card.draftKept":`草稿已保留`,"question.card.foldTitle":`折叠提问(不会跳过)`,"question.card.unfoldTitle":`展开提问`,"question.card.fold":`折叠`,"question.card.unfold":`展开`,"question.card.loadFailed":`无法读取完整问题:{message}`,"question.card.loading":`正在读取完整问题…`,"question.card.loadOffline":`离线,暂时无法读取完整问题。`,"question.card.chooseMany":`选择一个或多个选项`,"question.card.chooseOne":`选择一个选项`,"question.card.recommended":`推荐`,"question.card.clear":`清除选择`,"question.card.extra":`补充说明(可选)`,"question.card.yourAnswer":`你的回答`,"question.card.offlineNote":`离线:回答与跳过已停用,草稿已保留;重新连接后需要手动提交,不会自动发送。`,"question.card.submitting":`提交中…`,"question.card.submit":`提交回答`,"question.card.skipTitle":`跳过:不提供答案,助手会自行判断并继续;不会停止运行`,"question.card.skipping":`跳过中…`,"question.card.skip":`跳过`,"question.card.needInput":`选择选项或填写文字后才能提交;选择只保存为草稿。`,"question.card.foldHint":`折叠或关闭不会跳过,运行仍可随时停止。`,"queue.mode.steer":`引导`,"queue.mode.followUp":`排队`,"queue.section":`排队消息`,"queue.image":`图片`,"queue.imageOnly":`(仅图片)`,"queue.images":`{count} 图`,"queue.steerAria":`引导消息:{label}`,"queue.steerTitle":`改为引导:在当前工具轮结束后加入进行中的工作`,"queue.steer":`引导`,"queue.withdrawAria":`撤回{mode}消息:{label}`,"queue.withdraw":`撤回`,"sessions.switchWorkspace":`切换工作区`,"sessions.collapse":`收起侧栏`,"sessions.new":`新建会话`,"sessions.searchAria":`搜索当前工作区会话`,"sessions.searchPlaceholder":`搜索会话…`,"sessions.heading":`会话`,"sessions.actionsFor":`{name}的操作`,"sessions.actions":`会话操作`,"sessions.waitingGateway":`等待网关连接…`,"sessions.noMatch":`没有匹配的会话`,"sessions.empty":`此工作区暂无会话`,"sessions.market":`技能市场`,"sessions.settings":`设置`,"sessions.drawer":`工作区与会话`,"sessions.chooseWorkspace":`选择工作区`,"sessions.archive":`归档会话`,"sessions.currentWorkspace":`当前工作区`,"sessions.addWorkspace":`添加工作区`,"sessions.archiveConfirm":`归档“{name}”?会话将从列表中隐藏,工作区和文件仍会保留。`,"sessions.confirmArchive":`确认归档`,"sessions.removeWorkspace":`移除工作区`,"sessions.removeWorkspaceAria":`移除工作区 {name}`,"sessions.removeWorkspaceLaunch":`这是 Web 的启动目录,无法移除`,"sessions.removeWorkspaceLast":`至少需要保留一个工作区`,"sessions.removeWorkspaceNoFiles":`不会删除磁盘上的任何文件。`,"sessions.removeWorkspaceHidden":`该工作区下的会话将被隐藏,当前共 {count} 个。`,"sessions.removeWorkspaceRestore":`重新添加这个目录后,会话会恢复。`,"sessions.confirmRemoveWorkspace":`确认移除`,"subagent.title":`子智能体`,"subagent.history":`历史 · `,"subagent.usage":`子智能体累计用量`,"subagent.duration":`当前或最近任务耗时`,"subagent.stop":`停止此任务`,"subagent.queued":`任务排队中…`,"subagent.noContent":`暂无内容`,"subagent.rounds":`{count} 轮`,"todo.aria":`待办 {done}/{total},已完成 {done} 项{offline}`,"todo.ariaOffline":`(离线)`,"todo.progressTitle":`待办进度(只读)`,"todo.label":`待办`,"todo.panel":`待办列表`,"todo.heading":`待办 · 已完成 {done}/{total}`,"todo.offlineNote":`离线 · 显示最后一次加载的内容,可能不是最新状态`,"todo.items":`待办条目`,"codemode.card.script":`脚本`,"codemode.card.calls":`工具调用({count})`,"codemode.card.callCount":`{count} 次调用`,"codemode.card.omitted":`还有 {count} 条未显示`,"codemode.card.fullOutput":`完整输出:{path}`,"codemode.call.running":`运行中`,"codemode.call.ok":`成功`,"codemode.call.error":`失败`,"codemode.call.cancelled":`已取消`,"tool.status.pending":`待执行`,"tool.status.running":`运行中`,"tool.status.done":`完成`,"tool.status.failed":`失败`,"tool.diff":`代码变更`,"tool.diffTruncated":`代码变更预览已截断,可在下方查看完整写入内容。`,"tool.fullWrite":`完整写入内容`,"tool.output":`输出`,"tool.errorOutput":`错误输出`,"tool.result":`结果`,"common.reconnecting":`重连中…`,"common.connectionFailed":`连接失败`,"topbar.toggleSidebar":`切换侧栏`,"topbar.switching":`切换中…`,"topbar.jobs":`任务{state}`,"topbar.jobsRunning":` · {count} 运行中`,"topbar.jobsCount":` {count}`,"topbar.workspaceAria":`工作区,{count} 个改动文件`,"topbar.workspaceTitle":`工作区:浏览文件与 agent 的改动(只读)`,"panel.resize":`调整面板宽度`,"wspanel.close":`关闭工作区栏`,"wspanel.views":`工作区视图`,"wspanel.files":`文件`,"wspanel.changes":`改动 {count}`,"wspanel.backToTree":`← 文件树`,"picker2.hint":`选择 Harness 所在电脑上的文件夹`,"picker2.pathNav":`目录路径`,"picker2.fullPath":`完整目录路径`,"picker2.go":`前往`,"picker2.filter":`筛选文件夹`,"picker2.filterPlaceholder":`筛选文件夹…`,"picker2.hidden":`隐藏目录`,"picker2.list":`文件夹列表`,"picker2.parent":`上级目录`,"picker2.inaccessible":`不可访问`,"picker2.loading":`正在读取目录…`,"picker2.noMatch":`没有匹配的子文件夹,可选择当前目录`,"picker2.more":`加载更多`,"picker2.adding":`正在添加…`,"picker2.choose":`选择文件夹`,"path.thisComputer":`此电脑`,"chat.skip":`跳到主内容`,"chat.dismissNotice":`关闭提示`,"chat.startHere":`在这个工作区开始新的会话`,"chat.subagents":`子智能体 · {count} 个`,"chat.subagentsApproval":` · 待审批 {count}`,"chat.subagentsRunning":` · {count} 运行中`,"command.compact":`压缩上下文(可附加要求)`,"command.plan":`切换规划模式(只读调研并提交计划,批准后执行)`,"command.builtin":`内置`,"thinking.label":`思考过程…`,"skills.category.documents":`文档处理`,"skills.category.development":`开发工作流`,"skills.category.frontend":`前端 / UI`,"skills.category.research":`研究检索`,"skills.category.skills":`技能生态`,"skills.category.automation":`自动化`,"skills.category.database":`数据库`,"skills.category.writing":`写作`,"skills.category.uncategorized":`未分类`,"skills.badge.project":`项目级`,"skills.badge.user":`用户级`,"skills.badge.active":`{level}·生效`,"skills.badge.builtin":`内置`,"skills.scope.user":`用户级`,"skills.scope.project":`项目级`,"skills.processing":`处理中…`,"skills.installedShadowed":`已安装到用户级,但项目级同名技能优先,此安装暂不生效。下次发送消息时生效。`,"skills.installed":`安装完成,下次发送消息时生效。`,"skills.overwriteTitle":`覆盖已安装技能`,"skills.overwriteBody":`{scope}已存在 {name}。以市场版本覆盖?本地改动将丢失。`,"skills.overwriteBodyVersion":`{scope}已存在 {name}。以市场版本 {version} 覆盖?本地改动将丢失。`,"skills.overwrite":`覆盖安装`,"skills.opFailed":`操作失败:{error}`,"skills.shadowTitle":`安装后暂不生效`,"skills.shadowBody":`项目级已存在同名 {name},项目级优先。仍要安装到用户级吗?`,"skills.installAnyway":`仍安装`,"skills.uninstallTitle":`卸载技能`,"skills.uninstallBody":`删除{scope}的 {name}?此操作不可撤销。`,"skills.uninstall":`卸载`,"skills.uninstalled":`已卸载,下次发送消息时生效。`,"skills.closeDetail":`关闭详情`,"skills.detailAria":`技能详情 {name}`,"skills.tab.about":`说明`,"skills.tab.preview":`预览`,"skills.loadFailed":`加载失败:{error}`,"skills.field.category":`分类`,"skills.field.source":`来源`,"skills.field.size":`大小`,"skills.field.uploaded":`上传于`,"skills.field.license":`许可证`,"skills.notInstalled":`尚未安装`,"skills.previewLoading":`下载并解开预览…`,"skills.previewFailed":`预览失败:{error}`,"skills.packageFiles":`包内文件`,"skills.builtinNote":`内置技能随 neko 分发,无需安装,也不支持卸载。`,"skills.uninstallScope":`卸载{scope}`,"skills.installing":`安装中…`,"skills.installScope":`安装到{scope}`,"skills.back":`← 返回聊天`,"skills.title":`技能市场`,"skills.groupCategory":`按分类`,"skills.groupSource":`按来源`,"skills.search":`搜索技能`,"skills.searchPlaceholder":`搜索技能…`,"skills.loadingCatalog":`加载市场目录…`,"skills.waitingGateway":`等待网关连接…`,"skills.catalogFailed":`市场目录加载失败,请检查网络后重试。`,"skills.noMatch":"没有匹配的技能。反复出现的需求可以用 `/skill:skill-creator` 自己造一个。"},en:{"common.connected":`Connected`,"common.connecting":`Connecting…`,"common.loading":`Loading…`,"settings.menuLabel":`Settings menu`,"settings.backToChat":`← Back to chat`,"settings.title":`Settings`,"settings.menu.credentials":`Model services`,"settings.menu.search":`Web search`,"settings.menu.context":`Context`,"settings.menu.codemode":`Codemode`,"settings.menu.appearance":`Appearance`,"settings.menu.language":`语言 / Language`,"settings.menu.mobile":`Mobile pairing`,"settings.menu.about":`About and updates`,"settings.credentials.title":`Model services`,"settings.credentials.intro":`Enable the model services you use and set their API Keys. Saved values take precedence over environment variables and apply to all workspaces. DeepSeek is always enabled`,"settings.credentials.providerLabel":`Model provider`,"settings.credentials.disabled":`Disabled`,"settings.credentials.configured":`Configured`,"settings.credentials.keyMissing":`No Key`,"settings.credentials.enabledCount":`{enabled} / {total} enabled`,"settings.search.title":`Web search`,"settings.search.intro":`Choose the service the assistant uses to search the web, and manage the Tavily and DeepSeek API Keys`,"settings.search.deepseekNote":`Shares the same DeepSeek Key as “Model services”. Saving or removing it on either page syncs both`,"settings.context.title":`Context`,"settings.context.intro":`Manage how long conversations save context. Choices are saved and applied immediately for all workspaces. Leave “Default” selected to keep the original behavior`,"settings.codemode.title":`Codemode`,"settings.codemode.intro":`Let the model write a short JavaScript script that calls several tools at once and brings only the result back into the chat. Choices save immediately and apply to every workspace`,"codemode.modeTitle":`Mode`,"codemode.newSessionsOnly":`Applies to sessions created afterwards; existing sessions stay as they are`,"codemode.mode.off.label":`Off`,"codemode.mode.off.description":`The model calls tools one by one, exactly as before`,"codemode.mode.on.label":`On`,"codemode.mode.on.description":`Adds codemode next to the usual tools; the model picks what fits`,"codemode.mode.only.label":`Only codemode`,"codemode.mode.only.description":`File and command tools are reachable only through scripts; todo, questions and sub-agents stay direct`,"codemode.current":`Current: {mode} · {source}`,"codemode.fromConfig":`From the config file; picking another option overrides it`,"codemode.saved":`Saved. Applies to new sessions`,"codemode.restored":`Restored the default`,"codemode.restore":`Restore default`,"codemode.saveFailed":`Save failed. Check the connection and try again`,"settings.mobile.title":`Mobile pairing`,"settings.mobile.intro":`Control the Agent on your computer from the mobile app. Pairing is managed on this computer only`,"settings.appearance.title":`Appearance`,"settings.appearance.intro":`Choose the theme and chat typography. Choices are saved and applied immediately in this browser only, and do not affect the terminal UI or the mobile app`,"language.title":`语言 / Language`,"language.intro":`Choose the interface language. The choice is saved and applied immediately in this browser only. It does not affect the terminal UI or the mobile app, and conversation content is unchanged`,"language.legend":`Interface language`,"language.option.zh":`中文`,"language.option.en":`English`,"appearance.theme":`Theme`,"appearance.theme.sakura":`Sakura`,"appearance.theme.sakuraBlurb":`Blue-pink-white light theme, default`,"appearance.theme.light":`Paper`,"appearance.theme.lightBlurb":`Neutral cool grey-white, restrained`,"appearance.theme.dark":`Ink`,"appearance.theme.darkBlurb":`Dark blue-grey, easy on the eyes at night`,"appearance.previewUser":`Hi`,"appearance.previewAssistant":`Hi, how can I help?`,"appearance.typography":`Chat typography`,"appearance.typographyBlurb":`Affects message text and the input box in chat only. Code blocks, tool cards and the sidebar stay the same`,"appearance.font":`Font`,"appearance.fontHint":`Uses system fonts installed on this device, so the result depends on your device. Falls back automatically when missing`,"appearance.font.sans":`Sans-serif`,"appearance.font.serif":`Serif`,"appearance.font.mono":`Monospace`,"appearance.size":`Size`,"appearance.size.13":`Small 13px`,"appearance.size.14":`Default 14px`,"appearance.size.16":`Large 16px`,"appearance.size.18":`Extra large 18px`,"appearance.weight":`Weight`,"appearance.weight.regular":`Regular`,"appearance.weight.medium":`Medium`,"appearance.weight.semibold":`Semibold`,"appearance.leading":`Line height`,"appearance.leading.compact":`Compact`,"appearance.leading.normal":`Normal`,"appearance.leading.relaxed":`Relaxed`,"appearance.sample":`Preview`,"appearance.sampleBlurb":`Updates instantly with your choices above`,"appearance.sampleUser":`Why does this function return undefined?`,"appearance.sampleAssistantIntro":"This is a **sample answer** to preview the current typography. Inline code looks like `const total = items.length`, and here is a code block:","appearance.sampleItem1":`First item`,"appearance.sampleItem2":`Second item`,"appearance.isDefault":`Using the default appearance`,"appearance.customized":`Customized`,"appearance.reset":`Restore defaults`,"credential.source.saved":`Using saved key`,"credential.source.environment":`Using environment variable`,"credential.source.runtime":`Using runtime configuration`,"credential.source.keyless":`keyless (rate-limited)`,"credential.source.none":`Not configured`,"credential.failed":`Action failed. Check the connection and try again`,"credential.removed":`Saved key removed`,"credential.saved":`Saved. Takes effect on the next request`,"credential.enableAria":`Enable {name}`,"credential.enabledDone":`Enabled`,"credential.disabledDone":`Disabled`,"credential.alwaysOn":`Always on`,"credential.enable":`Enable`,"credential.envVar":`Environment variable: {state} ({envVar})`,"credential.envConfigured":`configured`,"credential.envMissing":`not configured`,"credential.keylessNote":` · Runs in keyless rate-limited mode when not configured`,"credential.keyLabel":`{name} API Key`,"credential.placeholderReplace":`Enter a new key to replace it`,"credential.placeholderNew":`Paste your API Key`,"credential.working":`Working…`,"credential.save":`Save key`,"credential.remove":`Remove saved key`,"credential.getKey":`Get a {name} API Key ↗`,"search.switched":`Switched to {name}. Takes effect on the next search`,"search.saveFailed":`Save failed. Check the connection and try again`,"search.service":`Search service`,"search.current":`Using: {name}`,"search.intro":`Choose the service the assistant uses to search the web and read pages. Takes effect on the next call after saving`,"search.source.saved":`Saved key`,"search.source.environment":`Environment variable`,"search.source.runtime":`Runtime configuration`,"search.source.keyless":`keyless, rate-limited`,"search.source.none":`No key configured`,"search.tavilyDescription":`Search and fetch with Tavily ({source}), default`,"search.deepseekDescription":`Search and fetch with DeepSeek, shares the DeepSeek key ({source})`,"search.deepseekWarning":`No DeepSeek key is configured, so search is unavailable. Set a key in the DeepSeek card below, or choose Tavily`,"providerCombo.placeholder":`Select a provider`,"providerCombo.empty":`No matching providers`,"model.context":`{size} context`,"model.images":`Image input`,"model.textOnly":`Text only`,"model.reasoning":`Reasoning`,"model.noReasoning":`No reasoning`,"context.row.compactionTrigger.label":`Trigger point`,"context.row.compactionTrigger.description":`Compacts automatically when context reaches this share of the model window. Defaults to near the window limit`,"context.row.keepRecentTokens.label":`Keep recent`,"context.row.keepRecentTokens.description":`Recent content kept verbatim when compacting. More means fewer lost details`,"context.row.pruningTrigger.label":`Trigger point`,"context.row.pruningTrigger.description":`Prunes old results when context reaches this share of the model window`,"context.row.keepRecent.label":`Keep recent results`,"context.row.keepRecent.description":`This many of the newest tool results always stay intact`,"context.row.minChars.label":`Minimum result length`,"context.row.minChars.description":`Results shorter than this are never pruned`,"context.row.minSave.label":`Minimum savings per run`,"context.row.minSave.description":`A prune runs only when it is expected to free at least this share of the model window. Each prune invalidates the prompt cache, so a larger share means fewer, more concentrated prunes`,"context.source.default":`Default`,"context.source.config":`Config file`,"context.source.saved":`Saved`,"context.value.chars":`{value} chars`,"context.value.charsK":`{value}k chars`,"context.value.count":`{value}`,"context.chipDefault":`Default`,"context.chipCustom":`{value} · Custom`,"context.nearLimit":`Near the window limit`,"context.current":`Current {value} · {source}`,"context.marker.pruning":`Prune`,"context.marker.compaction":`Compact`,"context.group.compaction.title":`Context compaction`,"context.group.compaction.blurb":`When a conversation grows long, older content is summarized to free up space. Manual /compact is always available`,"context.group.pruning.title":`Tool result pruning`,"context.group.pruning.blurb":`Replaces older large tool outputs with a one-line note in what the model sees. Full results and history in the UI are unaffected. Each prune invalidates the prompt cache, so pruning runs in batches`,"context.threshold.aria":`Trigger position preview`,"context.threshold.title":`Trigger position`,"context.threshold.window":`Model context window`,"context.threshold.allOff":`Automatic compaction and pruning are both off`,"context.fromConfig":`From the config file. Choosing another option overrides it`,"context.saveFailed":`Save failed. Check the connection and try again`,"context.restored":`{label} restored to default`,"context.saved":`Saved`,"context.switch.compaction":`Auto compaction`,"context.switch.pruning":`Prune tool results`,"context.allRestored":`All restored to defaults`,"context.restoreAll":`Restore all defaults`,"context.saving":`Saving…`,"common.close":`Close`,"about.intro":`View the neko version status and software updates`,"about.checkDone":`Check complete`,"about.checkDevelopment":`Development builds do not check for release updates`,"about.checkFailedRetry":`Check failed. Try again`,"about.checking":`Checking…`,"about.badge.incompatible":`Incompatible protocol`,"about.badge.install":`New version available`,"about.badge.restart":`Ready · restart needed`,"about.badge.refresh":`Page needs refresh`,"about.badge.development":`Development build`,"about.badge.failed":`Check failed`,"about.badge.latest":`Up to date`,"about.versionStatus":`Version status`,"about.currentVersion":`Current version`,"about.latestStable":`Latest stable version`,"about.runUpdate":`Run neko update to upgrade`,"about.installedNew":`New version installed`,"about.newVersion":`New version`,"about.afterRestart":`Takes effect after restarting the neko process`,"about.staticUpdated":`Static server updated`,"about.afterRefresh":`Takes effect after refreshing the page`,"about.checkUpdates":`Check for updates`,"about.copyUpdate":`Copy neko update`,"about.refreshPage":`Refresh page`,"about.commandShell":`Command shell`,"about.upgradeTitle":`Upgrade instructions`,"about.upgradeBefore":`Run`,"about.upgradeAfter":`in a terminal, then restart neko to apply the update`,"about.draftKept":`Draft kept before upgrade`,"update.copied":`Copied neko update. Run it on the computer running neko`,"update.copyManually":`Copy the command: neko update`,"update.install":`New version available · run neko update`,"update.refreshPage":`Page updated`,"update.incompatible":`Version incompatible · update and restart neko`,"update.restart":`Upgraded · restart local neko`,"update.copyCommand":`Copy command`,"update.refresh":`Refresh`,"update.viewSteps":`View steps`,"update.dismiss":`Dismiss update notice`,"shell.dismiss":`Dismiss shell notice`,"shell.invalid":`{detail} bash and background jobs are unavailable. Fix shell.path in neko.config.json`,"shell.invalidDefault":`Invalid shell.path configuration`,"shell.missing":`Git Bash not found: bash and background jobs are unavailable. Install Git for Windows, or set shell.path in neko.config.json`,"shell.ready":`Ready`,"shell.unavailable":`Unavailable`,"shell.sourceConfig":`{path} (shell.path config)`,"shell.sourceAuto":`{path} (auto-detected)`,"pairing.qrTitle":`Mobile pairing QR code`,"pairing.getFailed":`GET {path} failed ({status})`,"pairing.requestFailed":`Request failed ({status})`,"pairing.disabledNotice":`Mobile access turned off. Tasks already accepted keep running`,"pairing.addressRequired":`Select a LAN address to listen on`,"pairing.portInvalid":`The port must be an integer from 1 to 65535`,"pairing.enabledNotice":`Mobile access turned on: {address}`,"pairing.qrGenerated":`QR code generated. Valid for 120 seconds`,"pairing.certRotated":`Certificate regenerated ({fingerprint}…). Phones must scan the code again to pair`,"pairing.revoked":`Device access revoked. Tasks it already submitted keep running`,"pairing.revokeMissing":`Device not found or already revoked`,"pairing.unsupported":`This gateway version does not support mobile pairing. Update or restart the desktop side, then refresh this page. Chat is not affected`,"pairing.stateOn":`On · https://{address}{relay}`,"pairing.relayed":` (via Windows relay)`,"pairing.stateError":`Failed to start`,"pairing.stateOff":`Off`,"pairing.intro":`Allow the phone to control the Agent on this computer. Pairing is managed on this computer only. Turn it on only on trusted networks`,"pairing.wslNote":`Running in WSL: the addresses listed are Windows LAN addresses. When turned on, a relay process on the Windows side accepts phone connections (no administrator rights needed; it stops automatically when you turn off mobile access or exit neko)`,"pairing.startFailed":`Failed to start: {error}. Check whether the selected address and port are in use`,"pairing.allow":`Allow the phone to control the Agent on this computer`,"pairing.address":`Address`,"pairing.noAddressWindows":`No Windows LAN address found`,"pairing.noAddress":`No LAN address found`,"pairing.lastConnected":`{address} (last connected)`,"pairing.port":`Port`,"pairing.noUsableWindows":`No usable Windows LAN address found. Make sure Windows is online and WSL interop is available`,"pairing.noUsable":`No usable LAN address found. Make sure this computer is online (loopback addresses cannot be used for mobile access)`,"pairing.qrRemaining":`QR code expires in {seconds}s`,"pairing.copyText":`Copy pairing text`,"pairing.refreshQr":`Refresh QR code`,"pairing.qrExpired":`The QR code has expired. Refresh it and scan again`,"pairing.generateQr":`Generate QR code`,"pairing.scanHint":`Scan with the mobile app, or choose “Copy pairing text” and paste it in the app. Make sure the phone and computer are on the same network and the firewall allows the selected port{relay}`,"pairing.relayFirewall":` (under WSL, allow powershell.exe in Windows Firewall)`,"pairing.certificate":`Certificate`,"pairing.certInfo":`{fingerprint}… · expires {date}`,"pairing.regenerate":`Regenerate certificate`,"pairing.certExpiring":`The certificate is about to expire. Regenerate it soon. All phones must scan again afterwards`,"pairing.regenerateWarning":`Regenerating disconnects all phones and revokes all device access. Tasks already accepted on the computer keep running`,"pairing.devices":`Paired devices`,"pairing.noDevices":`No paired devices`,"pairing.online":`Online`,"pairing.offline":`Offline`,"pairing.lastSeen":`Last connected {time}`,"pairing.revoke":`Revoke`,"pairing.spawnedBefore":`This page started the gateway through neko web. Closing it also stops the gateway and the mobile entry point. For a long-lived phone connection, use`,"pairing.spawnedAfter":`or keep the TUI running`,"pairing.regenerateConfirm":`A new self-signed certificate will be generated. All phones disconnect, all device access is revoked, and you must scan to pair again. Tasks already accepted on the computer keep running`,"pairing.confirmRegenerate":`Confirm regeneration`,"pairing.revokeTitle":`Revoke device “{name}”`,"pairing.revokeConfirm":`The phone disconnects immediately and cannot reconnect. Tasks already accepted on the computer keep running; stop them separately on the computer`,"pairing.confirmRevoke":`Confirm revoke`,"common.cancel":`Cancel`,"gw.notConnected":`Gateway not connected`,"gw.sessionNotReady":`Session not ready`,"gw.sessionChangedDraft":`Session changed. Draft kept`,"gw.sessionChanged":`Session changed`,"gw.sessionChangedOrNotReady":`Session changed or not ready`,"gw.sessionChangedAnswerDraft":`Session changed or not ready. Answer draft kept`,"gw.sessionChangedFeedbackDraft":`Session changed or not ready. Feedback draft kept`,"gw.connectionChanged":`Connection changed. Try again`,"gw.busy":`An operation is in progress or the gateway is not connected. Try again later`,"gw.workspaceMissing":`Workspace not found`,"gw.sessionNotInWorkspace":`The session is not in this workspace or has been archived`,"gw.workspaceNotReady":`Workspace not ready`,"gw.incompatible":`Version incompatible. Run neko update, then restart local neko`,"gw.infoFailed":`GET /api/info failed ({status})`,"gw.invalidInfo":`Invalid gateway info`,"gw.infoLoadFailed":`Failed to get gateway info: {error}`,"gw.sessionGone":`The original session is unavailable. The draft kept before the upgrade is in About and updates`,"gw.notReady":`Gateway connection not ready. Wait a moment or refresh the page`,"gw.sessionChangedRetry":`Session changed. Try again`,"gw.notStarted":`Gateway not connected yet`,"core.status.thinking":`Thinking…`,"core.status.running":`Running {tool}…`,"core.status.retrying":`Retrying (attempt {attempt})…`,"core.row.compacted":`[context compacted]`,"core.row.newContext":`[new context]`,"core.note.notRun":`Not run: response interrupted`,"core.error.providerDisabled":`PROVIDER_DISABLED: {provider} is not enabled. Enable it in /login or Web settings, or switch model`,"core.error.providerKeyRequired":`PROVIDER_KEY_REQUIRED: Configure a {provider} API Key in /login or Web settings`,"core.error.planBusy":`PLAN_BUSY: Wait for the current run to finish or stop it first`,"core.error.continueBusy":`CONTINUE_BUSY: The session is running; wait for it to finish`,"core.error.continueUnavailable":`CONTINUE_UNAVAILABLE: The last run was answered; there is nothing to continue`,"runFailure.section":`The last run did not finish`,"runFailure.reason.model_error":`Model request failed`,"runFailure.reason.no_model":`No model is available`,"runFailure.reason.aborted":`Stopped`,"runFailure.reason.reset":`A new context started`,"runFailure.reason.faulted":`The run failed`,"runFailure.reason.orphaned":`The run could not continue`,"runFailure.reason.interrupted":`The run was interrupted`,"runFailure.reason.restart_limit":`Stopped after repeated crashes`,"runFailure.reason.nothing_to_answer":`Nothing to answer`,"runFailure.reason.turn_limit":`Turn limit reached`,"runFailure.continue":`Continue`,"runFailure.continueAria":`Continue the last run on its current context`,"runFailure.continueFailed":`Could not continue`,"core.error.workspaceUnknown":`WORKSPACE_UNKNOWN: This workspace is not in the list`,"core.error.workspaceLast":`WORKSPACE_LAST: Keep at least one workspace`,"core.error.workspaceBusy":`WORKSPACE_BUSY: Stop or finish the running sessions of this workspace, including ones waiting for an answer or approval, first`,"plan.status.awaiting_approval":`Awaiting approval`,"plan.status.approved":`Approved`,"plan.status.revision_requested":`Revision requested`,"plan.status.superseded":`Superseded`,"plan.status.cancelled":`Cancelled`,"plan.modeLabel":`Plan mode (read-only)`,"plan.unsupported":`This gateway does not support plan mode. Restart the gateway and try again`,"plan.settle.approved":`Approved. Starting to execute the plan`,"plan.settle.revised":`Revision request sent. Still in plan mode`,"plan.settle.superseded":`This plan was superseded by new input. Your decision was not saved`,"plan.settle.cancelled":`This plan was cancelled (the run stopped or plan mode ended). Your decision was not saved`,"plan.settle.pending":`Your decision has not been saved. Try again`,"plan.settle.other":`Another client already handled this plan. The saved result applies: {status}`,"plan.busy":`A run is in progress. Wait for the answer to finish or stop it, then try again`,"title.answerPrefix":`({count}) Awaiting answer · `,"title.planPrefix":`Awaiting approval · `,"todo.status.pending":`To do`,"todo.status.in_progress":`In progress`,"todo.status.completed":`Done`,"question.status.pending":`Awaiting answer`,"question.status.answered":`Answered`,"question.status.skipped":`Skipped`,"question.status.cancelled":`Cancelled`,"question.settle.answeredWith":`Answered: {answer}`,"question.settle.answered":`Answered`,"question.settle.skipped":`Skipped. No answer provided`,"question.settle.cancelled":`Cancelled (the run stopped or the session was archived)`,"session.suffix.awaitingAnswer":` · Awaiting answer`,"session.suffix.awaitingPlan":` · Awaiting approval`,"session.suffix.running":` · Running`,"session.suffix.error":` · Error`,"composer.input":`Message input`,"composer.upgrade.sending":`Sending. Refresh later`,"composer.upgrade.attachments":`Send or remove attachments, then refresh`,"composer.upgrade.notReady":`Not connected yet. Try again later`,"composer.upgrade.otherDrafts":`Other sessions have drafts. Send or clear them first`,"composer.upgrade.saveFailed":`Could not save the draft. Copy the text first`,"composer.attach.type":`Only PNG, JPEG and WebP are supported`,"composer.attach.size":`Each image must be 20 MiB or smaller`,"composer.attach.decode":`Could not decode the image. Choose another`,"composer.attach.limit":`Up to 4 images per message, 40 MiB in total`,"composer.attach.removeUnsupported":`Remove unsupported attachments first`,"composer.attach.checking":`Checking image…`,"composer.attach.remove":`Remove {name}`,"composer.skills.newSession":`Start a session to choose workspace skills`,"composer.skills.waiting":`Waiting for the session…`,"composer.skills.loading":`Loading skills…`,"composer.skills.empty":`No skills available in this workspace`,"composer.skills.failed":`Failed to load skills. Close the menu and try again`,"composer.image.reading":`Reading image…`,"composer.image.readFailed":`Failed to read the image. Try again`,"composer.workspaceChanged":`Workspace changed`,"composer.workspaceChangedDraft":`Workspace changed. Draft kept`,"composer.compaction.retrying":`Retrying compaction`,"composer.compaction.waiting":`Waiting for context compaction`,"composer.compaction.running":`Compacting context`,"composer.compaction.failure":`Compaction failed: {error}`,"composer.compaction.applied":`Context compacted`,"composer.compaction.nothing":`Nothing to compact`,"composer.compaction.skipped":`Skipped a stale summary`,"composer.compaction.cancelled":`Compaction cancelled`,"composer.compaction.failed":`Compaction failed. You can retry`,"composer.compaction.applying":`Waiting to apply the summary`,"composer.compaction.nothingTitle":`Recent context is kept, so there is no older content to compact. By default about the latest 20,000 tokens are kept`,"composer.compactFailed":`Compaction failed. Try again`,"composer.plan.noArgs":`/plan takes no arguments. Switch to plan mode first, then describe your request as usual`,"composer.plan.needSession":`Start a session before switching plan mode`,"composer.plan.busy":`A run is in progress. Wait for the answer to finish or stop it before switching plan mode`,"composer.planModeTitle":`Read-only research, then submit a plan. After approval it exits plan mode and starts executing. Type /plan to exit`,"composer.sendFailed":`Send failed. Try again`,"composer.queue.steerWithdrawn":`Could not steer the message. It was moved back to the input`,"composer.queue.gone":`The message is no longer queued`,"composer.queue.sentNoSteer":`The message was already sent and cannot be steered`,"composer.queue.steerFailed":`Steer failed. Try again`,"composer.queue.imagesNotRestored":`Images were not restored. Add them again`,"composer.queue.sentNoWithdraw":`The message was already sent and cannot be withdrawn`,"composer.queue.withdrawFailed":`Withdraw failed. Try again`,"composer.questionHint":`The assistant is waiting for your answer. Messages sent here are still queued (including steer) and enter the context only after you answer or skip. They are not treated as the answer`,"composer.openQuestion":`Open question`,"composer.dropHint":`Release to add images. They are not sent automatically`,"composer.provider.disabled":`Model service {provider} is disabled. Enable it again or switch model`,"composer.provider.keyMissing":`No Key configured for {provider}`,"composer.provider.goSettings":`Go to settings`,"composer.noVision":`The current model does not support images. Switch model or remove the attachments`,"composer.noHistoryImages":`The current model cannot view earlier original images. Existing text analysis still applies`,"composer.placeholder.waiting":`The assistant is waiting for your answer. Messages here will be queued`,"composer.placeholder.busy":`Running: messages are queued after the answer ends. Steer or withdraw them in the queue bar`,"composer.placeholder.idle":`Type a message, @ to mention a file, / for commands`,"composer.addImage":`Add image`,"composer.addImageTitle":`Add images (up to 4)`,"composer.menu":`Input actions menu`,"composer.ctx.none":`No valid usage yet. Updates after the first answer or the next answer after compaction`,"composer.ctx.usage":`Context usage of the last successful answer: {tokens} / {window} tokens. Not cumulative session usage`,"composer.usage.aria":`Task total usage: input {input}, output {output}, cache read {cacheRead}, cost {cost}`,"composer.usage.detail":`Input {input} · Output {output} · Cache read {cacheRead} · {cost}`,"composer.working":`Working`,"composer.queue":`Queue`,"composer.send":`Send`,"composer.stopTitle":`Stop the running session and any stoppable tasks`,"composer.stop":`Stop`,"composer.commandTitle":`Commands`,"composer.noCommands":`No matching commands or skills`,"common.retry":`Retry`,"common.loadingEllipsis":`Loading…`,"common.workspace":`Workspace`,"common.newSession":`New session`,"approval.status.pending":`Awaiting approval`,"approval.status.allowed":`Allowed once`,"approval.status.denied":`Denied`,"approval.status.cancelled":`Cancelled`,"approval.section":`Bash approval`,"approval.timeout":`Timeout: {value}`,"approval.timeoutDefault":`default`,"approval.command":`Full command`,"approval.allow":`Allow once`,"approval.deny":`Deny`,"approval.inbox":`Commands awaiting approval`,"askUser.answer":`Answer: {answer}`,"askUser.skipped":`Skipped, no answer provided`,"askUser.cancelled":`Question cancelled, no answer received`,"askUser.record":`Assistant question record`,"askUser.badge":`Assistant question`,"askUser.locate":`Go to question`,"suggest.hint":`↑↓ Select · Enter / Tab Confirm · Esc Close`,"suggest.retryFiles":`Retry file search`,"copy.copied":`Copied`,"copy.failed":`Copy failed`,"copy.label":`Copy`,"export.busy":`Exporting…`,"export.empty":`This session has nothing to export yet`,"export.title":`Export session`,"export.failed":`Export failed: {error}`,"export.button":`Export`,"export.format":`Export format`,"export.thinking":`Include thinking`,"export.cancelled":`Session changed, export cancelled`,"export.done":`Exported {name}`,"export.doneSkipped":`Exported {name}; images not embedded: {count}`,"mention.searching":`Searching files…`,"mention.incomplete":`File index is incomplete, type a subdirectory to narrow down`,"mention.limited":`Too many results, keep typing the path to narrow down`,"mention.empty":`No matching files or directories`,"mention.errorWith":`Search failed: {error}`,"mention.error":`Search failed, try again`,"mention.title":`Workspace files`,"tree.symlinkTitle":`Symbolic link (not followed)`,"tree.symlink":`Symbolic link`,"tree.protectedTitle":`Protected file, viewing is not available`,"tree.protected":`Protected file`,"tree.emptyDir":`Empty directory`,"tree.readFailed":`Read failed: {error}`,"tree.incomplete":`Incomplete list: {reason}`,"tree.limitedDir":`This directory has too many entries, showing part of them`,"tree.limitedWorkspace":`The workspace has too many files, the listing was truncated`,"tree.readOnly":`Read-only browsing`,"tree.refreshAria":`Refresh file tree`,"tree.refresh":`Refresh`,"tree.aria":`Workspace file tree`,"viewer.content":`File content`,"viewer.zoom":`Code zoom`,"viewer.zoomOut":`Zoom out code`,"viewer.zoomReset":`Reset zoom`,"viewer.zoomResetTitle":`Reset to 100%`,"viewer.zoomIn":`Zoom in code`,"viewer.refreshAria":`Refresh file content`,"viewer.refreshing":`Refreshing…`,"viewer.refresh":`Refresh`,"viewer.workspaceRoot":`(workspace root)`,"viewer.stale":`The agent modified this file, the content shown may be outdated`,"viewer.reload":`Reload content`,"viewer.missing":`File not found`,"viewer.missingDetail":`The file may have been deleted or moved out of the workspace`,"viewer.readFailed":`Read failed: {error}`,"viewer.protected":`Protected file, viewing is not available`,"viewer.protectedDetail":`Credential files (such as .env and private keys) are never sent to the browser, to avoid leaking them over the network`,"viewer.binary":`Binary file, preview is not available`,"viewer.binarySize":`Size {size}`,"viewer.refreshFailed":`Refresh failed: {error}`,"viewer.truncated":`Truncated, showing only the beginning of the file ({size} in total)`,"changes.scopeNote":`Lists only changes the agent made with the edit / write tools, not changes made by commands (such as bash), and not the actual disk or git differences`,"changes.listFailed":`Failed to load the change list: {error}`,"changes.empty":`No agent edit / write changes in this session yet`,"changes.ops":`{count}×`,"changes.outside":`Outside workspace`,"changes.root":`(root)`,"changes.listIncomplete":`Incomplete list: too many changed files, over the limit, showing part of them`,"changes.truncated":`Truncated`,"changes.backToList":`← Changes`,"changes.viewCurrent":`View current content`,"changes.detailFailed":`Failed to load change details: {error}`,"changes.noRecords":`No change records to show for this file`,"changes.detailIncomplete":`Incomplete records: too many operations on this file, over the limit, showing part of them`,"agent.main":`Main agent`,"job.status.running":`Running`,"job.status.exited":`Exited`,"job.status.failed":`Failed`,"job.status.stopped":`Stopped`,"job.status.lost":`Lost`,"job.reason.timeout":`timed out`,"job.reason.spawnError":`failed to start`,"job.reason.exitCode":`exit code {code}`,"job.reason.restart":`gateway restarted`,"job.stopping":`Stopping…`,"job.stop":`Stop job`,"job.dropped":`… {count} earlier bytes of output omitted`,"job.reading":`Reading…`,"job.noOutput":`No output yet`,"job.toBottom":`Back to bottom ↓`,"job.panel":`Background jobs`,"job.panelEmpty":`No background jobs in this session yet`,"job.reportTitle":`Background job {id}`,"job.reportCurrent":`Now: {status}`,"image.loadFailed":`Image failed to load, click to retry`,"image.view":`View image {name}`,"image.loading":`Loading image…`,"image.save":`Save image`,"task.status.idle":`Idle`,"task.status.queued":`Queued`,"task.status.running":`Running`,"task.status.completed":`Completed`,"task.status.failed":`Failed`,"task.status.cancelled":`Stopped`,"message.cat":`neko cat`,"message.defaultImagePrompt":`Default image prompt`,"message.copyAnswer":`Copy answer`,"message.welcome":`Type a message to start ✦`,"message.round":`Task {round} · {title} · {status}`,"message.roundUsage":"This round ↑{input} ↓{output} · cache {cacheRead}/{cacheWrite} · ${cost}","message.roundUsageMissing":`Usage for this round was not recorded`,"message.approvalsPending":`· {count} awaiting approval`,"message.viewProcess":`· View full process`,"message.approvalLine":`Approval · {status}`,"message.toBottom":`Back to bottom ↓`,"picker.aria":`Model and thinking level: {label} {level}`,"picker.badgeImage":`Img`,"picker.badgeReasoning":`Think`,"picker.providerModels":`{count} models`,"picker.keyMissing":`No Key`,"picker.applyFailed":`Failed to apply, try again`,"picker.defaultFailed":`Failed to save the default model, try again`,"picker.title":`Model and thinking level`,"picker.issueDisabled":`The model service {provider} of this session is disabled. Switch to another model or enable it again in settings`,"picker.issueKey":`No API Key is set for {provider}. Configure it or switch to another model`,"picker.goSettings":`Go to settings`,"picker.providerLabel":`Model provider`,"picker.searchLabel":`Search models`,"picker.searchPlaceholder":`Search by model name, ID or provider`,"picker.models":`Models`,"picker.keyMissingDot":`No Key ·`,"picker.configure":`Configure`,"picker.unsetDefault":`Unset default`,"picker.setDefault":`Set as default`,"picker.unsetDefaultTitle":`Unset the default model (affects new sessions only)`,"picker.setDefaultTitle":`Set as the default model (affects new sessions only)`,"picker.noMatch":`No matching models`,"picker.noModels":`No models available. Enable a model service in settings first`,"picker.thinking":`Thinking level`,"picker.cliNote":`The default model is currently set by the --model startup option and overrides the saved value. The saved default takes effect once the option is removed`,"picker.scopeNote":`Applies to this session only, from the next request. ☆ sets the default model for new sessions (the current session is unaffected)`,"picker.applying":`Applying…`,"picker.apply":`Apply`,"open.explorer":`File Explorer`,"open.fileManager":`File manager`,"open.noVscodeExe":`VS Code not found (Code.exe)`,"open.noVscodeCommand":`VS Code not found (the code command is not in PATH)`,"open.noExplorer":`explorer.exe not found (Windows interop must be enabled)`,"open.noXdg":`xdg-open not found`,"open.title":`Open workspace`,"open.withTarget":`Open with {target}`,"open.noTargets":`No way to open is available on this computer`,"open.pickSession":`Select a session first`,"open.notReady":`Connection not ready`,"open.failed":`Failed to open: {error}`,"open.disabledTitle":`{label} ({reason})`,"open.unavailable":`unavailable`,"open.choose":`Choose how to open`,"open.forbidden":`Not allowed to open, refresh the page and try again`,"open.invalidPath":`The workspace directory does not exist or is not accessible`,"open.requestFailedStatus":`Request failed ({status})`,"open.requestFailed":`Request failed: {error}`,"plan.card.gone":`This plan is no longer awaiting approval: {status}`,"plan.card.goneOther":`This plan is no longer awaiting approval. It may have been handled elsewhere or replaced by a new plan`,"plan.card.section":`Plan approval`,"plan.card.dismiss":`Dismiss result`,"plan.card.notSaved":`The decision was not saved, try again`,"plan.card.submitFailed":`Submit failed: {error}`,"plan.card.draftKept":` (feedback draft kept, retry manually)`,"plan.card.exitFailed":`Exit failed: {error}`,"plan.card.awaiting":`Plan awaiting approval`,"plan.card.badge":`Plan`,"plan.card.offline":` · offline`,"plan.card.feedback":`Feedback`,"plan.card.offlineNote":`Offline: approve, revise and exit are disabled, act manually after reconnecting`,"plan.card.submitting":`Submitting…`,"plan.card.submitFeedback":`Submit feedback`,"plan.card.needFeedback":`Enter your feedback`,"plan.card.approve":`Approve and run`,"plan.card.revise":`Request changes`,"plan.card.processing":`Working…`,"plan.card.exit":`Cancel and leave plan mode`,"plan.card.hint":`You can keep typing without deciding, a new message replaces this plan`,"plan.row.section":`Plan submitted by the assistant`,"question.card.cancelledElsewhere":`This question was cancelled (the run stopped or the session was archived), the new answer was not saved`,"question.card.handledElsewhere":`This question was handled elsewhere first, the saved result applies: {result}`,"question.card.gone":`This question is no longer waiting. It may have been handled elsewhere or cancelled`,"question.card.notFound":`Question not found, it may already be settled`,"question.card.dock":`Questions awaiting an answer`,"question.card.dismiss":`Dismiss result`,"question.card.count":`{total} questions awaiting an answer, showing {index}`,"question.card.prev":`Previous`,"question.card.next":`Next`,"question.card.notSaved":`The answer was not saved, try again`,"question.card.submitFailed":`Submit failed: {error} (answer draft kept, retry manually)`,"question.card.section":`Assistant question`,"question.card.awaiting":`Awaiting answer`,"question.card.offline":` · offline`,"question.card.draftKept":`Draft kept`,"question.card.foldTitle":`Collapse question (does not skip it)`,"question.card.unfoldTitle":`Expand question`,"question.card.fold":`Collapse`,"question.card.unfold":`Expand`,"question.card.loadFailed":`Cannot load the full question: {message}`,"question.card.loading":`Loading the full question…`,"question.card.loadOffline":`Offline, the full question cannot be loaded for now`,"question.card.chooseMany":`Choose one or more options`,"question.card.chooseOne":`Choose one option`,"question.card.recommended":`Recommended`,"question.card.clear":`Clear selection`,"question.card.extra":`Additional notes (optional)`,"question.card.yourAnswer":`Your answer`,"question.card.offlineNote":`Offline: answering and skipping are disabled and your draft is kept. Submit manually after reconnecting, nothing is sent automatically`,"question.card.submitting":`Submitting…`,"question.card.submit":`Submit answer`,"question.card.skipTitle":`Skip: provide no answer, the assistant decides on its own and continues; the run is not stopped`,"question.card.skipping":`Skipping…`,"question.card.skip":`Skip`,"question.card.needInput":`Choose an option or type text to submit; choices are only kept as a draft`,"question.card.foldHint":`Collapsing or closing does not skip, and the run can still be stopped at any time`,"queue.mode.steer":`Steer`,"queue.mode.followUp":`Queued`,"queue.section":`Queued messages`,"queue.image":`Image`,"queue.imageOnly":`(image only)`,"queue.images":`{count} img`,"queue.steerAria":`Steer message: {label}`,"queue.steerTitle":`Switch to steer: join the work in progress after the current tool round ends`,"queue.steer":`Steer`,"queue.withdrawAria":`Withdraw {mode} message: {label}`,"queue.withdraw":`Withdraw`,"sessions.switchWorkspace":`Switch workspace`,"sessions.collapse":`Collapse sidebar`,"sessions.new":`New session`,"sessions.searchAria":`Search sessions in this workspace`,"sessions.searchPlaceholder":`Search sessions…`,"sessions.heading":`Sessions`,"sessions.actionsFor":`Actions for {name}`,"sessions.actions":`Session actions`,"sessions.waitingGateway":`Waiting for the gateway…`,"sessions.noMatch":`No matching sessions`,"sessions.empty":`No sessions in this workspace yet`,"sessions.market":`Skill market`,"sessions.settings":`Settings`,"sessions.drawer":`Workspaces and sessions`,"sessions.chooseWorkspace":`Choose workspace`,"sessions.archive":`Archive session`,"sessions.currentWorkspace":`Current workspace`,"sessions.addWorkspace":`Add workspace`,"sessions.archiveConfirm":`Archive “{name}”? The session is hidden from the list, the workspace and files are kept`,"sessions.confirmArchive":`Archive`,"sessions.removeWorkspace":`Remove workspace`,"sessions.removeWorkspaceAria":`Remove workspace {name}`,"sessions.removeWorkspaceLaunch":`Web was started in this directory, so it cannot be removed`,"sessions.removeWorkspaceLast":`Keep at least one workspace`,"sessions.removeWorkspaceNoFiles":`No files on disk are deleted`,"sessions.removeWorkspaceHidden":`Its sessions are hidden, {count} right now`,"sessions.removeWorkspaceRestore":`Add the directory again to restore them`,"sessions.confirmRemoveWorkspace":`Remove`,"subagent.title":`Sub-agents`,"subagent.history":`History · `,"subagent.usage":`Total sub-agent usage`,"subagent.duration":`Duration of the current or latest task`,"subagent.stop":`Stop this task`,"subagent.queued":`Task queued…`,"subagent.noContent":`Nothing yet`,"subagent.rounds":`{count} rounds`,"todo.aria":`Todo {done}/{total}, {done} completed{offline}`,"todo.ariaOffline":` (offline)`,"todo.progressTitle":`Todo progress (read-only)`,"todo.label":`Todo`,"todo.panel":`Todo list`,"todo.heading":`Todo · {done}/{total} completed`,"todo.offlineNote":`Offline · showing the last loaded content, it may be out of date`,"todo.items":`Todo items`,"codemode.card.script":`Script`,"codemode.card.calls":`Tool calls ({count})`,"codemode.card.callCount":`{count} calls`,"codemode.card.omitted":`{count} more not shown`,"codemode.card.fullOutput":`Full output: {path}`,"codemode.call.running":`Running`,"codemode.call.ok":`Succeeded`,"codemode.call.error":`Failed`,"codemode.call.cancelled":`Cancelled`,"tool.status.pending":`Pending`,"tool.status.running":`Running`,"tool.status.done":`Done`,"tool.status.failed":`Failed`,"tool.diff":`Code changes`,"tool.diffTruncated":`The code change preview is truncated, see the full content written below`,"tool.fullWrite":`Full content written`,"tool.output":`Output`,"tool.errorOutput":`Error output`,"tool.result":`Result`,"common.reconnecting":`Reconnecting…`,"common.connectionFailed":`Connection failed`,"topbar.toggleSidebar":`Toggle sidebar`,"topbar.switching":`Switching…`,"topbar.jobs":`Jobs{state}`,"topbar.jobsRunning":` · {count} running`,"topbar.jobsCount":` {count}`,"topbar.workspaceAria":`Workspace, {count} changed files`,"topbar.workspaceTitle":`Workspace: browse files and agent changes (read-only)`,"panel.resize":`Resize panel`,"wspanel.close":`Close workspace panel`,"wspanel.views":`Workspace views`,"wspanel.files":`Files`,"wspanel.changes":`Changes {count}`,"wspanel.backToTree":`← File tree`,"picker2.hint":`Choose a folder on the computer running Harness`,"picker2.pathNav":`Directory path`,"picker2.fullPath":`Full directory path`,"picker2.go":`Go`,"picker2.filter":`Filter folders`,"picker2.filterPlaceholder":`Filter folders…`,"picker2.hidden":`Hidden folders`,"picker2.list":`Folder list`,"picker2.parent":`Parent directory`,"picker2.inaccessible":`Not accessible`,"picker2.loading":`Reading directory…`,"picker2.noMatch":`No matching subfolders, you can choose the current directory`,"picker2.more":`Load more`,"picker2.adding":`Adding…`,"picker2.choose":`Choose folder`,"path.thisComputer":`This PC`,"chat.skip":`Skip to main content`,"chat.dismissNotice":`Dismiss notice`,"chat.startHere":`Start a new session in this workspace`,"chat.subagents":`Sub-agents · {count}`,"chat.subagentsApproval":` · {count} awaiting approval`,"chat.subagentsRunning":` · {count} running`,"command.compact":`Compact the context (optional instructions)`,"command.plan":`Toggle plan mode (read-only research, submit a plan, run after approval)`,"command.builtin":`Built-in`,"thinking.label":`Thinking…`,"skills.category.documents":`Documents`,"skills.category.development":`Development workflow`,"skills.category.frontend":`Frontend / UI`,"skills.category.research":`Research`,"skills.category.skills":`Skills ecosystem`,"skills.category.automation":`Automation`,"skills.category.database":`Database`,"skills.category.writing":`Writing`,"skills.category.uncategorized":`Uncategorized`,"skills.badge.project":`Project`,"skills.badge.user":`User`,"skills.badge.active":`{level} · active`,"skills.badge.builtin":`Built-in`,"skills.scope.user":`user level`,"skills.scope.project":`project level`,"skills.processing":`Working…`,"skills.installedShadowed":`Installed at user level, but a project-level skill with the same name takes precedence, so this install is not active yet. It applies from your next message`,"skills.installed":`Installed, it applies from your next message`,"skills.overwriteTitle":`Overwrite installed skill`,"skills.overwriteBody":`{name} is already installed at {scope}. Overwrite with the market version? Local changes will be lost`,"skills.overwriteBodyVersion":`{name} is already installed at {scope}. Overwrite with market version {version}? Local changes will be lost`,"skills.overwrite":`Overwrite`,"skills.opFailed":`Operation failed: {error}`,"skills.shadowTitle":`Not active after install`,"skills.shadowBody":`A project-level {name} already exists and takes precedence. Install to user level anyway?`,"skills.installAnyway":`Install anyway`,"skills.uninstallTitle":`Uninstall skill`,"skills.uninstallBody":`Delete {name} from {scope}? This cannot be undone`,"skills.uninstall":`Uninstall`,"skills.uninstalled":`Uninstalled, it applies from your next message`,"skills.closeDetail":`Close details`,"skills.detailAria":`Skill details {name}`,"skills.tab.about":`About`,"skills.tab.preview":`Preview`,"skills.loadFailed":`Failed to load: {error}`,"skills.field.category":`Category`,"skills.field.source":`Source`,"skills.field.size":`Size`,"skills.field.uploaded":`Uploaded`,"skills.field.license":`License`,"skills.notInstalled":`Not installed`,"skills.previewLoading":`Downloading and unpacking preview…`,"skills.previewFailed":`Preview failed: {error}`,"skills.packageFiles":`Files in package`,"skills.builtinNote":`Built-in skills ship with neko, so they need no install and cannot be uninstalled`,"skills.uninstallScope":`Uninstall from {scope}`,"skills.installing":`Installing…`,"skills.installScope":`Install to {scope}`,"skills.back":`← Back to chat`,"skills.title":`Skill market`,"skills.groupCategory":`By category`,"skills.groupSource":`By source`,"skills.search":`Search skills`,"skills.searchPlaceholder":`Search skills…`,"skills.loadingCatalog":`Loading the market catalog…`,"skills.waitingGateway":`Waiting for the gateway…`,"skills.catalogFailed":`Failed to load the market catalog, check your network and try again`,"skills.noMatch":"No matching skills. For a recurring need, create your own with `/skill:skill-creator`"}},zg=/\{(\w+)\}/g;function Bg(e,t,n=``){return e.replace(zg,(e,r)=>{let i=t?.[r];if(i===void 0)throw Error(`i18n: missing param "${r}" for "${n}"`);return String(i)})}function Vg(e){let t=Rg[e];return((e,n)=>Bg(t[e],n,e))}function R(){return Vg(Ig())}function z(){let e=Lg();return(0,d.useMemo)(()=>Vg(e),[e])}function Hg(e,t){return e.filter(e=>e.workspaceRoot===t).sort(Xi)}var Ug=class{subagent(e){if(!this.ready||!this.#t)throw Error(R()(`gw.sessionNotReady`));return this.#t.subagent(e)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=[];#m;#h;#g=[];#_;#v;#y=0;#b=0;#x=0;#S=!1;#C=!1;#w=!1;#T=!1;#E=!1;#D=!1;#O=!1;constructor(e){this.#e=e,this.#m=e.workspaceRoot,this.#h=e.preferredSession}get currentSessionId(){return this.#h}get workspaceRoot(){return this.#m}get ready(){return this.#C&&!this.#T&&this.#f!==void 0}get managementReady(){return this.#C&&!this.#T}async saveCredential(e,t){if(!this.#C||!this.#o)throw Error(R()(`gw.notConnected`));await this.#o.save({provider:e,key:t})}async removeCredential(e){if(!this.#C||!this.#o)throw Error(R()(`gw.notConnected`));await this.#o.remove({provider:e})}async setProviderEnabled(e,t){if(!this.#C||!this.#o)throw Error(R()(`gw.notConnected`));await this.#o.setEnabled({provider:e,enabled:t})}async setSearchProvider(e){if(!this.#C||!this.#s)throw Error(R()(`gw.notConnected`));await this.#s.set({provider:e})}async setContextSettings(e){if(!this.#C||!this.#c)throw Error(R()(`gw.notConnected`));await this.#c.set(e)}async setCodemodeMode(e){if(!this.#C||!this.#l)throw Error(R()(`gw.notConnected`));await this.#l.set({mode:e})}async resetCodemodeMode(){if(!this.#C||!this.#l)throw Error(R()(`gw.notConnected`));await this.#l.reset({})}async resetContextSettings(){if(!this.#C||!this.#c)throw Error(R()(`gw.notConnected`));await this.#c.reset({})}async setDefaultModel(e){if(!this.#C||!this.#u)throw Error(R()(`gw.notConnected`));await this.#u.set(e)}async clearDefaultModel(){if(!this.#C||!this.#u)throw Error(R()(`gw.notConnected`));await this.#u.clear(null)}async start(){this.#e.events.onPhase(`connecting`),this.#e.events.onWorkspace(this.#m);try{await this.#L()}catch(e){this.#k(e),e instanceof Hi?(this.#w=!0,this.#e.events.onPhase(`error`),await this.#H()):this.#B()}}#k(e){this.#e.events.onError(e instanceof Hi?R()(`gw.incompatible`):e instanceof Error?e.message:String(e))}#A(e){if(this.#S||e!==this.#b)throw Error(R()(`gw.connectionChanged`))}async#j(e){if(!this.managementReady)throw Error(R()(`gw.busy`));this.#T=!0,this.#e.events.onOperation(!0);let t=this.#b;try{await e(t)}finally{this.#T=!1,this.#e.events.onOperation(!1),t===this.#b&&this.#F()}}async selectWorkspace(e){await this.#j(async t=>{if(!this.#r?.state.value.workspaces.some(t=>t.path===e))throw Error(R()(`gw.workspaceMissing`));await this.#M(e,void 0,t)})}async addWorkspace(e){await this.#j(async t=>{let n=await this.#r.add({path:e});this.#A(t),await this.#M(n.path,void 0,t)})}async removeWorkspace(e){await this.#j(async t=>{let n=this.#r.state.value.workspaces.find(t=>t.path!==e);await this.#r.remove({path:e}),this.#A(t),e===this.#m&&(this.#D=!1,n&&await this.#M(n.path,void 0,t))})}async browse(e){if(!this.#C||!this.#r)throw Error(R()(`gw.notConnected`));return this.#r.browse(e)}async attachTo(e){await this.#j(async t=>{if(!this.#p.find(t=>t.id===e&&t.workspaceRoot===this.#m))throw Error(R()(`gw.sessionNotInWorkspace`));await this.#N(e,t)})}async createSession(){await this.#j(async e=>{let t=await this.#n.create({cwd:this.#m});this.#A(e),await this.#N(t.id,e)})}async archiveSession(e){await this.#j(async t=>{await this.#n.archive(e),this.#A(t),this.#p=this.#p.filter(t=>t.id!==e),this.#h===e&&await this.#M(this.#m,void 0,t)})}async#M(e,t,n){let r=Hg(this.#p,e).sort(Zi),i=r.find(e=>e.id===t)??r[0];try{i?await this.#N(i.id,n):await this.#P(n),this.#A(n),this.#m=e,this.#E=this.#r?.state.value.workspaces.some(t=>t.path===e)===!0,this.#e.events.onWorkspace(e)}catch(e){throw n===this.#b&&(this.#V(),this.#h=void 0,this.#e.events.onSessionChange(null)),e}}async#N(e,t){if(this.#h===e&&this.#f)return;let n=this.#t;this.#V();let r=this.#x;this.#h=void 0,this.#e.events.onSessionChange(null);let i=await n.attach(e);this.#A(t),this.#f=i,this.#h=e,this.#e.events.onSessionChange(e);let a=e=>{e&&t===this.#b&&r===this.#x&&this.#e.events.onView(e)};i.view.value&&a(i.view.value),this.#_=i.view.subscribe(a)}async#P(e){this.#V(),this.#h=void 0,this.#e.events.onSessionChange(null),await this.#t.detach(),this.#A(e)}#F(){if(this.managementReady){if(this.#D){let e=this.#r?.state.value.workspaces??[],t=e[0];if(e.some(e=>e.path===this.#m))this.#D=!1;else if(t){this.#D=!1,this.#j(e=>this.#M(t.path,void 0,e)).catch(e=>this.#k(e));return}}this.#h&&!this.#p.some(e=>e.id===this.#h)&&this.#j(e=>this.#M(this.#m,void 0,e)).catch(e=>this.#k(e))}}async configure(e){if(!this.ready)throw Error(R()(`gw.sessionNotReady`));await this.#f.configure(e)}async submit(e,t=[],n=crypto.randomUUID(),r){if(r!==void 0&&r!==this.#h)throw Error(R()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(R()(`gw.sessionNotReady`));let i=this.#f,a=[];try{for(let e of t)a.push(await Gi(e,{begin:e=>i.beginImage(e),append:e=>i.appendImage(e),finish:e=>i.finishImage(e),release:e=>i.releaseImage(e)}));await i.submit({content:e,requestId:n,images:a})}finally{for(let e of a)await i.releaseImage(e).catch(()=>{})}}async searchFiles(e,t,n){if(!this.managementReady||!this.#i||t!==this.#m)throw Error(R()(`gw.workspaceNotReady`));return this.#t.host.root(n=>this.#i.search({workspaceRoot:t,query:e},n),{signal:n})}async workspaceImage(e,t,n){if(!this.ready||t!==this.#h)throw Error(R()(`gw.sessionChangedDraft`));let r=this.#f;return this.#t.host.root(async t=>{let n=await r.importImage(e,t);try{return{...await Ki(e=>r.draftImage({id:n.id,offset:e},t)),name:n.name}}finally{await r.releaseImage(n.id).catch(()=>{})}},{signal:n})}async compact(e,t){if(t!==void 0&&t!==this.#h)throw Error(R()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(R()(`gw.sessionNotReady`));await this.#f.compact({instructions:e})}#I(e){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChanged`));return lg(this.#f)}async steer(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChanged`));return dg(this.#f).steer(t)}async withdraw(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChanged`));return dg(this.#f).withdraw(t)}async questionGet(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedOrNotReady`));return mg(this.#f).get(t)}async questionRespond(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedAnswerDraft`));return mg(this.#f).respond(t)}async planMode(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedOrNotReady`));return gg(this.#f).setMode(t)}async planGet(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedOrNotReady`));return gg(this.#f).get(t)}async planRespond(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedFeedbackDraft`));return gg(this.#f).respond(t)}async continueRun(e){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedOrNotReady`));await vg(this.#f).continueRun()}workspace(e){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionChangedOrNotReady`));return bg(this.#f,this.#t.host)}async jobOutput(e,t,n){return this.#I(e).output(t,n)}async jobStop(e,t){return this.#I(e).stop(t)}async image(e,t,n){if(n!==void 0&&n!==this.#h)throw Error(R()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(R()(`gw.sessionNotReady`));let r=this.#f;return Ki(n=>r.getImage({entryId:e,contentIndex:t,offset:n}))}abort(){this.ready&&this.#f.abort(null).catch(e=>this.#k(e))}async listSkills(e,t){if(!this.ready||e!==this.#h)throw Error(R()(`gw.sessionNotReady`));return this.#t.host.root(e=>this.#f.skills(null,e),{signal:t})}async listModels(){return this.#a?.list(null)??[]}marketList(e){return this.#d?this.#d.list({...e?{query:e}:{},workspaceRoot:this.#m}):Promise.reject(Error(R()(`gw.notConnected`)))}marketDetail(e){return this.#d?this.#d.detail({name:e,workspaceRoot:this.#m}):Promise.reject(Error(R()(`gw.notConnected`)))}marketPreview(e){return this.#d?this.#d.preview({name:e}):Promise.reject(Error(R()(`gw.notConnected`)))}marketInstall(e,t,n){return this.#d?this.#d.install({name:e,scope:t,workspaceRoot:this.#m,...n?{overwrite:n}:{}}):Promise.reject(Error(R()(`gw.notConnected`)))}async marketUninstall(e,t){if(!this.#d)return Promise.reject(Error(R()(`gw.notConnected`)));await this.#d.uninstall({name:e,scope:t,workspaceRoot:this.#m})}async#L(){let e=++this.#b,t=this.#e.discover?await this.#e.discover():{gatewayWs:this.#e.url,serverId:this.#e.serverId};this.#A(e);let n=xg(rg(new WebSocket(t.gatewayWs)),t.serverId);this.#t=n,n.link.onClose(()=>{n===this.#t&&this.#B()});try{await n.ready()}catch(e){throw e instanceof Hi&&(this.#w=!0,this.#v&&=(clearTimeout(this.#v),void 0),this.#e.events.onPhase(`error`)),e}this.#A(e),this.#g.push(n.application.info.subscribe(t=>{e===this.#b&&(this.#e.events.onUpdates?.(t),this.#e.events.onShell?.(t.shell??null))})),this.#e.events.onUpdates?.(n.application.info.value),this.#e.events.onShell?.(n.application.info.value.shell??null),this.#n=n.management,this.#r=n.workspaces,this.#i=n.workspaceFiles,this.#a=n.models,this.#o=n.credentials,this.#s=n.searchSettings,this.#c=n.contextSettings,this.#l=n.codemodeSettings,this.#u=n.defaultModel,this.#d=n.skillMarket;let r=this.#o.state.value?.revision;this.#g.push(this.#o.state.subscribe(t=>{e===this.#b&&(this.#e.events.onCredentials?.(t),this.#C&&t.revision!==r&&this.#z(e),r=t.revision)})),this.#e.events.onCredentials?.(this.#o.state.value),this.#g.push(this.#s.state.subscribe(t=>{e===this.#b&&this.#e.events.onSearchSettings?.(t)})),this.#e.events.onSearchSettings?.(this.#s.state.value);let i=this.#c;this.#g.push(i.state.subscribe(t=>{e===this.#b&&this.#e.events.onContextSettings?.(t)})),this.#e.events.onContextSettings?.(i.state.value);let a=this.#l;this.#g.push(a.state.subscribe(t=>{e===this.#b&&this.#e.events.onCodemodeSettings?.(t)})),this.#e.events.onCodemodeSettings?.(a.state.value);let o=this.#u;this.#g.push(o.state.subscribe(t=>{e===this.#b&&this.#e.events.onDefaultModel?.(t)})),this.#e.events.onDefaultModel?.(o.state.value);let s=n.directory,c=t=>{e===this.#b&&(this.#p=t.sessions,this.#e.events.onDirectory(t),this.#F())};this.#g.push(s.state.subscribe(c)),this.#g.push(this.#r.state.subscribe(t=>{if(e!==this.#b)return;this.#e.events.onWorkspaces(t);let n=t.workspaces.some(e=>e.path===this.#m);!n&&this.#E&&(this.#D=!0,this.#F()),this.#E=n})),this.#O||=(await this.#r.add({path:this.#m}),this.#A(e),!0),c(s.state.value),this.#e.events.onWorkspaces(this.#r.state.value),await this.#M(this.#m,this.#h,e),this.#A(e),this.#C=!0,this.#y=0,this.#e.events.onPhase(`ready`),this.#z(e)}#R=0;#z(e){let t=++this.#R;this.#a?.list(null).then(n=>{e===this.#b&&t===this.#R&&this.#e.events.onModels(n)}).catch(()=>{})}async checkUpdates(){if(!this.#t)throw Error(R()(`gw.notConnected`));return this.#t.application.check(null)}#B(){if(this.#S||this.#w||this.#v)return;++this.#b,this.#C=!1,this.#V(),this.#e.events.onPhase(`reconnecting`),this.#e.events.onUpdates?.(null),this.#e.events.onShell?.(null);let e=Math.min((this.#e.retryBaseMs??800)*++this.#y,this.#e.retryMaxMs??8e3);this.#v=setTimeout(()=>{this.#v=void 0,this.#H().then(()=>{if(!this.#S)return this.#L()}).catch(e=>{this.#k(e),e instanceof Hi?(this.#e.events.onPhase(`error`),this.#H()):this.#B()})},e)}#V(){++this.#x,this.#_?.(),this.#_=void 0,this.#f?.release(),this.#f=void 0,this.#e.events.onView(null)}async#H(){for(let e of this.#g.splice(0))e();this.#V(),this.#n=void 0,this.#r=void 0,this.#i=void 0,this.#o=void 0,this.#e.events.onCredentials?.(null),this.#s=void 0,this.#e.events.onSearchSettings?.(null),this.#c=void 0,this.#e.events.onContextSettings?.(null),this.#l=void 0,this.#e.events.onCodemodeSettings?.(null),this.#u=void 0,this.#e.events.onDefaultModel?.(null),this.#a=void 0;let e=this.#t;this.#t=void 0,await e?.close().catch(()=>{})}dispose(){this.#S=!0,++this.#b,this.#C=!1,clearTimeout(this.#v),this.#H()}},Wg=[{pattern:/^Thinking\.\.\.$/,render:e=>e(`core.status.thinking`)},{pattern:/^Running (.+)\.\.\.$/,render:(e,t)=>e(`core.status.running`,{tool:t[1]??``})},{pattern:/^Retrying \(attempt (\d+)\)\.\.\.$/,render:(e,t)=>e(`core.status.retrying`,{attempt:t[1]??``})},{pattern:/^\[context compacted\]$/,render:e=>e(`core.row.compacted`)},{pattern:/^\[new context\]$/,render:e=>e(`core.row.newContext`)},{pattern:/^Not run: response interrupted\.$/,render:e=>e(`core.note.notRun`)}];function Gg(e,t=R()){for(let n of Wg){let r=n.pattern.exec(e);if(r)return n.render(t,r)}return e}var Kg={PROVIDER_DISABLED:{pattern:/^(.+?) is not enabled\./,render:(e,t)=>e(`core.error.providerDisabled`,{provider:t[1]??``})},PROVIDER_KEY_REQUIRED:{pattern:/^Configure an? (.+?) API key\b/,render:(e,t)=>e(`core.error.providerKeyRequired`,{provider:t[1]??``})},PLAN_BUSY:{pattern:/^/,render:e=>e(`core.error.planBusy`)},CONTINUE_BUSY:{pattern:/^/,render:e=>e(`core.error.continueBusy`)},CONTINUE_UNAVAILABLE:{pattern:/^/,render:e=>e(`core.error.continueUnavailable`)},WORKSPACE_UNKNOWN:{pattern:/^/,render:e=>e(`core.error.workspaceUnknown`)},WORKSPACE_LAST:{pattern:/^/,render:e=>e(`core.error.workspaceLast`)},WORKSPACE_BUSY:{pattern:/^/,render:e=>e(`core.error.workspaceBusy`)}},qg=/^([A-Z][A-Z_]+): ([\s\S]*)$/;function Jg(e,t=R()){let n=qg.exec(e),r=n?.[1]===void 0?void 0:Kg[n[1]];if(!n||!r)return e;let i=r.pattern.exec(n[2]??``);return i?r.render(t,i):e}var Yg={phase:`connecting`,updates:null,shell:null,webInfo:null,credentials:null,searchSettings:null,contextSettings:null,codemodeSettings:null,defaultModel:null,workspaceRoot:``,workspaces:[],operating:!1,sessions:[],models:[],currentSessionId:null,view:null,retained:null,notice:null},Xg=new Set;function Zg(e){Yg=e;for(let e of Xg)e()}function Qg(e){return Xg.add(e),()=>{Xg.delete(e)}}function $g(){return(0,d.useSyncExternalStore)(Qg,()=>Yg)}function e_(){return Yg}var t_={setUpdates(e){Zg({...Yg,updates:e})},setShell(e){Zg({...Yg,shell:e})},setWebInfo(e){Zg({...Yg,webInfo:e})},setCredentials(e){e&&Yg.credentials&&e.revision<Yg.credentials.revision||Zg({...Yg,credentials:e})},setSearchSettings(e){e&&Yg.searchSettings&&e.revision<Yg.searchSettings.revision||Zg({...Yg,searchSettings:e})},setCodemodeSettings(e){e&&Yg.codemodeSettings&&e.revision<Yg.codemodeSettings.revision||Zg({...Yg,codemodeSettings:e})},setContextSettings(e){e&&Yg.contextSettings&&e.revision<Yg.contextSettings.revision||Zg({...Yg,contextSettings:e})},setDefaultModel(e){Zg({...Yg,defaultModel:e})},setWorkspace(e){Zg({...Yg,workspaceRoot:e})},setWorkspaces(e){Zg({...Yg,workspaces:e})},setOperation(e){Zg({...Yg,operating:e})},setPhase(e){Zg({...Yg,phase:e})},setDirectory(e){Zg({...Yg,sessions:e})},setModels(e){Zg({...Yg,models:e})},setSession(e){Zg({...Yg,currentSessionId:e})},setView(e){let t=Yg.currentSessionId,n=e!==null&&t!==null?{sessionId:t,todos:e.todos,questions:e.questions}:Yg.retained;Zg({...Yg,view:e,retained:n})},notice(e){Zg({...Yg,notice:{...e,text:Jg(e.text)}})},clearNotice(){Yg.notice!==null&&Zg({...Yg,notice:null})}},n_=`neko.upgrade-draft.v1`;function r_(e=sessionStorage){try{let t=JSON.parse(e.getItem(n_)??`null`);if(t?.version===1&&typeof t.serverId==`string`&&typeof t.workspace==`string`&&(typeof t.session==`string`||t.session===null)&&typeof t.text==`string`&&typeof t.requestId==`string`)return t}catch{}return null}function i_(e,t=sessionStorage){if(t.setItem(n_,JSON.stringify(e)),t.getItem(n_)!==JSON.stringify(e))throw Error(`Draft not saved`)}function a_(){sessionStorage.removeItem(n_)}var o_=0;async function s_(){let e=++o_,t=await fetch(`/api/info`,{cache:`no-store`,signal:AbortSignal.timeout(5e3)});if(!t.ok)throw Error(R()(`gw.infoFailed`,{status:t.status}));let n=await t.json();if(n.protocolCompatible===!1)throw new Hi;if(typeof n.gatewayWs!=`string`||typeof n.serverId!=`string`||typeof n.webVersion!=`string`||typeof n.workspaceRoot!=`string`||n.installedVersion!==null&&typeof n.installedVersion!=`string`)throw Error(R()(`gw.invalidInfo`));return e===o_&&t_.setWebInfo({serverId:n.serverId,webVersion:n.webVersion,installedVersion:n.installedVersion,gatewaySpawned:n.gatewaySpawned===!0,launchRoot:n.workspaceRoot}),n}var c_;function l_(){(async()=>{let e;try{e=await s_()}catch(e){t_.setPhase(`error`),t_.notice({level:`error`,text:e instanceof Hi?R()(`gw.incompatible`):R()(`gw.infoLoadFailed`,{error:e instanceof Error?e.message:String(e)})});return}let t=r_(),n=t?.serverId===e.serverId?t:null;c_=new Ug({url:e.gatewayWs,serverId:e.serverId,workspaceRoot:n?.workspace??e.workspaceRoot,preferredSession:n?.session??void 0,discover:s_,events:{onPhase:t_.setPhase,onUpdates:t_.setUpdates,onShell:t_.setShell,onCredentials:t_.setCredentials,onSearchSettings:t_.setSearchSettings,onContextSettings:t_.setContextSettings,onCodemodeSettings:t_.setCodemodeSettings,onDefaultModel:t_.setDefaultModel,onWorkspaces:e=>t_.setWorkspaces(e.workspaces),onWorkspace:t_.setWorkspace,onOperation:t_.setOperation,onError:e=>t_.notice({level:`error`,text:e}),onDirectory:e=>t_.setDirectory(e.sessions),onModels:t_.setModels,onSessionChange:t_.setSession,onView:t_.setView}}),await c_.start();let r=()=>{document.visibilityState===`visible`&&s_().catch(()=>{})},i=setInterval(r,3e4);document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)},{once:!0}),n?.text&&c_.currentSessionId!==n.session&&t_.notice({level:`info`,text:R()(`gw.sessionGone`)})})()}function u_(){t_.notice({level:`error`,text:R()(`gw.notReady`)})}var d_={subagent(e){return f_().subagent(e)},jobOutput(e,t,n){return f_().jobOutput(e,t,n)},jobStop(e,t){return f_().jobStop(e,t)},workspace(e){return f_().workspace(e)},checkUpdates(){return f_().checkUpdates()},saveCredential(e,t){return f_().saveCredential(e,t)},removeCredential(e){return f_().removeCredential(e)},setProviderEnabled(e,t){return f_().setProviderEnabled(e,t)},setContextSettings(e){return f_().setContextSettings(e)},setCodemodeMode(e){return f_().setCodemodeMode(e)},resetCodemodeMode(){return f_().resetCodemodeMode()},resetContextSettings(){return f_().resetContextSettings()},setDefaultModel(e){return f_().setDefaultModel(e)},clearDefaultModel(){return f_().clearDefaultModel()},setSearchProvider(e){return f_().setSearchProvider(e)},configure(e,t){let n=f_();return n.currentSessionId!==t||!n.ready?Promise.reject(Error(R()(`gw.sessionChangedRetry`))):n.configure(e)},submit(e,t=[],n,r){return f_().submit(e,t,n,r)},continueRun(e){return f_().continueRun(e)},steer(e,t){return f_().steer(e,t)},withdraw(e,t){return f_().withdraw(e,t)},questionGet(e,t){return f_().questionGet(e,t)},questionRespond(e,t){return f_().questionRespond(e,t)},planMode(e,t){return f_().planMode(e,t)},planGet(e,t){return f_().planGet(e,t)},planRespond(e,t){return f_().planRespond(e,t)},searchFiles(e,t,n){return f_().searchFiles(e,t,n)},workspaceImage(e,t,n){return f_().workspaceImage(e,t,n)},compact(e,t){return f_().compact(e,t)},listSkills(e,t){return f_().listSkills(e,t)},marketList(e){return f_().marketList(e)},marketDetail(e){return f_().marketDetail(e)},marketPreview(e){return f_().marketPreview(e)},marketInstall(e,t,n){return f_().marketInstall(e,t,n)},marketUninstall(e,t){return f_().marketUninstall(e,t)},image(e,t,n){return f_().image(e,t,n)},abort(){c_?.ready===!0?c_.abort():u_()},selectSession(e){return f_().attachTo(e)},selectWorkspace(e){return f_().selectWorkspace(e)},addWorkspace(e){return f_().addWorkspace(e)},removeWorkspace(e){return f_().removeWorkspace(e)},browse(e){return f_().browse(e)},createSession(){return f_().createSession()},configureModel(e){c_===void 0?u_():c_.configure({model:e}).catch(e=>{t_.notice({level:`error`,text:e instanceof Error?e.message:String(e)})})},archiveSession(e){return f_().archiveSession(e)}};function f_(){if(!c_)throw Error(R()(`gw.notStarted`));return c_}function p_(e){t_.notice({level:`error`,text:e instanceof Error?e.message:String(e)})}function m_(e,t){let n=e.slice(0,t),r=/(?:^|\s|[([{])(@(?:"[^"\n]*"?|[^\s"@]*))$/.exec(n);if(!r?.[1])return null;let i=r[1];return{start:t-i.length,end:t,query:i.slice(1).replace(/^"|"$/g,``)}}function h_(e,t=!1){let n=t&&!e.endsWith(`/`)?`${e}/`:e;return`@${/\s/.test(n)?`"${n}"`:n}`}function g_(e,t,n,r){let i=h_(n,r),a=r?``:` `;return{text:e.slice(0,t.start)+i+a+e.slice(t.end),cursor:t.start+i.length+a.length-(r&&i.endsWith(`"`)?1:0)}}function __(e){return e.skill===void 0?e.text:e.skill.args===``?`/skill:${e.skill.name}`:`/skill:${e.skill.name} ${e.skill.args}`}function v_(e){return e.phase===`done`?e.isError?`error`:`ok`:e.phase}function y_(e){return(e.phase===`done`?e.result:e.output)??``}function b_(e){let t=e.width>0&&e.height>0?` · ${e.width}×${e.height}`:``;return`${e.name} · ${e.mimeType}${t}`}function x_(e){return[`${e.name}${e.args===``?``:` ${w_(e.args)}`}`,e.status,e.durationMs===null?``:C_(e.durationMs),e.error===null?``:w_(e.error)].filter(Boolean).join(` · `)}var S_=e=>`… ${e} more calls not listed`;function C_(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function w_(e){return e.replace(/\s+/g,` `).trim()}function T_(e){let t=[];for(let n of e){if(n.type!==`user`||n.subagentRoundId!==void 0)continue;let e=__(n).trim();e!==``&&t.at(-1)!==e&&t.push(e)}return t.reverse().slice(0,100)}var E_=e=>/^\/[^\s]*$/.test(e);function D_(e,t,n={}){let r=E_(e)?e:`/`,i=R();return[{key:`compact`,label:`/compact`,description:i(`command.compact`)},...n.plan===!0?[{key:`plan`,label:`/plan`,description:i(`command.plan`)}]:[],...t.map(e=>({key:`skill:${e.name}`,label:`/skill:${e.name}`,description:e.description,...e.level===`builtin`?{badge:i(`command.builtin`)}:{}}))].filter(e=>e.label.startsWith(r))}function O_(e,t=160){e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`}function k_(e,t,n,r,i){if(n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`||i.start!==i.end)return null;let a=e!==null&&e.entries[e.index]===r?e:null;if(n.key===`ArrowUp`){if(i.start!==0)return null;let e=a?.entries??t,n=(a?.index??-1)+1,o=e[n];return o===void 0?null:{browse:{index:n,draft:a?.draft??r,entries:e},text:o,caret:`start`}}if(a===null||i.start!==r.length)return null;let o=a.index-1;return o<0?{browse:null,text:a.draft,caret:`end`}:{browse:{...a,index:o},text:a.entries[o]??``,caret:`end`}}function A_(e){return e.retained!==null&&e.retained.sessionId===e.currentSessionId?e.retained:null}function j_(e){let t=e.view===null?A_(e)?.todos:e.view.todos;return t===void 0?null:{items:t.items,revision:t.revision,...vm(t.items),offline:e.view===null||e.phase!==`ready`}}function M_(e){let t=e.view===null?A_(e)?.questions:e.view.questions;return t===void 0?null:{pending:t.pending,online:e.phase===`ready`&&!e.operating&&e.view!==null}}var N_={pending:`todo.status.pending`,in_progress:`todo.status.in_progress`,completed:`todo.status.completed`},P_={pending:`question.status.pending`,answered:`question.status.answered`,skipped:`question.status.skipped`,cancelled:`question.status.cancelled`},F_=e=>R()(N_[e]),I_=e=>R()(P_[e]);function L_(e){let t=R();return e.awaitingAnswer===!0?t(`session.suffix.awaitingAnswer`):e.awaitingPlan===!0?t(`session.suffix.awaitingPlan`):e.status===`running`?t(`session.suffix.running`):e.status===`error`?t(`session.suffix.error`):``}function R_(e,t){return t>0?`${R()(`title.answerPrefix`,{count:t})}${e}`:e}function z_(e){return[...e.replace(/\r\n?/g,`
11
+ `)].map(e=>{let t=e.charCodeAt(0);return t<32&&t!==9&&t!==10||t>=127&&t<=159||t>=8234&&t<=8238||t>=8294&&t<=8297?`\\u${t.toString(16).padStart(4,`0`)}`:e}).join(``)}function B_(e){let t=R();if(e.status===`answered`){let n=Cm(e);return n?t(`question.settle.answeredWith`,{answer:n}):t(`question.settle.answered`)}return e.status===`skipped`?t(`question.settle.skipped`):e.status===`cancelled`?t(`question.settle.cancelled`):I_(`pending`)}function V_(e,t){if(t.kind===`skip`)return e.status===`skipped`;if(e.status!==`answered`||e.answer===null)return!1;let n=t.optionIds??[];return e.answer.optionIds.length===n.length&&e.answer.optionIds.every(e=>n.includes(e))&&e.answer.text===(t.text??null)}function H_(e){let t=[...e.labels??e.optionIds??[]];return e.text&&t.push(e.text),t.join(`, `)}var U_={awaiting_approval:`plan.status.awaiting_approval`,approved:`plan.status.approved`,revision_requested:`plan.status.revision_requested`,superseded:`plan.status.superseded`,cancelled:`plan.status.cancelled`},W_=e=>R()(U_[e]),G_=()=>R()(`plan.modeLabel`),K_=()=>R()(`plan.unsupported`);function q_(e){let t=e.view?.plan;return t===void 0?null:{mode:t.mode,current:t.current,awaiting:t.current?.status===`awaiting_approval`?t.current:null,online:e.phase===`ready`&&!e.operating}}function J_(e){let t=/^\/plan(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}function Y_(e,t){let n=R();return t?e.status===`approved`?n(`plan.settle.approved`):n(`plan.settle.revised`):e.status===`superseded`?n(`plan.settle.superseded`):e.status===`cancelled`?n(`plan.settle.cancelled`):e.status===`awaiting_approval`?n(`plan.settle.pending`):n(`plan.settle.other`,{status:W_(e.status)})}function X_(e){return e===`approve`?`approved`:`revision_requested`}function Z_(e){return(e instanceof Error?e.message:String(e)).includes(`PLAN_BUSY`)}function Q_(e){let t=e instanceof Error?e.message:String(e);return Z_(e)?R()(`plan.busy`):t}function $_(e,t,n){if(!n)return R_(e,t);let r=R();return`${t>0?r(`title.answerPrefix`,{count:t}):``}${r(`title.planPrefix`)}${e}`}var ev=(e,t,n,r)=>({id:e,kind:`model`,name:t,envVar:n,signupUrl:r,keyless:!1}),tv=[ev(`deepseek`,`DeepSeek`,`DEEPSEEK_API_KEY`,`https://platform.deepseek.com/api_keys`),ev(`openrouter`,`OpenRouter`,`OPENROUTER_API_KEY`,`https://openrouter.ai/keys`),ev(`opencode-go`,`OpenCode Go`,`OPENCODE_API_KEY`,`https://opencode.ai/auth`),ev(`opencode`,`OpenCode Zen`,`OPENCODE_API_KEY`,`https://opencode.ai/auth`),ev(`openai`,`OpenAI`,`OPENAI_API_KEY`,`https://platform.openai.com/api-keys`),ev(`google`,`Google`,`GEMINI_API_KEY`,`https://aistudio.google.com/apikey`),ev(`groq`,`Groq`,`GROQ_API_KEY`,`https://console.groq.com/keys`),ev(`mistral`,`Mistral`,`MISTRAL_API_KEY`,`https://console.mistral.ai/api-keys`),ev(`xai`,`xAI`,`XAI_API_KEY`,`https://console.x.ai`),ev(`together`,`Together`,`TOGETHER_API_KEY`,`https://api.together.ai/settings/api-keys`),ev(`fireworks`,`Fireworks`,`FIREWORKS_API_KEY`,`https://fireworks.ai/account/api-keys`),ev(`cerebras`,`Cerebras`,`CEREBRAS_API_KEY`,`https://cloud.cerebras.ai`),ev(`nvidia`,`NVIDIA`,`NVIDIA_API_KEY`,`https://build.nvidia.com/settings/api-keys`),ev(`huggingface`,`Hugging Face`,`HF_TOKEN`,`https://huggingface.co/settings/tokens`),ev(`vercel-ai-gateway`,`Vercel AI Gateway`,`AI_GATEWAY_API_KEY`,`https://vercel.com/ai-gateway`),ev(`moonshotai`,`Moonshot AI`,`MOONSHOT_API_KEY`,`https://platform.moonshot.ai/console/api-keys`),ev(`moonshotai-cn`,`Moonshot AI CN`,`MOONSHOT_API_KEY`,`https://platform.moonshot.cn/console/api-keys`),ev(`minimax`,`MiniMax`,`MINIMAX_API_KEY`,`https://platform.minimax.io`),ev(`minimax-cn`,`MiniMax CN`,`MINIMAX_CN_API_KEY`,`https://platform.minimaxi.com`),ev(`zai`,`Z.AI`,`ZAI_API_KEY`,`https://z.ai/manage-apikey/apikey-list`),ev(`zai-coding-cn`,`Z.AI Coding CN`,`ZAI_CODING_CN_API_KEY`,`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`),ev(`qwen-token-plan`,`Qwen Token Plan`,`QWEN_TOKEN_PLAN_API_KEY`,`https://modelstudio.console.alibabacloud.com`),ev(`qwen-token-plan-cn`,`Qwen Token Plan CN`,`QWEN_TOKEN_PLAN_CN_API_KEY`,`https://bailian.console.aliyun.com`),ev(`qwen-token-plan-individual`,`Qwen Token Plan Individual`,`QWEN_TOKEN_PLAN_API_KEY`,`https://modelstudio.console.alibabacloud.com`),ev(`xiaomi`,`Xiaomi MiMo`,`XIAOMI_API_KEY`,`https://platform.xiaomimimo.com`),ev(`xiaomi-token-plan-cn`,`Xiaomi Token Plan CN`,`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`https://platform.xiaomimimo.com`),ev(`xiaomi-token-plan-ams`,`Xiaomi Token Plan AMS`,`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`https://platform.xiaomimimo.com`),ev(`xiaomi-token-plan-sgp`,`Xiaomi Token Plan SGP`,`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`https://platform.xiaomimimo.com`),ev(`baseten`,`Baseten`,`BASETEN_API_KEY`,`https://app.baseten.co/settings/api_keys`),ev(`ant-ling`,`Ant Ling`,`ANT_LING_API_KEY`,`https://ling.tbox.cn`),ev(`kimi-coding`,`Kimi For Coding`,`KIMI_API_KEY`,`https://www.kimi.com/code/console`),ev(`meta`,`Meta`,`META_API_KEY`,`https://llama.developer.meta.com`)],nv=[{id:`tavily`,kind:`search`,name:`Tavily`,envVar:`TAVILY_API_KEY`,signupUrl:`https://app.tavily.com`,keyless:!0}];[...tv,...nv];function rv(e){return tv.some(t=>t.id===e)}var iv=new Map(tv.map(e=>[e.id,e.name]));function av(e){return iv.get(e)??e}function ov(e,t){if(!e||!t||!rv(t))return null;let n=e.statuses[t];return n?n.enabled===!1?`disabled`:n.source===`none`?`missing-key`:null:null}var sv=new Map(tv.map((e,t)=>[e.id,t]));function cv(e,t){return e!==null&&t!=null&&e.effective.provider===t.provider&&e.effective.modelId===t.modelId}function lv(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean),r=new Map;for(let t of e){let e=`${t.name} ${t.modelId} ${t.provider} ${av(t.provider)}`.toLowerCase();if(!n.every(t=>e.includes(t)))continue;let i=r.get(t.provider);i||(i={provider:t.provider,name:av(t.provider),available:t.available,models:[]},r.set(t.provider,i)),i.models.push(t)}return[...r.values()].sort((e,t)=>(sv.get(e.provider)??sv.size)-(sv.get(t.provider)??sv.size))}function uv(e,t){return t&&e.some(e=>e.provider===t)?t:(e.find(e=>e.available)??e[0])?.provider??null}function dv(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{let t=`${e.name} ${e.id} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))})}function fv(e){return e>=1e6?`${Number((e/1e6).toFixed(1))}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function pv(e){let t=R();return[t(`model.context`,{size:fv(e.contextWindow)}),e.input.includes(`image`)?t(`model.images`):t(`model.textOnly`),e.reasoning?t(`model.reasoning`):t(`model.noReasoning`)].join(` · `)}var mv=ym(),hv={drafts:{},fold:{},active:{},focus:null},gv=0,_v=new Set;function vv(e){hv=e;for(let e of _v)e()}var yv=(e,t,n)=>JSON.stringify([e,t,n]);function bv(){return(0,d.useSyncExternalStore)(e=>(_v.add(e),()=>{_v.delete(e)}),()=>hv)}var xv={get state(){return hv},draft(e){return hv.drafts[e]??mv},setDraft(e,t){vv({...hv,drafts:{...hv.drafts,[e]:t}})},clearDraft(e){if(!(e in hv.drafts))return;let{[e]:t,...n}=hv.drafts;vv({...hv,drafts:n})},setFold(e,t){hv.fold[e]!==t&&vv({...hv,fold:{...hv.fold,[e]:t}})},setActive(e,t){hv.active[e]!==t&&vv({...hv,active:{...hv.active,[e]:t}})},open(e,t){let n=yv(e,t.id,t.version);vv({...hv,fold:{...hv.fold,[n]:`open`},active:{...hv.active,[e]:t.id},focus:{key:n,nonce:++gv}})},consumeFocus(e){hv.focus?.nonce===e&&vv({...hv,focus:null})},reset(){vv({drafts:{},fold:{},active:{},focus:null})}};function Sv(){return typeof window<`u`}function Cv(e){return Ev(e)?(e.nodeName||``).toLowerCase():`#document`}function wv(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tv(e){return((Ev(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ev(e){return Sv()?e instanceof Node||e instanceof wv(e).Node:!1}function Dv(e){return Sv()?e instanceof Element||e instanceof wv(e).Element:!1}function Ov(e){return Sv()?e instanceof HTMLElement||e instanceof wv(e).HTMLElement:!1}function kv(e){return!Sv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof wv(e).ShadowRoot}function Av(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Vv(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function jv(e){return/^(table|td|th)$/.test(Cv(e))}function Mv(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Nv=/transform|translate|scale|rotate|perspective|filter/,Pv=/paint|layout|strict|content/,Fv=e=>!!e&&e!==`none`,Iv;function Lv(e){let t=Dv(e)?Vv(e):e;return Fv(t.transform)||Fv(t.translate)||Fv(t.scale)||Fv(t.rotate)||Fv(t.perspective)||!zv()&&(Fv(t.backdropFilter)||Fv(t.filter))||Nv.test(t.willChange||``)||Pv.test(t.contain||``)}function Rv(e){let t=Uv(e);for(;Ov(t)&&!Bv(t);){if(Lv(t))return t;if(Mv(t))return null;t=Uv(t)}return null}function zv(){return Iv??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Iv}function Bv(e){return/^(html|body|#document)$/.test(Cv(e))}function Vv(e){return wv(e).getComputedStyle(e)}function Hv(e){return Dv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uv(e){if(Cv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||kv(e)&&e.host||Tv(e);return kv(t)?t.host:t}function Wv(e){let t=Uv(e);return Bv(t)?(e.ownerDocument||e).body:Ov(t)&&Av(t)?t:Wv(t)}function Gv(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wv(e),i=r===e.ownerDocument?.body,a=wv(r);if(i){let e=Kv(a);return t.concat(a,a.visualViewport||[],Av(r)?r:[],e&&n?Gv(e):[])}return t.concat(r,Gv(r,[],n))}function Kv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var qv=Math.min,Jv=Math.max,Yv=Math.round,Xv=Math.floor,Zv=e=>({x:e,y:e}),Qv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $v(e,t,n){return Jv(e,qv(t,n))}function ey(e,t){return typeof e==`function`?e(t):e}function ty(e){return e.split(`-`)[0]}function ny(e){return e.split(`-`)[1]}function ry(e){return e===`x`?`y`:`x`}function iy(e){return e===`y`?`height`:`width`}function ay(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function oy(e){return ry(ay(e))}function sy(e,t,n){n===void 0&&(n=!1);let r=ny(e),i=oy(e),a=iy(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=gy(o)),[o,gy(o)]}function cy(e){let t=gy(e);return[ly(e),t,ly(t)]}function ly(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var uy=[`left`,`right`],dy=[`right`,`left`],fy=[`top`,`bottom`],py=[`bottom`,`top`];function my(e,t,n){switch(e){case`top`:case`bottom`:return n?t?dy:uy:t?uy:dy;case`left`:case`right`:return t?fy:py;default:return[]}}function hy(e,t,n,r){let i=ny(e),a=my(ty(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ly)))),a}function gy(e){let t=ty(e);return Qv[t]+e.slice(t.length)}function _y(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vy(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_y(e)}function yy(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var by=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),xy=typeof Element>`u`,Sy=xy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cy=!xy&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},wy=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):wy(e.parentNode))},Ty=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Ey=function(e,t,n){if(wy(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(by));return t&&Sy.call(e,by)&&r.unshift(e),r=r.filter(n),r},Dy=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!wy(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Dy(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Sy.call(a,by)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!wy(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Dy(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},Oy=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},ky=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Ty(e))&&!Oy(e)?0:e.tabIndex},Ay=function(e,t){var n=ky(e);return n<0&&t&&!Oy(e)?0:n},jy=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},My=function(e){return e.tagName===`INPUT`},Ny=function(e){return My(e)&&e.type===`hidden`},Py=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Fy=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Iy=function(e){if(!e.name)return!0;var t=e.form||Cy(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Fy(r,e.form);return!i||i===e},Ly=function(e){return My(e)&&e.type===`radio`},Ry=function(e){return Ly(e)&&!Iy(e)},zy=function(e){var t=e&&Cy(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Cy(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},By=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Vy=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=Sy.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Sy.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=Cy(e);if(s&&!s.shadowRoot&&r(s)===!0)return By(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(zy(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return By(e);return!1},Hy=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Sy.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Uy=function(e,t){return!(t.disabled||Ny(t)||Vy(t,e)||Py(t)||Hy(t))},Wy=function(e,t){return!(Ry(t)||ky(t)<0||!Uy(e,t))},Gy=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Ky=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Ay(a,i),s=i?Ky(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(jy).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},qy=function(e,t){return t||={},Ky(t.getShadowRoot?Dy([e],t.includeContainer,{filter:Wy.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Gy}):Ey(e,t.includeContainer,Wy.bind(null,t)))};function Jy(){return/apple/i.test(navigator.vendor)}function Yy(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Xy(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&kv(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Zy(e){return e?.ownerDocument||document}var Qy=typeof document<`u`?d.useLayoutEffect:function(){},$y={...d}.useInsertionEffect||(e=>e());function eb(e){let t=d.useRef(()=>{});return $y(()=>{t.current=e}),d.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var tb=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function nb(e,t){let n=qy(e,tb()),r=n.length;if(r===0)return;let i=Yy(Zy(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function rb(e){return nb(Zy(e).body,1)||e}function ib(e){return nb(Zy(e).body,-1)||e}function ab(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Xy(n,r)}function ob(e){qy(e,tb()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function sb(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var cb=c(mi(),1);function lb(e,t,n){let{reference:r,floating:i}=e,a=ay(t),o=oy(t),s=iy(o),c=ty(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ny(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ub(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ey(t,e),p=vy(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yy(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=yy(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var db=50,fb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ub},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=lb(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<db&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=lb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},pb=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ey(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ty(r),_=ay(o),v=ty(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[gy(o)]:cy(o)),x=p!==`none`;!d&&x&&b.push(...hy(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=sy(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ay(t)||T.every(e=>ay(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ay(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},mb=new Set([`left`,`top`]);async function hb(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ty(n),s=ny(n),c=ay(n)===`y`,l=mb.has(o)?-1:1,u=a&&c?-1:1,d=ey(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gb=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hb(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_b=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ey(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ay(i),p=ry(f),m=u[p],h=u[f],g=(e,t)=>$v(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vb=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ey(e,t),c=await i.detectOverflow(t,s),l=ty(n),u=ny(n),d=ay(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=qv(p-c[m],g),y=qv(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Jv(c.left,c.right):S=p-2*Jv(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function yb(e){let t=Vv(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ov(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Yv(n)!==a||Yv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function bb(e){return Dv(e)?e:e.contextElement}function xb(e){let t=bb(e);if(!Ov(t))return Zv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=yb(t),o=(a?Yv(n.width):n.width)/r,s=(a?Yv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Sb=Zv(0);function Cb(e){let t=wv(e);return!zv()||!t.visualViewport?Sb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wb(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===wv(e)}function Tb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=bb(e),o=Zv(1);t&&(r?Dv(r)&&(o=xb(r)):o=xb(e));let s=wb(a,n,r)?Cb(a):Zv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=wv(a),t=Dv(r)?wv(r):r,n=e,i=Kv(n);for(;i&&t!==n;){let e=xb(i),t=i.getBoundingClientRect(),r=Vv(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=wv(i),i=Kv(n)}}return yy({width:u,height:d,x:c,y:l})}function Eb(e,t){let n=Hv(e).scrollLeft;return t?t.left+n:Tb(Tv(e)).left+n}function Db(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Eb(e,n),y:n.top+t.scrollTop}}function Ob(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Tv(r),s=t?Mv(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Zv(1),u=Zv(0),d=Ov(r);if((d||!a)&&((Cv(r)!==`body`||Av(o))&&(c=Hv(r)),d)){let e=Tb(r);l=xb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Db(o,c):Zv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function kb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ab(e){let t=Hv(e),n=e.ownerDocument.body,r=Jv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Jv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Eb(e),o=-t.scrollTop;return Vv(n).direction===`rtl`&&(a+=Jv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var jb=25;function Mb(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=wv(e),a=Tv(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!zv()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Eb(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=jb&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Nb(e,t){let n=Tb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xb(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Pb(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Mb(e,n,t);else if(t===`document`)r=Ab(Tv(e));else if(Dv(t))r=Nb(t,n);else{let n=Cb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yy(r)}function Fb(e,t){let n=t.get(e);if(n)return n;let r=Gv(e,[],!1).filter(e=>Dv(e)&&Cv(e)!==`body`),i=null,a=Vv(e).position===`fixed`,o=a?Uv(e):e;for(;Dv(o)&&!Bv(o);){let e=Vv(o),t=Lv(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Uv(o)}return t.set(e,r),r}function Ib(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Mv(t)?[]:Fb(t,this._c):[].concat(n),r],o=Pb(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Pb(t,a[e],i);s=Jv(n.top,s),c=qv(n.right,c),l=qv(n.bottom,l),u=Jv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Lb(e){let{width:t,height:n}=yb(e);return{width:t,height:n}}function Rb(e,t,n){let r=Ov(t),i=Tv(t),a=n===`fixed`,o=Tb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Zv(0);if((r||!a)&&((Cv(t)!==`body`||Av(i))&&(s=Hv(t)),r)){let e=Tb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Eb(i));let l=i&&!r&&!a?Db(i,s):Zv(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function zb(e){return Vv(e).position===`static`}function Bb(e,t){if(!Ov(e)||Vv(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Tv(e)===n&&(n=n.ownerDocument.body),n}function Vb(e,t){let n=wv(e);if(Mv(e))return n;if(!Ov(e)){let t=Uv(e);for(;t&&!Bv(t);){if(Dv(t)&&!zb(t))return t;t=Uv(t)}return n}let r=Bb(e,t);for(;r&&jv(r)&&zb(r);)r=Bb(r,t);return r&&Bv(r)&&zb(r)&&!Lv(r)?n:r||Rv(e)||n}var Hb=async function(e){let t=this.getOffsetParent||Vb,n=this.getDimensions,r=await n(e.floating);return{reference:Rb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ub(e){return Vv(e).direction===`rtl`}var Wb={convertOffsetParentRelativeRectToViewportRelativeRect:Ob,getDocumentElement:Tv,getClippingRect:Ib,getOffsetParent:Vb,getElementRects:Hb,getClientRects:kb,getDimensions:Lb,getScale:xb,isElement:Dv,isRTL:Ub};function Gb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kb(e,t,n){let r=null,i,a=Tv(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Xv(d),h=Xv(a.clientWidth-(u+f)),g=Xv(a.clientHeight-(d+p)),_=Xv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Jv(0,qv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Gb(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=wv(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function qb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=bb(e),u=i||a?[...l?Gv(l):[],...t?Gv(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Kb(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Tb(e):null;c&&g();function g(){let t=Tb(e);h&&!Gb(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Jb=gb,Yb=_b,Xb=pb,Zb=vb,Qb=(e,t,n)=>{let r=new Map,i=n??{},a={...Wb,...i.platform,_c:r};return fb(e,t,{...i,platform:a})},$b=typeof document<`u`?d.useLayoutEffect:function(){};function ex(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ex(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ex(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function tx(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nx(e,t){let n=tx(e);return Math.round(t*n)/n}function rx(e){let t=d.useRef(e);return $b(()=>{t.current=e}),t}function ix(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);ex(p,r)||m(r);let[h,g]=d.useState(null),[_,v]=d.useState(null),y=d.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=d.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=d.useRef(null),w=d.useRef(null),T=d.useRef(u),E=c!=null,ee=rx(c),te=rx(i),ne=rx(l),D=d.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};te.current&&(e.platform=te.current),Qb(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};re.current&&!ex(T.current,t)&&(T.current=t,cb.flushSync(()=>{f(t)}))})},[p,t,n,te,ne]);$b(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let re=d.useRef(!1);$b(()=>(re.current=!0,()=>{re.current=!1}),[]),$b(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,D);D()}},[x,S,D,ee,E]);let ie=d.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),O=d.useMemo(()=>({reference:x,floating:S}),[x,S]),ae=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!O.floating)return e;let t=nx(O.floating,u.x),r=nx(O.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...tx(O.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,O.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:D,refs:ie,elements:O,floatingStyles:ae}),[u,D,ie,O,ae])}var ax=(e,t)=>{let n=Jb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ox=(e,t)=>{let n=Yb(e);return{name:n.name,fn:n.fn,options:[e,t]}},sx=(e,t)=>{let n=Xb(e);return{name:n.name,fn:n.fn,options:[e,t]}},cx=(e,t)=>{let n=Zb(e);return{name:n.name,fn:n.fn,options:[e,t]}},lx=`ArrowLeft`,ux=`ArrowRight`,dx=`ArrowUp`,fx=`ArrowDown`,px=[lx,ux],mx=[dx,fx];[...px,...mx];var hx={...d},gx=!1,_x=0,vx=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+_x++;function yx(){let[e,t]=d.useState(()=>gx?vx():void 0);return Qy(()=>{e??t(vx())},[]),d.useEffect(()=>{gx=!0},[]),e}var bx=hx.useId||yx;function xx(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var Sx=d.createContext(null),Cx=d.createContext(null),wx=()=>d.useContext(Sx)?.id||null,Tx=()=>d.useContext(Cx);function Ex(e){return`data-floating-ui-`+e}var Dx={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Ox=d.forwardRef(function(e,t){let[n,r]=d.useState();Qy(()=>{Jy()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ex(`focus-guard`)]:``,style:Dx};return(0,j.jsx)(`span`,{...e,...i})}),kx={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ax=d.createContext(null),jx=Ex(`portal`);function Mx(e){e===void 0&&(e={});let{id:t,root:n}=e,r=bx(),i=Px(),[a,o]=d.useState(null),s=d.useRef(null);return Qy(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Qy(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(jx,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Qy(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!Ev(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(jx,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Nx(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=Mx({id:n,root:r}),[o,s]=d.useState(null),c=d.useRef(null),l=d.useRef(null),u=d.useRef(null),f=d.useRef(null),p=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return d.useEffect(()=>{if(!a||!i||p)return;function e(e){a&&ab(e)&&(e.type===`focusin`?sb:ob)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,p]),d.useEffect(()=>{a&&(m||sb(a))},[m,a]),(0,j.jsxs)(Ax.Provider,{value:d.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&(0,j.jsx)(Ox,{"data-type":`outside`,ref:c,onFocus:e=>{if(ab(e,a)){var t;(t=u.current)==null||t.focus()}else ib(o?o.domReference:null)?.focus()}}),h&&a&&(0,j.jsx)(`span`,{"aria-owns":a.id,style:kx}),a&&cb.createPortal(t,a),h&&a&&(0,j.jsx)(Ox,{"data-type":`outside`,ref:l,onFocus:e=>{if(ab(e,a)){var t;(t=f.current)==null||t.focus()}else rb(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var Px=()=>d.useContext(Ax);function Fx(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=bx(),a=d.useRef({}),[o]=d.useState(()=>xx()),s=wx()!=null,[c,l]=d.useState(r.reference),u=eb((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),f=d.useMemo(()=>({setPositionReference:l}),[]),p=d.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return d.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:p,events:o,floatingId:i,refs:f}),[t,u,p,o,i,f])}function Ix(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Fx({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=d.useState(null),[l,u]=d.useState(null),f=o?.domReference||s,p=d.useRef(null),m=Tx();Qy(()=>{f&&(p.current=f)},[f]);let h=ix({...n,elements:{...o,...l&&{reference:l}}}),g=d.useCallback(e=>{let t=Dv(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=d.useCallback(e=>{(Dv(e)||e===null)&&(p.current=e,c(e)),(Dv(h.refs.reference.current)||h.refs.reference.current===null||e!==null&&!Dv(e))&&h.refs.setReference(e)},[h.refs]),v=d.useMemo(()=>({...h.refs,setReference:_,setPositionReference:g,domReference:p}),[h.refs,_,g]),y=d.useMemo(()=>({...h.elements,domReference:f}),[h.elements,f]),b=d.useMemo(()=>({...h,...a,refs:v,elements:y,nodeId:r}),[h,v,y,r,a]);return Qy(()=>{a.dataRef.current.floatingContext=b;let e=m?.nodesRef.current.find(e=>e.id===r);e&&(e.context=b)}),d.useMemo(()=>({...h,context:b,refs:v,elements:y}),[h,v,y,b])}function Lx({anchor:e,id:t,title:n,items:r,selected:i,onSelect:a,onAccept:o,message:s,onRetry:c}){let l=z(),{refs:u,floatingStyles:f,isPositioned:p}=Ix({elements:{reference:e.current},placement:`top-start`,whileElementsMounted:qb,middleware:[ax(8),sx(),ox({padding:12}),cx({padding:12,apply({availableHeight:e,availableWidth:t,rects:n,elements:r}){Object.assign(r.floating.style,{maxHeight:`${Math.max(0,Math.min(320,e))}px`,width:`${Math.min(n.reference.width,t)}px`})}})]});return(0,d.useEffect)(()=>{document.getElementById(`${t}-${i}`)?.scrollIntoView({block:`nearest`})},[t,i]),(0,j.jsx)(Nx,{children:(0,j.jsxs)(`div`,{ref:u.setFloating,style:{...f,visibility:p?`visible`:`hidden`},className:`z-50 overflow-y-auto rounded-xl border border-sakura-200 bg-base p-1.5 shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1 px-3 py-2 text-xs text-ink-500`,children:[(0,j.jsx)(`span`,{children:n}),(0,j.jsx)(`span`,{children:l(`suggest.hint`)})]}),(0,j.jsx)(`div`,{id:t,role:`listbox`,tabIndex:-1,"aria-label":n,children:r.map((e,n)=>(0,j.jsxs)(`button`,{type:`button`,role:`option`,id:`${t}-${n}`,"aria-selected":n===i,tabIndex:-1,title:e.description,onMouseDown:e=>e.preventDefault(),onPointerMove:e=>{e.pointerType===`mouse`&&(e.movementX!==0||e.movementY!==0)&&a(n)},onClick:()=>o(n),className:`block w-full rounded-lg px-3 py-2 text-left ${n===i?`bg-sakura-100`:``}`,children:[(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,j.jsx)(`span`,{className:`truncate text-sm text-ink-900`,children:e.label}),e.badge&&(0,j.jsx)(`span`,{className:`shrink-0 rounded-md bg-ink-100 px-1.5 py-0.5 text-xs text-ink-600`,children:e.badge})]}),(0,j.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:e.description})]},e.key))}),s&&(0,j.jsx)(`output`,{className:`block break-words px-3 py-2 text-sm text-ink-500`,children:s}),c&&(0,j.jsx)(`button`,{type:`button`,className:`px-3 py-2 text-sm text-ink-900 underline`,onMouseDown:e=>e.preventDefault(),onClick:c,children:l(`suggest.retryFiles`)})]})})}function Rx(e,t,n,r,i){let[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)({entries:[],limited:!1,incomplete:!1}),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(0),[m,h]=(0,d.useState)(!1),g=(0,d.useRef)(0),_=(0,d.useId)(),v=()=>{g.current++,o(null),c({entries:[],limited:!1,incomplete:!1}),p(0)},y=()=>{let t=e.current;if(!t||!r)return v();let n=m_(t.value,t.selectionStart);if(!n)return v();a&&n.start===a.start&&n.end===a.end&&n.query===a.query||(g.current++,c({entries:[],limited:!1,incomplete:!1}),u(R()(`mention.searching`)),h(!1),o(n),p(0))};(0,d.useEffect)(()=>{if(!a||!r){o(null);return}let e=new AbortController,t=++g.current,i=setTimeout(()=>{d_.searchFiles(a.query,n,e.signal).then(n=>{if(e.signal.aborted||t!==g.current)return;c(n);let r=R();u(n.incomplete?r(`mention.incomplete`):n.entries.length?n.limited?r(`mention.limited`):``:r(`mention.empty`))}).catch(n=>{if(!e.signal.aborted&&t===g.current){h(!0);let e=R();u(n instanceof Error?e(`mention.errorWith`,{error:n.message}):e(`mention.error`))}})},120);return()=>{clearTimeout(i),e.abort()}},[a,n,r]);let b=e=>{a&&(i(e,a),v())};return{refresh:y,close:v,keyDown:e=>{if(!a||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`||e.key===`Tab`&&(e.shiftKey||!s.entries.length))return v(),e.key===`Escape`&&e.preventDefault(),e.key===`Escape`;if(e.key===`ArrowDown`||e.key===`ArrowUp`)return e.preventDefault(),p(t=>Math.max(0,Math.min(s.entries.length-1,t+(e.key===`ArrowDown`?1:-1)))),!0;if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){e.preventDefault();let t=s.entries[f];return t&&b(t),!0}return!1},panel:a&&r?(0,j.jsx)(Lx,{anchor:t,id:_,title:R()(`mention.title`),selected:f,onSelect:p,onAccept:e=>{let t=s.entries[e];t&&b(t)},items:s.entries.map(e=>({key:e.path,label:`${e.kind===`directory`?`▸`:`▤`} ${e.name}${e.kind===`directory`?`/`:``}`,description:e.path})),message:l,onRetry:m?()=>{g.current++,h(!1),u(R()(`mention.searching`)),o(e=>e?{...e}:null)}:void 0}):null,open:!!a,controls:a?_:void 0,active:a&&s.entries[f]?`${_}-${f}`:void 0}}var zx=`(max-width: 768px)`,Bx={min:320,max:960,initial:560,step:24},Vx=.6,Hx=e=>Math.min(Bx.max,Math.max(Bx.min,Math.round(e)));function Ux({name:e,size:t=18,className:n}){return(0,j.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:e===`more`?3:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:n,children:(0,j.jsx)(`path`,{d:{folder:`M3 6h6l2 2h10v11H3z`,plus:`M12 5v14M5 12h14`,chevron:`m8 10 4 4 4-4`,panel:`M3 4h18v16H3zM9 4v16`,"panel-right":`M3 4h18v16H3zM15 4v16`,search:`M20 20l-5-5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0`,more:`M5 12h.01M12 12h.01M19 12h.01`,chat:`M4 4h16v12H9l-5 4z`,close:`m6 6 12 12M6 18 18 6`,settings:`M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0`,archive:`M3 4h18v4H3zM5 8v12h14V8M10 12h4`,up:`m5 12 7-7 7 7M12 5v14`,bolt:`M13 2 4 14h6l-1 8 9-12h-6l1-8z`,check:`M5 12.5l4.5 4.5L19 7.5`,clock:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 7v5l3 2`,spinner:`M21 12a9 9 0 1 1-9-9`,store:`M4 9.5 5.6 4.5h12.8L20 9.5M4 9.5V20h16V9.5M4 9.5h16M9.5 20v-5.5h5V20`,info:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 12v4M12 8h.01`,key:`M12.7 11.3 21 3m-4.2 1.8 3 3M8 19a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z`,download:`M12 4v10m0 0-4-4m4 4 4-4M5 20h14`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,trash:`M4.5 7h15M9.5 7V4.5h5V7m-7.5 0 .8 13h8.4l.8-13`,eye:`M2.5 12S6 6 12 6s9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Zm9.5 2.4a2.4 2.4 0 1 0 0-4.8 2.4 2.4 0 0 0 0 4.8Z`,phone:`M8 3h8a1.5 1.5 0 0 1 1.5 1.5v15A1.5 1.5 0 0 1 16 21H8a1.5 1.5 0 0 1-1.5-1.5v-15A1.5 1.5 0 0 1 8 3Zm2.5 14.5h3`,code:`m8 8-5 4 5 4M16 8l5 4-5 4M14 5l-4 14`,layers:`M12 3 3 8l9 5 9-5-9-5ZM3 12.5l9 5 9-5M3 17l9 5 9-5`,palette:`M12 3a9 9 0 1 0 0 18c1.2 0 1.8-.9 1.4-1.9-.4-1 .2-2.1 1.4-2.1H17a4 4 0 0 0 4-4c0-5-4-10-9-10ZM7.5 11h.01M10 7.5h.01M14.5 7.5h.01`,globe:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9s-1.3 6.3-3.8 9c-2.5-2.7-3.8-5.7-3.8-9S9.5 5.7 12 3Z`,sparkles:`M12 4l1.8 4.7L18.5 10.5l-4.7 1.8L12 17l-1.8-4.7L5.5 10.5l4.7-1.8zM18.5 3l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8zM5 16l.7 1.8 1.8.7-1.8.7L5 21l-.7-1.8-1.8-.7 1.8-.7z`}[e]})})}function Wx(){let[e,t]=(0,d.useState)(()=>window.matchMedia(zx).matches);return(0,d.useEffect)(()=>{let e=window.matchMedia(zx),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var Gx=0,Kx=``;function qx(e){let t=(0,d.useRef)(null),n=(0,d.useId)(),r=z();return(0,d.useEffect)(()=>{let e=document.activeElement,n=t.current;return Gx===0&&(Kx=document.body.style.overflow),Gx+=1,document.body.style.overflow=`hidden`,n.showModal(),()=>{n.close(),--Gx,Gx===0&&(document.body.style.overflow=Kx),e?.isConnected&&e.focus()}},[]),(0,cb.createPortal)((0,j.jsxs)(`dialog`,{ref:t,className:`chrome dialog ${e.drawer?`drawer`:``}`,"aria-labelledby":n,onCancel:t=>{t.preventDefault(),e.locked||e.onClose()},onKeyDown:e=>{if(e.key!==`Tab`)return;let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(0,j.jsxs)(`div`,{className:`dialog-heading`,children:[(0,j.jsx)(`h2`,{id:n,children:e.title}),(0,j.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":r(`common.close`),title:r(`common.close`),disabled:e.locked,onClick:e.onClose,children:(0,j.jsx)(Ux,{name:`close`})})]}),e.children]}),document.body)}function Jx(e){let t=(0,d.useRef)(null),n=(0,d.useRef)(e.onClose);n.current=e.onClose;let[r,i]=(0,d.useState)({left:8,top:8});return(0,d.useLayoutEffect)(()=>{let r=t.current,a=()=>{let t=e.anchor.getBoundingClientRect(),n=t.bottom+4+r.offsetHeight>window.innerHeight?Math.max(8,t.top-r.offsetHeight-4):t.bottom+4;i({left:Math.max(8,Math.min(t.left,window.innerWidth-r.offsetWidth-8)),top:n})};a(),r.querySelector(`button:not(:disabled), input, a`)?.focus();let o=t=>{!r.contains(t.target)&&!e.anchor.contains(t.target)&&n.current()};return document.addEventListener(`pointerdown`,o),window.addEventListener(`resize`,a),()=>{document.removeEventListener(`pointerdown`,o),window.removeEventListener(`resize`,a),e.anchor.isConnected&&e.anchor.focus()}},[e.anchor]),(0,cb.createPortal)((0,j.jsx)(`div`,{ref:t,className:`chrome popover`,role:`dialog`,"aria-label":e.label,style:r,onKeyDown:t=>{if(t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose()),t.key===`Tab`){e.onClose();return}if(t.key!==`ArrowDown`&&t.key!==`ArrowUp`)return;t.preventDefault();let n=[...t.currentTarget.querySelectorAll(`button:not(:disabled), a`)];n[(n.indexOf(document.activeElement)+(t.key===`ArrowDown`?1:-1)+n.length)%n.length]?.focus()},children:e.children}),e.anchor.closest(`dialog`)??document.body)}var Yx=e=>e.split(/[\\/]/).filter(Boolean).at(-1)??e;function Xx(e){return(0,j.jsx)(`button`,{type:`button`,className:`icon-btn focus-neko rounded hover:bg-ink-900/5`,"aria-label":e.label,title:e.label,onClick:e.onClick,children:(0,j.jsx)(Ux,{name:`close`,size:14})})}var Zx={on:`text-tianyi-800`,warn:`text-sakura-800`,off:`text-ink-400`};function Qx(e){let{options:t,value:n}=e,r=z(),i=(0,d.useId)(),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(0),f=t.find(e=>e.id===n),p=a?dv(t,s??``):[],m=a&&p[l]?`${i}-${l}`:void 0,h=`${i}-list`;(0,d.useEffect)(()=>{m&&document.getElementById(m)?.scrollIntoView?.({block:`nearest`})},[m]);function g(e=0){let r=t.findIndex(e=>e.id===n);u(s===null&&r>=0?r:e),o(!0)}function _(){o(!1),c(null)}function v(t){e.onChange(t.id),_()}function y(e){let t=p.length-1;switch(e.key){case`ArrowDown`:case`ArrowUp`:{if(e.preventDefault(),!a)return g();let n=e.key===`ArrowDown`?1:-1;u(t<0?0:(l+n+p.length)%p.length);return}case`Home`:case`End`:if(!a||s!==null)return;e.preventDefault(),u(e.key===`Home`?0:Math.max(t,0));return;case`Enter`:{if(!a)return;e.preventDefault();let t=p[l];t&&v(t);return}case`Escape`:if(!a)return;e.preventDefault(),e.stopPropagation(),_()}}return(0,j.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`input`,{type:`text`,role:`combobox`,"aria-label":e.label,"aria-expanded":a,"aria-controls":h,"aria-autocomplete":`list`,"aria-activedescendant":m,autoComplete:`off`,spellCheck:!1,disabled:e.disabled,value:s??f?.name??``,placeholder:r(`providerCombo.placeholder`),onChange:e=>{c(e.target.value),u(0),o(!0)},onFocus:e=>e.currentTarget.select(),onClick:e=>{if(a)return _();g(),e.currentTarget.select()},onKeyDown:y,onBlur:_,className:`focus-neko w-full min-w-0 cursor-pointer rounded-xl border border-sakura-200 bg-base py-2 pr-9 pl-3 text-sm font-semibold text-ink-900`}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-ink-500 transition-transform ${a?`rotate-180`:``}`,children:(0,j.jsx)(Ux,{name:`chevron`,size:16})})]}),(0,j.jsxs)(`div`,{id:h,role:`listbox`,tabIndex:-1,"aria-label":e.label,hidden:!a,onMouseDown:e=>e.preventDefault(),className:`absolute top-full right-0 left-0 z-20 mt-1 max-h-60 overflow-y-auto rounded-xl border border-sakura-200 bg-surface p-1 shadow-soft`,children:[p.map((e,t)=>(0,j.jsxs)(`div`,{id:`${i}-${t}`,role:`option`,tabIndex:-1,"aria-selected":e.id===n,onMouseEnter:()=>u(t),onClick:()=>v(e),className:`flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm ${t===l?`bg-sakura-50`:``} ${e.id===n?`font-semibold text-sakura-800`:`text-ink-700`}`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.detail&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs ${Zx[e.tone??`off`]}`,children:e.detail})]},e.id)),a&&p.length===0&&(0,j.jsx)(`p`,{className:`px-2.5 py-2 text-xs text-ink-500`,children:r(`providerCombo.empty`)})]})]})}function $x(e){let t=z(),{models:n,currentSessionId:r,view:i,phase:a,operating:o,defaultModel:s}=$g(),[c,l]=(0,d.useState)(null),u=n.find(t=>t.provider===e.current?.provider&&t.modelId===e.current?.modelId);c&&c.id!==r&&l(null);let f=u?.name??e.fallbackLabel,p=cv(s,e.current);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`button`,{type:`button`,disabled:!e.current||a!==`ready`||o,onClick:()=>r&&l({id:r}),className:`focus-neko min-w-0 truncate rounded-full px-2 py-1 text-left text-xs text-ink-500 hover:bg-sakura-50`,"aria-label":t(`picker.aria`,{label:f,level:i?.agent.thinkingLevel??``}),children:[p?`★ `:``,f,` · `,i?.agent.thinkingLevel??`off`,` ▾`]}),c&&c.id===r&&e.current&&(0,j.jsx)(tS,{session:c.id,currentRef:e.current,current:u??null,level:i?.agent.thinkingLevel??`off`,onClose:()=>l(e=>e===c?null:e)},c.id)]})}function eS(e,t){return[fv(e.contextWindow),e.input.includes(`image`)?t(`picker.badgeImage`):``,e.reasoning?t(`picker.badgeReasoning`):``].filter(Boolean).join(` · `)}function tS(e){let t=z(),{models:n,credentials:r,defaultModel:i}=$g(),[a,o]=(0,d.useState)(e.current),[s,c]=(0,d.useState)(e.level),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(e.currentRef.provider),[m,h]=(0,d.useState)(!1),g=(0,d.useRef)(!1),[_,v]=(0,d.useState)(``),y=lv(n,``),b=uv(y,f??void 0),x=y.map(e=>({id:e.provider,name:e.name,detail:e.available?t(`picker.providerModels`,{count:e.models.length}):t(`picker.keyMissing`),tone:e.available?`on`:`warn`})),S=l.trim().length>0,C=S?lv(n,l):y.filter(e=>e.provider===b),w=ov(r,e.currentRef.provider);async function T(){if(!g.current&&a){g.current=!0,h(!0),v(``);try{await d_.configure({model:{provider:a.provider,modelId:a.modelId},thinkingLevel:s},e.session),e.onClose()}catch{v(t(`picker.applyFailed`))}finally{g.current=!1,h(!1)}}}async function E(e){if(!g.current){g.current=!0,h(!0),v(``);try{cv(i,e)?await d_.clearDefaultModel():await d_.setDefaultModel({provider:e.provider,modelId:e.modelId})}catch{v(t(`picker.defaultFailed`))}finally{g.current=!1,h(!1)}}}return(0,j.jsx)(qx,{title:t(`picker.title`),onClose:e.onClose,children:(0,j.jsxs)(`div`,{className:`space-y-5 p-5`,children:[w&&(0,j.jsxs)(`p`,{role:`alert`,className:`rounded-xl bg-sakura-50 px-3 py-2 text-sm text-sakura-800`,children:[t(w===`disabled`?`picker.issueDisabled`:`picker.issueKey`,{provider:av(e.currentRef.provider)}),` `,(0,j.jsx)(Br,{to:`/settings`,hash:`credential-${e.currentRef.provider}`,className:`focus-neko rounded underline`,children:t(`picker.goSettings`)})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,j.jsx)(`div`,{className:`min-w-0 sm:w-64 sm:shrink-0`,children:(0,j.jsx)(Qx,{label:t(`picker.providerLabel`),options:x,value:b,onChange:e=>{p(e),u(``)}})}),(0,j.jsx)(`label`,{className:`sr-only`,htmlFor:`model-search`,children:t(`picker.searchLabel`)}),(0,j.jsx)(`input`,{id:`model-search`,type:`search`,value:l,onChange:e=>u(e.target.value),placeholder:t(`picker.searchPlaceholder`),autoComplete:`off`,spellCheck:!1,className:`focus-neko w-full min-w-0 rounded-xl border border-sakura-200 bg-base px-3 py-2 text-sm`})]}),(0,j.jsxs)(`fieldset`,{"aria-label":t(`picker.models`),className:`m-0 min-w-0 max-h-[min(40vh,22rem)] space-y-1 overflow-y-auto border-0 p-0 pr-1`,children:[C.map(e=>(0,j.jsxs)(`section`,{id:`models-${e.provider}`,children:[(S||!e.available)&&(0,j.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pt-1 pb-0.5 text-xs`,children:[S&&(0,j.jsx)(`span`,{className:`truncate font-semibold text-ink-700`,children:e.name}),!e.available&&(0,j.jsxs)(`span`,{className:`ml-auto shrink-0 text-sakura-800`,children:[t(`picker.keyMissingDot`),` `,(0,j.jsx)(Br,{to:`/settings`,hash:`credential-${e.provider}`,className:`focus-neko rounded underline`,children:t(`picker.configure`)})]})]}),(0,j.jsx)(`ul`,{className:`space-y-1`,children:e.models.map(n=>{let r=a?.provider===n.provider&&a.modelId===n.modelId,l=cv(i,n);return(0,j.jsxs)(`li`,{className:`flex items-stretch gap-1`,children:[(0,j.jsxs)(`button`,{type:`button`,disabled:m||!e.available,"aria-pressed":r,title:`${n.modelId} · ${pv(n)}`,onClick:()=>{o(n),c(n.thinkingLevelAdjustments[s])},className:`focus-neko flex min-w-0 flex-1 items-center gap-2 rounded-lg border px-3 py-1.5 text-left text-sm disabled:opacity-50 ${r?`border-sakura-300 bg-sakura-50 text-sakura-800`:`border-sakura-100 bg-surface text-ink-700`}`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 truncate`,children:[l?`★ `:``,n.name,r?` ✓`:``]}),(0,j.jsx)(`span`,{className:`hidden min-w-0 flex-1 truncate text-xs text-ink-400 sm:inline`,children:n.modelId}),(0,j.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-ink-500`,children:eS(n,t)})]}),e.available&&(0,j.jsx)(`button`,{type:`button`,disabled:m,"aria-pressed":l,"aria-label":`${t(l?`picker.unsetDefault`:`picker.setDefault`)} ${n.name}`,title:t(l?`picker.unsetDefaultTitle`:`picker.setDefaultTitle`),onClick:()=>void E(n),className:`focus-neko shrink-0 rounded-lg border border-sakura-100 px-2 text-sm text-ink-400 hover:bg-sakura-50 disabled:opacity-50`,children:(0,j.jsx)(`span`,{"aria-hidden":`true`,children:l?`★`:`☆`})})]},`${n.provider}/${n.modelId}`)})})]},e.provider)),C.length===0&&(0,j.jsx)(`p`,{className:`px-1 py-3 text-sm text-ink-500`,children:t(S?`picker.noMatch`:`picker.noModels`)})]})]}),a&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`mb-2 text-sm text-ink-600`,children:t(`picker.thinking`)}),(0,j.jsx)(`fieldset`,{className:`flex flex-wrap gap-2`,"aria-label":t(`picker.thinking`),children:a.supportedThinkingLevels.map(e=>(0,j.jsx)(`button`,{type:`button`,disabled:m,"aria-pressed":s===e,onClick:()=>c(e),className:`focus-neko rounded-full border px-4 py-2 text-sm ${e===s?`border-tianyi-300 bg-tianyi-50 text-tianyi-800`:`border-sakura-200`}`,children:e},e))})]}),i?.source===`cli`&&(0,j.jsx)(`p`,{className:`text-xs text-tianyi-800`,children:t(`picker.cliNote`)}),(0,j.jsx)(`p`,{className:`text-xs text-ink-500`,children:t(`picker.scopeNote`)}),_&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:_}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:e.onClose,className:`btn-outline rounded-full px-4 py-2 text-sm`,children:t(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,disabled:m||!a,onClick:()=>void T(),className:`btn-primary rounded-full px-5 py-2 text-sm`,children:t(m?`picker.applying`:`picker.apply`)})]})]})})}function nS({queued:e,busy:t,onSteer:n,onWithdraw:r}){let i=z();if(!e.length)return null;let a=e=>i(`queue.mode.${e}`);return(0,j.jsx)(`section`,{"aria-label":i(`queue.section`),className:`mb-2 rounded-2xl border border-sakura-200 bg-base/90 px-2 py-1.5`,children:(0,j.jsx)(`ul`,{className:`flex max-h-32 flex-col gap-1 overflow-y-auto`,children:e.map(e=>{let o=e.preview||(e.images?i(`queue.image`):``);return(0,j.jsxs)(`li`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[(0,j.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-xs ${e.mode===`steer`?`bg-sakura-100 text-sakura-700`:`bg-tianyi-50 text-ink-600`}`,children:a(e.mode)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-700`,title:e.preview,children:e.preview||(e.images?i(`queue.imageOnly`):``)}),e.images>0&&e.preview&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:i(`queue.images`,{count:e.images})}),e.mode===`followUp`&&(0,j.jsx)(`button`,{type:`button`,disabled:t,"aria-label":i(`queue.steerAria`,{label:o}),title:i(`queue.steerTitle`),onClick:()=>n(e),className:`focus-neko h-8 shrink-0 rounded-full px-2 text-xs text-sakura-700 hover:bg-sakura-50 disabled:opacity-50`,children:i(`queue.steer`)}),(0,j.jsx)(`button`,{type:`button`,disabled:t,"aria-label":i(`queue.withdrawAria`,{mode:a(e.mode),label:o}),onClick:()=>r(e),className:`focus-neko h-8 shrink-0 rounded-full px-2 text-xs text-ink-600 hover:bg-sakura-50 disabled:opacity-50`,children:i(`queue.withdraw`)})]},e.id)})})})}var rS=new Set([`nothing_to_answer`]);function iS({failure:e,pending:t,onContinue:n}){let r=z(),i=`runFailure.reason.${e.reason}`,a=i in Rg.zh?r(i):e.reason;return(0,j.jsxs)(`section`,{"aria-label":r(`runFailure.section`),"data-run-failure":e.reason,className:`mb-2 flex min-w-0 items-center gap-2 rounded-2xl border border-sakura-200 bg-base/90 px-3 py-1.5 text-sm`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`font-medium text-ink-800`,children:a}),e.detail&&(0,j.jsx)(`span`,{className:`ml-2 break-words text-ink-600`,title:e.detail,children:e.detail})]}),!rS.has(e.reason)&&(0,j.jsx)(`button`,{type:`button`,disabled:t,"aria-label":r(`runFailure.continueAria`),onClick:n,className:`focus-neko h-8 shrink-0 rounded-full px-3 text-xs text-sakura-700 hover:bg-sakura-50 disabled:opacity-50`,children:r(`runFailure.continue`)})]})}var aS=new Map,oS=new Set,sS=new Set;function cS(e){let t=aS.get(e);if(t&&(t.text.trim()!==``||t.files.length>0))return!0;let n=document.activeElement;return n?.tagName===`TEXTAREA`&&n.hasAttribute(`data-composer-input`)}function lS(){let e=R(),t=e_(),n=t.currentSessionId,r=n??`none:${t.workspaceRoot}`,i=aS.get(r);if(sS.size||t.operating)t_.notice({level:`info`,text:e(`composer.upgrade.sending`)});else if([...aS.values()].some(e=>e.files.length))t_.notice({level:`info`,text:e(`composer.upgrade.attachments`)});else if(!t.webInfo)t_.notice({level:`error`,text:e(`composer.upgrade.notReady`)});else if([...aS.entries()].some(([e,t])=>e!==r&&t.text.trim()))t_.notice({level:`info`,text:e(`composer.upgrade.otherDrafts`)});else{try{i_({version:1,serverId:t.webInfo.serverId,workspace:t.workspaceRoot,session:n,text:i?.text??``,requestId:i?.requestId??crypto.randomUUID()})}catch{t_.notice({level:`error`,text:e(`composer.upgrade.saveFailed`)});return}window.location.reload()}}var uS=e=>(oS.add(e),()=>{oS.delete(e)});function dS(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function fS(e){return`$${e.toFixed(e>=1?2:4)}`}function pS(e){let{currentSessionId:t,workspaceRoot:n}=$g();return(0,j.jsx)(hS,{sessionId:t??`none:${n}`,...e},t??`none:${n}`)}function mS({file:e}){let[t,n]=(0,d.useState)(``);return(0,d.useEffect)(()=>{let t=URL.createObjectURL(e);return n(t),()=>URL.revokeObjectURL(t)},[e]),(0,j.jsx)(`img`,{src:t||void 0,alt:e.name,className:`h-16 w-20 rounded-lg object-cover`})}function hS(e){let{credentials:t,view:n,models:r,workspaceRoot:i,phase:a,operating:o}=$g(),s=z(),c=n?.compaction?.active??[];aS.has(e.sessionId)||aS.set(e.sessionId,{text:``,files:[],requestId:crypto.randomUUID()}),(0,d.useEffect)(()=>{let t=r_(),n=e_();if(t&&t.serverId===n.webInfo?.serverId&&t.workspace===i&&(t.session??`none:${i}`)===e.sessionId){aS.set(e.sessionId,{text:t.text,files:[],requestId:t.requestId}),a_();for(let e of oS)e()}},[e.sessionId,i]);let l=(0,d.useSyncExternalStore)(uS,()=>aS.get(e.sessionId)),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)([]),[C,w]=(0,d.useState)(0),[T,E]=(0,d.useState)(``),ee=(0,d.useId)(),[te,ne]=(0,d.useState)(!1),D=(0,d.useRef)(null),re=(0,d.useRef)(null),ie=(0,d.useRef)(null),O=(0,d.useRef)(l);O.current=l;let ae=(0,d.useRef)(!1),oe=(0,d.useMemo)(()=>T_(n?.items??[]),[n?.items]),se=(0,d.useRef)(null),ce=(0,d.useRef)(null);(0,d.useLayoutEffect)(()=>{let e=D.current;if(!ce.current||!e)return;let t=ce.current===`start`?0:e.value.length;ce.current=null,e.setSelectionRange(t,t)}),(0,d.useLayoutEffect)(()=>{let e=D.current;e&&O_(e)},[l.text,e.sessionId]),(0,d.useEffect)(()=>{let e=D.current;if(!e||typeof ResizeObserver>`u`)return;let t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,O_(e))});return n.observe(e),()=>n.disconnect()},[]);let le=e=>{let t=e.currentTarget,n=k_(se.current,oe,e,t.value,{start:t.selectionStart,end:t.selectionEnd});return n?(se.current=n.browse,ce.current=n.caret,b(!1),de({text:n.text}),!0):!1},ue=t=>{O.current=t,aS.set(e.sessionId,t);for(let e of oS)e()},de=e=>ue({...O.current,...e,requestId:crypto.randomUUID()}),fe=ov(t,n?.agent.model?.provider),pe=fe!==null,me=r.find(e=>e.provider===n?.agent.model?.provider&&e.modelId===n?.agent.model?.modelId),he=l.files.length>0&&me!==void 0&&!me.input.includes(`image`),ge=e=>{let t=e.map(e=>({id:crypto.randomUUID(),file:e,processing:!0,error:[`image/png`,`image/jpeg`,`image/webp`].includes(e.type)?e.size>20971520?`composer.attach.size`:void 0:`composer.attach.type`}));de({files:[...O.current.files,...t]});for(let e of t)_e(e)},_e=async t=>{let n=t.error;if(!n)try{(await createImageBitmap(t.file)).close()}catch{n=`composer.attach.decode`}let r=aS.get(e.sessionId);if(!r?.files.some(e=>e.id===t.id))return;let i={...r,files:r.files.map(e=>e.id===t.id?{...e,error:n,processing:!1}:e)};ue(i)},ve=(0,d.useRef)(null),ye=(0,d.useRef)(!1);(0,d.useEffect)(()=>()=>{ye.current||ve.current?.abort()},[]),(0,d.useEffect)(()=>{if(S([]),w(0),!y)return;if(e.sessionId.startsWith(`none:`)){E(`composer.skills.newSession`);return}if(a!==`ready`||o){E(`composer.skills.waiting`);return}let t=new AbortController;return E(`composer.skills.loading`),d_.listSkills(e.sessionId,t.signal).then(e=>{t.signal.aborted||(S(e),E(e.length?``:`composer.skills.empty`))}).catch(()=>{t.signal.aborted||E(`composer.skills.failed`)}),()=>t.abort()},[e.sessionId,a,o,y]);let k=Rx(D,re,i,a===`ready`&&!o,(t,n)=>{let r=O.current;if(t.kind===`file`&&/\.(png|jpe?g|webp)$/i.test(t.path)){if(ve.current)return;let a=new AbortController;ve.current=a,m(s(`composer.image.reading`)),(async()=>{let o=e.sessionId;if(o.startsWith(`none:`)){ye.current=!0,await d_.createSession();let e=e_();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(s(`composer.workspaceChanged`));o=e.currentSessionId,aS.set(o,r);for(let e of oS)e()}let c=await d_.workspaceImage(t.path,o,a.signal);if(a.signal.aborted||e_().currentSessionId!==o||e_().workspaceRoot!==i)return;let l=aS.get(o)??r,u={id:crypto.randomUUID(),file:new File([new Uint8Array(c.bytes)],c.name,{type:c.mimeType})},d=l.text===r.text?r.text.slice(0,n.start)+r.text.slice(n.end):l.text;aS.set(o,{...l,text:d,files:[...l.files,u],requestId:crypto.randomUUID()});for(let e of oS)e();m(``)})().catch(e=>{if(!a.signal.aborted){let t=e instanceof Error?e.message:s(`composer.image.readFailed`);m(t),ye.current&&t_.notice({level:`error`,text:t})}}).finally(()=>{ve.current===a&&(ve.current=null)});return}let a=g_(r.text,n,t.path,t.kind===`directory`),o=D.current;if(o){o.focus(),o.setSelectionRange(n.start,n.end);let e=a.text.slice(n.start,a.text.length-(r.text.length-n.end));document.execCommand(`insertText`,!1,e)?de({text:o.value}):de({text:a.text}),requestAnimationFrame(()=>{o.setSelectionRange(a.cursor,a.cursor),t.kind===`directory`&&k.refresh()})}}),A=n?.contextUsage,be=n?.compaction?.latest,xe=be&&![`summarizing`,`waiting-to-apply`].includes(be.phase)?be.at+(be.phase===`failed`?1e4:5e3):null,[Se,Ce]=(0,d.useState)(xe!==null&&xe<=Date.now());(0,d.useEffect)(()=>{if(Ce(xe!==null&&xe<=Date.now()),xe===null||xe<=Date.now())return;let e=setTimeout(()=>Ce(!0),xe-Date.now());return()=>clearTimeout(e)},[xe]);let we=c.length?c.some(e=>e.retry)?s(`composer.compaction.retrying`):c.some(e=>e.blocking)?s(`composer.compaction.waiting`):s(`composer.compaction.running`):n?.compaction?.failure?s(`composer.compaction.failure`,{error:n.compaction.failure.error}):be&&!Se?s({applied:`composer.compaction.applied`,nothing:`composer.compaction.nothing`,skipped:`composer.compaction.skipped`,cancelled:`composer.compaction.cancelled`,failed:`composer.compaction.failed`,summarizing:`composer.compaction.running`,"waiting-to-apply":`composer.compaction.applying`}[be.phase]):null,Te=!c.length&&(!!n?.compaction?.failure||be?.phase===`failed`),Ee=n?.taskUsage??n?.usage??null,De=async t=>{if(ae.current||e.disabled)return;ae.current=!0,f(!0),sS.add(e.sessionId),m(``);let n=O.current;aS.set(e.sessionId,n);try{await d_.compact(t,e.sessionId),O.current===n&&aS.get(e.sessionId)===n&&qi(n.text)!==null&&ue({...n,text:``,requestId:crypto.randomUUID()}),b(!1)}catch(e){m(e instanceof Error?Jg(e.message):s(`composer.compactFailed`))}finally{ae.current=!1,f(!1),sS.delete(e.sessionId)}},Oe=q_({view:n,phase:a,operating:o}),ke=async t=>{if(ae.current||e.disabled)return;if(m(``),g(``),t!==``){g(s(`composer.plan.noArgs`));return}if(e.sessionId.startsWith(`none:`)){g(s(`composer.plan.needSession`));return}if(Oe===null){g(K_());return}if(e.busy){g(s(`composer.plan.busy`));return}ae.current=!0,f(!0);let n=O.current;try{await d_.planMode(e.sessionId,Oe.mode===`plan`?`normal`:`plan`),O.current===n&&aS.get(e.sessionId)===n&&J_(n.text)!==null&&ue({...n,text:``,requestId:crypto.randomUUID()}),b(!1)}catch(e){let t=Q_(e);(Z_(e)?g:m)(t)}finally{ae.current=!1,f(!1)}},Ae=async()=>{let t=qi(O.current.text);if(t!==null){await De(t);return}let n=J_(O.current.text);if(n!==null){await ke(n);return}let r=O.current;if(aS.set(e.sessionId,r),!(ae.current||e.disabled||pe||he||!r.text.trim()&&!r.files.length)){if(r.files.length>4||r.files.reduce((e,t)=>e+t.file.size,0)>41943040)m(s(`composer.attach.limit`));else if(!r.files.some(e=>e.processing)){if(r.files.some(e=>e.error))m(s(`composer.attach.removeUnsupported`));else{ae.current=!0,f(!0),sS.add(e.sessionId),m(``),g(``);try{let t=[];for(let e of r.files)t.push({name:e.file.name,mimeType:e.file.type,bytes:new Uint8Array(await e.file.arrayBuffer())});let n=e.sessionId;if(n.startsWith(`none:`)){await d_.createSession();let e=e_();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(s(`composer.workspaceChangedDraft`));n=e.currentSessionId,aS.set(n,r);for(let e of oS)e()}if(await d_.submit(r.text.trim(),t,r.requestId,n),n!==e.sessionId){aS.set(n,{text:``,files:[],requestId:crypto.randomUUID()});for(let e of oS)e()}let a=aS.get(e.sessionId);a&&ue({text:a.text===r.text?``:a.text,files:a.files.filter(e=>!r.files.some(t=>t.id===e.id)),requestId:crypto.randomUUID()})}catch(t){let n=t instanceof Error?Jg(t.message):s(`composer.sendFailed`);m(n),e_().currentSessionId!==e.sessionId&&t_.notice({level:`error`,text:n})}finally{ae.current=!1,f(!1),sS.delete(e.sessionId)}}}}},je=D_(l.text,x,{plan:Oe!==null}),Me=Math.min(C,Math.max(0,je.length-1)),Ne=(e=Me)=>{let t=je[e];t&&(de({text:`${t.label} `}),b(!1),D.current?.focus())},Pe=n?.queued??[],Fe=n?.questions?.pending??[],Ie=()=>{let t=xv.state.active[e.sessionId],n=Fe.find(e=>e.id===t)??Fe[0];n&&xv.open(e.sessionId,n)},[Le,Re]=(0,d.useState)(!1),ze=n?.continuable&&!e.busy?n.runFailure:void 0,Be=async()=>{if(!Le){Re(!0),m(``),g(``);try{await d_.continueRun(e.sessionId)}catch(e){m(e instanceof Error?Jg(e.message):s(`runFailure.continueFailed`))}finally{Re(!1)}}},Ve=async t=>{if(_===null){v(t.id),m(``),g(``);try{let n=await d_.steer(e.sessionId,t.id);if(n.result===`withdrawn`){let e=O.current.text,r=n.text??t.preview;de({text:e.trim()?`${e}\n${r}`:r}),g(s(`composer.queue.steerWithdrawn`))}else n.result===`unknown`?g(s(`composer.queue.gone`)):n.result!==`steered`&&g(s(`composer.queue.sentNoSteer`))}catch(e){m(e instanceof Error?Jg(e.message):s(`composer.queue.steerFailed`))}finally{v(null)}}},He=async t=>{if(_===null){v(t.id),m(``),g(``);try{let n=await d_.withdraw(e.sessionId,t.id);if(n.result===`withdrawn`){let e=O.current.text,r=n.text??t.preview;de({text:e.trim()?`${e}\n${r}`:r}),n.images&&g(s(`composer.queue.imagesNotRestored`)),D.current?.focus()}else n.result===`unknown`?g(s(`composer.queue.gone`)):g(s(`composer.queue.sentNoWithdraw`))}catch(e){m(e instanceof Error?Jg(e.message):s(`composer.queue.withdrawFailed`))}finally{v(null)}}},Ue=e.busy||c.some(e=>e.reason===`manual`||e.blocking);return(0,j.jsx)(`section`,{"aria-label":s(`composer.input`),className:`relative shrink-0 px-3 pt-1 pb-3 sm:px-4 sm:pb-4`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),ne(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||ne(!1)},onDrop:e=>{e.preventDefault(),ne(!1),ge(Array.from(e.dataTransfer.files))},children:(0,j.jsxs)(`div`,{className:`chat-column`,children:[ze&&(0,j.jsx)(iS,{failure:ze,pending:Le,onContinue:()=>void Be()}),(0,j.jsx)(nS,{queued:Pe,busy:_!==null,onSteer:e=>void Ve(e),onWithdraw:e=>void He(e)}),(0,j.jsxs)(`div`,{ref:re,className:`composer-card ${Ue?`is-busy`:``} ${te?`ring-2 ring-sakura-300`:``}`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pt-2.5 empty:pt-0`,children:[Fe.length>0&&(0,j.jsxs)(`output`,{"data-question-hint":!0,className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-snug text-tianyi-900 sm:text-sm`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:s(`composer.questionHint`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-full border border-tianyi-300 bg-tianyi-50 px-2.5 py-0.5 text-xs text-tianyi-900 hover:bg-tianyi-100`,onClick:Ie,children:s(`composer.openQuestion`)})]}),te&&(0,j.jsx)(`p`,{className:`text-sm text-sakura-700`,children:s(`composer.dropHint`)}),fe&&(0,j.jsxs)(`p`,{className:`text-sm text-sakura-700`,children:[s(fe===`disabled`?`composer.provider.disabled`:`composer.provider.keyMissing`,{provider:av(n?.agent.model?.provider??``)}),(0,j.jsx)(Br,{to:`/settings`,hash:`credential-${n?.agent.model?.provider??``}`,className:`focus-neko ml-1 underline`,children:s(`composer.provider.goSettings`)})]}),he&&(0,j.jsx)(`p`,{className:`text-sm text-sakura-700`,children:s(`composer.noVision`)}),!me?.input.includes(`image`)&&n?.items.some(e=>e.type===`user`&&e.images?.length)&&(0,j.jsx)(`p`,{className:`text-xs text-ink-500`,children:s(`composer.noHistoryImages`)}),h&&(0,j.jsx)(`output`,{className:`block break-words text-sm text-ink-600`,children:h}),p&&(0,j.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-sakura-700`,children:p})]}),!!l.files.length&&(0,j.jsx)(`ul`,{className:`flex max-h-40 flex-wrap gap-2 overflow-y-auto px-4 pt-2.5`,children:l.files.map(e=>(0,j.jsxs)(`li`,{className:`relative w-28 rounded-xl border border-sakura-200 bg-base p-2`,children:[(0,j.jsx)(mS,{file:e.file}),(0,j.jsx)(`span`,{className:`block truncate text-xs`,title:e.file.name,children:e.file.name}),e.processing&&(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:s(`composer.attach.checking`)}),e.error&&(0,j.jsx)(`span`,{className:`text-xs text-sakura-700`,children:s(e.error)}),(0,j.jsx)(`button`,{type:`button`,"aria-label":s(`composer.attach.remove`,{name:e.file.name}),className:`focus-neko absolute right-0 top-0 rounded-full bg-base px-1`,onClick:()=>de({files:O.current.files.filter(t=>t.id!==e.id)}),children:`×`})]},e.id))}),(0,j.jsx)(`textarea`,{ref:D,disabled:e.disabled,value:l.text,rows:1,placeholder:Fe.length>0?s(`composer.placeholder.waiting`):e.busy?s(`composer.placeholder.busy`):s(`composer.placeholder.idle`),"aria-label":s(`composer.input`),"data-composer-input":!0,"aria-autocomplete":`list`,"aria-controls":k.controls??(y?ee:void 0),"aria-activedescendant":k.active??(y&&je.length?`${ee}-${Me}`:void 0),onClick:e=>{k.refresh(),b(E_(e.currentTarget.value))},onBlur:()=>{k.close(),b(!1)},onCompositionStart:()=>{k.close(),b(!1)},onCompositionEnd:e=>{k.refresh(),b(E_(e.currentTarget.value))},className:`composer-input max-h-40 min-h-10 min-w-0 w-full resize-none bg-transparent px-4 py-2 text-ink-900 focus:outline-none`,onChange:e=>{se.current=null,de({text:e.target.value}),w(0),b(!e.nativeEvent.isComposing&&E_(e.target.value)),e.nativeEvent.isComposing||k.refresh()},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),ge(t))},onKeyDown:e=>{e.nativeEvent.isComposing||k.keyDown(e)||(e.key===`Escape`&&y?(e.preventDefault(),b(!1)):y&&(e.key===`ArrowDown`||e.key===`ArrowUp`)?(e.preventDefault(),w(Math.max(0,Math.min(je.length-1,Me+(e.key===`ArrowDown`?1:-1))))):y&&e.key===`Tab`?!e.shiftKey&&je.length?(e.preventDefault(),Ne()):b(!1):(e.key===`ArrowUp`||e.key===`ArrowDown`)&&!y&&le(e)?e.preventDefault():e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y&&je.length?Ne():(b(!1),Ae())))}}),(0,j.jsxs)(`div`,{className:`composer-toolbar flex flex-wrap items-center gap-x-1 gap-y-1 border-t border-sakura-100 px-2 py-1.5`,children:[(0,j.jsx)(`input`,{ref:ie,type:`file`,accept:`image/png,image/jpeg,image/webp`,multiple:!0,hidden:!0,onChange:e=>{ge(Array.from(e.target.files??[])),e.target.value=``}}),(0,j.jsx)(`button`,{type:`button`,"aria-label":s(`composer.addImage`),title:s(`composer.addImageTitle`),disabled:e.disabled,onClick:()=>ie.current?.click(),className:`focus-neko inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink-600 hover:bg-sakura-50`,children:(0,j.jsx)(Ux,{name:`plus`})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":s(`composer.menu`),"aria-expanded":y,className:`focus-neko inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink-500 hover:bg-sakura-50`,onClick:()=>{k.close(),b(!y),D.current?.focus()},children:(0,j.jsx)(Ux,{name:`more`})}),(0,j.jsx)(`div`,{className:`min-w-0 max-w-64 [&>button]:max-w-full`,children:(0,j.jsx)($x,{current:n?.agent.model??null,fallbackLabel:n?.model??`…`})}),A&&A.window>0&&(0,j.jsxs)(`span`,{className:`shrink-0 rounded-full bg-tianyi-50 px-2 py-1 font-mono text-xs ${A.percent!==null&&A.percent>90?`text-sakura-700 font-semibold`:`text-ink-600`}`,title:A.tokens===null?s(`composer.ctx.none`):s(`composer.ctx.usage`,{tokens:A.tokens,window:A.window}),children:[`Ctx `,A.percent===null?`?`:`${A.percent.toFixed(1)}%`,`/`,dS(A.window)]}),(0,j.jsxs)(`output`,{"aria-live":`polite`,"aria-atomic":`true`,className:`contents`,children:[we&&(0,j.jsx)(`span`,{className:`max-w-full whitespace-nowrap rounded-full border px-2 py-1 text-xs ${Te?`border-sakura-300 bg-sakura-50 text-sakura-700`:`border-tianyi-200 bg-tianyi-50 text-ink-600`}`,title:be?.phase===`nothing`&&!c.length?s(`composer.compaction.nothingTitle`):void 0,children:we}),Oe?.mode===`plan`&&(0,j.jsx)(`span`,{"data-plan-mode":!0,className:`max-w-full whitespace-nowrap rounded-full border border-sakura-300 bg-sakura-50 px-2 py-1 text-xs font-medium text-sakura-800`,title:s(`composer.planModeTitle`),children:G_()})]}),(0,j.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[e.busy&&e.status!==null&&(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-64 items-center gap-1.5 text-xs font-medium text-sakura-700`,title:Gg(e.status,s),children:[(0,j.jsxs)(`span`,{className:`dots shrink-0`,"aria-hidden":!0,children:[(0,j.jsx)(`span`,{}),(0,j.jsx)(`span`,{}),(0,j.jsx)(`span`,{})]}),(0,j.jsx)(`span`,{className:`truncate`,children:Gg(e.status,s).replace(/(\.\.\.|…)$/,``)})]}),Ee!==null&&(0,j.jsxs)(`button`,{type:`button`,className:`telemetry focus-neko shrink-0 rounded-full px-1.5 py-1 font-mono text-xs text-ink-500`,"aria-label":s(`composer.usage.aria`,{input:Ee.input,output:Ee.output,cacheRead:Ee.cacheRead,cost:fS(Ee.cost)}),children:[`↑`,dS(Ee.input),` ↓`,dS(Ee.output),(0,j.jsx)(`span`,{className:`telemetry-detail`,"aria-hidden":!0,children:s(`composer.usage.detail`,{input:Ee.input,output:Ee.output,cacheRead:Ee.cacheRead,cost:fS(Ee.cost)})})]}),(0,j.jsx)(`button`,{type:`button`,disabled:u||e.disabled||!l.text.trim()&&!l.files.length||qi(l.text)===null&&J_(l.text)===null&&(pe||he||l.files.some(e=>!!e.error||e.processing)),onClick:()=>void Ae(),className:`btn-primary focus-neko h-10 shrink-0 rounded-full px-3 text-sm disabled:opacity-50`,children:u?s(`composer.working`):e.busy?s(`composer.queue`):s(`composer.send`)}),Ue&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>d_.abort(),className:`btn-stop focus-neko h-10 rounded-full px-2 text-sm`,title:s(`composer.stopTitle`),children:s(`composer.stop`)})]})]})]}),k.panel,y&&!k.open&&(0,j.jsx)(Lx,{anchor:re,id:ee,title:s(`composer.commandTitle`),items:je,selected:Me,onSelect:w,message:T?s(T):je.length?void 0:s(`composer.noCommands`),onAccept:Ne})]})})}var gS=[{key:`credentials`,label:`settings.menu.credentials`,icon:`key`,to:`/settings`},{key:`search`,label:`settings.menu.search`,icon:`search`,to:`/settings/search`},{key:`context`,label:`settings.menu.context`,icon:`layers`,to:`/settings/context`},{key:`codemode`,label:`settings.menu.codemode`,icon:`code`,to:`/settings/codemode`},{key:`appearance`,label:`settings.menu.appearance`,icon:`palette`,to:`/settings/appearance`},{key:`language`,label:`settings.menu.language`,icon:`globe`,to:`/settings/language`},{key:`mobile`,label:`settings.menu.mobile`,icon:`phone`,to:`/settings/mobile`},{key:`about`,label:`settings.menu.about`,icon:`info`,to:`/about`}];function _S({active:e,children:t}){let n=z();return(0,j.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base sm:flex-row`,children:[(0,j.jsxs)(`nav`,{"aria-label":n(`settings.menuLabel`),className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b border-sakura-100 px-4 py-2.5 sm:w-48 sm:flex-col sm:items-stretch sm:gap-1 sm:border-r sm:border-b-0 sm:px-3 sm:py-5`,children:[(0,j.jsx)(Br,{to:`/`,className:`focus-neko mr-2 inline-flex shrink-0 items-center rounded-lg px-2 py-1.5 text-sm text-sakura-700 sm:mr-0 sm:mb-3`,children:n(`settings.backToChat`)}),(0,j.jsx)(`span`,{className:`hidden px-2 pb-1 text-xs font-medium text-ink-400 sm:block`,children:n(`settings.title`)}),gS.map(t=>(0,j.jsxs)(Br,{to:t.to,activeOptions:{exact:!0},"aria-current":e===t.key?`page`:void 0,className:`focus-neko inline-flex shrink-0 items-center gap-2 rounded-xl px-3 py-2 text-sm ${e===t.key?`bg-sakura-100 font-semibold text-sakura-800`:`text-ink-600 hover:bg-ink-100`}`,children:[(0,j.jsx)(Ux,{name:t.icon,size:15}),n(t.label)]},t.key))]}),(0,j.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}async function vS(){let e=R(),t;try{await navigator.clipboard.writeText(`neko update`),t=e(`update.copied`)}catch{t=e(`update.copyManually`)}return t_.notice({level:`info`,text:t}),t}function yS(){let{updates:e,webInfo:t}=$g();return Vi({gateway:e,frontend:Ri,installed:t?.installedVersion??null,web:t?{runningVersion:t.webVersion,installedVersion:t.installedVersion}:void 0})}function bS(){let e=yS(),t=z(),[n,r]=(0,d.useState)(null);if(e===`none`||n===e)return null;let i=t(e===`install`?`update.install`:e===`refresh-page`?`update.refreshPage`:e===`incompatible`?`update.incompatible`:`update.restart`);return(0,j.jsxs)(`output`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-x-3 gap-y-1 border-b border-sakura-100 bg-sakura-50 px-4 py-1.5 text-xs text-ink-700`,children:[(0,j.jsx)(`span`,{children:i}),e===`install`?(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:()=>void vS(),children:t(`update.copyCommand`)}):e===`refresh-page`?(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:lS,children:t(`update.refresh`)}):(0,j.jsx)(Br,{to:`/about`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,children:t(`update.viewSteps`)}),(0,j.jsx)(Xx,{label:t(`update.dismiss`),onClick:()=>r(e)})]})}function xS(e){if(e?.status!==`missing`)return;let t=R();return e.reason===`invalid_config`?t(`shell.invalid`,{detail:e.detail??t(`shell.invalidDefault`)}):t(`shell.missing`)}function SS(e){if(e===null)return null;let t=R();return e.status===`ready`?{label:t(`shell.ready`),tone:`ok`,detail:t(e.source===`config`?`shell.sourceConfig`:`shell.sourceAuto`,{path:e.path})}:{label:t(`shell.unavailable`),tone:`warn`,detail:xS(e)??``}}function CS(){let{updates:e,webInfo:t,phase:n,shell:r}=$g(),i=z(),a=SS(r),o=yS(),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(``),f=r_();async function p(){if(!s){c(!0),u(``);try{let e=await d_.checkUpdates();u(e.checkState===`ok`?i(`about.checkDone`):e.checkState===`development`?i(`about.checkDevelopment`):i(`about.checkFailedRetry`))}catch{u(i(`about.checkFailedRetry`))}finally{c(!1)}}}return(0,j.jsxs)(_S,{active:`about`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:i(`settings.menu.about`)}),(0,j.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:i(n===`ready`?`common.connected`:`common.connecting`)})]}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:i(`about.intro`)})]}),(0,j.jsxs)(`main`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-5 px-5 pb-8`,children:[(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsx)(`h2`,{className:`mb-4 text-base font-bold text-ink-900`,children:i(`about.versionStatus`)}),(0,j.jsxs)(`div`,{className:`flex flex-col divide-y divide-sakura-100`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`text-sm font-medium text-ink-800`,children:i(`about.currentVersion`)}),(0,j.jsx)(`span`,{className:`ml-3 font-mono text-sm text-ink-600`,children:Ri})]}),(0,j.jsx)(`div`,{children:s?(0,j.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2.5 py-0.5 text-xs text-ink-600`,children:i(`about.checking`)}):o===`incompatible`?(0,j.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs font-semibold text-sakura-800`,children:i(`about.badge.incompatible`)}):o===`install`?(0,j.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs font-semibold text-sakura-800`,children:i(`about.badge.install`)}):o===`restart-service`?(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-100 px-2.5 py-0.5 text-xs font-semibold text-tianyi-800`,children:i(`about.badge.restart`)}):o===`refresh-page`?(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-100 px-2.5 py-0.5 text-xs font-semibold text-tianyi-800`,children:i(`about.badge.refresh`)}):e?.checkState===`development`?(0,j.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2.5 py-0.5 text-xs text-ink-600`,children:i(`about.badge.development`)}):e?.checkState===`failed`?(0,j.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs text-sakura-800`,children:i(`about.badge.failed`)}):(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2.5 py-0.5 text-xs font-medium text-tianyi-800`,children:i(`about.badge.latest`)})})]}),o===`install`&&e?.latestVersion&&(0,j.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-sakura-50/60 px-3 py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`text-sm font-semibold text-sakura-800`,children:i(`about.latestStable`)}),(0,j.jsx)(`span`,{className:`ml-3 font-mono text-sm text-sakura-900`,children:e.latestVersion})]}),(0,j.jsx)(`span`,{className:`text-xs text-sakura-700`,children:i(`about.runUpdate`)})]}),o===`restart-service`&&(0,j.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:i(`about.installedNew`)}),(0,j.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:e?.installedVersion??t?.installedVersion??i(`about.newVersion`)})]}),(0,j.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:i(`about.afterRestart`)})]}),o===`refresh-page`&&(0,j.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:i(`about.staticUpdated`)}),(0,j.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:t?.webVersion??i(`about.newVersion`)})]}),(0,j.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:i(`about.afterRefresh`)})]})]}),(0,j.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,disabled:s,onClick:()=>void p(),children:i(s?`about.checking`:`about.checkUpdates`)}),o===`install`?(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void vS().then(u),children:i(`about.copyUpdate`)}):(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-sakura-200 bg-surface px-4 py-1.5 text-sm text-ink-600 hover:bg-sakura-50`,onClick:()=>void vS().then(u),children:i(`about.copyUpdate`)}),o===`refresh-page`&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-tianyi-100 px-4 py-1.5 text-sm font-semibold text-tianyi-800`,onClick:lS,children:i(`about.refreshPage`)})]}),l&&(0,j.jsx)(`output`,{className:`mt-3 block text-xs text-tianyi-800`,children:l})]}),a&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"data-shell-status":!0,children:[(0,j.jsx)(`h2`,{className:`mb-3 text-base font-bold text-ink-900`,children:i(`about.commandShell`)}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,j.jsx)(`span`,{className:`rounded-full px-2.5 py-0.5 text-xs font-semibold ${a.tone===`ok`?`bg-tianyi-50 text-tianyi-800`:`bg-sakura-100 text-sakura-800`}`,children:a.label}),(0,j.jsx)(`span`,{className:`min-w-0 break-all text-sm text-ink-600`,children:a.detail})]})]}),(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsx)(`h2`,{className:`mb-2 text-base font-bold text-ink-900`,children:i(`about.upgradeTitle`)}),(0,j.jsxs)(`p`,{className:`text-sm text-ink-600`,children:[i(`about.upgradeBefore`),` `,(0,j.jsx)(`code`,{className:`select-all rounded bg-ink-100 px-1.5 py-0.5 font-mono text-xs text-ink-800`,children:`neko update`}),i(`about.upgradeAfter`)]}),f?.text&&(0,j.jsxs)(`details`,{className:`mt-4 border-t border-sakura-100 pt-3 text-sm`,children:[(0,j.jsx)(`summary`,{className:`focus-neko cursor-pointer font-medium text-ink-700`,children:i(`about.draftKept`)}),(0,j.jsx)(`p`,{className:`mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-xl bg-ink-50 p-3 font-mono text-xs text-ink-600 select-text`,children:f.text})]})]})]})]})}var wS=e=>[...e].map(e=>{let t=e.charCodeAt(0);return t<32&&t!==9&&t!==10||t>=127&&t<=159||t>=8234&&t<=8238||t>=8294&&t<=8297?`\\u${t.toString(16).padStart(4,`0`)}`:e}).join(``);function TS({item:e,title:t,decide:n}){let r=z(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(``),c=(0,d.useRef)(!1),l=async t=>{if(!(c.current||e.status!==`pending`)){c.current=!0,a(!0),s(``);try{await n(t)}catch(e){s(String(e))}finally{c.current=!1,a(!1)}}};return(0,j.jsxs)(`section`,{"aria-label":r(`approval.section`),className:`min-w-0 rounded-xl border border-sakura-200 bg-surface p-3 text-sm`,children:[(0,j.jsxs)(`output`,{className:`block font-medium text-sakura-800`,children:[t,` · Bash · `,r(`approval.status.${e.status}`)]}),(0,j.jsxs)(`p`,{className:`break-all text-xs text-ink-500`,children:[wS(e.cwd),` · `,r(`approval.timeout`,{value:e.timeout??r(`approval.timeoutDefault`)})]}),(0,j.jsx)(`textarea`,{readOnly:!0,rows:Math.min(6,Math.max(1,e.command.split(`
12
+ `).length)),"aria-label":r(`approval.command`),value:wS(e.command),className:`focus-neko my-2 w-full resize-y whitespace-pre-wrap break-all rounded-lg bg-base p-2 font-mono text-xs`}),e.status===`pending`&&(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,disabled:i,className:`focus-neko rounded-lg bg-tianyi-100 px-3 py-1 text-tianyi-800 disabled:opacity-50`,onClick:()=>void l(`allowed`),children:r(`approval.allow`)}),(0,j.jsx)(`button`,{type:`button`,disabled:i,className:`focus-neko rounded-lg border border-sakura-300 px-3 py-1 disabled:opacity-50`,onClick:()=>void l(`denied`),children:r(`approval.deny`)})]}),o&&(0,j.jsx)(`p`,{role:`alert`,className:`break-all text-xs text-sakura-800`,children:o})]})}function ES(){let e=z(),{phase:t,operating:n,currentSessionId:r,view:i}=$g(),[,a]=(0,d.useState)(0),o=(0,d.useRef)(null),[s,c]=(0,d.useState)(null),l=t===`ready`&&!n&&i!==null;if((0,d.useEffect)(()=>{if(!l||!r)return;let e=!0,t=new og(e=>d_.subagent(e),()=>{e&&a(e=>e+1)});return o.current=t,c(t),()=>{e=!1,o.current=null,t.close(),c(null)}},[l,r]),(0,d.useEffect)(()=>{l&&s===o.current&&s?.update(i?.subagents??[])},[s,l,i?.subagents]),!l||!s)return null;let u=s.pending;return!u.length&&!s.error?null:(0,j.jsxs)(`section`,{"aria-label":e(`approval.inbox`),className:`max-h-[40dvh] shrink-0 space-y-2 overflow-auto px-3 py-2`,children:[u.map(({item:e,title:t,service:n})=>(0,j.jsx)(TS,{item:e,title:t,decide:t=>n.decideApproval({id:e.id,version:e.version,decision:t})},`${e.id}:${e.version}`)),s.error&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:s.error})]})}function DS(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(t<3600)return`${n}m ${t%60}s`;let r=Math.floor(t/3600);return t<86400?`${r}h ${n%60}m`:`${Math.floor(t/86400)}d ${r%24}h`}var OS=e=>e.split(`
13
+ `).map(e=>e.trim()).find(Boolean)??``;function kS(e){return e.title.trim()||OS(e.command)||`(empty command)`}function AS(e,t){return e.status===`running`?DS(t-e.startedAt):e.reason===`timeout`?`timeout`:e.exitCode===null?e.reason===`restart`?`restart`:DS((e.endedAt??t)-e.startedAt):`exit ${e.exitCode}`}var jS=e=>Number.parseInt(e.replace(/^\D+/,``),10)||0;function MS(e,t){let n=[...e].sort((e,t)=>t.startedAt-e.startedAt||jS(t.jobId)-jS(e.jobId)).map(e=>{let n=e.status===`running`;return{job:e,label:kS(e),running:n,statusText:e.status,meta:AS(e,t),durationMs:Math.max(0,(e.endedAt??t)-e.startedAt)}});return{rows:n,running:n.filter(e=>e.running).length}}function NS(e){let t=e.split(`
14
+ `),n=t[0]??``,r=t[1]?.startsWith(`Command: `)?t[1].slice(9):void 0,i=t.findIndex((e,t)=>t>0&&e.startsWith(`Last output (`)),a=i<0?void 0:t.slice(i+1).join(`
15
+ `);return{head:n,command:r,output:a===``?void 0:a}}var PS=262144,FS=class{#e=``;#t=0;#n;#r;constructor(e=PS){this.#r=e}get text(){return this.#e}get dropped(){return this.#t}get offset(){return this.#n}apply(e,t=e=>e){if(this.#n===void 0?this.#t=e.dropped:e.truncated&&(this.#t+=e.dropped),this.#n=e.offset,this.#e+=t(e.text),this.#e.length>this.#r){let e=this.#e.length-this.#r;this.#e=this.#e.slice(e),this.#t+=e}}},IS={running:`job.status.running`,exited:`job.status.exited`,failed:`job.status.failed`,stopped:`job.status.stopped`,lost:`job.status.lost`};function LS(e,t){let n=R(),r=n(IS[e.status]);return e.status===`running`?`${r} · ${DS(t-e.startedAt)}`:e.reason===`timeout`?`${r} · ${n(`job.reason.timeout`)}`:e.reason===`spawn-error`?`${r} · ${n(`job.reason.spawnError`)}`:e.exitCode===null?e.reason===`restart`?`${r} · ${n(`job.reason.restart`)}`:`${r} · ${DS((e.endedAt??t)-e.startedAt)}`:`${r} · ${n(`job.reason.exitCode`,{code:e.exitCode})}`}var RS=/\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\)|[@-Z\\-_])/g,zS=/[\u0000-\u0008\u000b-\u001f\u007f]/g;function BS(e){return e.replace(RS,``).replace(/\r\n?/g,`
16
+ `).replace(zS,``)}function VS(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}var HS=`neko.panelWidth`;function US(e){if(e==null||e.trim()===``)return Bx.initial;let t=Number(e);return Number.isFinite(t)?Hx(t):Bx.initial}function WS(){try{return localStorage}catch{return}}function GS(e={}){let t=e.storage??WS(),n=()=>{try{return US(t?.getItem(HS))}catch{return Bx.initial}},r=n(),i=new Set,a=e=>{if(e!==r){r=e;for(let e of i)e()}},o=()=>{try{r===Bx.initial?t?.removeItem(HS):t?.setItem(HS,String(r))}catch{}},s=e=>{let t=e.key;(t===null||t===`neko.panelWidth`)&&a(n())},c=e.target??(typeof window>`u`?void 0:window);return{get:()=>r,set(e){a(Hx(e))},commit(){o()},reset(){a(Bx.initial),o()},subscribe(e){return i.size===0&&c?.addEventListener(`storage`,s),i.add(e),()=>{i.delete(e),i.size===0&&c?.removeEventListener(`storage`,s)}}}}var KS;function qS(){return KS??=GS(),KS}function JS(e=qS()){return{width:(0,d.useSyncExternalStore)(e.subscribe,e.get,()=>Bx.initial),set:e.set,commit:e.commit,reset:e.reset}}var YS=`is-resizing-panel`;function XS({width:e,onChange:t,onCommit:n,onReset:r}){let i=z(),a=(0,d.useRef)(null),[o,s]=(0,d.useState)(!1),c=(0,d.useRef)(n);c.current=n;let l=()=>{a.current!==null&&(a.current=null,document.body.classList.remove(YS),s(!1),c.current())},u=(0,d.useRef)(l);return u.current=l,(0,d.useEffect)(()=>()=>u.current(),[]),(0,j.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":i(`panel.resize`),"aria-valuemin":Bx.min,"aria-valuemax":Bx.max,"aria-valuenow":e,tabIndex:0,"data-dragging":o,className:`resize-handle hidden lg:block`,onKeyDown:r=>{let i=r.key===`ArrowLeft`?e+Bx.step:r.key===`ArrowRight`?e-Bx.step:r.key===`Home`?Bx.min:r.key===`End`?Bx.max:null;i!==null&&(r.preventDefault(),r.stopPropagation(),t(Hx(i)),n())},onDoubleClick:r,onPointerDown:e=>{e.button===0&&a.current===null&&(a.current=e.pointerId,e.currentTarget.setPointerCapture?.(e.pointerId),document.body.classList.add(YS),s(!0))},onPointerMove:e=>{if(a.current!==e.pointerId)return;let n=window.innerWidth*Vx;t(Hx(Math.min(window.innerWidth-e.clientX,n)))},onPointerUp:l,onPointerCancel:l,onLostPointerCapture:l})}var ZS=1e3,QS=e=>e instanceof Error?e.message:String(e);function $S({sessionId:e,job:t}){let n=z(),r=t.jobId,i=(0,d.useRef)(new FS),[,a]=(0,d.useState)(0),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(!0),[u,f]=(0,d.useState)(!1),p=(0,d.useRef)(!0),m=(0,d.useRef)(null),h=t.status===`running`,g=(0,d.useRef)(h);g.current=h;let[_,v]=(0,d.useState)(Date.now);(0,d.useEffect)(()=>{if(!h)return;let e=setInterval(()=>v(Date.now()),ZS);return()=>clearInterval(e)},[h]),(0,d.useEffect)(()=>{let t=!1,n,o=async()=>{let c=g.current;try{let l=await d_.jobOutput(e,r,i.current.offset);if(t)return;i.current.apply(l,BS),s(``),a(e=>e+1),c&&(n=setTimeout(()=>void o(),ZS))}catch(e){t||s(QS(e))}};return o(),()=>{t=!0,clearTimeout(n)}},[e,r]),(0,d.useLayoutEffect)(()=>{let e=m.current;e&&p.current&&(e.scrollTop=e.scrollHeight)});let y=(0,d.useCallback)(()=>{let e=m.current;e&&(p.current=!0,l(!0),e.scrollTop=e.scrollHeight)},[]),b=()=>{u||(f(!0),d_.jobStop(e,r).catch(e=>s(QS(e))).finally(()=>f(!1)))},x=i.current.text;return(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 p-3 text-xs`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`font-medium text-ink-800`,children:LS(t,_)}),h&&(0,j.jsx)(`button`,{type:`button`,disabled:u,className:`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 disabled:opacity-50`,onClick:b,children:n(u?`job.stopping`:`job.stop`)})]}),(0,j.jsx)(`code`,{className:`max-h-20 overflow-auto whitespace-pre-wrap break-all text-ink-700`,children:t.command}),(0,j.jsx)(`span`,{className:`break-all text-ink-500`,children:t.cwd})]}),o&&(0,j.jsx)(`p`,{role:`alert`,className:`shrink-0 p-3 text-sm text-sakura-800`,children:o}),(0,j.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,j.jsxs)(`div`,{ref:m,"data-testid":`job-output`,className:`h-full overflow-y-auto overflow-x-hidden p-3`,onScroll:e=>{let t=VS(e.currentTarget);p.current=t,l(t)},children:[i.current.dropped>0&&(0,j.jsx)(`p`,{className:`mb-2 text-xs text-sakura-800`,children:n(`job.dropped`,{count:i.current.dropped})}),x===``?(0,j.jsx)(`p`,{className:`text-xs text-ink-500`,children:i.current.offset===void 0?n(`job.reading`):n(`job.noOutput`)}):(0,j.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-ink-800`,children:x})]}),!c&&(0,j.jsx)(`button`,{type:`button`,onClick:y,className:`focus-neko discrete-in absolute right-3 bottom-3 rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,children:n(`job.toBottom`)})]})]})}function eC({sessionId:e,jobs:t,open:n,onClose:r}){let i=z(),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(Date.now),l=JS(),u=(0,d.useRef)(null),f=(0,d.useRef)(null),[p,m]=(0,d.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,d.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>m(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let h=MS(t,s);(0,d.useEffect)(()=>{if(!n||h.running===0)return;let e=setInterval(()=>c(Date.now()),ZS);return()=>clearInterval(e)},[n,h.running]),(0,d.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=p&&f.current?.parentElement?[...f.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==f.current):[],r=t.map(e=>e.inert);return t.forEach(e=>{e.inert=!0}),u.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,p]);let g=h.rows.find(e=>e.job.jobId===a)??h.rows[0];return(0,j.jsxs)(`aside`,{ref:f,role:p?`dialog`:`complementary`,"aria-modal":p&&n?!0:void 0,"aria-label":i(`job.panel`),style:{"--panel-w":`${l.width}px`},className:`${n?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:relative lg:z-auto lg:w-[var(--panel-w)] lg:max-w-[60vw] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),r())}},children:[(0,j.jsx)(XS,{width:l.width,onChange:l.set,onCommit:l.commit,onReset:l.reset}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,j.jsx)(`strong`,{className:`text-sm text-ink-800`,children:i(`job.panel`)}),(0,j.jsx)(`button`,{ref:u,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,onClick:r,children:i(`common.close`)})]}),h.rows.length===0?(0,j.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:i(`job.panelEmpty`)}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:h.rows.map(e=>(0,j.jsxs)(`button`,{type:`button`,"aria-pressed":g?.job.jobId===e.job.jobId,className:`focus-neko flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm ${g?.job.jobId===e.job.jobId?`bg-tianyi-100`:`hover:bg-sakura-50`}`,onClick:()=>o(e.job.jobId),children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,j.jsx)(`span`,{className:`text-tianyi-700`,children:e.job.jobId}),` · `,e.label]}),(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:LS(e.job,s)})]},e.job.jobId))}),n&&g&&(0,j.jsx)($S,{sessionId:e,job:g.job},`${e}:${g.job.jobId}`)]})]})}function tC(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var nC=tC();function rC(e){nC=e}var iC={exec:()=>null};function aC(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function oC(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(cC.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var sC=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),cC={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,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:aC(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:aC(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:aC(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:aC(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:aC(e=>RegExp(`^ {0,${e}}(?:</?(?:${CC})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:aC(e=>RegExp(`^ {0,${e}}>`))},lC=/^(?:[ \t]*(?:\n|$))+/,uC=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dC=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fC=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pC=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mC=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,hC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gC=oC(hC).replace(/bull/g,mC).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),_C=oC(hC).replace(/bull/g,mC).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),vC=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,yC=/^[^\n]+/,bC=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xC=oC(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,bC).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),SC=oC(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,mC).getRegex(),CC=`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`,wC=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,TC=oC(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,wC).replace(`tag`,CC).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),EC=e=>oC(vC).replace(`hr`,fC).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,CC).getRegex(),DC=EC(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),OC=EC(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),kC={blockquote:oC(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,OC).getRegex(),code:uC,def:xC,fences:dC,heading:pC,hr:fC,html:TC,lheading:gC,list:SC,newline:lC,paragraph:DC,table:iC,text:yC},AC=oC(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,fC).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,CC).getRegex(),jC={...kC,lheading:_C,table:AC,paragraph:oC(vC).replace(`hr`,fC).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,AC).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,CC).getRegex()},MC={...kC,html:oC(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,wC).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:iC,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oC(vC).replace(`hr`,fC).replace(`heading`,` *#{1,6} *[^
17
+ ]`).replace(`lheading`,gC).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},NC=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PC=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FC=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,IC=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,LC=/[\p{P}\p{S}]/u,RC=/[\s\p{P}\p{S}]/u,zC=/[^\s\p{P}\p{S}]/u,BC=oC(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,RC).getRegex(),VC=/[\p{Pi}\p{Ps}"']/u,HC=/(?!~)[\p{P}\p{S}]/u,UC=/(?!~)[\s\p{P}\p{S}]/u,WC=/(?:[^\s\p{P}\p{S}]|~)/u,GC=oC(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,sC?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),KC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qC=oC(KC,`u`).replace(/punct/g,LC).getRegex(),JC=oC(KC,`u`).replace(/punct/g,HC).getRegex(),YC=oC(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,VC).replace(/punct/g,LC).getRegex(),XC=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ZC=oC(XC,`gu`).replace(/notPunctSpace/g,zC).replace(/punctSpace/g,RC).replace(/punct/g,LC).getRegex(),QC=oC(XC,`gu`).replace(/notPunctSpace/g,WC).replace(/punctSpace/g,UC).replace(/punct/g,HC).getRegex(),$C=oC(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zC).replace(/punctSpace/g,RC).replace(/punct/g,LC).getRegex(),ew=oC(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,zC).replace(/punctSpace/g,RC).replace(/punct/g,LC).getRegex(),tw=oC(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zC).replace(/punctSpace/g,RC).replace(/punct/g,LC).getRegex(),nw=oC(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,LC).getRegex(),rw=oC(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zC).replace(/punctSpace/g,RC).replace(/punct/g,LC).getRegex(),iw=oC(/\\(punct)/,`gu`).replace(/punct/g,LC).getRegex(),aw=oC(/^<(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(),ow=oC(wC).replace(`(?:-->|$)`,`-->`).getRegex(),sw=oC(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,ow).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),cw=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,lw=oC(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,cw).getRegex(),uw=oC(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,lw).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),dw=oC(/^!?\[(label)\]\[(ref)\]/).replace(`label`,lw).replace(`ref`,bC).getRegex(),fw=oC(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,bC).getRegex(),pw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,mw=oC(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,cw).getRegex(),hw=oC(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,oC(/^!?\[(label)\]\[(ref)\]/).replace(`label`,mw).replace(`ref`,pw).getRegex()).replace(`nolink`,oC(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,pw).getRegex()).getRegex(),gw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,_w=oC(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),vw={_backpedal:iC,anyPunctuation:iw,autolink:aw,blockSkip:GC,br:FC,code:PC,del:iC,delLDelim:iC,delRDelim:iC,emStrongLDelim:qC,emStrongRDelimAst:ZC,emStrongRDelimUnd:ew,escape:NC,link:uw,nolink:fw,punctuation:BC,reflink:dw,reflinkSearch:hw,tag:sw,text:IC,url:iC},yw={...vw,emStrongLDelim:YC,emStrongRDelimAst:$C,emStrongRDelimUnd:tw,link:oC(/^!?\[(label)\]\((.*?)\)/).replace(`label`,lw).getRegex(),reflink:oC(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,lw).getRegex()},bw={...vw,emStrongRDelimAst:QC,emStrongLDelim:JC,delLDelim:nw,delRDelim:rw,url:oC(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,_w).replace(`protocol`,gw).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:oC(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,gw).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},xw={...bw,br:oC(FC).replace(`{2,}`,`*`).getRegex(),text:oC(bw.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Sw={normal:kC,gfm:jC,pedantic:MC},Cw={normal:vw,gfm:bw,breaks:xw,pedantic:yw},ww={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Tw=e=>ww[e];function Ew(e,t){if(t){if(cC.escapeTest.test(e))return e.replace(cC.escapeReplace,Tw)}else if(cC.escapeTestNoEncode.test(e))return e.replace(cC.escapeReplaceNoEncode,Tw);return e}function Dw(e){return e.replace(cC.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function Ow(e){try{e=encodeURI(e).replace(cC.percentDecode,`%`)}catch{return null}return e}function kw(e,t){let n=e.replace(cC.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(cC.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(cC.slashPipe,`|`);return n}function Aw(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 jw(e){let t=e.split(`
18
+ `),n=t.length-1;for(;n>=0&&cC.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
19
+ `)}function Mw(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Nw(e,t){if(e.indexOf(t[0])===-1&&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 Pw(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 Fw(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function Iw(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
20
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
21
+ `)}function Lw(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var Rw=class{options;rules;lexer;constructor(e){this.options=e||nC}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:jw(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Iw(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=Aw(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Aw(t[0],`
22
+ `),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:Aw(t[0],`
23
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Aw(t[0],`
24
+ `).split(`
25
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;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(`
26
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
27
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
28
+ ${s}`:s,r=r?`${r}
29
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
30
+ `),o=t.raw+`
31
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
32
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
33
+ ${d.join(`
34
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
35
+ `+e.join(`
36
+ `),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(`
37
+ `)}}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=t[2].split(`
38
+ `,1)[0],l=t[1].length,u=this.options.pedantic?Pw(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>Pw(e,l)),d=e.split(`
39
+ `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
40
+ `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
41
+ `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
42
+ `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
43
+ `+d}f=!d.trim(),r+=l+`
44
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=jw(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Nw(t[2],`()`)!==-1)return;let e=Mw(t[1]).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:Aw(t[0],`
45
+ `),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=kw(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
46
+ `):[],a={type:`table`,raw:Aw(t[0],`
47
+ `),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(kw(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:Aw(t[0],`
48
+ `),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)===`
49
+ `?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){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Lw(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Aw(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Nw(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 i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Fw(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.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 r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Lw(e,n[1],r,this.rules))return;let i=t[Mw((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Fw(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,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,autolink:!0,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:e?t[0]:Dw(t[0]),escaped:e}}}},zw=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||nC,this.options.tokenizer=this.options.tokenizer||new Rw,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:cC,block:Sw.normal,inline:Cw.normal};this.options.pedantic?(t.block=Sw.pedantic,t.inline=Cw.pedantic):this.options.gfm&&(t.block=Sw.gfm,t.inline=this.options.breaks?Cw.breaks:Cw.gfm),this.tokenizer.rules=t}static get rules(){return{block:Sw,inline:Cw}}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(cC.carriageReturn,`
50
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(cC.tabCharGlobal,` `).replace(cC.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
51
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
52
+ `)?``:`
53
+ `)+i.raw,n.text+=`
54
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
55
+ `)?``:`
56
+ `)+i.raw,n.text+=`
57
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
58
+ `)?``:`
59
+ `)+i.raw,r.text+=`
60
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
61
+ `)?``:`
62
+ `)+i.raw,n.text+=`
63
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Mw(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Mw(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Bw=class{options;parser;constructor(e){this.options=e||nC}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(cC.notSpaceStart)?.[0],i=e?e.replace(cC.endingNewline,``)+`
64
+ `:``;return r?`<pre><code class="language-`+Ew(r)+`">`+(n?i:Ew(i,!0))+`</code></pre>
65
+ `:`<pre><code>`+(n?i:Ew(i,!0))+`</code></pre>
66
+ `}blockquote({tokens:e}){return`<blockquote>
67
+ ${this.parser.parse(e)}</blockquote>
68
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
69
+ `}hr(e){return`<hr>
70
+ `}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+`>
71
+ `+r+`</`+i+`>
72
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
73
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
74
+ `}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>
75
+ <thead>
76
+ `+t+`</thead>
77
+ `+r+`</table>
78
+ `}tablerow({text:e}){return`<tr>
79
+ ${e}</tr>
80
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
81
+ `}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>${Ew(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Ew(n,!0):this.parser.parseInline(r),o=Ow(e);if(o===null)return a;e=Ew(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Ew(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ow(e);if(i===null)return Ew(n);e=i;let a=`<img src="${Ew(e)}" alt="${Ew(n)}"`;return t&&(a+=` title="${Ew(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Ew(e.text)}},Vw=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}},Hw=class e{options;renderer;textRenderer;constructor(e){this.options=e||nC,this.options.renderer=this.options.renderer||new Bw,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vw}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Uw=class{options;block;constructor(e){this.options=e||nC}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?zw.lex:zw.lexInline}provideParser(e=this.block){return e?Hw.parse:Hw.parseInline}},Ww=class{defaults=tC();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Hw;Renderer=Bw;TextRenderer=Vw;Lexer=zw;Tokenizer=Rw;Hooks=Uw;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 Bw(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 Rw(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 Uw;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Uw.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Uw.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return zw.lex(e,t??this.defaults)}parser(e,t){return Hw.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?zw.lex:zw.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Hw.parse:Hw.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?zw.lex:zw.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Hw.parse:Hw.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+=`
82
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ew(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},Gw=new Ww;function Kw(e,t){return Gw.parse(e,t)}Kw.options=Kw.setOptions=function(e){return Gw.setOptions(e),Kw.defaults=Gw.defaults,rC(Kw.defaults),Kw},Kw.getDefaults=tC,Kw.defaults=nC;function qw(...e){return Gw.use(...e),Kw.defaults=Gw.defaults,rC(Kw.defaults),Kw}Kw.use=qw,Kw.walkTokens=function(e,t){return Gw.walkTokens(e,t)},Kw.parseInline=Gw.parseInline,Kw.Parser=Hw,Kw.parser=Hw.parse,Kw.Renderer=Bw,Kw.TextRenderer=Vw,Kw.Lexer=zw,Kw.lexer=zw.lex,Kw.Tokenizer=Rw,Kw.Hooks=Uw,Kw.parse=Kw,Kw.options,Kw.setOptions,Kw.walkTokens,Kw.parseInline,Hw.parse,zw.lex;var Jw=/^image\/(png|jpeg|webp|gif)$/i,Yw=/^(https?:|mailto:)/i,Xw=49152,Zw=`default-src 'none'; img-src data:; style-src 'unsafe-inline'`,Qw=`
83
+ :root{color-scheme:light dark;--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--user:#eef4ff;--code:#f6f8fa}
84
+ @media(prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8b949e;--border:#30363d;--user:#16243a;--code:#161b22}}
85
+ body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
86
+ main{max-width:860px;margin:0 auto;padding:24px 16px 64px}
87
+ h1{font-size:1.5rem;margin:0 0 4px}
88
+ .meta{color:var(--muted);font-size:.85rem;margin:0 0 24px}
89
+ .msg{margin:16px 0;padding:12px 16px;border:1px solid var(--border);border-radius:12px}
90
+ .msg.user{background:var(--user)}
91
+ .role{font-size:.75rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
92
+ .text{white-space:pre-wrap;overflow-wrap:anywhere}
93
+ .system{text-align:center;color:var(--muted);font-size:.85rem;margin:16px 0}
94
+ .md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}
95
+ .md pre,pre{background:var(--code);border-radius:8px;padding:10px 12px;overflow:auto;font-size:.85rem;white-space:pre-wrap;overflow-wrap:anywhere}
96
+ .md code{background:var(--code);border-radius:4px;padding:1px 4px}.md pre code{background:none;padding:0}
97
+ .md table{border-collapse:collapse}.md th,.md td{border:1px solid var(--border);padding:4px 8px}
98
+ .md blockquote{margin:0;padding-left:12px;border-left:3px solid var(--border);color:var(--muted)}
99
+ details{margin:8px 0}summary{cursor:pointer;color:var(--muted)}
100
+ details.tool{border:1px solid var(--border);border-radius:8px;padding:6px 12px;margin:12px 0}
101
+ details.tool.error>summary .status{color:#cf222e}
102
+ .label{font-size:.75rem;color:var(--muted);margin-top:8px}
103
+ .note{color:var(--muted);font-style:italic;margin-top:6px}
104
+ figure{margin:8px 0}img{max-width:100%;height:auto;border-radius:8px}figcaption,.placeholder{color:var(--muted);font-size:.8rem}
105
+ `,$w=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#39;`),eT=new Ww({gfm:!0,breaks:!0,renderer:{html:({text:e})=>$w(e),link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n);if(!Yw.test(e.trim()))return r;let i=t?` title="${$w(t)}"`:``;return`<a href="${$w(e)}"${i} rel="noopener noreferrer" target="_blank">${r}</a>`},image({href:e,text:t}){let n=`[image: ${$w(t||e)}]`;return Yw.test(e.trim())?`<a href="${$w(e)}" rel="noopener noreferrer" target="_blank">${n}</a>`:n}}});async function tT(e,t){let n=new Map,r=0,i=0;for(let a of e)if(a.type===`user`||a.type===`tool`)for(let e of a.images??[]){let a=null;if(t===void 0)a=`not embedded`;else if(r+e.bytes>33554432)a=`over the embedding size limit`;else try{let i=await t(e);if(!Jw.test(i.mimeType))a=`unsupported image type`;else if(r+i.bytes.length>33554432)a=`over the embedding size limit`;else{r+=i.bytes.length;let t=[];for(let e=0;e<i.bytes.length;e+=Xw)t.push(Ui(i.bytes.subarray(e,e+Xw)));n.set(`${e.entryId}:${e.contentIndex}`,{src:`data:${i.mimeType.toLowerCase()};base64,${t.join(``)}`})}}catch{a=`image unavailable`}a!==null&&(n.set(`${e.entryId}:${e.contentIndex}`,{reason:a}),i++)}return{embedded:n,skipped:i}}function nT(e,t){return(e??[]).map(e=>{let n=t.get(`${e.entryId}:${e.contentIndex}`),r=$w(b_(e));return n!==void 0&&`src`in n?`<figure><img src="${n.src}" alt="${$w(e.name)}"><figcaption>${r}</figcaption></figure>`:`<p class="placeholder">[image: ${r}${n!==void 0&&`reason`in n?` — ${n.reason}`:``}]</p>`}).join(``)}async function rT(e,t){let{embedded:n,skipped:r}=await tT(e.items,t.loadImage),i=$w(w_(e.title)||`neko-session`),a=[];for(let r of e.items)if(r.type===`system`)a.push(`<div class="system">${$w(w_(r.text))}</div>`);else if(r.type===`user`){let e=__(r);a.push(`<section class="msg user"><div class="role">User</div>${e===``?``:`<div class="text">${$w(e)}</div>`}${nT(r.images,n)}</section>`)}else if(r.type===`assistant`){let e=t.includeThinking&&r.thinking.trim()!==``?`<details class="thinking"><summary>Thinking</summary><div class="text">${$w(r.thinking.trim())}</div></details>`:``,n=r.text.trim()===``?``:`<div class="md">${eT.parse(r.text.trim(),{async:!1})}</div>`,i=r.note===null?``:`<div class="note">${$w(w_(r.note))}</div>`;a.push(`<section class="msg assistant"><div class="role">Assistant</div>${e}${n}${i}</section>`)}else{let e=v_(r),t=y_(r),i=[`<b>Tool</b> ${$w(r.name)}`,r.summary===``?``:`<span class="args">${$w(w_(r.summary))}</span>`,e===`ok`?``:`<span class="status">[${e}]</span>`,r.durationMs===null?``:`<span class="duration">(${C_(r.durationMs)})</span>`].filter(Boolean).join(` `),o=r.codemode===void 0||r.codemode.calls.length===0?``:`<div class="label">Calls</div><pre>${$w([...r.codemode.calls.map(x_),...r.codemode.omitted>0?[S_(r.codemode.omitted)]:[]].join(`
106
+ `))}</pre>`;a.push(`<details class="tool ${e}"><summary>${i}</summary>${r.detail===null||r.detail===``?``:`<pre${r.codemode===void 0?``:` class="language-javascript"`}>${$w(r.detail)}</pre>`}${o}${t===``?``:`<div class="label">${e===`running`?`Output so far`:`Result`}</div><pre>${$w(t)}</pre>`}${r.note===null?``:`<div class="note">${$w(w_(r.note))}</div>`}${nT(r.images,n)}</details>`)}return{content:`<!doctype html>
107
+ <html lang="en">
108
+ <head>
109
+ <meta charset="utf-8">
110
+ <meta http-equiv="Content-Security-Policy" content="${Zw}">
111
+ <meta name="viewport" content="width=device-width, initial-scale=1">
112
+ <title>${i}</title>
113
+ <style>${Qw}</style>
114
+ </head>
115
+ <body>
116
+ <main>
117
+ <h1>${i}</h1>
118
+ <p class="meta">${$w(w_(e.model))} · ${$w(w_(e.cwd))} · ${$w(e.exportedAt.toISOString())}</p>
119
+ ${a.join(`
120
+ `)}
121
+ </main>
122
+ </body>
123
+ </html>
124
+ `,skippedImages:r}}var iT={markdown:`md`,html:`html`,json:`json`},aT={markdown:`text/markdown;charset=utf-8`,html:`text/html;charset=utf-8`,json:`application/json;charset=utf-8`},oT=60;function sT(e){return e.type===`user`?__(e):e.type===`assistant`?e.text.trim():``}function cT(e,t,n){let r=e.replace(/[\\/:*?"<>|\u0000-\u001f\u007f]/g,`-`).replace(/\s+/g,` `).replace(/-{2,}/g,`-`),i=Array.from(r).slice(0,oT).join(``).replace(/^[\s.-]+|[\s.-]+$/g,``)||`neko-session`,a=(e,t=2)=>String(e).padStart(t,`0`);return`${i}-${`${a(n.getFullYear(),4)}${a(n.getMonth()+1)}${a(n.getDate())}-${a(n.getHours())}${a(n.getMinutes())}${a(n.getSeconds())}`}.${iT[t]}`}async function lT(e,t,n){if(t.items.length===0)throw Error(`Nothing to export yet - start a conversation first`);let r=iT[e],i=aT[e];if(e===`html`){let{content:e,skippedImages:a}=await rT(t,n);return{content:e,mimeType:i,extension:r,skippedImages:a}}return{content:e===`markdown`?fT(t,n):mT(t,n),mimeType:i,extension:r,skippedImages:0}}function uT(e,t=``){let n=0;for(let t of e.matchAll(/`+/g))n=Math.max(n,t[0].length);let r="`".repeat(Math.max(3,n+1));return`${r}${t}\n${e}\n${r}`}var dT=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`);function fT(e,t){let n=[`# ${w_(e.title)||`neko-session`}`,``,`- **Model:** ${w_(e.model)}`,`- **Workspace:** ${w_(e.cwd)}`,`- **Exported:** ${e.exportedAt.toISOString()}`,``],r=null,i=e=>{r!==e&&(r=e,n.push(`---`,``,e===`user`?`## User`:`## Assistant`,``))};for(let a of e.items)if(a.type===`system`)r=null,n.push(`---`,``,`*${dT(w_(a.text))}*`,``);else if(a.type===`user`){i(`user`);let e=__(a);e!==``&&n.push(e,``);for(let e of a.images??[])n.push(`> [image] ${dT(b_(e))}`,``)}else a.type===`assistant`?(i(`assistant`),t.includeThinking&&a.thinking.trim()!==``&&n.push(`<details>`,`<summary>Thinking</summary>`,``,a.thinking.trim(),``,`</details>`,``),a.text.trim()!==``&&n.push(a.text.trim(),``),a.note!==null&&n.push(`> ${dT(w_(a.note))}`,``)):(i(`assistant`),n.push(...pT(a)));return`${n.join(`
125
+ `).trimEnd()}\n`}function pT(e){let t=v_(e),n=[`<details>`,`<summary>${dT([`Tool: ${e.name}`,e.summary===``?``:`· ${w_(e.summary)}`,t===`ok`?``:`[${t}]`,e.durationMs===null?``:`(${C_(e.durationMs)})`].filter(Boolean).join(` `))}</summary>`,``];if(e.detail!==null&&e.detail!==``&&n.push(uT(e.detail,e.codemode===void 0?``:`javascript`),``),e.codemode!==void 0&&e.codemode.calls.length>0){let t=e.codemode.calls.map(x_);e.codemode.omitted>0&&t.push(S_(e.codemode.omitted)),n.push(`Calls:`,``,uT(t.join(`
126
+ `)),``)}let r=y_(e);r!==``&&n.push(t===`running`?`Output so far:`:`Result:`,``,uT(r),``),e.note!==null&&n.push(`> ${dT(w_(e.note))}`,``);for(let t of e.images??[])n.push(`> [image] ${dT(b_(t))}`,``);return n.push(`</details>`,``),n}function mT(e,t){let n=e.items.map(e=>{switch(e.type){case`user`:return{type:`user`,text:__(e),images:(e.images??[]).map(({name:e,mimeType:t,width:n,height:r,bytes:i})=>({name:e,mimeType:t,width:n,height:r,bytes:i}))};case`assistant`:return{type:`assistant`,text:e.text,...t.includeThinking&&e.thinking.trim()!==``?{thinking:e.thinking}:{},stopReason:e.stopReason,note:e.note};case`tool`:return{type:`tool`,name:e.name,summary:e.summary,detail:e.detail,status:e.phase,isError:e.isError,result:y_(e),...e.codemode===void 0?{}:{codemode:e.codemode},durationMs:e.durationMs,note:e.note,images:(e.images??[]).map(({name:e,mimeType:t,width:n,height:r,bytes:i})=>({name:e,mimeType:t,width:n,height:r,bytes:i}))};default:return{type:`system`,text:e.text}}});return`${JSON.stringify({format:`neko-conversation`,version:1,session:{id:e.sessionId,title:e.title,model:e.model,cwd:e.cwd,exportedAt:e.exportedAt.toISOString()},items:n},null,2)}\n`}var hT={pending:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`,answered:`border-ink-200 bg-ink-50 text-ink-700`,skipped:`border-ink-200 bg-ink-50 text-ink-700`,cancelled:`border-sakura-300 bg-sakura-50 text-sakura-800`};function gT(e,t){return e.status===`answered`?t(`askUser.answer`,{answer:z_(H_(e))}):e.status===`skipped`?t(`askUser.skipped`):e.status===`cancelled`?t(`askUser.cancelled`):null}function _T({interaction:e,onLocate:t}){let n=z(),r=gT(e,n);return(0,j.jsxs)(`section`,{"aria-label":n(`askUser.record`),"data-ask-user-row":!0,"data-status":e.status,className:`rounded-card border border-tianyi-200 bg-surface px-3 py-2 text-sm shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,j.jsx)(Ux,{name:`sparkles`,size:12}),n(`askUser.badge`)]}),(0,j.jsx)(`span`,{className:`shrink-0 rounded-full border px-2 py-0.5 text-xs font-medium ${hT[e.status]}`,children:I_(e.status)}),t&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko ml-auto shrink-0 rounded-full border border-tianyi-300 px-3 py-1 text-xs text-tianyi-900 hover:bg-tianyi-50`,onClick:t,children:n(`askUser.locate`)})]}),(0,j.jsx)(`p`,{className:`mt-1.5 max-h-40 overflow-y-auto whitespace-pre-wrap break-words text-ink-900`,children:z_(e.question)}),r!==null&&(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-xs text-ink-700`,children:r})]})}function vT(e,t){this.v=e,this.k=t}function yT(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 bT(e){if(Array.isArray(e))return e}function xT(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}}function ST(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
127
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CT(e,t){return bT(e)||xT(e,t)||wT(e,t)||ST()}function wT(e,t){if(e){if(typeof e==`string`)return yT(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yT(e,t):void 0}}function TT(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof vT;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}TT.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},TT.prototype.next=function(e){return this._invoke(`next`,e)},TT.prototype.throw=function(e){return this._invoke(`throw`,e)},TT.prototype.return=function(e){return this._invoke(`return`,e)};var ET=Object.entries,DT=Object.setPrototypeOf,OT=Object.isFrozen,kT=Object.getPrototypeOf,AT=Object.getOwnPropertyDescriptor,jT=Object.freeze,MT=Object.seal,NT=Object.create,PT=typeof Reflect<`u`&&Reflect,FT=PT.apply,IT=PT.construct;jT||=function(e){return e},MT||=function(e){return e},FT||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},IT||=function(e){return new e(...[...arguments].slice(1))};var LT=rE(Array.prototype.forEach);Array.prototype.indexOf;var RT=rE(Array.prototype.lastIndexOf),zT=rE(Array.prototype.pop),BT=rE(Array.prototype.push);Array.prototype.slice;var VT=rE(Array.prototype.splice),HT=Array.isArray,UT=rE(String.prototype.toLowerCase),WT=rE(String.prototype.toString),GT=rE(String.prototype.match),KT=rE(String.prototype.replace),qT=rE(String.prototype.indexOf),JT=rE(String.prototype.trim),YT=rE(Number.prototype.toString),XT=rE(Boolean.prototype.toString),ZT=typeof BigInt>`u`?null:rE(BigInt.prototype.toString),QT=typeof Symbol>`u`?null:rE(Symbol.prototype.toString),$T=rE(Object.prototype.hasOwnProperty),eE=rE(Object.prototype.toString),tE=rE(RegExp.prototype.test),nE=iE(TypeError);function rE(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return FT(e,t,n)}}function iE(e){return function(){return IT(e,[...arguments])}}function aE(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:UT;if(DT&&DT(e,null),!HT(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(OT(t)||(t[r]=e),i=e)}e[i]=!0}return e}function oE(e){for(let t=0;t<e.length;t++)$T(e,t)||(e[t]=null);return e}function sE(e){let t=NT(null);for(let r of ET(e)){var n=CT(r,2);let i=n[0],a=n[1];$T(e,i)&&(t[i]=HT(a)?oE(a):a&&typeof a==`object`&&a.constructor===Object?sE(a):a)}return t}function cE(e){switch(typeof e){case`string`:return e;case`number`:return YT(e);case`boolean`:return XT(e);case`bigint`:return ZT?ZT(e):`0`;case`symbol`:return QT?QT(e):`Symbol()`;case`undefined`:return eE(e);case`function`:case`object`:{if(e===null)return eE(e);let t=e,n=lE(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:eE(e)}return eE(e)}default:return eE(e)}}function lE(e,t){for(;e!==null;){let n=AT(e,t);if(n){if(n.get)return rE(n.get);if(typeof n.value==`function`)return rE(n.value)}e=kT(e)}function n(){return null}return n}function uE(e){try{return tE(e,``),!0}catch{return!1}}var dE=jT(`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(`.`)),fE=jT(`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(`.`)),pE=jT([`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`]),mE=jT([`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`]),hE=jT(`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(`.`)),gE=jT([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),_E=jT([`#text`]),vE=jT(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),yE=jT(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),bE=jT(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),xE=jT([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),SE=MT(/{{[\w\W]*|^[\w\W]*}}/g),CE=MT(/<%[\w\W]*|^[\w\W]*%>/g),wE=MT(/\${[\w\W]*/g),TE=MT(/^data-[\-\w.\u00B7-\uFFFF]+$/),EE=MT(/^aria-[\-\w]+$/),DE=MT(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),OE=MT(/^(?:\w+script|data):/i),kE=MT(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),AE=MT(/^html$/i),jE=MT(/^[a-z][.\w]*(-[.\w]+)+$/i),ME=MT(/<[/\w!]/g),NE=MT(/<[/\w]/g),PE=MT(/<\/no(script|embed|frames)/i),FE=MT(/\/>/i),IE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},LE=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],RE=jT(aE({},LE)),zE=function(){let e={};return LT(LE,t=>{e[t]=MT(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),jT(e)}(),BE=function(){return typeof window>`u`?null:window},VE=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}},HE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},UE=function(e,t,n,r){return $T(e,t)&&HT(e[t])?aE(r.base?sE(r.base):{},e[t],r.transform):n},WE=function(e,t,n){let r=$T(e,t)?e[t]:void 0;return r&&typeof r==`object`?sE(r):n()};function GE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:BE(),t=e=>GE(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==IE.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=lE(d,`cloneNode`),p=lE(d,`remove`),m=lE(d,`removeAttributeNode`),h=lE(d,`nextSibling`),g=lE(d,`childNodes`),_=lE(d,`parentNode`),v=lE(d,`shadowRoot`),y=lE(d,`attributes`),b=o&&o.prototype?lE(o.prototype,`nodeType`):null,x=o&&o.prototype?lE(o.prototype,`nodeName`):null,S=o&&o.prototype?lE(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,ee,te=!1,ne=0,D=function(){if(ne>0)throw nE(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},re=function(e){D(),ne++;try{return T.createHTML(e)}finally{ne--}},ie=function(e){D(),ne++;try{return T.createScriptURL(e)}finally{ne--}},O=function(){return te||=(ee=VE(u,i),!0),ee},ae=n,oe=ae.implementation,se=ae.createNodeIterator,ce=ae.createDocumentFragment,le=ae.getElementsByTagName,ue=r.importNode,de=HE();t.isSupported=typeof ET==`function`&&typeof _==`function`&&oe&&oe.createHTMLDocument!==void 0;let fe=SE,pe=CE,me=wE,he=TE,ge=EE,_e=OE,ve=kE,ye=jE,k=DE,A=null,be=aE({},[...dE,...fE,...pE,...hE,..._E]),xe=null,Se=aE({},[...vE,...yE,...bE,...xE]),Ce=Object.seal(NT(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}})),we=null,Te=null,Ee=Object.seal(NT(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),De=!0,Oe=!0,ke=!1,Ae=!0,je=!1,Me=!0,Ne=!1,Pe=!1,Fe=null,Ie=null,Le=!1,Re=!1,ze=!1,Be=!1,Ve=!0,He=!1,Ue=`user-content-`,We=!0,Ge=!1,Ke={},qe=null,Je=aE({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ye=null,Xe=aE({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ze=null,Qe=aE({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,et=`http://www.w3.org/2000/svg`,tt=`http://www.w3.org/1999/xhtml`,nt=tt,rt=!1,it=null,at=aE({},[$e,et,tt],WT),ot=jT([`mi`,`mo`,`mn`,`ms`,`mtext`]),st=aE({},ot),ct=jT([`annotation-xml`]),lt=aE({},ct),ut=aE({},[`title`,`style`,`font`,`a`,`script`]),dt=null,ft=[`application/xhtml+xml`,`text/html`],pt=null,mt=null,ht=n.createElement(`form`),gt=function(e){return e instanceof RegExp||e instanceof Function},_t=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mt&&mt===e)return;(!e||typeof e!=`object`)&&(e={}),e=sE(e),dt=ft.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,pt=dt===`application/xhtml+xml`?WT:UT,A=UE(e,`ALLOWED_TAGS`,be,{transform:pt}),xe=UE(e,`ALLOWED_ATTR`,Se,{transform:pt}),it=UE(e,`ALLOWED_NAMESPACES`,at,{transform:WT}),Ze=UE(e,`ADD_URI_SAFE_ATTR`,Qe,{transform:pt,base:Qe}),Ye=UE(e,`ADD_DATA_URI_TAGS`,Xe,{transform:pt,base:Xe}),qe=UE(e,`FORBID_CONTENTS`,Je,{transform:pt}),we=UE(e,`FORBID_TAGS`,sE({}),{transform:pt}),Te=UE(e,`FORBID_ATTR`,sE({}),{transform:pt}),Ke=$T(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?sE(e.USE_PROFILES):e.USE_PROFILES:!1,De=e.ALLOW_ARIA_ATTR!==!1,Oe=e.ALLOW_DATA_ATTR!==!1,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=e.SAFE_FOR_TEMPLATES||!1,Me=e.SAFE_FOR_XML!==!1,Ne=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ve=e.SANITIZE_DOM!==!1,He=e.SANITIZE_NAMED_PROPS||!1,We=e.KEEP_CONTENT!==!1,Ge=e.IN_PLACE||!1,k=uE(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:DE,nt=typeof e.NAMESPACE==`string`?e.NAMESPACE:tt,st=WE(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>aE({},ot)),lt=WE(e,`HTML_INTEGRATION_POINTS`,()=>aE({},ct));let t=WE(e,`CUSTOM_ELEMENT_HANDLING`,()=>NT(null));if(Ce=NT(null),$T(t,`tagNameCheck`)&&gt(t.tagNameCheck)&&(Ce.tagNameCheck=t.tagNameCheck),$T(t,`attributeNameCheck`)&&gt(t.attributeNameCheck)&&(Ce.attributeNameCheck=t.attributeNameCheck),$T(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Ce.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),MT(Ce),je&&(Oe=!1),ze&&(Re=!0),Ke&&(A=aE({},_E),xe=NT(null),Ke.html===!0&&(aE(A,dE),aE(xe,vE)),Ke.svg===!0&&(aE(A,fE),aE(xe,yE),aE(xe,xE)),Ke.svgFilters===!0&&(aE(A,pE),aE(xe,yE),aE(xe,xE)),Ke.mathMl===!0&&(aE(A,hE),aE(xe,bE),aE(xe,xE))),Ee.tagCheck=null,Ee.attributeCheck=null,$T(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ee.tagCheck=e.ADD_TAGS:HT(e.ADD_TAGS)&&(A===be&&(A=sE(A)),aE(A,e.ADD_TAGS,pt))),$T(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ee.attributeCheck=e.ADD_ATTR:HT(e.ADD_ATTR)&&(xe===Se&&(xe=sE(xe)),aE(xe,e.ADD_ATTR,pt))),$T(e,`ADD_FORBID_CONTENTS`)&&HT(e.ADD_FORBID_CONTENTS)&&(qe===Je&&(qe=sE(qe)),aE(qe,e.ADD_FORBID_CONTENTS,pt)),We&&(A[`#text`]=!0),Ne&&aE(A,[`html`,`head`,`body`]),A.table&&(aE(A,[`tbody`]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw nE(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw nE(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=re(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=O()),T&&typeof E==`string`&&(E=re(``)));jT&&jT(e),mt=e},vt=aE({},[...fE,...pE,...mE]),yt=aE({},[...hE,...gE]),bt=function(e,t,n){return t.namespaceURI===tt?e===`svg`:t.namespaceURI===$e?e===`svg`&&(n===`annotation-xml`||st[n]):!!vt[e]},xt=function(e,t,n){return t.namespaceURI===tt?e===`math`:t.namespaceURI===et?e===`math`&&lt[n]:!!yt[e]},St=function(e,t,n){return t.namespaceURI===et&&!lt[n]||t.namespaceURI===$e&&!st[n]?!1:!yt[e]&&(ut[e]||!vt[e])},Ct=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:nt,tagName:`template`});let n=UT(e.tagName),r=UT(t.tagName);return it[e.namespaceURI]?e.namespaceURI===et?bt(n,t,r):e.namespaceURI===$e?xt(n,t,r):e.namespaceURI===tt?St(n,t,r):!!(dt===`application/xhtml+xml`&&it[e.namespaceURI]):!1},wt=function(e){BT(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw nE(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Tt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Et=function(e){kt(e);let t=g(e);if(t){let e=[];LT(t,t=>{BT(e,t)}),LT(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Tt(e,r,i)}},Dt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}BT(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Re||ze)try{wt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ot=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||xe[pt(i)]||Tt(e,r,i)}},kt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===IE.element&&Ot(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},At=function(e,t){return Me?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},jt=function(e){if(!Me)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===IE.processingInstruction||n===IE.comment&&tE(NE,e.data)){try{p(e)}catch{}continue}if(n===IE.element){let t=e,n=pt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&At(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Mt=function(e){let t=null,r=null;if(Le)e=`<remove></remove>`+e;else{let t=GT(e,/^[\r\n\t ]+/);r=t&&t[0]}dt===`application/xhtml+xml`&&nt===tt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?re(e):e;if(nt===tt)try{t=new l().parseFromString(i,dt)}catch{}if(!t||!t.documentElement){t=oe.createDocument(nt,`template`,null);try{t.documentElement.innerHTML=rt?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),nt===tt?le.call(t,Ne?`html`:`body`)[0]:Ne?t.documentElement:a},Nt=function(e){let t=S?S(e):e.ownerDocument;return se.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pt=function(e){return e=KT(e,fe,` `),e=KT(e,pe,` `),e=KT(e,me,` `),e},Ft=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=se.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Pt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&LT(i,e=>{Lt(e.content)&&Ft(e.content)})},It=function(e){let t=x?x(e):null;return typeof t!=`string`||pt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Lt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===IE.documentFragment}catch{return!1}},Rt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function zt(e,n,r){e.length!==0&&LT(e,e=>{e.call(t,n,r,mt)})}let Bt=function(e,t){return!!(Me&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&tE(ME,e.textContent)&&tE(ME,e.innerHTML)||Me&&e.namespaceURI===tt&&RE[t]&&(Rt(e.firstElementChild)||typeof e.textContent==`string`&&tE(zE[t],e.textContent))||e.nodeType===IE.processingInstruction||Me&&e.nodeType===IE.comment&&tE(NE,e.data))},Vt=function(e,t){return e instanceof RegExp?tE(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Ht=function(e,t,n){if(!we[t]&&Jt(t)&&Vt(Ce.tagNameCheck,t))return!1;if(We&&!qe[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return wt(e),!0},Ut=function(e,t,n,r){return e.length===0?t:t===n||t===r?sE(t):t},Wt=function(e,t){return e===t||_(e)!==null?!1:(Ge&&kt(e),!0)},Gt=function(e,n){if(zt(de.beforeSanitizeElements,e,null),Wt(e,n))return!0;if(It(e))return wt(e),!0;let r=pt(w(e));if(A=Ut(de.uponSanitizeElement,A,be,Fe),zt(de.uponSanitizeElement,e,{tagName:r,allowedTags:A}),Wt(e,n))return!0;if(Bt(e,r))return wt(e),!0;if(we[r]||!(Ee.tagCheck instanceof Function&&Ee.tagCheck(r))&&!A[r]){let t=Ht(e,r,n);return t===!1&&(zt(de.afterSanitizeElements,e,null),Wt(e,n))?!0:t}if(C(e)===IE.element&&!Ct(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&tE(PE,e.innerHTML))return wt(e),!0;if(je&&e.nodeType===IE.text){let n=Pt(e.textContent);e.textContent!==n&&(BT(t.removed,{element:e.cloneNode()}),e.textContent=n)}return zt(de.afterSanitizeElements,e,null),Wt(e,n)},Kt=function(e,t,r){if(Te[t]||At(t,e)||Ve&&(t===`id`||t===`name`)&&(r in n||r in ht))return!1;let i=xe[t]||Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e);return Oe&&tE(he,t)||De&&tE(ge,t)?!0:i?Ze[t]||tE(k,KT(r,ve,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&qT(r,`data:`)===0&&Ye[e]||ke&&!tE(_e,KT(r,ve,``))?!0:!r:Jt(e)&&Vt(Ce.tagNameCheck,e)&&Vt(Ce.attributeNameCheck,t,e)||t===`is`&&Ce.allowCustomizedBuiltInElements&&Vt(Ce.tagNameCheck,r)},qt=aE({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Jt=function(e){return!qt[UT(e)]&&tE(ye,e)},Yt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return re(r);case`TrustedScriptURL`:return ie(r)}return r},Xt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!It(e)||(wt(e),!1)}catch{return Dt(t,e),!1}},Zt=function(e,n){if(zt(de.beforeSanitizeAttributes,e,null),Wt(e,n))return;let r=e.attributes;if(!r||It(e))return;xe=Ut(de.uponSanitizeAttribute,xe,Se,Ie);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0},a=r.length,o=pt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=pt(s),d=l,f=s===`value`?d:JT(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,zt(de.uponSanitizeAttribute,e,i),f=i.attrValue,He&&(u===`id`||u===`name`)&&qT(f,Ue)!==0&&(Dt(s,e,n),f=Ue+f,p=!0),Me&&tE(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&GT(f,`href`)?Dt(s,e,n):i.forceKeepAttr||(i.keepAttr?!Ae&&tE(FE,f)?Dt(s,e,n):(je&&(f=Pt(f)),Kt(o,u,f)?(f=Yt(o,u,c,f),f!==d&&Xt(e,s,c,f)&&p&&zT(t.removed)):Dt(s,e,n)):Dt(s,e,n))}zt(de.afterSanitizeAttributes,e,null),Wt(e,n)},Qt=function(e){let t=null,n=Nt(e);for(zt(de.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(zt(de.uponSanitizeShadowNode,t,null),Gt(t,e),Zt(t,e),Lt(t.content)&&Qt(t.content),C(t)===IE.element){let e=v(t);Lt(e)&&($t(e),Qt(e))}zt(de.afterSanitizeShadowDOM,e,null)},$t=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Qt(e.shadow);continue}let n=e.node,r=C(n)===IE.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&pt(e)===`template`){let e=n.content;Lt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Lt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(rt=!e,rt&&(e=`<!-->`),typeof e!=`string`&&!Rt(e)&&(e=cE(e),typeof e!=`string`))throw nE(`dirty is not a string, aborting`);if(!t.isSupported)return e;Pe?(A=Fe,xe=Ie):_t(n),(de.uponSanitizeElement.length>0||de.uponSanitizeAttribute.length>0)&&(A=sE(A)),de.uponSanitizeAttribute.length>0&&(xe=sE(xe)),t.removed=[];let c=Ge&&typeof e!=`string`&&Rt(e);if(c){jt(e);let t=w(e);if(typeof t==`string`){let n=pt(t);if(!A[n]||we[n])throw Et(e),nE(`root node is forbidden and cannot be sanitized in-place`)}if(It(e))throw Et(e),nE(`root node is clobbered and cannot be sanitized in-place`);try{$t(e)}catch(t){throw Et(e),t}}else if(Rt(e))i=Mt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===IE.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),$t(i);else{if(!Re&&!je&&!Ne&&e.indexOf(`<`)===-1)return T&&Be?re(e):e;if(i=Mt(e),!i)return Re?null:Be?E:``}i&&Le&&wt(i.firstChild);let l=c?e:i;try{let e=Nt(l);for(;o=e.nextNode();)Gt(o,l),Zt(o,l),Lt(o.content)&&Qt(o.content)}catch(n){throw c&&(Et(e),LT(t.removed,e=>{e.element&&kt(e.element)})),n}if(c){let n=!1;if(LT(t.removed,t=>{t.element&&(t.element===e&&(n=!0),kt(t.element))}),n)throw nE(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return je&&Ft(e),e}if(Re){if(je&&Ft(i),ze)for(s=ce.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(xe.shadowroot||xe.shadowrootmode)&&(s=ue.call(r,s,!0)),s}let u=Ne?i.outerHTML:i.innerHTML;return Ne&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&tE(AE,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
128
+ `+u),je&&(u=Pt(u)),T&&Be?re(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(e),Pe=!0,Fe=A,Ie=xe},t.clearConfig=function(){mt=null,Pe=!1,Fe=null,Ie=null,T=ee,E=``},t.isValidAttribute=function(e,t,n){mt||_t({});let r=pt(e),i=pt(t);return Kt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&$T(de,e)&&BT(de[e],t)},t.removeHook=function(e,t){if($T(de,e)){if(t!==void 0){let n=RT(de[e],t);return n===-1?void 0:VT(de[e],n,1)[0]}return zT(de[e])}},t.removeHooks=function(e){$T(de,e)&&(de[e]=[])},t.removeAllHooks=function(){de=HE()},t}var KE=GE(),qE=c(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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}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=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([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]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,ee=`\\b\\d+(\\.\\d+)?`,te=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,ne=`\\b(0b[01]+)`,D=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,re=(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)},ie={begin:`\\\\[\\s\\S]`,relevance:0},O={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[ie]},ae={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[ie]},oe={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/},se=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},ce=se(`//`,`$`),le=se(`/\\*`,`\\*/`),ue=se(`#`,`$`),de=Object.freeze({__proto__:null,APOS_STRING_MODE:O,BACKSLASH_ESCAPE:ie,BINARY_NUMBER_MODE:{scope:`number`,begin:ne,relevance:0},BINARY_NUMBER_RE:ne,COMMENT:se,C_BLOCK_COMMENT_MODE:le,C_LINE_COMMENT_MODE:ce,C_NUMBER_MODE:{scope:`number`,begin:te,relevance:0},C_NUMBER_RE:te,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:ue,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:ee,relevance:0},NUMBER_RE:ee,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:ae,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ie,{begin:/\[/,end:/\]/,relevance:0,contains:[ie]}]},RE_STARTERS_RE:D,SHEBANG:re,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function fe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function pe(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function me(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=fe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function he(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ge(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 _e(e,t){e.relevance===void 0&&(e.relevance=1)}var ve=(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},ye=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],k=`keyword`;function A(e,t,n=k){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,A(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,be(n[0],n[1])]})}}function be(e,t){return t?Number(t):+!xe(e)}function xe(e){return ye.includes(e.toLowerCase())}var Se={},Ce=e=>{console.error(e)},we=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Te=(e,t)=>{Se[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Se[`${e}/${t}`]=!0)},Ee=Error();function De(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 Oe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ce(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Ee;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Ce(`beginScope must be object`),Ee;De(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function ke(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ce(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Ee;if(typeof e.endScope!=`object`||e.endScope===null)throw Ce(`endScope must be object`),Ee;De(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ae(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function je(e){Ae(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Oe(e),ke(e)}function Me(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);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{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;[pe,ge,je,ve].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[me,he,_e].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&&=A(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 Pe(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 Ne(e){return e?e.endsWithParent||Ne(e.starts):!1}function Pe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ne(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Fe=`11.12.0`,Ie=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Le=i,Re=a,ze=Symbol(`nomatch`),Be=7,Ve=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=O(n[1]);return t||(we(s.replace(`{}`,n[1])),we(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||O(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Te(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Te(`10.7.0`,`Please use highlight(code, options) instead.
129
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ue(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ue(`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(!D.keywords){ie.addText(ae);return}let e=0;D.keywordPatternRe.lastIndex=0;let t=D.keywordPatternRe.exec(ae),n=``;for(;t;){n+=ae.substring(e,t.index);let r=ee.case_insensitive?t[0].toLowerCase():t[0],i=u(D,r);if(i){let[e,a]=i;if(ie.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Be&&(oe+=a),e.startsWith(`_`))n+=t[0];else{let n=ee.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=D.keywordPatternRe.lastIndex,t=D.keywordPatternRe.exec(ae)}n+=ae.substring(e),ie.addText(n)}function f(){if(ae===``)return;let e=null;if(typeof D.subLanguage==`string`){if(!t[D.subLanguage]){ie.addText(ae);return}e=v(D.subLanguage,ae,!0,re[D.subLanguage]),re[D.subLanguage]=e._top}else e=S(ae,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(oe+=e.relevance),ie.__addSublanguage(e._emitter,e.language)}function p(){D.subLanguage==null?d():f(),ae=``}function m(e,t){e!==``&&(ie.startScope(t),ie.addText(e),ie.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=ee.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(ae=i,d(),ae=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&ie.openNode(ee.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(ae,ee.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),ae=``):e.beginScope._multi&&(h(e.beginScope,t),ae=``)),D=Object.create(e,{parent:{value:D}}),D}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 D.matcher.regexIndex===0?(ae+=e[0],1):(le=!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?ae+=t:(n.excludeBegin&&(ae+=t),p(),!n.returnBegin&&!n.excludeBegin&&(ae=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(D,e,r);if(!i)return ze;let a=D;D.endScope&&D.endScope._wrap?(p(),m(t,D.endScope._wrap)):D.endScope&&D.endScope._multi?(p(),h(D.endScope,e)):a.skip?ae+=t:(a.returnEnd||a.excludeEnd||(ae+=t),p(),a.excludeEnd&&(ae=t));do D.scope&&ie.closeNode(),!D.skip&&!D.subLanguage&&(oe+=D.relevance),D=D.parent;while(D!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=D;t!==ee;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>ie.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(ae+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(ae+=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 "`+(D.scope||`<unnamed>`)+`"`);throw e.mode=D,e}if(r.type===`end`){let e=C(r);if(e!==ze)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(ae+=`
130
+ `),1;if(ce>1e5&&ce>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return ae+=a,a.length}let ee=O(e);if(!ee)throw Ce(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let te=Me(ee),ne=``,D=a||te,re={},ie=new l.__emitter(l);w();let ae=``,oe=0,se=0,ce=0,le=!1;try{if(ee.__emitTokens)ee.__emitTokens(n,ie);else{for(D.matcher.considerAll();;){ce++,le?le=!1:D.matcher.considerAll(),D.matcher.lastIndex=se;let e=D.matcher.exec(n);if(!e)break;let t=E(n.substring(se,e.index),e);se=e.index+t}E(n.substring(se))}return ie.finalize(),ne=ie.toHTML(),{language:e,value:ne,relevance:oe,illegal:!1,_emitter:ie,_top:D}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Le(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:se,context:n.slice(se-100,se+100),mode:t.mode,resultSoFar:ne},_emitter:ie};if(o)return{language:e,value:Le(n),illegal:!1,relevance:0,errorRaised:t,_emitter:ie,_top:D};throw t}}function b(e){let t={value:Le(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(O).filter(oe).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(O(e.language).supersetOf===t.language)return 1;if(O(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(ue(`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 Ie(`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}),ue(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Re(l,e)}let E=()=>{ne(),Te(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function ee(){ne(),Te(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let te=!1;function ne(){function e(){ne()}document.readyState===`loading`?(te||window.addEventListener(`DOMContentLoaded`,e,!1),te=!0):document.querySelectorAll(l.cssSelector).forEach(w)}function D(n,r){let i=null;try{i=r(e)}catch(e){if(Ce(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Ce(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&ae(i.aliases,{languageName:n})}function re(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function ie(){return Object.keys(t)}function O(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function ae(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function oe(e){let t=O(e);return t&&!t.disableAutodetect}function se(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 ce(e){se(e),a.push(e)}function le(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ue(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function fe(e){return Te(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Te(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:ne,highlightElement:w,highlightBlock:fe,configure:T,initHighlighting:E,initHighlightingOnLoad:ee,registerLanguage:D,unregisterLanguage:re,listLanguages:ie,getLanguage:O,registerAliases:ae,autoDetection:oe,inherit:Re,addPlugin:ce,removePlugin:le}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Fe,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in de)typeof de[e]==`object`&&n(de[e]);return Object.assign(e,de),e},He=Ve({});He.newInstance=()=>Ve({}),t.exports=He,He.HighlightJS=He,He.default=He}))()).default;function JE(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 YE(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:t.concat(/\batomic_/,t.either(`bool`,`char`,`schar`,`uchar`,`short`,`ushort`,`int`,`uint`,`long`,`ulong`,`llong`,`ullong`,`char16_t`,`char32_t`,`wchar_t`,`int_least8_t`,`uint_least8_t`,`int_least16_t`,`uint_least16_t`,`int_least32_t`,`uint_least32_t`,`int_least64_t`,`uint_least64_t`,`int_fast8_t`,`uint_fast8_t`,`int_fast16_t`,`uint_fast16_t`,`int_fast32_t`,`uint_fast32_t`,`int_fast64_t`,`uint_fast64_t`,`intptr_t`,`uintptr_t`,`size_t`,`ptrdiff_t`,`intmax_t`,`uintmax_t`),/\b/)}]},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},s={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={scope:`meta`,begin:/#\s*include\b/,end:/$/,keywords:{keyword:`include`},contains:[{begin:/\\\n/},o,{scope:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),n,e.C_BLOCK_COMMENT_MODE]},u=[c,l],d={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},f=t.optional(r)+e.IDENT_RE+`\\s*\\(`,p={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},m=[...u,a,n,e.C_BLOCK_COMMENT_MODE,s,o],h={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:p,contains:m.concat([{begin:/\(/,end:/\)/,keywords:p,contains:m.concat([`self`]),relevance:0}]),relevance:0},g={begin:`(`+i+`[\\*&\\s]+){1,12}`+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:p,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(d,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,...u]};return{name:`C`,aliases:[`h`],keywords:p,disableAutodetect:!0,illegal:`</`,contains:[].concat(h,g,m,[...u,{begin:e.IDENT_RE+`::`,keywords:p},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:o,keywords:p}}}function XE(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c=[{scope:`meta`,begin:/#\s*include\b/,end:/$/,keywords:{keyword:`include`},contains:[{begin:/\\\n/},o,{scope:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),n,e.C_BLOCK_COMMENT_MODE]}],l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,`(?!${d.join(`|`)})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,...c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+){1,12}`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,...c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[...c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}var ZE=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/},UNICODE_RANGE:{scope:`number`,begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},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_-]*/}}),QE=`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(`.`),$E=`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(`.`),eD=[...QE,...$E],tD=`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(),nD=`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(),rD=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),iD=`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.corner-bottom-left-shape.corner-bottom-right-shape.corner-shape.corner-top-left-shape.corner-top-right-shape.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.unicode-range.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 aD(e){let t=e.regex,n=ZE(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:`:(`+nD.join(`|`)+`)`},{begin:`:(:)?(`+rD.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+iD.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...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:tD.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+eD.join(`|`)+`)\\b`}]}}function oD(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+,\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:/$/}]}}function sD(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:/-?\b0[bB](_?[01])*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 cD(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var lD=`[0-9](_*[0-9])*`,uD=`\\.(${lD})`,dD=`[0-9a-fA-F](_*[0-9a-fA-F])*`,fD={className:`number`,variants:[{begin:`(\\b(${lD})((${uD})|\\.)?|(${uD}))[eE][+-]?(${lD})[fFdD]?\\b`},{begin:`\\b(${lD})((${uD})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${uD})[fFdD]?\\b`},{begin:`\\b(${lD})[fFdD]\\b`},{begin:`\\b0[xX]((${dD})\\.?|(${dD})?\\.(${dD}))[pP][+-]?(${lD})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${dD})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function pD(e,t,n){return n===-1?``:e.replace(t,r=>pD(e,t,n-1))}function mD(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=`(?:(?:\\s*\\[\\s*])+)?`,i=`(?:\\?(?:\\s+(?:extends|super)\\s+[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*<@@@>(?:(?:\\s*\\[\\s*])+)?)?|[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*<@@@>(?:(?:\\s*\\[\\s*])+)?)`,a=pD(`(?:\\s*<\\s*`+i+`(?:\\s*,\\s*`+i+`)*\\s*>)?`,/<@@@>/g,2),o={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},s={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},c={className:`params`,begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{beginKeywords:`new throw return else yield assert`,relevance:0},{begin:[n,t.concat(a,r,/\s+/),n,r,/\s*/,/=(?!=)/],className:{1:`type`,3:`variable`,6:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(a,r,/\s+/),n,/\s*(?=\()/],className:{1:`type`,3:`title.function`},keywords:o,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,fD,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},fD,s]}}var hD=`[A-Za-z$_][0-9A-Za-z$_]*`,gD=`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(`.`),_D=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],vD=`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(`.`),yD=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],bD=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],xD=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],SD=[].concat(bD,vD,yD);function CD(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=hD,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);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:hD,keyword:gD,literal:_D,built_in:SD,"variable.language":xD},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:{_:[...vD,...yD]}},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 ee(e){return t.concat(`(?!`,e.join(`|`),`)`)}let te={match:t.concat(/\b/,ee([...bD,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},re=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ie={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(re)],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-Za-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},ie,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:re,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},ne,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},te,E,S,D,{match:/\$[(.]/}]}}var wD={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function TD(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\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`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,wD,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function ED(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},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,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function DD(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.lazy.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.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.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.sentinel.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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,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 OD(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={scope:`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(16|32|64|128))?`,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.raw.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`,`f16`,`f32`,`f64`,`f128`,`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}),{scope:`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})/}]}]},{scope:`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:[/\bsafe/,/\s+/,/extern/],scope:{1:`keyword`,3:`keyword`}},{begin:[/fn/,/\s+/,r],scope:{1:`keyword`,3:`title.function`}},{scope:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{scope:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],scope:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],scope:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{scope:`punctuation`,begin:`->`},a]}}function kD(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]}}var AD=`[A-Za-z$_][0-9A-Za-z$_]*`,jD=`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(`.`),MD=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],ND=`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(`.`),PD=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],FD=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],ID=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],LD=[].concat(FD,ND,PD);function RD(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=AD,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);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:AD,keyword:jD,literal:MD,built_in:LD,"variable.language":ID},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:{_:[...ND,...PD]}},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 ee(e){return t.concat(`(?!`,e.join(`|`),`)`)}let te={match:t.concat(/\b/,ee([...FD,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},re=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ie={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(re)],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-Za-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},ie,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:re,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},ne,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},te,E,S,D,{match:/\$[(.]/}]}}function zD(e){let t=e.regex,n=RD(e),r=AD,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:AD,keyword:jD.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:MD,built_in:LD.concat(i),"variable.language":ID},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}function BD(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`}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:`javascript`}},{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}]}]}}function VD(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}}qE.registerLanguage(`bash`,JE),qE.registerLanguage(`c`,YE),qE.registerLanguage(`cpp`,XE),qE.registerLanguage(`css`,aD),qE.registerLanguage(`diff`,oD),qE.registerLanguage(`go`,sD),qE.registerLanguage(`ini`,cD),qE.registerLanguage(`java`,mD),qE.registerLanguage(`javascript`,CD),qE.registerLanguage(`json`,TD),qE.registerLanguage(`markdown`,ED),qE.registerLanguage(`python`,DD),qE.registerLanguage(`rust`,OD),qE.registerLanguage(`sql`,kD),qE.registerLanguage(`typescript`,zD),qE.registerLanguage(`xml`,BD),qE.registerLanguage(`yaml`,VD);var HD={shell:`bash`};function UD(e){if(e===void 0)return!1;let t=HD[e.trim().toLowerCase()]??e.trim().toLowerCase();return t!==``&&qE.getLanguage(t)!==void 0}function WD(e,t){let n=t===void 0?``:HD[t.trim().toLowerCase()]??t.trim().toLowerCase();if(n!==``&&qE.getLanguage(n)!==void 0)try{return qE.highlight(e,{language:n}).value}catch{}return GD(e)}function GD(e){return e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`)}function KD(e,t=`edit`){if(t===`write`)return e.startsWith(`+ `)?{prefix:`+`,lineNum:``,content:e.slice(2)}:null;let n=e.match(/^([+\- ])( *\d+) (.*)$/),r=n?.[1];return r!==`+`&&r!==`-`&&r!==` `?null:{prefix:r,lineNum:n?.[2]??``,content:n?.[3]??``}}function qD(e,t){if(e===`write`){let e=t.trim();return e===``?null:e}if(e===`edit`){let e=(t.match(/^(.*) \(\d+ edits\)$/)?.[1]??``).trim();return e===``?null:e}return null}function JD(e){if(e==null)return;let t=e.split(`/`).pop()??``,n=t.lastIndexOf(`.`);if(n<=0)return;let r=t.slice(n+1).trim().toLowerCase();return UD(r)?r:void 0}function YD(e,t,n=`edit`){let r=e.split(`
131
+ `),i=r.map(e=>KD(e,n)),a=[],o=[],s=[],c=[];for(let e=0;e<i.length;e++){let t=i[e];t==null?(s.push(-1),c.push(-1)):(t.prefix===`-`?s.push(-1):(s.push(a.length),a.push(t.content)),t.prefix===`+`?c.push(-1):(c.push(o.length),o.push(t.content)))}let l=t!==void 0&&UD(t)?t:void 0;if(l!==void 0)try{return{kind:`highlighted`,rows:XD(r,i,s,c,ZD(qE.highlight(a.join(`
132
+ `),{language:l}).value),ZD(qE.highlight(o.join(`
133
+ `),{language:l}).value))}}catch{}return{kind:`plain`,rows:XD(r,i,s,c,a.map(GD),o.map(GD))}}function XD(e,t,n,r,i,a){return t.map((t,o)=>{if(t===null)return{kind:`context`,gutter:``,html:GD(e[o]??``)};let s=`${t.prefix}${t.lineNum}`;if(t.prefix===`-`)return{kind:`removed`,gutter:s,html:a[r[o]??-1]??``};let c=i[n[o]??-1]??``;return t.prefix===`+`?{kind:`added`,gutter:s,html:c}:{kind:`context`,gutter:s,html:c}})}function ZD(e){let t=[],n=[],r=/<span class="([^"]*)">|<\/span>|\n/g,i=``,a=0;for(let o of e.matchAll(r)){let r=o.index;i+=e.slice(a,r),a=r+o[0].length,o[0]===`
134
+ `?(t.push(i+n.map(()=>`</span>`).join(``)),i=n.map(e=>`<span class="${e}">`).join(``)):o[1]===void 0?(n.pop(),i+=o[0]):(n.push(o[1]),i+=o[0])}return t.push(i+e.slice(a)),t}function QD(e){let t=(0,d.useMemo)(()=>YD(e.diff,JD(e.path),e.format).rows.map(e=>({...e,html:KE.sanitize(e.html,{USE_PROFILES:{html:!0}})})),[e.diff,e.path,e.format]);return(0,j.jsx)(`div`,{className:e.className,children:t.map((e,t)=>(0,j.jsxs)(`div`,{className:`whitespace-pre ${e.kind===`added`?`diff-line-add`:e.kind===`removed`?`diff-line-del`:``}`,children:[(0,j.jsx)(`span`,{className:`diff-gutter`,children:e.gutter}),(0,j.jsx)(`span`,{dangerouslySetInnerHTML:{__html:e.html}})]},t))})}var $D={pending:{label:`tool.status.pending`,icon:`clock`,spin:!1,className:`border-ink-200 bg-ink-100 text-ink-600`},running:{label:`tool.status.running`,icon:`spinner`,spin:!0,className:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`},doneOk:{label:`tool.status.done`,icon:`check`,spin:!1,className:`border-ink-200 bg-ink-50 text-ink-600`},doneError:{label:`tool.status.failed`,icon:`close`,spin:!1,className:`border-2 border-sakura-500 bg-sakura-100 text-sakura-900 font-semibold`}};function eO(e,t){return e===`done`?t?$D.doneError:$D.doneOk:$D[e]}function tO(e){let t=z(),[n,r]=(0,d.useState)(!1),i=eO(e.phase,e.isError),a=e.phase===`done`&&e.durationMs!==void 0&&e.durationMs!==null?` · ${(e.durationMs/1e3).toFixed(1)}s`:``,o=n&&e.diff!=null,s=e.diffAdded??null,c=e.diffRemoved??null,l=s!==null&&c!==null?s>0&&c>0?`(+${s}/-${c})`:s>0?`(+${s})`:c>0?`(-${c})`:null:null,u=e.detail!==null&&!(e.name===`write`&&e.diff!=null&&!e.diffTruncated),f=u||e.output!=null||e.result!=null||e.note!=null||e.diff!=null;return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":f?n:void 0,onClick:()=>{f&&r(!n)},className:`focus-neko flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,j.jsx)(`span`,{className:`text-tianyi-500`,children:(0,j.jsx)(Ux,{name:`bolt`,size:14})}),(0,j.jsx)(`span`,{className:`font-mono text-sm font-semibold text-tianyi-800`,children:e.name}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:[e.summary,l!==null&&(0,j.jsxs)(`span`,{className:`text-ink-400`,children:[` `,l]})]}),(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${i.className}`,children:[(0,j.jsx)(Ux,{name:i.icon,size:12,className:i.spin?`animate-spin`:void 0}),t(i.label),a]}),f&&(0,j.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:n?`▾`:`▸`})]}),n&&(0,j.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[o&&e.diff!=null&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.diff`)}),e.diffTruncated&&(0,j.jsx)(`div`,{className:`mb-1 text-xs text-ink-600`,children:t(`tool.diffTruncated`)}),(0,j.jsx)(QD,{diff:e.diff,path:qD(e.name,e.summary),format:e.name===`write`?`write`:`edit`,className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`})]}),u&&(0,j.jsxs)(`div`,{children:[e.name===`write`&&e.diffTruncated&&(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.fullWrite`)}),(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.detail})]}),e.output!=null&&e.output!==``&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.output`)}),(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-tianyi-50 p-2 font-mono text-xs text-ink-700`,children:e.output})]}),e.result!=null&&e.result!==``&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium ${e.isError?`text-sakura-800`:`text-ink-600`}`,children:e.isError?t(`tool.errorOutput`):t(`tool.result`)}),(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg p-2 font-mono text-xs ${e.isError?`bg-sakura-50 text-sakura-900`:`bg-ink-50 text-ink-700`}`,children:e.result})]}),e.note!=null&&(0,j.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:Gg(e.note,t)})]})]})}var nO={running:{label:`codemode.call.running`,icon:`spinner`,className:`text-tianyi-700`},ok:{label:`codemode.call.ok`,icon:`check`,className:`text-ink-500`},error:{label:`codemode.call.error`,icon:`close`,className:`text-sakura-800`},cancelled:{label:`codemode.call.cancelled`,icon:`clock`,className:`text-ink-500`}};function rO({code:e}){let t=(0,d.useMemo)(()=>KE.sanitize(WD(e,`javascript`),{USE_PROFILES:{html:!0}}),[e]);return(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:(0,j.jsx)(`code`,{dangerouslySetInnerHTML:{__html:t}})})}function iO({call:e}){let t=z(),n=nO[e.status];return(0,j.jsxs)(`li`,{className:`flex flex-col gap-0.5 py-0.5`,"data-call-status":e.status,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`inline-flex shrink-0 items-center ${n.className}`,role:`img`,"aria-label":t(n.label),children:(0,j.jsx)(Ux,{name:n.icon,size:12,className:e.status===`running`?`animate-spin`:void 0})}),(0,j.jsx)(`span`,{className:`shrink-0 font-semibold text-tianyi-800`,children:e.name}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-600`,children:e.args}),e.durationMs!==null&&(0,j.jsxs)(`span`,{className:`shrink-0 text-ink-400`,children:[(e.durationMs/1e3).toFixed(1),`s`]})]}),e.error!==null&&(0,j.jsx)(`div`,{className:`pl-5 text-sakura-800`,children:e.error})]})}function aO(e){let t=z(),[n,r]=(0,d.useState)(!1),i=eO(e.phase,e.isError),{calls:a,omitted:o,fullOutputPath:s}=e.codemode,c=a.length+o,l=e.phase===`done`&&e.durationMs!=null?` · ${(e.durationMs/1e3).toFixed(1)}s`:``,u=e.detail!==null||c>0||e.output!=null||e.result!=null||e.note!=null||s!==null,f=e.phase===`done`?e.result:e.output;return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,"data-codemode-card":!0,children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":u?n:void 0,onClick:()=>{u&&r(!n)},className:`focus-neko flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,j.jsx)(`span`,{className:`text-tianyi-500`,children:(0,j.jsx)(Ux,{name:`code`,size:14})}),(0,j.jsx)(`span`,{className:`font-mono text-sm font-semibold text-tianyi-800`,children:e.name}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:[e.summary,c>0&&(0,j.jsxs)(`span`,{className:`text-ink-400`,children:[` · `,t(`codemode.card.callCount`,{count:c})]})]}),(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${i.className}`,children:[(0,j.jsx)(Ux,{name:i.icon,size:12,className:i.spin?`animate-spin`:void 0}),t(i.label),l]}),u&&(0,j.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:n?`▾`:`▸`})]}),n&&(0,j.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[e.detail!==null&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`codemode.card.script`)}),(0,j.jsx)(rO,{code:e.detail})]}),c>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`codemode.card.calls`,{count:c})}),(0,j.jsxs)(`ul`,{className:`m-0 max-h-48 list-none overflow-auto rounded-lg bg-tianyi-50 p-2 font-mono text-xs`,children:[a.map(e=>(0,j.jsx)(iO,{call:e},e.id)),o>0&&(0,j.jsx)(`li`,{className:`py-0.5 text-ink-500`,children:t(`codemode.card.omitted`,{count:o})})]})]}),f!=null&&f!==``&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-xs font-medium ${e.isError?`text-sakura-800`:`text-ink-600`}`,children:e.phase===`done`?e.isError?t(`tool.errorOutput`):t(`tool.result`):t(`tool.output`)}),(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg p-2 font-mono text-xs ${e.isError?`bg-sakura-50 text-sakura-900`:`bg-ink-50 text-ink-700`}`,children:f})]}),s!==null&&(0,j.jsx)(`div`,{className:`break-all text-xs text-ink-500`,children:t(`codemode.card.fullOutput`,{path:s})}),e.note!=null&&(0,j.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:Gg(e.note,t)})]})]})}function oO(e){let{codemode:t,...n}=e;return t?(0,j.jsx)(aO,{...n,codemode:t}):(0,j.jsx)(tO,{...n})}async function sO(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.activeElement,n=document.getSelection(),r=n?Array.from({length:n.rangeCount},(e,t)=>n.getRangeAt(t)):[],i=document.createElement(`textarea`);i.value=e,i.setAttribute(`readonly`,``),i.style.cssText=`position:fixed;top:0;left:-9999px;opacity:0`,document.body.append(i),i.select();let a=!1;try{a=document.execCommand(`copy`)}finally{if(i.remove(),n){n.removeAllRanges();for(let e of r)n.addRange(e)}t?.focus?.()}if(!a)throw Error(`Clipboard unavailable`)}var cO=1500;function lO({text:e,label:t}){let n=z(),r=t??n(`copy.label`),[i,a]=(0,d.useState)(`idle`),o=(0,d.useRef)(void 0);if((0,d.useEffect)(()=>()=>clearTimeout(o.current),[]),e===``)return null;let s=e=>{a(e),clearTimeout(o.current),o.current=setTimeout(()=>a(`idle`),cO)};return(0,j.jsxs)(`span`,{className:`copy-row`,"data-state":i,children:[(0,j.jsx)(`button`,{type:`button`,className:`copy-btn focus-neko`,"aria-label":r,title:r,onClick:()=>{sO(e).then(()=>s(`copied`),()=>s(`failed`))},children:(0,j.jsx)(Ux,{name:i===`copied`?`check`:`copy`,size:15})}),(0,j.jsx)(`output`,{className:`copy-status`,"aria-live":`polite`,children:i===`copied`?n(`copy.copied`):i===`failed`?n(`copy.failed`):``})]})}var uO=(0,d.createContext)(null);function dO({image:e}){let t=z(),{currentSessionId:n,phase:r}=$g(),i=(0,d.useContext)(uO),[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(0),m=(0,d.useRef)(null);return(0,d.useEffect)(()=>{if(!n)return;o(``);let t=!1,a=``,s=!1,l=new IntersectionObserver(l=>{!s&&l.some(e=>e.isIntersecting)&&r===`ready`&&(s=!0,(i?i(e.entryId,e.contentIndex):d_.image(e.entryId,e.contentIndex,n)).then(e=>{t||(a=URL.createObjectURL(new Blob([e.bytes],{type:e.mimeType})),o(a),c(``))}).catch(()=>{t||c(R()(`image.loadFailed`))}))});return m.current&&l.observe(m.current),()=>{t=!0,l.disconnect(),a&&URL.revokeObjectURL(a)}},[n,r,e.entryId,e.contentIndex,f,i]),(0,j.jsxs)(`div`,{ref:m,className:`max-w-full`,children:[(0,j.jsx)(`button`,{type:`button`,"aria-label":t(`image.view`,{name:e.name}),className:`focus-neko max-w-full rounded-xl border border-sakura-200 p-1`,onClick:()=>{s?(c(``),p(f+1)):a&&u(!0)},children:a?(0,j.jsx)(`img`,{src:a,alt:e.name,className:`max-h-40 max-w-full rounded-lg object-contain`}):(0,j.jsx)(`span`,{className:`text-sm`,children:s||t(`image.loading`)})}),l&&a&&(0,j.jsxs)(qx,{title:e.name,onClose:()=>u(!1),children:[(0,j.jsx)(`div`,{className:`min-h-0 overflow-auto bg-surface p-3 sm:p-4`,children:(0,j.jsx)(`img`,{src:a,alt:e.name,className:`max-h-[65dvh] w-full rounded-lg object-contain`})}),(0,j.jsx)(`div`,{className:`flex shrink-0 justify-end border-t border-sakura-200 bg-surface px-4 py-3`,children:(0,j.jsxs)(`a`,{href:a,download:e.name,className:`btn-primary focus-neko inline-flex min-h-10 items-center gap-2 rounded-full px-5 py-2 text-sm font-medium no-underline`,children:[(0,j.jsx)(`svg`,{"aria-hidden":`true`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,j.jsx)(`path`,{d:`M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4`})}),t(`image.save`)]})})]})]})}function fO({images:e}){return(0,j.jsx)(`div`,{className:`my-2 flex flex-wrap gap-2`,children:e.map(e=>(0,j.jsx)(dO,{image:e},`${e.entryId}:${e.contentIndex}`))})}function pO({text:e,jobId:t,job:n}){let r=z(),{head:i,command:a,output:o}=NS(e),s=o===void 0?void 0:BS(o),c=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`font-medium text-tianyi-700`,children:r(`job.reportTitle`,{id:t})}),(0,j.jsx)(`span`,{className:`min-w-0 break-words text-ink-700`,children:i.replace(/^\[|\]$/g,``)}),n&&(0,j.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 text-ink-600`,children:r(`job.reportCurrent`,{status:LS(n,Date.now())})})]});return(0,j.jsx)(`div`,{className:`chat-row anim-other`,"data-job-report":t,children:(0,j.jsx)(`div`,{className:`min-w-0 rounded-xl border border-sakura-200 bg-surface px-3 py-2 text-xs`,children:s===void 0?(0,j.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:c}):(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`focus-neko flex cursor-pointer flex-wrap items-center gap-x-2 gap-y-1`,children:c}),a!==void 0&&(0,j.jsxs)(`code`,{className:`mt-2 block whitespace-pre-wrap break-all text-ink-600`,children:[`$ `,a]}),(0,j.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-ink-800`,children:s})]})})})}var B=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},mO=/([A-Z])/g,hO=e=>e.replace(mO,`-$1`).toLowerCase(),gO={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},_O=/[&><"']/g,vO=e=>String(e).replace(_O,e=>gO[e]),yO=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?yO(e.body[0]):e:e.type===`font`?yO(e.body):e,bO=new Set([`mathord`,`textord`,`atom`]),xO=e=>bO.has(yO(e).type),SO=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},CO={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function wO(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function TO(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:wO(Array.isArray(e.type)?e.type[0]:e.type)}function EO(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?TO(r):a?a(i):i}var DO=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(CO)){var n=CO[t];n&&EO(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=SO(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},OO=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return LO[RO[this.id]]}sub(){return LO[zO[this.id]]}fracNum(){return LO[BO[this.id]]}fracDen(){return LO[VO[this.id]]}cramp(){return LO[HO[this.id]]}text(){return LO[UO[this.id]]}isTight(){return this.size>=2}},kO=0,AO=1,jO=2,MO=3,NO=4,PO=5,FO=6,IO=7,LO=[new OO(kO,0,!1),new OO(AO,0,!0),new OO(jO,1,!1),new OO(MO,1,!0),new OO(NO,2,!1),new OO(PO,2,!0),new OO(FO,3,!1),new OO(IO,3,!0)],RO=[NO,PO,NO,PO,FO,IO,FO,IO],zO=[PO,PO,PO,PO,IO,IO,IO,IO],BO=[jO,MO,NO,PO,FO,IO,FO,IO],VO=[MO,MO,PO,PO,IO,IO,IO,IO],HO=[AO,AO,MO,MO,PO,PO,IO,IO],UO=[kO,AO,jO,MO,jO,MO,jO,MO],WO={DISPLAY:LO[kO],TEXT:LO[jO],SCRIPT:LO[NO],SCRIPTSCRIPT:LO[FO]},GO=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function KO(e){for(var t=0;t<GO.length;t++)for(var n=GO[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var qO=[];GO.forEach(e=>e.blocks.forEach(e=>qO.push(...e)));function JO(e){for(var t=0;t<qO.length;t+=2)if(e>=qO[t]&&e<=qO[t+1])return!0;return!1}var YO=e=>e+` `+e,XO=80,ZO=function(e,t){return`M95,`+(622+e+t)+`
135
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
136
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
137
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
138
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
139
+ c69,-144,104.5,-217.7,106.5,-221
140
+ l`+e/2.075+` -`+e+`
141
+ c5.3,-9.3,12,-14,20,-14
142
+ H400000v`+(40+e)+`H845.2724
143
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
144
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
145
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},QO=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
146
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
147
+ c340,-704.7,510.7,-1060.3,512,-1067
148
+ l`+e/2.084+` -`+e+`
149
+ c4.7,-7.3,11,-11,19,-11
150
+ H40000v`+(40+e)+`H1012.3
151
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
152
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
153
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
154
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
155
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},$O=function(e,t){return`M983 `+(10+e+t)+`
156
+ l`+e/3.13+` -`+e+`
157
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
158
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
159
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
160
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
161
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
162
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
163
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
164
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},ek=function(e,t){return`M424,`+(2398+e+t)+`
165
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
166
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
167
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
168
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
169
+ l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
170
+ v`+(40+e)+`H1014.6
171
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
172
+ c-2,6,-10,9,-24,9
173
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
174
+ h400000v`+(40+e)+`h-400000z`},tk=function(e,t){return`M473,`+(2713+e+t)+`
175
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
176
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
177
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
178
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
179
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
180
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
181
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},nk=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},rk=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
182
+ H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
183
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
184
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
185
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},ik=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=ZO(t,XO);break;case`sqrtSize1`:r=QO(t,XO);break;case`sqrtSize2`:r=$O(t,XO);break;case`sqrtSize3`:r=ek(t,XO);break;case`sqrtSize4`:r=tk(t,XO);break;case`sqrtTall`:r=rk(t,XO,n)}return r},ak=function(e,t){switch(e){case`⎜`:return YO(`M291 0 H417 V`+t+` H291z`);case`∣`:return YO(`M145 0 H188 V`+t+` H145z`);case`∥`:return YO(`M145 0 H188 V`+t+` H145z`)+YO(`M367 0 H410 V`+t+` H367z`);case`⎟`:return YO(`M457 0 H583 V`+t+` H457z`);case`⎢`:return YO(`M319 0 H403 V`+t+` H319z`);case`⎥`:return YO(`M263 0 H347 V`+t+` H263z`);case`⎪`:return YO(`M384 0 H504 V`+t+` H384z`);case`⏐`:return YO(`M312 0 H355 V`+t+` H312z`);case`‖`:return YO(`M257 0 H300 V`+t+` H257z`)+YO(`M478 0 H521 V`+t+` H478z`);default:return``}},ok={doubleleftarrow:`M262 157
186
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
187
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
188
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
189
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
190
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
191
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
192
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
193
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
194
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
195
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
196
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
197
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
198
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
199
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
200
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
201
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
202
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
203
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
204
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
205
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
206
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
207
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
208
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
209
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
210
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
211
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
212
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
213
+ 435 0h399565z`,leftgroupunder:`M400000 262
214
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
215
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
216
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
217
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
218
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
219
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
220
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
221
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
222
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
223
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
224
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
225
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
226
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
227
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
228
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
229
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
230
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
231
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:YO(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:YO(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:YO(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:YO(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
232
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
233
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
234
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:YO(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
235
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
236
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
237
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
238
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
239
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
240
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
241
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
242
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
243
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
244
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
245
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
246
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
247
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
248
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
249
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
250
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
251
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
252
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
253
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
254
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
255
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
256
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
257
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
258
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
259
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
260
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
261
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
262
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
263
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
264
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
265
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
266
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
267
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
268
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
269
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
270
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
271
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
272
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
273
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
274
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
275
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
276
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
277
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
278
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
279
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
280
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
281
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
282
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
283
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:YO(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:YO(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:YO(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
284
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
285
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
286
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
287
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
288
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
289
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
290
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
291
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
292
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
293
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
294
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
295
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
296
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
297
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
298
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
299
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
300
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
301
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
302
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
303
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
304
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
305
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
306
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
307
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
308
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
309
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
310
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
311
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
312
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
313
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
314
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
315
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
316
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
317
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
318
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
319
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
320
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
321
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
322
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
323
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
324
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
325
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
326
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
327
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
328
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
329
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
330
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
331
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
332
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
333
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
334
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
335
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
336
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
337
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
338
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
339
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
340
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
341
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
342
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
343
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
344
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
345
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
346
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
347
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
348
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
349
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
350
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
351
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
352
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
353
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
354
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
355
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
356
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},sk=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
357
+ H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
358
+ M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
359
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
360
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
361
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
362
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
363
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
364
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
365
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
366
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
367
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
368
+ M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
369
+ M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
370
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
371
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
372
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
373
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
374
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
375
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
376
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
377
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
378
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
379
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
380
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
381
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
382
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
383
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
384
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function ck(e){return`toText`in e}var lk=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(ck(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},uk={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},dk={ex:!0,em:!0,mu:!0},fk=function(e){return typeof e!=`string`&&(e=e.unit),e in uk||e in dk||e===`ex`},pk=function(e,t){var n;if(e.unit in uk)n=uk[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new B(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},V=function(e){return+e.toFixed(4)+`em`},mk=function(e){return e.filter(e=>e).join(` `)},hk=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=hO(n)+`:`+r+`;`)}return t},gk=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},_k=function(e){var t=document.createElement(e);t.className=mk(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},vk=/[\s"'>/=\x00-\x1f]/,yk=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+vO(mk(this.classes))+`"`);var n=hk(this.style);n&&(t+=` style="`+vO(n)+`"`);for(var r of Object.keys(this.attributes)){if(vk.test(r))throw new B(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+vO(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},bk=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,gk.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return _k.call(this,`span`)}toMarkup(){return yk.call(this,`span`)}},xk=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,gk.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return _k.call(this,`a`)}toMarkup(){return yk.call(this,`a`)}},Sk=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+vO(this.src)+`"`+(` alt="`+vO(this.alt)+`"`),t=hk(this.style);return t&&(e+=` style="`+vO(t)+`"`),e+=`'/>`,e}},Ck={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},wk=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=KO(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=Ck[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=V(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=mk(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=vO(mk(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+V(this.italic)+`;`),n+=hk(this.style),n&&(e=!0,t+=` style="`+vO(n)+`"`);var r=vO(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},Tk=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+vO(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},Ek=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,ok[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+vO(this.alternate)+`"/>`:`<path d="`+vO(ok[this.pathName])+`"/>`}},Dk=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+vO(this.attributes[t])+`"`;return e+=`/>`,e}};function Ok(e){if(e instanceof wk)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function kk(e){if(e instanceof bk)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var Ak=e=>e instanceof bk||e instanceof xk||e instanceof lk,jk={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Mk={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Nk={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function Pk(e,t){jk[e]=t}function Fk(e,t,n){if(!jk[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=jk[t][r];if(!i&&e[0]in Nk&&(r=Nk[e[0]].charCodeAt(0),i=jk[t][r]),!i&&n===`text`&&JO(r)&&(i=jk[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ik={};function Lk(e){var t=e>=5?0:e>=3?1:2;if(!Ik[t]){var n=Ik[t]={cssEmPerMu:Mk.quad[t]/18};for(var r of Object.keys(Mk))n[r]=Mk[r][t]}return Ik[t]}var Rk={math:{},text:{}};function H(e,t,n,r,i,a){Rk[e][i]={font:t,group:n,replace:r},a&&r&&(Rk[e][r]=Rk[e][i])}var U=`math`,W=`text`,G=`main`,K=`ams`,zk=`accent-token`,q=`bin`,Bk=`close`,Vk=`inner`,Hk=`mathord`,Uk=`op-token`,Wk=`open`,Gk=`punct`,J=`rel`,Kk=`spacing`,Y=`textord`;H(U,G,J,`≡`,`\\equiv`,!0),H(U,G,J,`≺`,`\\prec`,!0),H(U,G,J,`≻`,`\\succ`,!0),H(U,G,J,`∼`,`\\sim`,!0),H(U,G,J,`⊥`,`\\perp`),H(U,G,J,`⪯`,`\\preceq`,!0),H(U,G,J,`⪰`,`\\succeq`,!0),H(U,G,J,`≃`,`\\simeq`,!0),H(U,G,J,`∣`,`\\mid`,!0),H(U,G,J,`≪`,`\\ll`,!0),H(U,G,J,`≫`,`\\gg`,!0),H(U,G,J,`≍`,`\\asymp`,!0),H(U,G,J,`∥`,`\\parallel`),H(U,G,J,`⋈`,`\\bowtie`,!0),H(U,G,J,`⌣`,`\\smile`,!0),H(U,G,J,`⊑`,`\\sqsubseteq`,!0),H(U,G,J,`⊒`,`\\sqsupseteq`,!0),H(U,G,J,`≐`,`\\doteq`,!0),H(U,G,J,`⌢`,`\\frown`,!0),H(U,G,J,`∋`,`\\ni`,!0),H(U,G,J,`∝`,`\\propto`,!0),H(U,G,J,`⊢`,`\\vdash`,!0),H(U,G,J,`⊣`,`\\dashv`,!0),H(U,G,J,`∋`,`\\owns`),H(U,G,Gk,`.`,`\\ldotp`),H(U,G,Gk,`⋅`,`\\cdotp`),H(U,G,Gk,`⋅`,`·`),H(W,G,Y,`⋅`,`·`),H(U,G,Y,`#`,`\\#`),H(W,G,Y,`#`,`\\#`),H(U,G,Y,`&`,`\\&`),H(W,G,Y,`&`,`\\&`),H(U,G,Y,`ℵ`,`\\aleph`,!0),H(U,G,Y,`∀`,`\\forall`,!0),H(U,G,Y,`ℏ`,`\\hbar`,!0),H(U,G,Y,`∃`,`\\exists`,!0),H(U,G,Y,`∇`,`\\nabla`,!0),H(U,G,Y,`♭`,`\\flat`,!0),H(U,G,Y,`ℓ`,`\\ell`,!0),H(U,G,Y,`♮`,`\\natural`,!0),H(U,G,Y,`♣`,`\\clubsuit`,!0),H(U,G,Y,`℘`,`\\wp`,!0),H(U,G,Y,`♯`,`\\sharp`,!0),H(U,G,Y,`♢`,`\\diamondsuit`,!0),H(U,G,Y,`ℜ`,`\\Re`,!0),H(U,G,Y,`♡`,`\\heartsuit`,!0),H(U,G,Y,`ℑ`,`\\Im`,!0),H(U,G,Y,`♠`,`\\spadesuit`,!0),H(U,G,Y,`§`,`\\S`,!0),H(W,G,Y,`§`,`\\S`),H(U,G,Y,`¶`,`\\P`,!0),H(W,G,Y,`¶`,`\\P`),H(U,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\textdagger`),H(U,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\textdaggerdbl`),H(U,G,Bk,`⎱`,`\\rmoustache`,!0),H(U,G,Wk,`⎰`,`\\lmoustache`,!0),H(U,G,Bk,`⟯`,`\\rgroup`,!0),H(U,G,Wk,`⟮`,`\\lgroup`,!0),H(U,G,q,`∓`,`\\mp`,!0),H(U,G,q,`⊖`,`\\ominus`,!0),H(U,G,q,`⊎`,`\\uplus`,!0),H(U,G,q,`⊓`,`\\sqcap`,!0),H(U,G,q,`∗`,`\\ast`),H(U,G,q,`⊔`,`\\sqcup`,!0),H(U,G,q,`◯`,`\\bigcirc`,!0),H(U,G,q,`∙`,`\\bullet`,!0),H(U,G,q,`‡`,`\\ddagger`),H(U,G,q,`≀`,`\\wr`,!0),H(U,G,q,`⨿`,`\\amalg`),H(U,G,q,`&`,`\\And`),H(U,G,J,`⟵`,`\\longleftarrow`,!0),H(U,G,J,`⇐`,`\\Leftarrow`,!0),H(U,G,J,`⟸`,`\\Longleftarrow`,!0),H(U,G,J,`⟶`,`\\longrightarrow`,!0),H(U,G,J,`⇒`,`\\Rightarrow`,!0),H(U,G,J,`⟹`,`\\Longrightarrow`,!0),H(U,G,J,`↔`,`\\leftrightarrow`,!0),H(U,G,J,`⟷`,`\\longleftrightarrow`,!0),H(U,G,J,`⇔`,`\\Leftrightarrow`,!0),H(U,G,J,`⟺`,`\\Longleftrightarrow`,!0),H(U,G,J,`↦`,`\\mapsto`,!0),H(U,G,J,`⟼`,`\\longmapsto`,!0),H(U,G,J,`↗`,`\\nearrow`,!0),H(U,G,J,`↩`,`\\hookleftarrow`,!0),H(U,G,J,`↪`,`\\hookrightarrow`,!0),H(U,G,J,`↘`,`\\searrow`,!0),H(U,G,J,`↼`,`\\leftharpoonup`,!0),H(U,G,J,`⇀`,`\\rightharpoonup`,!0),H(U,G,J,`↙`,`\\swarrow`,!0),H(U,G,J,`↽`,`\\leftharpoondown`,!0),H(U,G,J,`⇁`,`\\rightharpoondown`,!0),H(U,G,J,`↖`,`\\nwarrow`,!0),H(U,G,J,`⇌`,`\\rightleftharpoons`,!0),H(U,K,J,`≮`,`\\nless`,!0),H(U,K,J,``,`\\@nleqslant`),H(U,K,J,``,`\\@nleqq`),H(U,K,J,`⪇`,`\\lneq`,!0),H(U,K,J,`≨`,`\\lneqq`,!0),H(U,K,J,``,`\\@lvertneqq`),H(U,K,J,`⋦`,`\\lnsim`,!0),H(U,K,J,`⪉`,`\\lnapprox`,!0),H(U,K,J,`⊀`,`\\nprec`,!0),H(U,K,J,`⋠`,`\\npreceq`,!0),H(U,K,J,`⋨`,`\\precnsim`,!0),H(U,K,J,`⪹`,`\\precnapprox`,!0),H(U,K,J,`≁`,`\\nsim`,!0),H(U,K,J,``,`\\@nshortmid`),H(U,K,J,`∤`,`\\nmid`,!0),H(U,K,J,`⊬`,`\\nvdash`,!0),H(U,K,J,`⊭`,`\\nvDash`,!0),H(U,K,J,`⋪`,`\\ntriangleleft`),H(U,K,J,`⋬`,`\\ntrianglelefteq`,!0),H(U,K,J,`⊊`,`\\subsetneq`,!0),H(U,K,J,``,`\\@varsubsetneq`),H(U,K,J,`⫋`,`\\subsetneqq`,!0),H(U,K,J,``,`\\@varsubsetneqq`),H(U,K,J,`≯`,`\\ngtr`,!0),H(U,K,J,``,`\\@ngeqslant`),H(U,K,J,``,`\\@ngeqq`),H(U,K,J,`⪈`,`\\gneq`,!0),H(U,K,J,`≩`,`\\gneqq`,!0),H(U,K,J,``,`\\@gvertneqq`),H(U,K,J,`⋧`,`\\gnsim`,!0),H(U,K,J,`⪊`,`\\gnapprox`,!0),H(U,K,J,`⊁`,`\\nsucc`,!0),H(U,K,J,`⋡`,`\\nsucceq`,!0),H(U,K,J,`⋩`,`\\succnsim`,!0),H(U,K,J,`⪺`,`\\succnapprox`,!0),H(U,K,J,`≆`,`\\ncong`,!0),H(U,K,J,``,`\\@nshortparallel`),H(U,K,J,`∦`,`\\nparallel`,!0),H(U,K,J,`⊯`,`\\nVDash`,!0),H(U,K,J,`⋫`,`\\ntriangleright`),H(U,K,J,`⋭`,`\\ntrianglerighteq`,!0),H(U,K,J,``,`\\@nsupseteqq`),H(U,K,J,`⊋`,`\\supsetneq`,!0),H(U,K,J,``,`\\@varsupsetneq`),H(U,K,J,`⫌`,`\\supsetneqq`,!0),H(U,K,J,``,`\\@varsupsetneqq`),H(U,K,J,`⊮`,`\\nVdash`,!0),H(U,K,J,`⪵`,`\\precneqq`,!0),H(U,K,J,`⪶`,`\\succneqq`,!0),H(U,K,J,``,`\\@nsubseteqq`),H(U,K,q,`⊴`,`\\unlhd`),H(U,K,q,`⊵`,`\\unrhd`),H(U,K,J,`↚`,`\\nleftarrow`,!0),H(U,K,J,`↛`,`\\nrightarrow`,!0),H(U,K,J,`⇍`,`\\nLeftarrow`,!0),H(U,K,J,`⇏`,`\\nRightarrow`,!0),H(U,K,J,`↮`,`\\nleftrightarrow`,!0),H(U,K,J,`⇎`,`\\nLeftrightarrow`,!0),H(U,K,J,`△`,`\\vartriangle`),H(U,K,Y,`ℏ`,`\\hslash`),H(U,K,Y,`▽`,`\\triangledown`),H(U,K,Y,`◊`,`\\lozenge`),H(U,K,Y,`Ⓢ`,`\\circledS`),H(U,K,Y,`®`,`\\circledR`),H(W,K,Y,`®`,`\\circledR`),H(U,K,Y,`∡`,`\\measuredangle`,!0),H(U,K,Y,`∄`,`\\nexists`),H(U,K,Y,`℧`,`\\mho`),H(U,K,Y,`Ⅎ`,`\\Finv`,!0),H(U,K,Y,`⅁`,`\\Game`,!0),H(U,K,Y,`‵`,`\\backprime`),H(U,K,Y,`▲`,`\\blacktriangle`),H(U,K,Y,`▼`,`\\blacktriangledown`),H(U,K,Y,`■`,`\\blacksquare`),H(U,K,Y,`⧫`,`\\blacklozenge`),H(U,K,Y,`★`,`\\bigstar`),H(U,K,Y,`∢`,`\\sphericalangle`,!0),H(U,K,Y,`∁`,`\\complement`,!0),H(U,K,Y,`ð`,`\\eth`,!0),H(W,G,Y,`ð`,`ð`),H(U,K,Y,`╱`,`\\diagup`),H(U,K,Y,`╲`,`\\diagdown`),H(U,K,Y,`□`,`\\square`),H(U,K,Y,`□`,`\\Box`),H(U,K,Y,`◊`,`\\Diamond`),H(U,K,Y,`¥`,`\\yen`,!0),H(W,K,Y,`¥`,`\\yen`,!0),H(U,K,Y,`✓`,`\\checkmark`,!0),H(W,K,Y,`✓`,`\\checkmark`),H(U,K,Y,`ℶ`,`\\beth`,!0),H(U,K,Y,`ℸ`,`\\daleth`,!0),H(U,K,Y,`ℷ`,`\\gimel`,!0),H(U,K,Y,`ϝ`,`\\digamma`,!0),H(U,K,Y,`ϰ`,`\\varkappa`),H(U,K,Wk,`┌`,`\\@ulcorner`,!0),H(U,K,Bk,`┐`,`\\@urcorner`,!0),H(U,K,Wk,`└`,`\\@llcorner`,!0),H(U,K,Bk,`┘`,`\\@lrcorner`,!0),H(U,K,J,`≦`,`\\leqq`,!0),H(U,K,J,`⩽`,`\\leqslant`,!0),H(U,K,J,`⪕`,`\\eqslantless`,!0),H(U,K,J,`≲`,`\\lesssim`,!0),H(U,K,J,`⪅`,`\\lessapprox`,!0),H(U,K,J,`≊`,`\\approxeq`,!0),H(U,K,q,`⋖`,`\\lessdot`),H(U,K,J,`⋘`,`\\lll`,!0),H(U,K,J,`≶`,`\\lessgtr`,!0),H(U,K,J,`⋚`,`\\lesseqgtr`,!0),H(U,K,J,`⪋`,`\\lesseqqgtr`,!0),H(U,K,J,`≑`,`\\doteqdot`),H(U,K,J,`≓`,`\\risingdotseq`,!0),H(U,K,J,`≒`,`\\fallingdotseq`,!0),H(U,K,J,`∽`,`\\backsim`,!0),H(U,K,J,`⋍`,`\\backsimeq`,!0),H(U,K,J,`⫅`,`\\subseteqq`,!0),H(U,K,J,`⋐`,`\\Subset`,!0),H(U,K,J,`⊏`,`\\sqsubset`,!0),H(U,K,J,`≼`,`\\preccurlyeq`,!0),H(U,K,J,`⋞`,`\\curlyeqprec`,!0),H(U,K,J,`≾`,`\\precsim`,!0),H(U,K,J,`⪷`,`\\precapprox`,!0),H(U,K,J,`⊲`,`\\vartriangleleft`),H(U,K,J,`⊴`,`\\trianglelefteq`),H(U,K,J,`⊨`,`\\vDash`,!0),H(U,K,J,`⊪`,`\\Vvdash`,!0),H(U,K,J,`⌣`,`\\smallsmile`),H(U,K,J,`⌢`,`\\smallfrown`),H(U,K,J,`≏`,`\\bumpeq`,!0),H(U,K,J,`≎`,`\\Bumpeq`,!0),H(U,K,J,`≧`,`\\geqq`,!0),H(U,K,J,`⩾`,`\\geqslant`,!0),H(U,K,J,`⪖`,`\\eqslantgtr`,!0),H(U,K,J,`≳`,`\\gtrsim`,!0),H(U,K,J,`⪆`,`\\gtrapprox`,!0),H(U,K,q,`⋗`,`\\gtrdot`),H(U,K,J,`⋙`,`\\ggg`,!0),H(U,K,J,`≷`,`\\gtrless`,!0),H(U,K,J,`⋛`,`\\gtreqless`,!0),H(U,K,J,`⪌`,`\\gtreqqless`,!0),H(U,K,J,`≖`,`\\eqcirc`,!0),H(U,K,J,`≗`,`\\circeq`,!0),H(U,K,J,`≜`,`\\triangleq`,!0),H(U,K,J,`∼`,`\\thicksim`),H(U,K,J,`≈`,`\\thickapprox`),H(U,K,J,`⫆`,`\\supseteqq`,!0),H(U,K,J,`⋑`,`\\Supset`,!0),H(U,K,J,`⊐`,`\\sqsupset`,!0),H(U,K,J,`≽`,`\\succcurlyeq`,!0),H(U,K,J,`⋟`,`\\curlyeqsucc`,!0),H(U,K,J,`≿`,`\\succsim`,!0),H(U,K,J,`⪸`,`\\succapprox`,!0),H(U,K,J,`⊳`,`\\vartriangleright`),H(U,K,J,`⊵`,`\\trianglerighteq`),H(U,K,J,`⊩`,`\\Vdash`,!0),H(U,K,J,`∣`,`\\shortmid`),H(U,K,J,`∥`,`\\shortparallel`),H(U,K,J,`≬`,`\\between`,!0),H(U,K,J,`⋔`,`\\pitchfork`,!0),H(U,K,J,`∝`,`\\varpropto`),H(U,K,J,`◀`,`\\blacktriangleleft`),H(U,K,J,`∴`,`\\therefore`,!0),H(U,K,J,`∍`,`\\backepsilon`),H(U,K,J,`▶`,`\\blacktriangleright`),H(U,K,J,`∵`,`\\because`,!0),H(U,K,J,`⋘`,`\\llless`),H(U,K,J,`⋙`,`\\gggtr`),H(U,K,q,`⊲`,`\\lhd`),H(U,K,q,`⊳`,`\\rhd`),H(U,K,J,`≂`,`\\eqsim`,!0),H(U,G,J,`⋈`,`\\Join`),H(U,K,J,`≑`,`\\Doteq`,!0),H(U,K,q,`∔`,`\\dotplus`,!0),H(U,K,q,`∖`,`\\smallsetminus`),H(U,K,q,`⋒`,`\\Cap`,!0),H(U,K,q,`⋓`,`\\Cup`,!0),H(U,K,q,`⩞`,`\\doublebarwedge`,!0),H(U,K,q,`⊟`,`\\boxminus`,!0),H(U,K,q,`⊞`,`\\boxplus`,!0),H(U,K,q,`⋇`,`\\divideontimes`,!0),H(U,K,q,`⋉`,`\\ltimes`,!0),H(U,K,q,`⋊`,`\\rtimes`,!0),H(U,K,q,`⋋`,`\\leftthreetimes`,!0),H(U,K,q,`⋌`,`\\rightthreetimes`,!0),H(U,K,q,`⋏`,`\\curlywedge`,!0),H(U,K,q,`⋎`,`\\curlyvee`,!0),H(U,K,q,`⊝`,`\\circleddash`,!0),H(U,K,q,`⊛`,`\\circledast`,!0),H(U,K,q,`⋅`,`\\centerdot`),H(U,K,q,`⊺`,`\\intercal`,!0),H(U,K,q,`⋒`,`\\doublecap`),H(U,K,q,`⋓`,`\\doublecup`),H(U,K,q,`⊠`,`\\boxtimes`,!0),H(U,K,J,`⇢`,`\\dashrightarrow`,!0),H(U,K,J,`⇠`,`\\dashleftarrow`,!0),H(U,K,J,`⇇`,`\\leftleftarrows`,!0),H(U,K,J,`⇆`,`\\leftrightarrows`,!0),H(U,K,J,`⇚`,`\\Lleftarrow`,!0),H(U,K,J,`↞`,`\\twoheadleftarrow`,!0),H(U,K,J,`↢`,`\\leftarrowtail`,!0),H(U,K,J,`↫`,`\\looparrowleft`,!0),H(U,K,J,`⇋`,`\\leftrightharpoons`,!0),H(U,K,J,`↶`,`\\curvearrowleft`,!0),H(U,K,J,`↺`,`\\circlearrowleft`,!0),H(U,K,J,`↰`,`\\Lsh`,!0),H(U,K,J,`⇈`,`\\upuparrows`,!0),H(U,K,J,`↿`,`\\upharpoonleft`,!0),H(U,K,J,`⇃`,`\\downharpoonleft`,!0),H(U,G,J,`⊶`,`\\origof`,!0),H(U,G,J,`⊷`,`\\imageof`,!0),H(U,K,J,`⊸`,`\\multimap`,!0),H(U,K,J,`↭`,`\\leftrightsquigarrow`,!0),H(U,K,J,`⇉`,`\\rightrightarrows`,!0),H(U,K,J,`⇄`,`\\rightleftarrows`,!0),H(U,K,J,`↠`,`\\twoheadrightarrow`,!0),H(U,K,J,`↣`,`\\rightarrowtail`,!0),H(U,K,J,`↬`,`\\looparrowright`,!0),H(U,K,J,`↷`,`\\curvearrowright`,!0),H(U,K,J,`↻`,`\\circlearrowright`,!0),H(U,K,J,`↱`,`\\Rsh`,!0),H(U,K,J,`⇊`,`\\downdownarrows`,!0),H(U,K,J,`↾`,`\\upharpoonright`,!0),H(U,K,J,`⇂`,`\\downharpoonright`,!0),H(U,K,J,`⇝`,`\\rightsquigarrow`,!0),H(U,K,J,`⇝`,`\\leadsto`),H(U,K,J,`⇛`,`\\Rrightarrow`,!0),H(U,K,J,`↾`,`\\restriction`),H(U,G,Y,`‘`,"`"),H(U,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\textdollar`),H(U,G,Y,`%`,`\\%`),H(W,G,Y,`%`,`\\%`),H(U,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\textunderscore`),H(U,G,Y,`∠`,`\\angle`,!0),H(U,G,Y,`∞`,`\\infty`,!0),H(U,G,Y,`′`,`\\prime`),H(U,G,Y,`△`,`\\triangle`),H(U,G,Y,`Γ`,`\\Gamma`,!0),H(U,G,Y,`Δ`,`\\Delta`,!0),H(U,G,Y,`Θ`,`\\Theta`,!0),H(U,G,Y,`Λ`,`\\Lambda`,!0),H(U,G,Y,`Ξ`,`\\Xi`,!0),H(U,G,Y,`Π`,`\\Pi`,!0),H(U,G,Y,`Σ`,`\\Sigma`,!0),H(U,G,Y,`Υ`,`\\Upsilon`,!0),H(U,G,Y,`Φ`,`\\Phi`,!0),H(U,G,Y,`Ψ`,`\\Psi`,!0),H(U,G,Y,`Ω`,`\\Omega`,!0),H(U,G,Y,`A`,`Α`),H(U,G,Y,`B`,`Β`),H(U,G,Y,`E`,`Ε`),H(U,G,Y,`Z`,`Ζ`),H(U,G,Y,`H`,`Η`),H(U,G,Y,`I`,`Ι`),H(U,G,Y,`K`,`Κ`),H(U,G,Y,`M`,`Μ`),H(U,G,Y,`N`,`Ν`),H(U,G,Y,`O`,`Ο`),H(U,G,Y,`P`,`Ρ`),H(U,G,Y,`T`,`Τ`),H(U,G,Y,`X`,`Χ`),H(U,G,Y,`¬`,`\\neg`,!0),H(U,G,Y,`¬`,`\\lnot`),H(U,G,Y,`⊤`,`\\top`),H(U,G,Y,`⊥`,`\\bot`),H(U,G,Y,`∅`,`\\emptyset`),H(U,K,Y,`∅`,`\\varnothing`),H(U,G,Hk,`α`,`\\alpha`,!0),H(U,G,Hk,`β`,`\\beta`,!0),H(U,G,Hk,`γ`,`\\gamma`,!0),H(U,G,Hk,`δ`,`\\delta`,!0),H(U,G,Hk,`ϵ`,`\\epsilon`,!0),H(U,G,Hk,`ζ`,`\\zeta`,!0),H(U,G,Hk,`η`,`\\eta`,!0),H(U,G,Hk,`θ`,`\\theta`,!0),H(U,G,Hk,`ι`,`\\iota`,!0),H(U,G,Hk,`κ`,`\\kappa`,!0),H(U,G,Hk,`λ`,`\\lambda`,!0),H(U,G,Hk,`μ`,`\\mu`,!0),H(U,G,Hk,`ν`,`\\nu`,!0),H(U,G,Hk,`ξ`,`\\xi`,!0),H(U,G,Hk,`ο`,`\\omicron`,!0),H(U,G,Hk,`π`,`\\pi`,!0),H(U,G,Hk,`ρ`,`\\rho`,!0),H(U,G,Hk,`σ`,`\\sigma`,!0),H(U,G,Hk,`τ`,`\\tau`,!0),H(U,G,Hk,`υ`,`\\upsilon`,!0),H(U,G,Hk,`ϕ`,`\\phi`,!0),H(U,G,Hk,`χ`,`\\chi`,!0),H(U,G,Hk,`ψ`,`\\psi`,!0),H(U,G,Hk,`ω`,`\\omega`,!0),H(U,G,Hk,`ε`,`\\varepsilon`,!0),H(U,G,Hk,`ϑ`,`\\vartheta`,!0),H(U,G,Hk,`ϖ`,`\\varpi`,!0),H(U,G,Hk,`ϱ`,`\\varrho`,!0),H(U,G,Hk,`ς`,`\\varsigma`,!0),H(U,G,Hk,`φ`,`\\varphi`,!0),H(U,G,q,`∗`,`*`,!0),H(U,G,q,`+`,`+`),H(U,G,q,`−`,`-`,!0),H(U,G,q,`⋅`,`\\cdot`,!0),H(U,G,q,`∘`,`\\circ`,!0),H(U,G,q,`÷`,`\\div`,!0),H(U,G,q,`±`,`\\pm`,!0),H(U,G,q,`×`,`\\times`,!0),H(U,G,q,`∩`,`\\cap`,!0),H(U,G,q,`∪`,`\\cup`,!0),H(U,G,q,`∖`,`\\setminus`,!0),H(U,G,q,`∧`,`\\land`),H(U,G,q,`∨`,`\\lor`),H(U,G,q,`∧`,`\\wedge`,!0),H(U,G,q,`∨`,`\\vee`,!0),H(U,G,Y,`√`,`\\surd`),H(U,G,Wk,`⟨`,`\\langle`,!0),H(U,G,Wk,`∣`,`\\lvert`),H(U,G,Wk,`∥`,`\\lVert`),H(U,G,Bk,`?`,`?`),H(U,G,Bk,`!`,`!`),H(U,G,Bk,`⟩`,`\\rangle`,!0),H(U,G,Bk,`∣`,`\\rvert`),H(U,G,Bk,`∥`,`\\rVert`),H(U,G,J,`=`,`=`),H(U,G,J,`:`,`:`),H(U,G,J,`≈`,`\\approx`,!0),H(U,G,J,`≅`,`\\cong`,!0),H(U,G,J,`≥`,`\\ge`),H(U,G,J,`≥`,`\\geq`,!0),H(U,G,J,`←`,`\\gets`),H(U,G,J,`>`,`\\gt`,!0),H(U,G,J,`∈`,`\\in`,!0),H(U,G,J,``,`\\@not`),H(U,G,J,`⊂`,`\\subset`,!0),H(U,G,J,`⊃`,`\\supset`,!0),H(U,G,J,`⊆`,`\\subseteq`,!0),H(U,G,J,`⊇`,`\\supseteq`,!0),H(U,K,J,`⊈`,`\\nsubseteq`,!0),H(U,K,J,`⊉`,`\\nsupseteq`,!0),H(U,G,J,`⊨`,`\\models`),H(U,G,J,`←`,`\\leftarrow`,!0),H(U,G,J,`≤`,`\\le`),H(U,G,J,`≤`,`\\leq`,!0),H(U,G,J,`<`,`\\lt`,!0),H(U,G,J,`→`,`\\rightarrow`,!0),H(U,G,J,`→`,`\\to`),H(U,K,J,`≱`,`\\ngeq`,!0),H(U,K,J,`≰`,`\\nleq`,!0),H(U,G,Kk,`\xA0`,`\\ `),H(U,G,Kk,`\xA0`,`\\space`),H(U,G,Kk,`\xA0`,`\\nobreakspace`),H(W,G,Kk,`\xA0`,`\\ `),H(W,G,Kk,`\xA0`,` `),H(W,G,Kk,`\xA0`,`\\space`),H(W,G,Kk,`\xA0`,`\\nobreakspace`),H(U,G,Kk,``,`\\nobreak`),H(U,G,Kk,``,`\\allowbreak`),H(U,G,Gk,`,`,`,`),H(U,G,Gk,`;`,`;`),H(U,K,q,`⊼`,`\\barwedge`,!0),H(U,K,q,`⊻`,`\\veebar`,!0),H(U,G,q,`⊙`,`\\odot`,!0),H(U,G,q,`⊕`,`\\oplus`,!0),H(U,G,q,`⊗`,`\\otimes`,!0),H(U,G,Y,`∂`,`\\partial`,!0),H(U,G,q,`⊘`,`\\oslash`,!0),H(U,K,q,`⊚`,`\\circledcirc`,!0),H(U,K,q,`⊡`,`\\boxdot`,!0),H(U,G,q,`△`,`\\bigtriangleup`),H(U,G,q,`▽`,`\\bigtriangledown`),H(U,G,q,`†`,`\\dagger`),H(U,G,q,`⋄`,`\\diamond`),H(U,G,q,`⋆`,`\\star`),H(U,G,q,`◃`,`\\triangleleft`),H(U,G,q,`▹`,`\\triangleright`),H(U,G,Wk,`{`,`\\{`),H(W,G,Y,`{`,`\\{`),H(W,G,Y,`{`,`\\textbraceleft`),H(U,G,Bk,`}`,`\\}`),H(W,G,Y,`}`,`\\}`),H(W,G,Y,`}`,`\\textbraceright`),H(U,G,Wk,`{`,`\\lbrace`),H(U,G,Bk,`}`,`\\rbrace`),H(U,G,Wk,`[`,`\\lbrack`,!0),H(W,G,Y,`[`,`\\lbrack`,!0),H(U,G,Bk,`]`,`\\rbrack`,!0),H(W,G,Y,`]`,`\\rbrack`,!0),H(U,G,Wk,`(`,`\\lparen`,!0),H(U,G,Bk,`)`,`\\rparen`,!0),H(W,G,Y,`<`,`\\textless`,!0),H(W,G,Y,`>`,`\\textgreater`,!0),H(U,G,Wk,`⌊`,`\\lfloor`,!0),H(U,G,Bk,`⌋`,`\\rfloor`,!0),H(U,G,Wk,`⌈`,`\\lceil`,!0),H(U,G,Bk,`⌉`,`\\rceil`,!0),H(U,G,Y,`\\`,`\\backslash`),H(U,G,Y,`∣`,`|`),H(U,G,Y,`∣`,`\\vert`),H(W,G,Y,`|`,`\\textbar`,!0),H(U,G,Y,`∥`,`\\|`),H(U,G,Y,`∥`,`\\Vert`),H(W,G,Y,`∥`,`\\textbardbl`),H(W,G,Y,`~`,`\\textasciitilde`),H(W,G,Y,`\\`,`\\textbackslash`),H(W,G,Y,`^`,`\\textasciicircum`),H(U,G,J,`↑`,`\\uparrow`,!0),H(U,G,J,`⇑`,`\\Uparrow`,!0),H(U,G,J,`↓`,`\\downarrow`,!0),H(U,G,J,`⇓`,`\\Downarrow`,!0),H(U,G,J,`↕`,`\\updownarrow`,!0),H(U,G,J,`⇕`,`\\Updownarrow`,!0),H(U,G,Uk,`∐`,`\\coprod`),H(U,G,Uk,`⋁`,`\\bigvee`),H(U,G,Uk,`⋀`,`\\bigwedge`),H(U,G,Uk,`⨄`,`\\biguplus`),H(U,G,Uk,`⋂`,`\\bigcap`),H(U,G,Uk,`⋃`,`\\bigcup`),H(U,G,Uk,`∫`,`\\int`),H(U,G,Uk,`∫`,`\\intop`),H(U,G,Uk,`∬`,`\\iint`),H(U,G,Uk,`∭`,`\\iiint`),H(U,G,Uk,`∏`,`\\prod`),H(U,G,Uk,`∑`,`\\sum`),H(U,G,Uk,`⨂`,`\\bigotimes`),H(U,G,Uk,`⨁`,`\\bigoplus`),H(U,G,Uk,`⨀`,`\\bigodot`),H(U,G,Uk,`∮`,`\\oint`),H(U,G,Uk,`∯`,`\\oiint`),H(U,G,Uk,`∰`,`\\oiiint`),H(U,G,Uk,`⨆`,`\\bigsqcup`),H(U,G,Uk,`∫`,`\\smallint`),H(W,G,Vk,`…`,`\\textellipsis`),H(U,G,Vk,`…`,`\\mathellipsis`),H(W,G,Vk,`…`,`\\ldots`,!0),H(U,G,Vk,`…`,`\\ldots`,!0),H(U,G,Vk,`⋯`,`\\@cdots`,!0),H(U,G,Vk,`⋱`,`\\ddots`,!0),H(U,G,Y,`⋮`,`\\varvdots`),H(W,G,Y,`⋮`,`\\varvdots`),H(U,G,zk,`ˊ`,`\\acute`),H(U,G,zk,`ˋ`,`\\grave`),H(U,G,zk,`¨`,`\\ddot`),H(U,G,zk,`~`,`\\tilde`),H(U,G,zk,`ˉ`,`\\bar`),H(U,G,zk,`˘`,`\\breve`),H(U,G,zk,`ˇ`,`\\check`),H(U,G,zk,`^`,`\\hat`),H(U,G,zk,`⃗`,`\\vec`),H(U,G,zk,`˙`,`\\dot`),H(U,G,zk,`˚`,`\\mathring`),H(U,G,Hk,``,`\\@imath`),H(U,G,Hk,``,`\\@jmath`),H(U,G,Y,`ı`,`ı`),H(U,G,Y,`ȷ`,`ȷ`),H(W,G,Y,`ı`,`\\i`,!0),H(W,G,Y,`ȷ`,`\\j`,!0),H(W,G,Y,`ß`,`\\ss`,!0),H(W,G,Y,`æ`,`\\ae`,!0),H(W,G,Y,`œ`,`\\oe`,!0),H(W,G,Y,`ø`,`\\o`,!0),H(W,G,Y,`Æ`,`\\AE`,!0),H(W,G,Y,`Œ`,`\\OE`,!0),H(W,G,Y,`Ø`,`\\O`,!0),H(W,G,zk,`ˊ`,`\\'`),H(W,G,zk,`ˋ`,"\\`"),H(W,G,zk,`ˆ`,`\\^`),H(W,G,zk,`˜`,`\\~`),H(W,G,zk,`ˉ`,`\\=`),H(W,G,zk,`˘`,`\\u`),H(W,G,zk,`˙`,`\\.`),H(W,G,zk,`¸`,`\\c`),H(W,G,zk,`˚`,`\\r`),H(W,G,zk,`ˇ`,`\\v`),H(W,G,zk,`¨`,`\\"`),H(W,G,zk,`˝`,`\\H`),H(W,G,zk,`◯`,`\\textcircled`);var qk={"--":!0,"---":!0,"``":!0,"''":!0};H(W,G,Y,`–`,`--`,!0),H(W,G,Y,`–`,`\\textendash`),H(W,G,Y,`—`,`---`,!0),H(W,G,Y,`—`,`\\textemdash`),H(W,G,Y,`‘`,"`",!0),H(W,G,Y,`‘`,`\\textquoteleft`),H(W,G,Y,`’`,`'`,!0),H(W,G,Y,`’`,`\\textquoteright`),H(W,G,Y,`“`,"``",!0),H(W,G,Y,`“`,`\\textquotedblleft`),H(W,G,Y,`”`,`''`,!0),H(W,G,Y,`”`,`\\textquotedblright`),H(U,G,Y,`°`,`\\degree`,!0),H(W,G,Y,`°`,`\\degree`),H(W,G,Y,`°`,`\\textdegree`,!0),H(U,G,Y,`£`,`\\pounds`),H(U,G,Y,`£`,`\\mathsterling`,!0),H(W,G,Y,`£`,`\\pounds`),H(W,G,Y,`£`,`\\textsterling`,!0),H(U,K,Y,`✠`,`\\maltese`),H(W,K,Y,`✠`,`\\maltese`);for(var Jk=`0123456789/@."`,Yk=0;Yk<Jk.length;Yk++){var Xk=Jk.charAt(Yk);H(U,G,Y,Xk,Xk)}for(var Zk=`0123456789!@*()-=+";:?/.,`,Qk=0;Qk<Zk.length;Qk++){var $k=Zk.charAt(Qk);H(W,G,Y,$k,$k)}for(var eA=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,tA=0;tA<eA.length;tA++){var nA=eA.charAt(tA);H(U,G,Hk,nA,nA),H(W,G,Y,nA,nA)}H(U,K,Y,`C`,`ℂ`),H(W,K,Y,`C`,`ℂ`),H(U,K,Y,`H`,`ℍ`),H(W,K,Y,`H`,`ℍ`),H(U,K,Y,`N`,`ℕ`),H(W,K,Y,`N`,`ℕ`),H(U,K,Y,`P`,`ℙ`),H(W,K,Y,`P`,`ℙ`),H(U,K,Y,`Q`,`ℚ`),H(W,K,Y,`Q`,`ℚ`),H(U,K,Y,`R`,`ℝ`),H(W,K,Y,`R`,`ℝ`),H(U,K,Y,`Z`,`ℤ`),H(W,K,Y,`Z`,`ℤ`),H(U,G,Hk,`h`,`ℎ`),H(W,G,Hk,`h`,`ℎ`);for(var rA,iA=0;iA<eA.length;iA++){var aA=eA.charAt(iA);rA=String.fromCharCode(55349,56320+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56372+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56424+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56580+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56684+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56736+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56788+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56840+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56944+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),iA<26&&(rA=String.fromCharCode(55349,56632+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA),rA=String.fromCharCode(55349,56476+iA),H(U,G,Hk,aA,rA),H(W,G,Y,aA,rA))}rA=String.fromCharCode(55349,56668),H(U,G,Hk,`k`,rA),H(W,G,Y,`k`,rA);for(var oA=0;oA<10;oA++){var sA=oA.toString();rA=String.fromCharCode(55349,57294+oA),H(U,G,Hk,sA,rA),H(W,G,Y,sA,rA),rA=String.fromCharCode(55349,57314+oA),H(U,G,Hk,sA,rA),H(W,G,Y,sA,rA),rA=String.fromCharCode(55349,57324+oA),H(U,G,Hk,sA,rA),H(W,G,Y,sA,rA),rA=String.fromCharCode(55349,57334+oA),H(U,G,Hk,sA,rA),H(W,G,Y,sA,rA)}for(var cA=`ÐÞþ`,lA=0;lA<cA.length;lA++){var uA=cA.charAt(lA);H(U,G,Hk,uA,uA),H(W,G,Y,uA,uA)}var dA={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},fA={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},pA={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},mA={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},hA={mathClass:``,textClass:``,font:``},gA={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},_A={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},vA={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},yA={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},bA={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},xA={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},SA={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},CA=[dA,dA,fA,fA,pA,pA,mA,hA,hA,hA,gA,gA,_A,_A,vA,vA,yA,yA,bA,bA,xA,xA,hA,hA,SA,SA],wA=[dA,hA,yA,bA,SA],TA=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return CA[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return wA[Math.floor((r-120782)/10)];if(r===120485||r===120486)return CA[0];if(120486<r&&r<120782)return hA;throw new B(`Unsupported character: `+e)};function EA(e){var t=e.strict,n=e.errorCode,r=e.errorMsg,i=e.token,a=e.report,o=t;if(typeof t==`function`){if(a)o=t(n,r,i);else try{o=t(n,r,i)}catch{o=`error`}}switch(o){case!0:case`error`:if(a)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(r+` [`+n+`]`),i);return!0;case!1:case`ignore`:if(!a)return!1;break;default:if(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(r+` [`+n+`]`)),!a)return!1}}var DA=function(e,t,n){if(Rk[n][e]){var r=Rk[n][e].replace;r&&(e=r)}return{value:e,metrics:Fk(e,t,n)}},OA=function(e,t,n,r,i){var a=DA(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new wk(e,o.height,o.depth,c,o.skew,o.width,i)}else EA({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new wk(e,0,0,0,0,0,i);s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();return l&&(s.style.color=l),s},kA=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&DA(e,`Main-Bold`,t).metrics?OA(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||Rk[t][e].font===`main`?OA(e,`Main-Regular`,t,n,r):OA(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},AA=function(e,t,n){return n!==`textord`&&DA(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},jA=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=TA(i);f=m.font,p=m[r+`Class`]}if(f)return OA(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=AA(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=WA[o].fontName,g=[o]):(h=UA(s,c,l),g=[s,c,l]);if(DA(i,h,r).metrics)return OA(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(qk,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(OA(i[y],h,r,t,a.concat(g)));return RA(v)}}if(n===`mathord`)return OA(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=Rk[r][i]&&Rk[r][i].font;if(b===`ams`)return OA(i,UA(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return OA(i,UA(`textrm`,c,l),r,t,a.concat(c,l));var x=UA(b,c,l);return OA(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},MA=(e,t)=>{if(mk(e.classes)!==mk(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},NA=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof wk&&r instanceof wk&&MA(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},PA=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new bk(e,t,n,r);return PA(i),i},FA=(e,t,n,r)=>new bk(e,t,n,r),IA=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=V(r.height),r.maxFontSize=1,r},LA=function(e,t,n,r){var i=new xk(e,t,n,r);return PA(i),i},RA=function(e){var t=new lk(e);return PA(t),t},zA=function(e,t){return e instanceof lk?X([],[e],t):e},BA=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},VA=function(e,t){for(var n=BA(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=X([`pstrut`],[]);l.style.height=V(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=X(_,[l,g],void 0,v);y.style.top=V(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=X([`vlist`],u);b.style.height=V(f);var x;if(d<0){var S=X([`vlist`],[X([],[])]);S.style.height=V(-d),x=[X([`vlist-r`],[b,X([`vlist-s`],[new wk(`​`)])]),X([`vlist-r`],[S])]}else x=[X([`vlist-r`],[b])];var C=X([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},HA=(e,t)=>{var n=X([`mspace`],[],t),r=pk(e,t);return n.style.marginRight=V(r),n},UA=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},WA={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},GA={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},KA=function(e,t){var n=GA[e],r=n[0],i=n[1],a=n[2],o=FA([`katex-overlay`],[new Tk([new Ek(r)],{width:V(i),height:V(a),style:`width:`+V(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=V(a),o.style.width=V(i),o},qA={number:3,unit:`mu`},JA={number:4,unit:`mu`},YA={number:5,unit:`mu`},XA={mord:{mop:qA,mbin:JA,mrel:YA,minner:qA},mop:{mord:qA,mop:qA,mrel:YA,minner:qA},mbin:{mord:JA,mop:JA,mopen:JA,minner:JA},mrel:{mord:YA,mop:YA,mopen:YA,minner:YA},mopen:{},mclose:{mop:qA,mbin:JA,mrel:YA,minner:qA},mpunct:{mord:qA,mop:qA,mrel:YA,mopen:qA,mclose:qA,mpunct:qA,minner:qA},minner:{mord:qA,mop:qA,mbin:JA,mrel:YA,mopen:qA,mpunct:qA,minner:qA}},ZA={mord:{mop:qA},mop:{mord:qA,mop:qA},mbin:{},mrel:{},mopen:{},mclose:{mop:qA},mpunct:{},minner:{mop:qA}},QA={},$A={},ej={};function Z(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)QA[n[a]]=e;t&&(r&&($A[t]=r),i&&(ej[t]=i))}function tj(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&($A[t]=n),r&&(ej[t]=r)}var nj=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},rj=function(e){return e.type===`ordgroup`?e.body:[e]},ij=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),aj=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),oj={display:WO.DISPLAY,text:WO.TEXT,script:WO.SCRIPT,scriptscript:WO.SCRIPTSCRIPT},sj={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},cj=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=mj(e[a],t);if(o instanceof lk){var s=o.children;i.push(...s)}else i.push(o)}if(NA(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(oj[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return lj(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&aj.has(r)?t.classes[0]=`mord`:r===`mbin`&&ij.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),lj(i,(e,t)=>{var n=fj(t),r=fj(e),i=n&&r?e.hasClass(`mtight`)?ZA[n]?.[r]:XA[n]?.[r]:null;if(i)return HA(i,c)},{node:u},d,f),i},lj=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=uj(o);if(s)lj(s.children,t,n,null,i);else{var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},uj=function(e){return e instanceof lk||e instanceof xk||e instanceof bk&&e.hasClass(`enclosing`)?e:null},dj=function(e,t){var n=uj(e);if(n){var r=n.children;if(r.length){if(t===`right`)return dj(r[r.length-1],`right`);if(t===`left`)return dj(r[0],`left`)}}return e},fj=function(e,t){return e?(t&&(e=dj(e,t)),sj[e.classes[0]]||null):null},pj=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},mj=function(e,t,n){if(!e)return X();if($A[e.type]){var r=$A[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new B(`Got group of unknown type: '`+e.type+`'`)};function hj(e,t){var n=X([`katex-base`],e,t),r=X([`katex-strut`]);return r.style.height=V(n.height+n.depth),n.depth&&(r.style.verticalAlign=V(-n.depth)),n.children.unshift(r),n}function gj(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=cj(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(hj(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(hj(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(hj(o,t));var l;n?(l=hj(cj(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=V(u.height+u.depth),u.depth&&(d.style.verticalAlign=V(-u.depth))}return u}function _j(e){return new lk(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=mk(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof vj&&this.children[i+1]instanceof vj){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof vj;)a+=this.children[++i].toText();e.appendChild(new vj(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=vO(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+vO(mk(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},vj=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return vO(this.toText())}toText(){return this.text}},yj=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,V(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+V(this.width)+`"/>`}toText(){return this.character?this.character:` `}},bj=new Set([`\\imath`,`\\jmath`]),xj=new Set([`mrow`,`mtable`]),Sj=function(e,t,n){var r,i;return Rk[t][e]&&Rk[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(qk,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=Rk[t][e].replace),new vj(e)},Cj=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},wj={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},Tj=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=wj[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(bj.has(a))return null;if(Rk[r][a]){var o=Rk[r][a].replace;o&&(a=o)}var s=WA[n].fontName;return Fk(a,s,r)?WA[n].variant:null};function Ej(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof vj&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof vj&&n.text===`,`}return!1}var Dj=function(e,t,n){if(e.length===1){var r=kj(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=kj(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)||s.type===`mn`&&a.type===`mn`||Ej(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&Ej(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||Ej(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof vj&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof vj&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},Oj=function(e,t,n){return Cj(Dj(e,t,n))},kj=function(e,t){if(!e)return new Q(`mrow`);if(ej[e.type])return ej[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function Aj(e,t,n,r,i){var a=Dj(e,n),o=a.length===1&&a[0]instanceof Q&&xj.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new vj(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var jj=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Mj=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Nj=function(e,t){return t.size<2?e:jj[e-1][t.size-1]},Pj=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=Mj[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this.strict=t.strict,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Nj(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Mj[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=Nj(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=Lk(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};Pj.BASESIZE=6;var Fj=e=>new Pj({style:e.displayMode?WO.DISPLAY:WO.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),Ij=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},Lj=function(e,t,n){var r=Fj(n),i;return n.output===`mathml`?Aj(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[gj(e,r)]):X([`katex`],[Aj(e,t,r,n.displayMode,!1),gj(e,r)]),Ij(i,n))},Rj=function(e,t){return Ij(X([`katex`],[gj(e,Fj(t))]),t)},zj={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},Bj=function(e){var t=new Q(`mo`,[new vj(zj[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},Vj={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},Hj=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),Uj=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(Hj.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:FA([],[new Tk([new Ek(o)],{width:`100%`,height:V(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=Vj[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
385
+ `+h+` children.`);for(var v=0;v<h;v++){var y=new Tk([new Ek(d[v])],{width:`400em`,height:V(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=FA([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=V(m),l.push(b)}return{span:X([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=V(o),a>0&&(i.style.minWidth=V(a)),i},Wj=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new Dk({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new Dk({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=FA([],[new Tk(c,{width:`100%`,height:V(o)})],i)}return a.height=o,a.style.height=V(o),a},Gj=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],Kj=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],qj=new Set(Gj),Jj=new Set(Kj);function Yj(e){return qj.has(e)}function Xj(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function Zj(e){var t=Qj(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function Qj(e){return e.type===`atom`||Jj.has(e.type)?e:null}function $j(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new B(t,e);return r}var eM=e=>{if(e instanceof wk)return e;if(Ak(e)&&e.children.length===1)return eM(e.children[0])},tM=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Xj(e.base,`accent`),n=r.base,e.base=n,i=kk(mj(e,t)),e.base=r):(r=Xj(e,`accent`),n=r.base);var a=mj(n,t.havingCrampedStyle()),o=r.isShifty&&xO(n),s=0;o&&(s=eM(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=Uj(r,t),u=VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+V(2*s)+`)`,marginLeft:V(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=KA(`vec`,t),f=GA.vec[1]):(d=jA({type:`textord`,mode:r.mode,text:r.label},t),d=Ok(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=V(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},nM=(e,t)=>{var n=e.isStretchy?Bj(e.label):new Q(`mo`,[Sj(e.label,e.mode)]),r=new Q(`mover`,[kj(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},rM=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=nj(t[0]),r=!rM.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:tM,mathmlBuilder:nM}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(EA({strict:e.parser.settings.strict,errorCode:`mathVsTextAccents`,errorMsg:`LaTeX's accent `+e.funcName+` works only in text mode`,report:!0}),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=mj(e.base,t),r=Uj(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[VA({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=Bj(e.label),r=new Q(`munder`,[kj(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var iM=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=zA(mj(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=zA(mj(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=Uj(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=VA({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=VA({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=Bj(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=iM(kj(e.body,t));r=e.below?new Q(`munderover`,[n,iM(kj(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,iM(kj(e.below,t))]):(r=iM(),r=new Q(`mover`,[n,r]));return r}});function aM(e,t){var n=cj(e.body,t,!0);return X([e.mclass],n,t)}function oM(e,t){var n,r=Dj(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:rj(i),isCharacterBox:xO(i)}},htmlBuilder:aM,mathmlBuilder:oM});var sM=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:sM(t[0]),body:rj(t[1]),isCharacterBox:xO(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:sM(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:rj(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:xO(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:sM(t[0]),body:rj(t[0])}},htmlBuilder(e,t){var n=cj(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,Dj(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var cM={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},lM=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),uM=e=>e.type===`textord`&&e.text===`@`,dM=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function fM(e,t,n){var r=cM[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function pM(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new B(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=lM(),c=0;c<o.length;c++)if(!uM(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=Zj(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(dM(o[p],l)){f=!1,c=p;break}if(uM(o[p]))throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new B(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[fM(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=lM()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=zA(mj(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=V(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[kj(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=zA(mj(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[kj(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=$j(Xj(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new B(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new B(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),Z({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=Xj(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:rj(i)}},htmlBuilder:(e,t)=>RA(cj(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,Dj(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Z({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=Xj(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Z({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text===`[`?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!EA({strict:t.settings.strict,errorCode:`newLineInDisplayMode`,errorMsg:`In LaTeX, \\\\ or \\newline does nothing in display mode`,report:!1});return{type:`cr`,mode:t.mode,newLine:r,size:n&&Xj(n,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=V(pk(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,V(pk(e.size,t)))),n}});var mM={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},hM=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},gM=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},_M=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(mM[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=mM[r.text]),Xj(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new B(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new B(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new B(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===mM[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=hM(t.gullet.popToken());return t.gullet.consumeSpaces(),_M(t,r,gM(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=hM(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return _M(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var vM=function(e,t,n){var r=Fk(Rk.math[e]&&Rk.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},yM=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},bM=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=V(i),e.height-=i,e.depth+=i},xM=function(e,t,n,r,i,a){var o=yM(OA(e,`Main-Regular`,i,r),t,r,a);return n&&bM(o,r,t),o},SM=function(e,t,n,r){return OA(e,`Size`+t+`-Regular`,n,r)},CM=function(e,t,n,r,i,a){var o=SM(e,t,i,r),s=yM(X([`delimsizing`,`size`+t],[o],r),WO.TEXT,r,a);return n&&bM(s,r,WO.TEXT),s},wM=function(e,t,n,r){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[OA(e,t,n,r)])])}},TM=function(e,t,n){var r=jk[`Size4-Regular`][e.charCodeAt(0)]?jk[`Size4-Regular`][e.charCodeAt(0)][4]:jk[`Size1-Regular`][e.charCodeAt(0)][4],i=FA([],[new Tk([new Ek(`inner`,ak(e,Math.round(1e3*t)))],{width:V(r),height:V(t),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=V(t),i.style.width=V(r),{type:`elem`,elem:i}},EM=.008,DM={type:`kern`,size:-1*EM},OM=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),kM=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),AM=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):OM.has(e)?(c=`∣`,u=`vert`,d=333):kM.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=vM(o,f,i),m=p.height+p.depth,h=vM(c,f,i),g=h.height+h.depth,_=vM(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=vM(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var ee=C-m-v,te=Math.round(C*1e3),ne=sk(u,Math.round(ee*1e3)),D=new Ek(u,ne),re=V(d/1e3),ie=V(te/1e3),O=FA([],[new Tk([D],{width:re,height:ie,viewBox:`0 0 `+d+` `+te})],r);O.height=te/1e3,O.style.width=re,O.style.height=ie,E.push({type:`elem`,elem:O})}else{if(E.push(wM(l,f,i,r)),E.push(DM),s===null){var ae=C-m-v+2*EM;E.push(TM(c,ae,r))}else{var oe=(C-m-v-y)/2+2*EM;E.push(TM(c,oe,r)),E.push(DM),E.push(wM(s,f,i,r)),E.push(DM),E.push(TM(c,oe,r))}E.push(DM),E.push(wM(o,f,i,r))}var se=r.havingBaseStyle(WO.TEXT);return yM(X([`delimsizing`,`mult`],[VA({positionType:`bottom`,positionData:T,children:E})],se),WO.TEXT,r,a)},jM=80,MM=.08,NM=function(e,t,n,r,i){return FA([`hide-tail`],[new Tk([new Ek(e,ik(e,r,n))],{width:`400em`,height:V(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},PM=function(e,t){var n=t.havingBaseSizing(),r=WM(`\\surd`,e*n.sizeMultiplier,HM,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+jM,e<1?i=1:e<1.4&&(i=.7),s=(1+a+MM)/i,c=(1+a)/i,o=NM(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+jM)*RM[r.size],c=(RM[r.size]+a)/i,s=(RM[r.size]+a+MM)/i,o=NM(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+MM,c=e+a,l=Math.floor(1e3*e+a)+jM,o=NM(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=V(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},FM=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),IM=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),LM=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),RM=[0,1.2,1.8,2.4,3],zM=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),FM.has(e)||LM.has(e))return CM(e,t,!1,n,r,i);if(IM.has(e))return AM(e,RM[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},BM=[{type:`small`,style:WO.SCRIPTSCRIPT},{type:`small`,style:WO.SCRIPT},{type:`small`,style:WO.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],VM=[{type:`small`,style:WO.SCRIPTSCRIPT},{type:`small`,style:WO.SCRIPT},{type:`small`,style:WO.TEXT},{type:`stack`}],HM=[{type:`small`,style:WO.SCRIPTSCRIPT},{type:`small`,style:WO.SCRIPT},{type:`small`,style:WO.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],UM=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},WM=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=vM(e,UM(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},GM=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=LM.has(e)?BM:FM.has(e)?HM:VM,s=WM(e,t,o,r);return s.type===`small`?xM(e,s.style,n,r,i,a):s.type===`large`?CM(e,s.size,n,r,i,a):AM(e,t,n,r,i,a)},KM=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return GM(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},qM={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},JM=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function YM(e){return`isMiddle`in e}function XM(e,t){var n=Qj(e);if(n&&JM.has(n.text))return n;throw n?new B(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new B(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=XM(nj(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:qM[e.funcName].size,mclass:qM[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):zM(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(Sj(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=V(RM[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function ZM(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new B(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:XM(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=XM(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Xj(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{ZM(e);for(var n=cj(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];YM(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?pj(t,[`mopen`]):KM(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(YM(u)){var d=u.isMiddle;n[l]=KM(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=pj(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=KM(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{ZM(e);var n=Dj(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[Sj(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[Sj(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return Cj(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=XM(t[0],e);if(!e.parser.leftrightDepth)throw new B(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=pj(t,[]):(n=zM(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?Sj(`|`,`text`):Sj(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Z({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Xj(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=zA(mj(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=xO(e.body);if(r===`sout`)a=X([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=pk({number:.6,unit:`pt`},t),l=pk({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=V(d/2+c);var f=Math.floor(1e3*d*i);a=FA([`hide-tail`],[new Tk([new Ek(`phase`,nk(f))],{width:`400em`,height:V(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=V(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=Wj(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=V(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=V(h),a.style.borderRightWidth=V(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=VA({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=VA({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[kj(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+V(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Z({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Xj(t[0],`color-token`).color,o=Xj(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Z({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&EA({strict:n.settings.strict,errorCode:`mathVsSout`,errorMsg:`LaTeX's \\sout works only in text mode`,report:!0});var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var QM={};function $M(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)QM[n[c]]=s;a&&($A[t]=a),o&&(ej[t]=o)}var eN={};function $(e,t){eN[e]=t}var tN=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},nN=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,tN.range(this,t))}};function rN(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var iN=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},aN=new Set([`gather`,`gather*`]);function oN(e){if(!e.includes(`ed`))return!e.includes(`*`)}function sN(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new nN(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(rN(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new B(`Too many tab characters: &`,e.nextToken);EA({strict:e.settings.strict,errorCode:`textEnv`,errorMsg:`Too few columns specified in the {array} column argument.`,report:!0})}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(rN(e)),m=[],h.push(m),y()}else throw new B(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function cN(e){return e.slice(0,1)===`d`?`display`:`text`}var lN=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(WO.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?pk({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=mj(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=pk(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,ee=e.cols||[],te=[],ne,D,re=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ie=s[n],O=ie.pos-E,ae=e.tags[n],oe=void 0;oe=ae===!0?X([`eqn-num`],[],t):ae===!1?X([],[],t):X([],cj(ae,t,!0),t),oe.depth=ie.depth,oe.height=ie.height,re.push({type:`elem`,elem:oe,shift:O})}for(r=0,D=0;r<o||D<ee.length;++r,++D){for(var se=ee[D],ce=!0;(le=se)?.type===`separator`;){var le;if(ce||(ne=X([`arraycolsep`],[]),ne.style.width=V(t.fontMetrics().doubleRuleSep),te.push(ne)),se.separator===`|`||se.separator===`:`){var ue=se.separator===`|`?`solid`:`dashed`,de=X([`vertical-separator`],[],t);de.style.height=V(_),de.style.borderRightWidth=V(l),de.style.borderRightStyle=ue,de.style.margin=`0 `+V(-l/2);var fe=_-E;fe&&(de.style.verticalAlign=V(-fe)),te.push(de)}else throw new B(`Invalid separator type: `+se.separator);D++,se=ee[D],ce=!1}if(!(r>=o)){var pe=void 0;(r>0||e.hskipBeforeAndAfter)&&(pe=se?.pregap??d,pe!==0&&(ne=X([`arraycolsep`],[]),ne.style.width=V(pe),te.push(ne)));var me=[];for(n=0;n<i;++n){var he=s[n],ge=he.cells[r];if(ge){var _e=he.pos-E;ge.depth=he.depth,ge.height=he.height,me.push({type:`elem`,elem:ge,shift:_e})}}var ve=VA({positionType:`individualShift`,children:me}),ye=X([`col-align-`+(se?.align||`c`)],[ve]);te.push(ye),(r<o-1||e.hskipBeforeAndAfter)&&(pe=se?.postgap??d,pe!==0&&(ne=X([`arraycolsep`],[]),ne.style.width=V(pe),te.push(ne)))}}var k=X([`mtable`],te);if(c.length>0){for(var A=IA(`katex-hline`,t,l),be=IA(`katex-hdashline`,t,l),xe=[{type:`elem`,elem:k,shift:0}];c.length>0;){var Se=c.pop(),Ce=Se.pos-E;Se.isDashed?xe.push({type:`elem`,elem:be,shift:Ce}):xe.push({type:`elem`,elem:A,shift:Ce})}k=VA({positionType:`individualShift`,children:xe})}if(re.length===0)return X([`mord`],[k],t);var we=X([`katex-tag`],[VA({positionType:`individualShift`,children:re})],t);return RA([k,we])},uN={c:`center `,l:`left `,r:`right `},dN=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[kj(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,V(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=uN[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},fN=function(e,t){e.envName.includes(`ed`)||iN(e);var n=[],r=e.envName===`split`,i=sN(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:oN(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=$j(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new B(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)Xj(Xj(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new B(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};$M({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(Qj(t[0])?[t[0]]:Xj(t[0],`ordgroup`).body).map(function(e){var t=Zj(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new B(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return sN(e.parser,r,cN(e.envName))},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new B(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=sN(e.parser,r,cN(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=sN(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(Qj(t[0])?[t[0]]:Xj(t[0],`ordgroup`).body).map(function(e){var t=Zj(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new B(`Unknown column alignment: `+t,e)});if(n.length>1)throw new B(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=sN(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new B(`{subarray} can contain only one column`);return i},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=sN(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},cN(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:fN,htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){aN.has(e.envName)&&iN(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:oN(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return sN(e.parser,t,`display`)},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:fN,htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){iN(e);var t={autoTag:oN(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return sN(e.parser,t,`display`)},htmlBuilder:lN,mathmlBuilder:dN}),$M({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return iN(e),pM(e.parser)},htmlBuilder:lN,mathmlBuilder:dN}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var pN=QM;Z({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);var a=$j(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(pN,a))throw new B(`No such environment: `+a,i);var o=pN[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Xj(n.parseFunction(),`environment`);if(p.name!==a)throw new B(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var mN=(e,t)=>{var n=e.font,r=t.withFont(n);return mj(e.body,r)},hN=(e,t)=>{var n=e.font,r=t.withFont(n);return kj(e.body,r)},gN={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=nj(t[0]),a=r in gN?gN[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:mN,mathmlBuilder:hN}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:sM(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:xO(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var _N=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=mj(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=mj(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=pk(e.barSize,t),u=IA(`frac-line`,t,d)):u=IA(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===WO.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=VA({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=VA({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===WO.DISPLAY.size?t.fontMetrics().delim1:n.size===WO.SCRIPTSCRIPT.size?t.havingStyle(WO.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?pj(t,[`mopen`]):GM(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?pj(t,[`mclose`]):GM(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},vN=(e,t)=>{var n=new Q(`mfrac`,[kj(e.numer,t),kj(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=pk(e.barSize,t);n.setAttribute(`linethickness`,V(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new vj(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new vj(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return Cj(i)}return n},yN=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),yN({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:_N,mathmlBuilder:vN}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var bN=[`display`,`text`,`script`,`scriptscript`],xN=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=nj(t[0]),o=a.type===`atom`&&a.family===`open`?xN(a.text):null,s=nj(t[1]),c=s.type===`atom`&&s.family===`close`?xN(s.text):null,l=Xj(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Xj(p.body[0],`textord`);f=bN[Number(m.text)]}}else p=Xj(p,`textord`),f=bN[Number(p.text)];return yN({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Xj(t[0],`size`).value,token:r}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=Xj(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var SN=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?mj(e.sup,t.havingStyle(n.sup()),t):mj(e.sub,t.havingStyle(n.sub()),t),i=Xj(e.base,`horizBrace`)):i=Xj(e,`horizBrace`);var a=mj(i.base,t.havingBaseStyle(WO.DISPLAY)),o=Uj(i,t),s=i.isOver?VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):VA({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):VA({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:SN,mathmlBuilder:(e,t)=>{var n=Bj(e.label);return new Q(e.isOver?`mover`:`munder`,[kj(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=Xj(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:rj(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=cj(e.body,t,!1);return LA(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Oj(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=Xj(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:rj(s)}}}),Z({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:rj(t[0])}},htmlBuilder(e,t){return RA(cj(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,Dj(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=Xj(t[0],`raw`).string,a=t[1];n.settings.strict&&EA({strict:n.settings.strict,errorCode:`htmlExtension`,errorMsg:`HTML extension is disabled on strict mode`,report:!0});var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new B(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:rj(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=cj(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>Oj(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:rj(t[0]),mathml:rj(t[1])}),htmlBuilder:(e,t)=>RA(cj(e.html,t,!1)),mathmlBuilder:(e,t)=>Oj(e.mathml,t)});var CN=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!fk(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Xj(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=CN(d);break;case`height`:a=CN(d);break;case`totalheight`:o=CN(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=Xj(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=pk(e.height,t),r=0;e.totalheight.number>0&&(r=pk(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=pk(e.width,t));var a={height:V(n+r)};i>0&&(a.width=V(i)),r>0&&(a.verticalAlign=V(-r));var o=new Sk(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=pk(e.height,t),i=0;if(e.totalheight.number>0&&(i=pk(e.totalheight,t)-r,n.setAttribute(`valign`,V(-i))),n.setAttribute(`height`,V(r+i)),e.width.number>0){var a=pk(e.width,t);n.setAttribute(`width`,V(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=Xj(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||EA({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&EA({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&EA({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` doesn't support mu units`,report:!0})}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return HA(e.dimension,t)},mathmlBuilder(e,t){return new yj(pk(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[mj(e.body,t)]),n=X([`katex-inner`],[n],t)):n=X([`katex-inner`],[mj(e.body,t)]);var r=X([`katex-fix`],[]),i=X([e.alignment],[n,r],t),a=X([`katex-strut`]);return a.style.height=V(i.height+i.depth),i.depth&&(a.style.verticalAlign=V(-i.depth)),i.children.unshift(a),i=X([`katex-thinbox`],[i],t),X([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[kj(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new B(`Mismatched `+e.funcName)}});var wN=(e,t)=>{switch(t.style.size){case WO.DISPLAY.size:return e.display;case WO.TEXT.size:return e.text;case WO.SCRIPT.size:return e.script;case WO.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:rj(t[0]),text:rj(t[1]),script:rj(t[2]),scriptscript:rj(t[3])}),htmlBuilder:(e,t)=>RA(cj(wN(e,t),t,!1)),mathmlBuilder:(e,t)=>Oj(wN(e,t),t)});var TN=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&xO(n),c,l;if(t){var u=mj(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=mj(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=VA({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=VA({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=VA({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=V(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},EN=new Set([`\\smallint`]),DN=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Xj(e.base,`op`),i=!0):a=Xj(e,`op`);var o=t.style,s=!1;o.size===WO.DISPLAY.size&&a.symbol&&!EN.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=OA(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=KA(d+`Size`+(s?`2`:`1`),t);c=VA({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=cj(a.body,t,!0);p.length===1&&p[0]instanceof wk?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(kA(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof wk||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?TN(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=V(g)),c)},ON=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[Sj(e.name,e.mode)]),EN.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,Dj(e.body,t));else{n=new Q(`mi`,[new vj(e.name.slice(1))]);var r=new Q(`mo`,[Sj(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):_j([n,r])}return n},kN={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=kN[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:DN,mathmlBuilder:ON}),Z({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:rj(r)}}});var AN={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=AN[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var jN=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Xj(e.base,`operatorname`),i=!0):a=Xj(e,`operatorname`);var o;if(a.body.length>0){for(var s=cj(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof wk&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?TN(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:rj(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:jN,mathmlBuilder:(e,t)=>{for(var n=Dj(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof yj)){if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof vj?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new vj(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[Sj(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):_j([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),tj({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?RA(cj(e.body,t,!1)):X([`mord`],cj(e.body,t,!0),t)},mathmlBuilder(e,t){return Oj(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=mj(e.body,t.havingCrampedStyle()),r=IA(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-overline`],[VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new vj(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[kj(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:rj(r)}},htmlBuilder:(e,t)=>RA(cj(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,Dj(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`katex-inner`],[mj(e.body,t.withPhantom())]),X([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,Dj(rj(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=Xj(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=mj(e.body,t);return VA({positionType:`shift`,positionData:-pk(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[kj(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var MN=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Z({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:MN,htmlBuilder(e,t){return X([`mord`,`reflectbox`],[mj(e.body,t)],t)},mathmlBuilder(e,t){return kj(e.body,t)}}),Z({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:MN}),Z({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),Z({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=Xj(t[0],`size`),o=Xj(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Xj(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`katex-rule`],[],t),r=pk(e.width,t),i=pk(e.height,t),a=e.shift?pk(e.shift,t):0;return n.style.borderRightWidth=V(r),n.style.borderTopWidth=V(i),n.style.bottom=V(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=pk(e.width,t),r=pk(e.height,t),i=e.shift?pk(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,V(n)),o.setAttribute(`height`,V(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,V(i)):(s.setAttribute(`height`,V(i)),s.setAttribute(`depth`,V(-i))),s.setAttribute(`voffset`,V(i)),s}});function NN(e,t,n){for(var r=cj(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return RA(r)}var PN=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:PN,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:PN.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return NN(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,Dj(e.body,n));return r.setAttribute(`mathsize`,V(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&Xj(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=Zj(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[mj(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[kj(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=mj(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=zA(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<WO.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=PM(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=V(l);var f=VA({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(WO.SCRIPTSCRIPT),m=mj(e.index,p,t);return X([`mord`,`sqrt`],[X([`katex-root`],[VA({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return X([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Q(`mroot`,[kj(n,t),kj(r,t)]):new Q(`msqrt`,[kj(n,t)])}});var FN={display:WO.DISPLAY,text:WO.TEXT,script:WO.SCRIPT,scriptscript:WO.SCRIPTSCRIPT};function IN(e){return e in FN}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!IN(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=FN[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),NN(e.body,r,t)},mathmlBuilder(e,t){var n=FN[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,Dj(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var LN=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===WO.DISPLAY.size||n.alwaysHandleSupSub)?DN:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===WO.DISPLAY.size||n.limits)?jN:null:n.type===`accent`?xO(n.base)?tM:null:n.type===`horizBrace`&&!e.sub===n.isOver?SN:null:null};tj({type:`supsub`,htmlBuilder(e,t){var n=LN(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=mj(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&xO(r);if(i){var p=t.havingStyle(t.style.sup());s=mj(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=mj(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===WO.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=V(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof wk||y)&&(v=V(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=VA({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=VA({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=VA({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([fj(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[kj(e.base,t)];e.sub&&a.push(kj(e.sub,t)),e.sup&&a.push(kj(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===WO.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===WO.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===WO.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===WO.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===WO.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===WO.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),tj({type:`atom`,htmlBuilder(e,t){return kA(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[Sj(e.text,e.mode)]);if(e.family===`bin`){var r=Tj(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var RN={mi:`italic`,mn:`normal`,mtext:`normal`};tj({type:`mathord`,htmlBuilder(e,t){return jA(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[Sj(e.text,e.mode,t)]),r=Tj(e,t)||`italic`;return r!==RN[n.type]&&n.setAttribute(`mathvariant`,r),n}}),tj({type:`textord`,htmlBuilder(e,t){return jA(e,t)},mathmlBuilder(e,t){var n=Sj(e.text,e.mode,t),r=Tj(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==RN[i.type]&&i.setAttribute(`mathvariant`,r),i}});var zN=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),BN=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);tj({type:`spacing`,htmlBuilder(e,t){var n=BN.get(e.text),r=zN.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=jA(e,t);return a.classes.push(i),a}return X([`mspace`,i],[kA(e.text,e.mode,t)],t)}if(r)return X([`mspace`,r],[],t);throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(BN.has(e.text))n=new Q(`mtext`,[new vj(`\xA0`)]);else if(zN.has(e.text))return new Q(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var VN=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};tj({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[VN(),new Q(`mtd`,[Oj(e.body,t)]),VN(),new Q(`mtd`,[Oj(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var HN={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},UN={"\\textbf":`textbf`,"\\textmd":`textmd`},WN={"\\textit":`textit`,"\\textup":`textup`},GN=(e,t)=>{var n=e.font;return n?HN[n]?t.withTextFontFamily(HN[n]):UN[n]?t.withTextFontWeight(UN[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(WN[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:rj(i),font:r}},htmlBuilder(e,t){var n=GN(e,t);return X([`mord`,`text`],cj(e.body,n,!0),n)},mathmlBuilder(e,t){var n=GN(e,t);return Oj(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=mj(e.body,t),r=IA(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-underline`],[VA({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new vj(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[kj(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=mj(e.body,t),r=t.fontMetrics().axisHeight;return VA({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[kj(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new B(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=KN(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(OA(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),NA(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new vj(KN(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var KN=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),qN=QA,JN=`[ \r
386
+ ]`,YN=`\\\\[a-zA-Z@]+`,XN=`\\\\[^\ud800-\udfff]`,ZN=`(`+YN+`)`+JN+`*`,QN=`\\\\(
387
+ |[ \r ]+
388
+ ?)[ \r ]*`,$N=`[̀-ͯ]`,eP=RegExp($N+`+$`),tP=`(`+JN+`+)|`+(QN+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+($N+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+($N+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+ZN)+(`|`+XN+`)`),nP=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(tP,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new nN(`EOF`,new tN(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new nN(e[t],new tN(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
389
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,EA({strict:this.settings.strict,errorCode:`commentAtEnd`,errorMsg:`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`,report:!0})):this.tokenRegex.lastIndex=i+1,this.lex()}return new nN(r,new tN(this,t,this.tokenRegex.lastIndex))}},rP=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},iP=eN;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var aP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new B("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=aP[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=aP[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var oP=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new B(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new B(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new B(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new B(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>oP(e,!1,!0,!1)),$(`\\renewcommand`,e=>oP(e,!0,!1,!1)),$(`\\providecommand`,e=>oP(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),qN[n],Rk.math[n],Rk.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var sP={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},cP=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in sP?t=sP[n]:(n.slice(0,4)===`\\not`||n in Rk.math&&cP.has(Rk.math[n].group))&&(t=`\\dotsb`),t});var lP={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in lP?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in lP&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in lP?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new B(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var uP=V(jk[`Main-Regular`][84][1]-.7*jk[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+uP+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+uP+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var dP=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,dP(!1)),$(`\\bra@set`,dP(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var fP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},pP=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new rP(iP,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new nP(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new nN(`EOF`,n.loc)),this.pushTokens(r),new nN(``,tN.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new B(`Extra }`,i)}else if(i.text===`EOF`)throw new B(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new B(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new B(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new B(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new B(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new B(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new nN(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new nP(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(qN,e)||Object.prototype.hasOwnProperty.call(Rk.math,e)||Object.prototype.hasOwnProperty.call(Rk.text,e)||Object.prototype.hasOwnProperty.call(fP,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(qN,e)&&!qN[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},mP=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,hP=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),gP={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},_P={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},vP=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new pP(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new nN(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&qN[i.text]&&qN[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new B(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new B(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new B(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new B(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new B(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new B(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(hP[i.text]){var s=mP.test(i.text),c=[];for(c.push(new nN(hP[i.text])),this.consume();;){var l=this.fetch().text;if(!hP[l]||mP.test(l)!==s)break;c.unshift(new nN(hP[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=qN[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new B(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new B(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new B(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=qN[e];if(o&&o.handler)return o.handler(a,t,n);throw new B(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new B(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new B(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new B(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new B(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new B(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new B(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new B(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!fk(i))throw new B(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:tN.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(fP,r)){if(this.settings.throwOnError)throw new B(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:tN.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:tN.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:tN.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new B(`\\verb assertion failed --
390
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(_P,t[0])&&!Rk[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&EA({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=_P[t[0]]+t.slice(1));var i=eP.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Rk[this.mode][t]){this.settings.strict&&this.mode===`math`&&cA.includes(t)&&EA({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=Rk[this.mode][t].group,s=tN.range(e);a=Yj(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(JO(t.charCodeAt(0))?this.mode===`math`&&EA({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):EA({strict:this.settings.strict,errorCode:`unknownSymbol`,errorMsg:`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),report:!0,token:e})),a={type:`textord`,mode:`text`,loc:tN.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!gP[l])throw new B(`Unknown accent ' `+l+`'`,e);var u=gP[l][this.mode]||gP[l].text;if(!u)throw new B(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:tN.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};vP.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var yP=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new vP(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new B(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new nN(`\\df@tag`)])}]}return r},bP=function(e,t,n){t.textContent=``;var r=wP(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),bP=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var xP=function(e,t){return wP(e,t).toMarkup()},SP=function(e,t){return yP(e,new DO(t))},CP=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=X([`katex-error`],[new wk(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},wP=function(e,t){var n=new DO(t);try{return Lj(yP(e,n),e,n)}catch(t){return CP(t,e,n)}},TP={version:`0.19.0`,render:bP,renderToString:xP,ParseError:B,SETTINGS_SCHEMA:CO,__parse:SP,__renderToDomTree:wP,__renderToHTMLTree:function(e,t){var n=new DO(t);try{return Rj(yP(e,n),n)}catch(t){return CP(t,e,n)}},__setFontMetrics:Pk,__defineSymbol:H,__defineFunction:Z,__defineMacro:$,__domTree:{Span:bk,Anchor:xk,SymbolNode:wk,SvgNode:Tk,PathNode:Ek,LineNode:Dk}},EP=500,DP=new Map;function OP(e,t){let n=`${+!!t}:${e}`;if(DP.has(n)){let e=DP.get(n)??null;return DP.delete(n),DP.set(n,e),e}let r;try{let n=TP.renderToString(e,{displayMode:t,output:`htmlAndMathml`,throwOnError:!0,trust:!1,strict:`ignore`,maxExpand:1e3,maxSize:50});r=KE.sanitize(n,{USE_PROFILES:{html:!0,svg:!0,mathMl:!0}})}catch{r=null}return DP.set(n,r),DP.size>EP&&DP.delete(DP.keys().next().value),r}var kP=null;function AP(e,t){let n=kP;kP=e;try{return t()}finally{kP=n}}function jP(e,t){let n=RegExp(`<span data-math="${t.nonce}:(\\d+)"></span>`,`g`);return e.replace(n,(e,n)=>t.items[Number(n)]??e)}function MP(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function NP(e,t,n){let r=OP(e,t);return r===null||kP===null?MP(n):(kP.items.push(r),`<span data-math="${kP.nonce}:${kP.items.length-1}"></span>`)}var PP=[/^\$\$[ \t]*\n?([\s\S]+?)\n?[ \t]*\$\$[ \t]*(?:\n|$)/,/^\\\[[ \t]*\n?([\s\S]+?)\n?[ \t]*\\\][ \t]*(?:\n|$)/],FP=/^(?:\\\(([\s\S]+?)\\\)|(\$\$?)(?![\s$])((?:\\[\s\S]|[^$\\`])+?)(?<!\s)\2(?!\d))/,IP=/^\\[()[\]]/;function LP(e,t){let n=e.search(t);return n<0?void 0:n}var RP=new Ww({extensions:[{name:`mathLiteral`,level:`inline`,start:e=>LP(e,/\\[()[\]]/),tokenizer(e){let t=IP.exec(e);return t?{type:`mathLiteral`,raw:t[0]}:void 0},renderer:e=>MP(e.raw)},{name:`mathBlock`,level:`block`,start:e=>e.match(/^(?:\$\$|\\\[)/m)?.index,tokenizer(e){for(let t of PP){let n=t.exec(e);if(n?.[1]?.trim())return{type:`mathBlock`,raw:n[0],text:n[1].trim()}}},renderer:e=>`<p>${NP(e.text,!0,e.raw.trimEnd())}</p>\n`},{name:`mathInline`,level:`inline`,start:e=>LP(e,/\$|\\\(/),tokenizer(e){let t=FP.exec(e),n=t?.[1]??t?.[3];if(t&&n?.trim())return{type:`mathInline`,raw:t[0],text:n.trim(),display:t[2]===`$$`}},renderer:e=>NP(e.text,e.display,e.raw)}],renderer:{code({text:e,lang:t}){return`<pre><code class="${UD(t)?`hljs language-${t??``}`:`hljs`}">${WD(e,t)}</code></pre>`}}});function zP(e){let t={nonce:crypto.randomUUID(),items:[]},n=AP(t,()=>RP.parse(e,{async:!1,gfm:!0,breaks:!0}));return jP(KE.sanitize(n,{USE_PROFILES:{html:!0}}),t)}function BP({text:e}){let t=(0,d.useMemo)(()=>zP(e),[e]);return(0,j.jsx)(`div`,{className:`md`,dangerouslySetInnerHTML:{__html:t}})}function VP({interaction:e,status:t}){let n=z();return(0,j.jsxs)(`section`,{"aria-label":n(`plan.row.section`),"data-plan-row":!0,"data-status":t,className:`rounded-card border border-tianyi-200 bg-surface px-3 py-2 text-sm shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,j.jsx)(Ux,{name:`sparkles`,size:12}),n(`plan.card.badge`)]}),t!==void 0&&(0,j.jsx)(`span`,{className:`shrink-0 rounded-full border border-ink-200 bg-ink-50 px-2 py-0.5 text-xs font-medium text-ink-700`,children:W_(t)})]}),(0,j.jsx)(`p`,{className:`mt-1.5 whitespace-pre-wrap break-words font-semibold text-ink-900`,children:z_(e.title)}),(0,j.jsx)(`ol`,{className:`mt-1 max-h-40 list-decimal space-y-0.5 overflow-y-auto pl-5 text-ink-800`,children:e.steps.map((e,t)=>(0,j.jsx)(`li`,{className:`break-words pl-1`,children:(0,j.jsx)(BP,{text:e})},t))})]})}function HP({invocation:e}){let[t,n]=(0,d.useState)(!1);return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-sakura-200 bg-surface text-left shadow-soft`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`focus-neko flex w-full items-center gap-2 px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`text-sakura-500`,children:(0,j.jsx)(Ux,{name:`sparkles`,size:14})}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-semibold text-sakura-800`,children:[`skill:`,e.name]}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,title:e.location,children:e.location}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:t?`▾`:`▸`})]}),t&&(0,j.jsx)(`div`,{className:`border-t border-sakura-100 px-3 py-2`,children:(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.body.trim()})})]})}function UP({text:e}){let t=z(),[n,r]=(0,d.useState)(!1);return e.trim()===``?null:(0,j.jsxs)(`div`,{className:`rounded-xl border border-dashed border-sakura-300 bg-sakura-50/70`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>{r(!n)},className:`focus-neko flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-ink-600 italic`,children:[(0,j.jsx)(`span`,{"aria-hidden":!0,children:n?`▾`:`▸`}),t(`thinking.label`)]}),n&&(0,j.jsx)(`div`,{className:`px-3 pb-2 text-sm whitespace-pre-wrap text-ink-600 italic`,children:e})]})}var WP=48,GP=(e,t)=>e(`task.status.${t}`);function KP(){let e=z(),t=`var(--color-sakura-200)`,n=`var(--color-sakura-300)`,r=`var(--color-tianyi-800)`;return(0,j.jsxs)(`svg`,{width:`132`,height:`112`,viewBox:`0 0 132 112`,fill:`none`,"aria-hidden":`true`,children:[(0,j.jsx)(`title`,{children:e(`message.cat`)}),(0,j.jsx)(`path`,{d:`M30 46 L24 14 L54 30 Z`,fill:t,stroke:n,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,j.jsx)(`path`,{d:`M102 46 L108 14 L78 30 Z`,fill:t,stroke:n,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,j.jsx)(`path`,{d:`M32 39 L29 23 L46 32 Z`,fill:n,opacity:`0.55`}),(0,j.jsx)(`path`,{d:`M100 39 L103 23 L86 32 Z`,fill:n,opacity:`0.55`}),(0,j.jsx)(`ellipse`,{cx:`66`,cy:`66`,rx:`44`,ry:`38`,fill:`var(--color-surface)`,stroke:t,strokeWidth:`2.5`}),(0,j.jsx)(`circle`,{cx:`50`,cy:`62`,r:`5`,fill:r}),(0,j.jsx)(`circle`,{cx:`82`,cy:`62`,r:`5`,fill:r}),(0,j.jsx)(`circle`,{cx:`51.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,j.jsx)(`circle`,{cx:`83.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,j.jsx)(`ellipse`,{cx:`40`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:n,opacity:`0.65`}),(0,j.jsx)(`ellipse`,{cx:`92`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:n,opacity:`0.65`}),(0,j.jsx)(`path`,{d:`M62 71 q4 4.5 4 1 q0 -3.5 4 -1`,stroke:`var(--color-sakura-800)`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`}),(0,j.jsx)(`path`,{d:`M18 64 L32 66 M19 72 L32 70`,stroke:t,strokeWidth:`2`,strokeLinecap:`round`}),(0,j.jsx)(`path`,{d:`M114 64 L100 66 M113 72 L100 70`,stroke:t,strokeWidth:`2`,strokeLinecap:`round`})]})}function qP({text:e,images:t,skill:n,defaultImagePrompt:r,copy:i}){let a=z();return n===void 0?(0,j.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,j.jsxs)(`div`,{className:`bubble-user chat-bubble px-4 py-2.5 whitespace-pre-wrap${r?` [&>div]:mt-0`:``}`,children:[e,r&&(0,j.jsxs)(`details`,{className:`min-w-0 text-sm`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer min-h-8 py-1 text-ink-500 focus-visible:outline-2 focus-visible:outline-sakura-500`,children:a(`message.defaultImagePrompt`)}),(0,j.jsx)(`p`,{className:`pt-2 whitespace-pre-wrap break-words`,children:r.text})]}),t&&(0,j.jsx)(fO,{images:t})]}),(0,j.jsx)(lO,{text:i})]}):(0,j.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,j.jsxs)(`div`,{className:`chat-bubble flex min-w-0 flex-col items-stretch gap-1.5`,children:[(0,j.jsx)(HP,{invocation:n}),n.args!==``&&(0,j.jsx)(`div`,{className:`bubble-user px-4 py-2.5 whitespace-pre-wrap`,children:n.args})]}),(0,j.jsx)(lO,{text:i})]})}function JP({thinking:e,text:t}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(UP,{text:e}),t.trim()!==``&&(0,j.jsx)(BP,{text:t})]})}function YP({item:e}){let t=z();return e.text.trim()===``&&e.thinking.trim()===``&&e.note===null?null:(0,j.jsxs)(`div`,{className:`chat-row anim-other flex flex-col items-start`,children:[(0,j.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,j.jsx)(JP,{thinking:e.thinking,text:e.text}),e.note!==null&&(0,j.jsxs)(`div`,{className:`text-xs text-sakura-800 italic`,children:[`⚠ `,Gg(e.note,t)]})]}),(0,j.jsx)(lO,{text:sT(e),label:t(`message.copyAnswer`)})]})}function XP({text:e,decision:t}){let n=z();return(0,j.jsx)(`div`,{className:`chat-row anim-other flex justify-center`,"data-plan-decision":t?``:void 0,children:(0,j.jsx)(`span`,{className:`rounded-full bg-ink-100 px-3 py-1 text-xs text-ink-600`,children:Gg(e,n)})})}function ZP({item:e,pending:t,plan:n}){let r=e.interaction;if(r?.kind===`ask_user`){let e=r.status===`pending`?t?.find(e=>e.id===r.id):void 0;return(0,j.jsx)(`div`,{className:`chat-row anim-other`,children:(0,j.jsx)(_T,{interaction:r,onLocate:e?()=>{let t=e_().currentSessionId;t&&xv.open(t,e)}:void 0})})}return r?.kind===`submit_plan`?(0,j.jsx)(`div`,{className:`chat-row anim-other`,children:(0,j.jsx)(VP,{interaction:r,status:n?.version===r.version?n.status:void 0})}):(0,j.jsxs)(`div`,{className:`chat-row anim-other`,children:[(0,j.jsx)(oO,{codemode:e.codemode,name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,isError:e.isError,output:e.output,result:e.result,durationMs:e.durationMs,note:e.note,diff:e.diff,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffTruncated:e.diffTruncated}),e.images&&(0,j.jsx)(fO,{images:e.images})]})}function QP({streaming:e,busy:t}){let n=e.text.trim()!==``||e.thinking.trim()!==``;return(0,j.jsxs)(j.Fragment,{children:[n&&(0,j.jsx)(`div`,{className:`chat-row stream-block flex justify-start`,children:(0,j.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,j.jsx)(JP,{thinking:e.thinking,text:e.text}),t&&(0,j.jsx)(`span`,{className:`stream-caret`,"aria-hidden":!0})]})}),e.toolCalls.map(e=>(0,j.jsx)(`div`,{className:`chat-row anim-other`,children:(0,j.jsx)(oO,{codemode:e.codemode,name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,output:e.output,diff:e.diff,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffTruncated:e.diffTruncated})},`st${e.callId}`))]})}function $P({view:e,busy:t,onSubagent:n,emptyLabel:r,onLoadEarlier:i,tray:a,focusEntry:o}){let s=z(),c=(0,d.useRef)(null),l=(0,d.useRef)(``),u=(0,d.useRef)(!0),f=(0,d.useRef)(!1),[p,m]=(0,d.useState)(!1),h=e?.items??[],g=e?.streaming??null,_=e=>{let t=c.current;t!==null&&t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`})};return(0,d.useEffect)(()=>{if(!u.current)return;let e=c.current;e!==null&&e.scrollTo({top:e.scrollHeight})}),(0,d.useEffect)(()=>{if(!o||!h.some(e=>e.type===`user`&&e.id===o.id))return;let e=`${o.id}:${o.nonce}`;if(l.current===e)return;let t=c.current,n=t?.querySelector(`[data-entry-id="${o.id}"]`);t&&n&&(l.current=e,u.current=!1,t.scrollTop+=n.getBoundingClientRect().top-t.getBoundingClientRect().top,m(!0))},[o,h]),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsx)(`div`,{ref:c,onScroll:()=>{let e=c.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<WP;if(u.current=t,m(!t),e.scrollTop<=24&&i&&!f.current){f.current=!0,u.current=!1;let t=e.scrollTop,n=e.scrollHeight;i().finally(()=>{requestAnimationFrame(()=>{c.current===e&&(e.scrollTop=t+e.scrollHeight-n),f.current=!1})})}},className:`min-h-0 flex-1 overflow-y-auto`,children:(0,j.jsxs)(`div`,{className:`chat-column flex flex-col gap-3 px-4 py-5`,children:[h.length===0&&g===null&&(r?(0,j.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:r}):(0,j.jsxs)(`div`,{className:`mt-[14vh] flex flex-col items-center gap-4 text-center`,children:[(0,j.jsx)(`div`,{className:`welcome-cat`,children:(0,j.jsx)(KP,{})}),(0,j.jsxs)(`div`,{className:`text-4xl font-extrabold tracking-tight`,children:[(0,j.jsx)(`span`,{className:`logo-gradient`,children:`neko`}),(0,j.jsx)(`span`,{className:`text-tianyi-600`,children:`.`}),(0,j.jsx)(`span`,{className:`logo-gradient`,children:`harness`})]}),(0,j.jsx)(`p`,{className:`max-w-sm text-sm text-ink-600`,children:s(`message.welcome`)})]})),h.map(t=>{switch(t.type){case`user`:{let n=e?.rounds?.find(e=>e.inputEntryId===t.id||e.taskId===t.subagentRoundId);return(0,j.jsxs)(`div`,{"data-entry-id":t.id,children:[n&&(0,j.jsxs)(`details`,{className:`chat-row border-t border-sakura-200 pt-2 text-xs text-ink-500`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer`,children:s(`message.round`,{round:n.round??``,title:n.title,status:GP(s,n.status)})}),(0,j.jsx)(`p`,{className:`pt-1`,children:n.roundUsage?s(`message.roundUsage`,{input:n.roundUsage.input,output:n.roundUsage.output,cacheRead:n.roundUsage.cacheRead,cacheWrite:n.roundUsage.cacheWrite,cost:n.roundUsage.cost.toFixed(4)}):s(`message.roundUsageMissing`)})]}),(0,j.jsx)(qP,{text:t.text,copy:sT(t),images:t.images,skill:t.skill,defaultImagePrompt:t.defaultImagePrompt})]},t.key)}case`assistant`:return(0,j.jsx)(YP,{item:t},t.key);case`tool`:{let r=e?.subagents?.find(e=>e.callId===t.callId);return r&&n?(0,j.jsxs)(`button`,{type:`button`,onClick:()=>n(r.taskId),className:`focus-neko rounded-2xl border border-sakura-200 bg-surface p-4 text-left`,children:[(0,j.jsx)(`span`,{className:`text-tianyi-700`,children:r.role}),` · `,r.title,(0,j.jsxs)(`span`,{className:`block text-xs text-ink-500`,children:[GP(s,r.status),` `,r.approvalCount?s(`message.approvalsPending`,{count:r.approvalCount}):s(`message.viewProcess`)]})]},t.key):(0,j.jsxs)(`div`,{children:[(0,j.jsx)(ZP,{item:t,pending:e?.questions?.pending,plan:e?.plan?.current}),e?.approvals?.filter(e=>e.callId===t.callId&&e.status!==`pending`).map(e=>(0,j.jsx)(`p`,{className:`chat-row text-xs text-ink-500`,children:s(`message.approvalLine`,{status:s(`approval.status.${e.status}`)})},e.id))]},t.key)}case`system`:return t.jobId===void 0?(0,j.jsx)(XP,{text:t.text,decision:t.planDecision!==void 0},t.key):(0,j.jsx)(pO,{text:t.text,jobId:t.jobId,job:e?.jobs?.find(e=>e.jobId===t.jobId)},t.key);default:return null}}),g!==null&&(0,j.jsx)(QP,{streaming:g,busy:t})]})}),(p||a)&&(0,j.jsxs)(`div`,{className:`discrete-in flex shrink-0 items-center justify-center gap-2 border-t border-sakura-100 bg-base/70 py-1.5`,children:[a,p&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>{u.current=!0,m(!1),_(!0)},className:`focus-neko rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,children:s(`message.toBottom`)})]})]})}var eF=()=>document.querySelector(`textarea[data-composer-input]`)?.focus();function tF(){let{currentSessionId:e}=$g();return e?(0,j.jsx)(nF,{sessionId:e},e):null}function nF({sessionId:e}){let t=z(),n=q_($g()),r=n?.awaiting??null,i=n?.online??!1,[a,o]=(0,d.useState)(null),s=(0,d.useRef)(!0);(0,d.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let c=(0,d.useRef)(new Set),l=(0,d.useRef)(null),u=n?.current??null;return(0,d.useEffect)(()=>{let e=l.current;l.current=r,!(e===null||e.version===r?.version||c.current.has(e.version))&&o(u!==null&&u.version===e.version?t(`plan.card.gone`,{status:W_(u.status)}):t(`plan.card.goneOther`))},[r,u,t]),r===null&&a===null?null:(0,j.jsx)(`section`,{"aria-label":t(`plan.card.section`),"data-plan-dock":!0,className:`flex shrink-0 flex-col px-3 pt-0.5 pb-1 sm:px-4`,children:(0,j.jsxs)(`div`,{className:`chat-column flex flex-col gap-1.5`,children:[a!==null&&(0,j.jsxs)(`output`,{"data-plan-notice":!0,className:`flex items-start gap-2 rounded-xl border border-tianyi-200 bg-surface px-3 py-2 text-sm text-ink-800`,children:[(0,j.jsx)(`span`,{className:`max-h-24 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,children:a}),(0,j.jsx)(Xx,{label:t(`plan.card.dismiss`),onClick:()=>o(null)})]}),r!==null&&(0,j.jsx)(rF,{sessionId:e,plan:r,online:i,deciding:c.current,onSettled:(e,t)=>{s.current&&o(Y_(e,t))}},r.version)]})})}function rF(e){let t=z(),{plan:n,online:r}=e,[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(``),[u,f]=(0,d.useState)(``),p=(0,d.useRef)(!1),m=(0,d.useRef)(null),h=(0,d.useRef)(null),g=(0,d.useId)();(0,d.useLayoutEffect)(()=>()=>{m.current?.contains(document.activeElement)&&eF()},[]),(0,d.useEffect)(()=>{o&&h.current?.focus()},[o]);let _=c.trim(),v=!r||i!==null,y=async i=>{if(!p.current&&r){p.current=!0,e.deciding.add(n.version),a(i.kind),f(``);try{let r=await d_.planRespond(e.sessionId,{version:n.version,decision:i});if(r.status===`awaiting_approval`)throw Error(t(`plan.card.notSaved`));let a=r.status===X_(i.kind)&&(i.kind===`approve`||r.feedback===i.feedback);e.onSettled(r,a)}catch(e){f(t(`plan.card.submitFailed`,{error:Q_(e)})+(i.kind===`revise`?t(`plan.card.draftKept`):``))}finally{e.deciding.delete(n.version),p.current=!1,a(null)}}},b=async()=>{if(!p.current&&r){p.current=!0,e.deciding.add(n.version),a(`exit`),f(``);try{await d_.planMode(e.sessionId,`normal`)}catch(e){f(t(`plan.card.exitFailed`,{error:Q_(e)}))}finally{e.deciding.delete(n.version),p.current=!1,a(null)}}};return(0,j.jsxs)(`section`,{ref:m,"aria-label":t(`plan.card.awaiting`),"data-plan-card":!0,"data-version":n.version,className:`flex max-h-[min(50dvh,32rem)] flex-col rounded-xl border border-tianyi-300 bg-tianyi-50 text-sm shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1.5`,children:[(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,j.jsx)(Ux,{name:`sparkles`,size:12}),t(`plan.card.badge`)]}),(0,j.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-tianyi-900`,children:[W_(`awaiting_approval`),r?``:t(`plan.card.offline`)]})]}),(0,j.jsxs)(`div`,{"data-plan-body":!0,className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain border-t border-tianyi-200 px-3 py-2`,children:[(0,j.jsx)(`h2`,{"data-plan-title":!0,className:`whitespace-pre-wrap break-words font-semibold text-ink-900`,children:z_(n.title)}),(0,j.jsx)(`ol`,{"data-plan-steps":!0,className:`list-decimal space-y-1 pl-5 text-ink-900`,children:n.steps.map((e,t)=>(0,j.jsx)(`li`,{className:`break-words pl-1`,children:(0,j.jsx)(BP,{text:e})},t))}),n.note!==``&&(0,j.jsx)(`div`,{"data-plan-note":!0,className:`break-words text-xs text-ink-700`,children:(0,j.jsx)(BP,{text:n.note})}),o&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`label`,{htmlFor:`${g}-feedback`,className:`mb-1 block text-xs font-medium text-ink-600`,children:t(`plan.card.feedback`)}),(0,j.jsx)(`textarea`,{ref:h,id:`${g}-feedback`,rows:3,value:c,maxLength:cm.feedbackChars,disabled:v,className:`focus-neko max-h-40 w-full resize-y rounded-lg border border-sakura-200 bg-surface px-2 py-1.5 text-base text-ink-900 disabled:opacity-60 sm:text-sm`,onChange:e=>l(e.target.value)})]})]}),(0,j.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t border-tianyi-200 px-3 py-2`,children:[!r&&(0,j.jsx)(`output`,{className:`block text-xs text-sakura-800`,children:t(`plan.card.offlineNote`)}),u&&(0,j.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-sakura-800`,children:u}),(0,j.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:o?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,disabled:v||_===``,className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,onClick:()=>void y({kind:`revise`,feedback:_}),children:t(i===`revise`?`plan.card.submitting`:`plan.card.submitFeedback`)}),(0,j.jsx)(`button`,{type:`button`,disabled:v,className:`focus-neko h-9 rounded-full border border-ink-300 bg-surface px-3 text-sm text-ink-700 hover:bg-ink-50 disabled:opacity-50`,onClick:()=>{s(!1),f(``)},children:t(`common.cancel`)}),(0,j.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:_===``?t(`plan.card.needFeedback`):`${c.length}/${cm.feedbackChars}`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,disabled:v,className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,onClick:()=>void y({kind:`approve`}),children:t(i===`approve`?`plan.card.submitting`:`plan.card.approve`)}),(0,j.jsx)(`button`,{type:`button`,disabled:v,className:`focus-neko h-9 rounded-full border border-ink-300 bg-surface px-3 text-sm text-ink-700 hover:bg-ink-50 disabled:opacity-50`,onClick:()=>s(!0),children:t(`plan.card.revise`)}),(0,j.jsx)(`button`,{type:`button`,disabled:v,className:`focus-neko h-9 rounded-full border border-sakura-300 bg-surface px-3 text-sm text-sakura-800 hover:bg-sakura-50 disabled:opacity-50`,onClick:()=>void b(),children:t(i===`exit`?`plan.card.processing`:`plan.card.exit`)}),(0,j.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:t(`plan.card.hint`)})]})})]})]})}var iF=[],aF=e=>e instanceof Error?e.message:String(e),oF=()=>document.querySelector(`textarea[data-composer-input]`)?.focus();function sF(e){return document.querySelector(`dialog[open]`)!==null||(e?.subagents??[]).some(e=>(e.approvalCount??0)>0&&e.historyThrough===void 0)}function cF(e,t){if(t)return B_(e);let n=R();return e.status===`cancelled`?n(`question.card.cancelledElsewhere`):n(`question.card.handledElsewhere`,{result:B_(e)})}function lF(){let{currentSessionId:e}=$g();return e?(0,j.jsx)(uF,{sessionId:e},e):null}function uF({sessionId:e}){let t=z(),n=$g(),r=bv(),i=M_(n),a=i?.online??!1,[o,s]=(0,d.useState)(()=>new Set),[c,l]=(0,d.useState)({}),[u,f]=(0,d.useState)(null),p=(0,d.useRef)(!0);(0,d.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=i?.pending??iF,h=m.map(t=>({summary:t,key:yv(e,t.id,t.version)})).filter(({key:e})=>!o.has(e)),g=h.find(({summary:t})=>t.id===r.active[e])??h[0],_=g!==void 0&&r.fold[g.key]===`open`,v=g===void 0?void 0:c[g.key];(0,d.useLayoutEffect)(()=>{let t=h.some(({key:e})=>xv.state.fold[e]===`open`);for(let{summary:r,key:i}of h){if(xv.state.fold[i]!==void 0)continue;let a=r.id===g?.summary.id&&!t&&!cS(e)&&!sF(n.view);xv.setFold(i,a?`open`:`folded`),a&&(t=!0)}});let y=(0,d.useCallback)((e,t,n)=>{xv.clearDraft(e),s(t=>new Set(t).add(e)),f(cF(t,n))},[]),b=i!==null,x=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(!b)return;let t=new Map(m.map(t=>[yv(e,t.id,t.version),t]));for(let[n,r]of x.current)t.has(n)||o.has(n)||m.some(e=>e.id===r.id)||(xv.clearDraft(n),d_.questionGet(e,r.id).then(e=>{p.current&&f(e!==null&&e.status!==`pending`?cF(e,!1):R()(`question.card.gone`))}).catch(()=>{p.current&&f(R()(`question.card.gone`))}));x.current=t},[b,m,e,o]),(0,d.useEffect)(()=>{a&&l(e=>dF(e))},[a]);let S=g?.key,C=g?.summary,w=v===void 0;if((0,d.useEffect)(()=>{if(S===void 0||C===void 0||!_||!a||!w)return;let n=S;l(e=>({...e,[n]:{state:`loading`}})),d_.questionGet(e,C.id).then(e=>{p.current&&(e===null?l(e=>({...e,[n]:{state:`error`,message:t(`question.card.notFound`)}})):e.status===`pending`?l(t=>({...t,[n]:{state:`ready`,record:e}})):y(n,e,!1))}).catch(e=>{p.current&&l(t=>({...t,[n]:{state:`error`,message:aF(e)}}))})},[S,C,_,a,w,e,y,t]),g===void 0&&u===null)return null;let T=g===void 0?0:h.indexOf(g);return(0,j.jsx)(`section`,{"aria-label":t(`question.card.dock`),"data-question-dock":!0,className:`flex shrink-0 flex-col px-3 pt-0.5 pb-1 sm:px-4`,children:(0,j.jsxs)(`div`,{className:`chat-column flex flex-col gap-1.5`,children:[u!==null&&(0,j.jsxs)(`output`,{"data-question-notice":!0,className:`flex items-start gap-2 rounded-xl border border-tianyi-200 bg-surface px-3 py-2 text-sm text-ink-800`,children:[(0,j.jsx)(`span`,{className:`max-h-24 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,children:z_(u)}),(0,j.jsx)(Xx,{label:t(`question.card.dismiss`),onClick:()=>f(null)})]}),h.length>1&&(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-700`,children:[(0,j.jsx)(`span`,{children:t(`question.card.count`,{total:h.length,index:T+1})}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-tianyi-300 px-2.5 py-0.5 disabled:opacity-50`,disabled:T===0,onClick:()=>xv.setActive(e,h[T-1].summary.id),children:t(`question.card.prev`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-tianyi-300 px-2.5 py-0.5 disabled:opacity-50`,disabled:T===h.length-1,onClick:()=>xv.setActive(e,h[T+1].summary.id),children:t(`question.card.next`)})]}),g!==void 0&&(0,j.jsx)(fF,{sessionId:e,summary:g.summary,questionKey:g.key,slot:v,online:a,open:_,onRetry:()=>l(({[g.key]:e,...t})=>t),onSettled:(e,t)=>y(g.key,e,t)},g.key)]})})}function dF(e){return Object.values(e).some(e=>e.state===`error`)?Object.fromEntries(Object.entries(e).filter(([,e])=>e.state!==`error`)):e}function fF(e){let t=z(),{summary:n,questionKey:r,open:i,online:a}=e,o=bv(),s=xv.draft(r),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(``),p=(0,d.useRef)(!1),m=(0,d.useRef)(null),h=(0,d.useRef)(null),g=(0,d.useRef)(null),_=(0,d.useId)(),v=e.slot?.state===`ready`?e.slot.record:null,y=(v?.options.length??n.optionCount)>0;(0,d.useLayoutEffect)(()=>()=>{m.current?.contains(document.activeElement)&&oF()},[]);let b=o.focus?.key===r?o.focus:null,x=e.slot?.state;(0,d.useEffect)(()=>{if(b===null||!i||(x===void 0||x===`loading`)&&a)return;let e=h.current;(e?.querySelector(`[data-recommended] input:not(:disabled)`)??e?.querySelector(`input:not(:disabled)`)??e?.querySelector(`textarea:not(:disabled)`)??g.current)?.focus(),m.current?.scrollIntoView?.({block:`nearest`}),xv.consumeFocus(b.nonce)},[b,i,a,x]);let S=!a||c!==null||v===null,C=v!==null&&Sm(v,s)!==null,w=!S&&v!==null&&!C,T=async r=>{if(!p.current&&a&&v!==null){p.current=!0,l(r.kind===`skip`?`skip`:`answer`),f(``);try{let i=await d_.questionRespond(e.sessionId,{id:n.id,version:n.version,response:r});if(i.status===`pending`)throw Error(t(`question.card.notSaved`));e.onSettled(i,V_(i,r))}catch(e){f(t(`question.card.submitFailed`,{error:aF(e)}))}finally{p.current=!1,l(null)}}},E=()=>{let e=xm(s);e!==null&&w&&T(e)},ee=z_(n.preview).replace(/\s+/g,` `),te=`${_}-body`;return(0,j.jsxs)(`section`,{ref:m,"aria-label":t(`question.card.section`),"data-question-card":!0,"data-open":i,className:`flex max-h-[min(42dvh,28rem)] flex-col rounded-xl border border-tianyi-300 bg-tianyi-50 text-sm shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1.5`,children:[(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,j.jsx)(Ux,{name:`sparkles`,size:12}),t(`question.card.section`)]}),(0,j.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-tianyi-900`,children:[t(`question.card.awaiting`),a?``:t(`question.card.offline`)]}),i?(0,j.jsx)(`span`,{className:`min-w-0 flex-1`}):(0,j.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-ink-700`,title:ee,children:[ee,n.preview.length>=sm.previewChars?`…`:``]}),!i&&(s.optionIds.length>0||s.text!==``)&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:t(`question.card.draftKept`)}),(0,j.jsx)(`button`,{ref:g,type:`button`,className:`focus-neko h-9 shrink-0 rounded-full border border-tianyi-300 bg-surface px-3 text-xs text-tianyi-900 hover:bg-tianyi-100`,"aria-expanded":i,"aria-controls":te,"aria-label":t(i?`question.card.foldTitle`:`question.card.unfoldTitle`),onClick:()=>xv.setFold(r,i?`folded`:`open`),children:t(i?`question.card.fold`:`question.card.unfold`)})]}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{ref:h,id:te,"data-question-body":!0,className:`min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain border-t border-tianyi-200 px-3 py-2`,children:v===null?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-ink-900`,children:z_(n.preview)}),e.slot?.state===`error`?(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`p`,{role:`alert`,className:`min-w-0 break-words text-sm text-sakura-800`,children:t(`question.card.loadFailed`,{message:e.slot.message})}),a&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-tianyi-300 px-3 py-1 text-xs`,onClick:e.onRetry,children:t(`common.retry`)})]}):(0,j.jsx)(`output`,{className:`block text-xs text-ink-600`,children:t(a?`question.card.loading`:`question.card.loadOffline`)})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-ink-900`,"data-question-text":!0,children:z_(v.question)}),v.options.length>0&&(0,j.jsxs)(`fieldset`,{className:`min-w-0 space-y-1.5`,"data-question-options":!0,children:[(0,j.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-ink-600`,children:v.multiple?t(`question.card.chooseMany`):t(`question.card.chooseOne`)}),v.options.map((e,n)=>{let i=`${_}-option-${n}`,a=e.description?`${i}-description`:void 0;return(0,j.jsxs)(`div`,{"data-option-id":e.id,"data-recommended":e.recommended?``:void 0,className:`flex min-w-0 items-start gap-2 rounded-lg border border-tianyi-200 bg-surface px-2 py-1.5 has-[:checked]:border-tianyi-500 has-[:checked]:bg-tianyi-100`,children:[(0,j.jsx)(`input`,{id:i,type:v.multiple?`checkbox`:`radio`,name:`${_}-choice`,value:e.id,checked:s.optionIds.includes(e.id),disabled:S,"aria-describedby":a,className:`mt-1 h-4 w-4 shrink-0 accent-tianyi-600`,onChange:()=>xv.setDraft(r,bm(v,s,e.id))}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`label`,{htmlFor:i,className:`block cursor-pointer whitespace-pre-wrap break-words`,children:[z_(e.label),e.recommended&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`span`,{className:`rounded-full border border-sakura-300 bg-sakura-50 px-1.5 py-0.5 text-xs text-sakura-800`,children:t(`question.card.recommended`)})]})]}),e.description&&(0,j.jsx)(`p`,{id:a,className:`whitespace-pre-wrap break-words text-xs text-ink-600`,children:z_(e.description)})]})]},e.id)}),!v.multiple&&s.optionIds.length>0&&(0,j.jsx)(`button`,{type:`button`,disabled:S,className:`focus-neko rounded-full px-2 py-0.5 text-xs text-tianyi-800 underline disabled:opacity-50`,onClick:()=>xv.setDraft(r,{...s,optionIds:[]}),children:t(`question.card.clear`)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`label`,{htmlFor:`${_}-text`,className:`mb-1 block text-xs font-medium text-ink-600`,children:t(y?`question.card.extra`:`question.card.yourAnswer`)}),(0,j.jsx)(`textarea`,{id:`${_}-text`,rows:y?2:3,value:s.text,maxLength:sm.textChars,disabled:S,className:`focus-neko max-h-40 w-full resize-y rounded-lg border border-sakura-200 bg-surface px-2 py-1.5 text-base text-ink-900 disabled:opacity-60 sm:text-sm`,onChange:e=>xv.setDraft(r,{...s,text:e.target.value})})]})]})}),(0,j.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t border-tianyi-200 px-3 py-2`,children:[!a&&(0,j.jsx)(`output`,{className:`block text-xs text-sakura-800`,children:t(`question.card.offlineNote`)}),u&&(0,j.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-sakura-800`,children:u}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,disabled:!w,className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,onClick:E,children:t(c===`answer`?`question.card.submitting`:`question.card.submit`)}),(0,j.jsx)(`button`,{type:`button`,disabled:S,title:t(`question.card.skipTitle`),className:`focus-neko h-9 rounded-full border border-ink-300 bg-surface px-3 text-sm text-ink-700 hover:bg-ink-50 disabled:opacity-50`,onClick:()=>void T({kind:`skip`}),children:t(c===`skip`?`question.card.skipping`:`question.card.skip`)}),(0,j.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:t(C&&c===null?`question.card.needInput`:`question.card.foldHint`)})]})]})]})]})}var pF={zh:`zh-CN`,en:`en-GB`};function mF(e,t=Ig()){return new Date(e).toLocaleString(pF[t])}function hF(e,t=Ig()){return new Date(e).toLocaleDateString(pF[t])}function gF(e,t,n=Ig()){return $i(e,t,n)}var _F=Date.now(),vF=new Set,yF,bF=()=>{_F=Date.now();for(let e of vF)e()},xF=e=>(vF.add(e),vF.size===1&&(bF(),yF=setInterval(bF,6e4),window.addEventListener(`focus`,bF)),()=>{vF.delete(e),vF.size||(clearInterval(yF),window.removeEventListener(`focus`,bF))}),SF=()=>(0,d.useSyncExternalStore)(xF,()=>_F);function CF(e){let t=/^([A-Za-z]:)[\\/]/.exec(e)?.[1];if(t!==void 0){let n=`${t}\\`,r=e.slice(n.length).split(/[\\/]+/).filter(Boolean);return{root:`/`,rootLabel:R()(`path.thisComputer`),crumbs:[{label:t,path:n},...r.map((e,t)=>({label:e,path:n+r.slice(0,t+1).join(`\\`)}))]}}let n=e.split(`/`).filter(Boolean);return{root:`/`,rootLabel:`/`,crumbs:n.map((e,t)=>({label:e,path:`/${n.slice(0,t+1).join(`/`)}`}))}}function wF({initialPath:e,onClose:t}){let n=z(),[r,i]=(0,d.useState)(e),[a,o]=(0,d.useState)(e),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(null),[m,h]=(0,d.useState)(!0),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(``),[b,x]=(0,d.useState)(0),S=(0,d.useRef)(0),C=(0,d.useRef)(null),w=(0,d.useRef)(!1);(0,d.useEffect)(()=>{let e=++S.current;return h(!0),y(``),p(null),d_.browse({path:r,query:s,showHidden:l}).then(t=>{e===S.current&&(p(t),o(e=>e===r?t.path:e),h(!1))},t=>{e===S.current&&(y(String(t)),h(!1))}),()=>{++S.current}},[r,s,l,b]);let T=e=>{C.current?.focus(),i(e),o(e),c(``),x(e=>e+1)},E=async()=>{if(!f?.next||m)return;let e=++S.current;h(!0),y(``);try{let t=await d_.browse({path:r,query:s,showHidden:l,cursor:f.next});e===S.current&&p({...t,entries:[...f.entries,...t.entries]})}catch(t){e===S.current&&y(String(t))}finally{e===S.current&&h(!1)}},ee=async()=>{if(!(!f||m||w.current)){w.current=!0,_(!0),y(``);try{await d_.addWorkspace(f.path),t()}catch(e){y(String(e))}finally{w.current=!1,_(!1)}}},{root:te,rootLabel:ne,crumbs:D}=CF(f?.path??r);return(0,j.jsxs)(qx,{title:n(`sessions.addWorkspace`),onClose:t,locked:g,children:[(0,j.jsxs)(`div`,{className:`picker-controls`,children:[(0,j.jsx)(`p`,{className:`text-ink-500`,children:n(`picker2.hint`)}),(0,j.jsxs)(`nav`,{className:`breadcrumbs`,"aria-label":n(`picker2.pathNav`),children:[(0,j.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>T(te),children:ne}),D.map(e=>(0,j.jsxs)(`button`,{type:`button`,disabled:g,onClick:()=>T(e.path),children:[e.label,` /`]},e.path))]}),(0,j.jsxs)(`form`,{className:`path-form`,onSubmit:e=>{e.preventDefault(),T(a)},children:[(0,j.jsx)(`input`,{ref:C,"aria-label":n(`picker2.fullPath`),value:a,disabled:g,onChange:e=>o(e.target.value)}),(0,j.jsx)(`button`,{className:`btn-outline`,type:`submit`,disabled:g,children:n(`picker2.go`)})]}),(0,j.jsxs)(`div`,{className:`filter-row`,children:[(0,j.jsx)(`input`,{"aria-label":n(`picker2.filter`),placeholder:n(`picker2.filterPlaceholder`),value:s,disabled:g,onChange:e=>c(e.target.value)}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:l,disabled:g,onChange:e=>u(e.target.checked)}),n(`picker2.hidden`)]})]})]}),(0,j.jsxs)(`fieldset`,{className:`folder-list`,"aria-label":n(`picker2.list`),"aria-busy":m,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},children:[v&&(0,j.jsxs)(`div`,{role:`alert`,className:`error-text`,children:[v,(0,j.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:g,onClick:()=>x(e=>e+1),children:n(`common.retry`)})]}),f?.parent&&(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:g||m,onClick:()=>T(f.parent),children:[(0,j.jsx)(Ux,{name:`up`}),n(`picker2.parent`)]}),f?.entries.map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:g||m||!!e.error,title:e.error??e.path,onClick:()=>T(e.path),children:[(0,j.jsx)(Ux,{name:`folder`}),(0,j.jsx)(`span`,{className:`truncate min-w-0`,children:e.name}),e.error&&(0,j.jsx)(`span`,{className:`text-ink-500`,children:n(`picker2.inaccessible`)})]},e.path)),m&&(0,j.jsx)(`output`,{className:`empty-text`,children:n(`picker2.loading`)}),!m&&f?.entries.length===0&&(0,j.jsx)(`p`,{className:`empty-text`,children:n(`picker2.noMatch`)}),f?.next&&(0,j.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:m||g,onClick:()=>void E(),children:n(`picker2.more`)})]}),(0,j.jsxs)(`div`,{className:`picker-footer`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:Yx(f?.path??r)}),(0,j.jsx)(`p`,{className:`path-text`,children:f?.path??r})]}),(0,j.jsxs)(`div`,{className:`actions`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:g,onClick:t,children:n(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,className:`btn-primary px-3 py-1.5`,disabled:!f||m||g||!!v,onClick:()=>void ee(),children:n(g?`picker2.adding`:`picker2.choose`)})]})]})]})}function TF({open:e,onClose:t}){let n=z(),r=n(`common.newSession`),i=$g(),a=SF(),o=Wx(),[s,c]=(0,d.useState)(null),l=i.sessions.find(e=>e.id===s?.id),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(null),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(``),T=i.phase!==`ready`||i.operating,E=Hg(i.sessions,i.workspaceRoot).filter(e=>Qi(e,C)),ee=e=>{e.then(()=>{o&&t()}).catch(p_)},te=i.webInfo?.launchRoot,ne=e=>e===te?n(`sessions.removeWorkspaceLaunch`):i.workspaces.length<=1?n(`sessions.removeWorkspaceLast`):null;if(!e)return null;let D=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`sidebar-top`,children:[(0,j.jsxs)(`div`,{className:`workspace-heading`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`workspace-trigger`,"aria-label":n(`sessions.switchWorkspace`),"aria-expanded":s!==null&&!s.id,disabled:T,onClick:e=>c({anchor:e.currentTarget}),children:[(0,j.jsx)(`span`,{className:`workspace-mark`,children:(0,j.jsx)(Ux,{name:`folder`})}),(0,j.jsx)(`span`,{className:`truncate min-w-0`,children:Yx(i.workspaceRoot)||n(`common.workspace`)}),(0,j.jsx)(Ux,{name:`chevron`})]}),!o&&(0,j.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":n(`sessions.collapse`),title:n(`sessions.collapse`),onClick:t,children:(0,j.jsx)(Ux,{name:`panel`})})]}),(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row font-medium`,disabled:T,onClick:()=>ee(d_.createSession()),children:[(0,j.jsx)(Ux,{name:`plus`}),n(`sessions.new`)]}),(0,j.jsxs)(`div`,{className:`search-box`,children:[(0,j.jsx)(Ux,{name:`search`}),(0,j.jsx)(`input`,{"aria-label":n(`sessions.searchAria`),placeholder:n(`sessions.searchPlaceholder`),value:C,onChange:e=>w(e.target.value)})]})]}),(0,j.jsxs)(`div`,{className:`section-label`,children:[n(`sessions.heading`),` `,(0,j.jsx)(`span`,{children:E.length})]}),(0,j.jsxs)(`div`,{className:`session-scroll`,children:[(0,j.jsx)(`ul`,{className:`session-list`,children:E.map(e=>(0,j.jsxs)(`li`,{className:`session-row ${e.id===i.currentSessionId?`is-active`:``}`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row session-select`,disabled:T,"aria-current":e.id===i.currentSessionId?`page`:void 0,"aria-describedby":`session-tip-${e.id}`,onClick:()=>ee(d_.selectSession(e.id)),children:[(0,j.jsx)(Ux,{name:`chat`}),(0,j.jsxs)(`span`,{className:`session-copy`,children:[(0,j.jsx)(`span`,{className:`truncate min-w-0`,children:Ji(e,r)}),(0,j.jsxs)(`span`,{className:`session-meta${e.awaitingAnswer===!0||e.awaitingPlan===!0?` font-semibold text-tianyi-800`:``}`,children:[(0,j.jsx)(`time`,{dateTime:new Date(Yi(e)).toISOString(),children:gF(Yi(e),a)}),L_(e)]}),(0,j.jsxs)(`span`,{className:`session-tooltip`,role:`tooltip`,id:`session-tip-${e.id}`,children:[Ji(e,r),(0,j.jsx)(`br`,{}),mF(Yi(e))]})]})]}),(0,j.jsx)(`button`,{type:`button`,className:`icon-btn row-more`,disabled:T,"aria-label":n(`sessions.actionsFor`,{name:Ji(e,r)}),title:n(`sessions.actions`),onClick:t=>c({anchor:t.currentTarget,id:e.id}),children:(0,j.jsx)(Ux,{name:`more`})})]},e.id))}),E.length===0&&(0,j.jsx)(`div`,{className:`empty-text`,children:i.phase===`ready`?n(C?`sessions.noMatch`:`sessions.empty`):n(`sessions.waitingGateway`)})]}),(0,j.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,j.jsx)(`span`,{className:`path-text`,title:i.workspaceRoot,children:i.workspaceRoot}),(0,j.jsxs)(Br,{to:`/skills`,className:`chrome-row`,onClick:()=>{o&&t()},children:[(0,j.jsx)(Ux,{name:`store`}),n(`sessions.market`)]}),(0,j.jsxs)(Br,{to:`/settings`,className:`chrome-row`,onClick:()=>{o&&t()},children:[(0,j.jsx)(Ux,{name:`settings`}),n(`sessions.settings`)]})]})]});return(0,j.jsxs)(j.Fragment,{children:[o?(0,j.jsx)(qx,{title:n(`sessions.drawer`),drawer:!0,onClose:t,children:D}):(0,j.jsx)(`aside`,{className:`chrome sidebar`,"aria-label":n(`sessions.drawer`),children:D}),s&&(0,j.jsx)(Jx,{anchor:s.anchor,label:s.id?n(`sessions.actions`):n(`sessions.chooseWorkspace`),onClose:()=>c(null),children:s.id?(0,j.jsxs)(j.Fragment,{children:[l&&(0,j.jsxs)(`div`,{className:`session-details`,children:[(0,j.jsx)(`strong`,{children:Ji(l,r)}),(0,j.jsx)(`small`,{children:mF(Yi(l))})]}),(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>{m(s.id),g(``),c(null)},children:[(0,j.jsx)(Ux,{name:`archive`}),n(`sessions.archive`)]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`section-label`,children:n(`common.workspace`)}),(0,j.jsx)(`div`,{className:`workspace-options`,children:i.workspaces.map(e=>{let t=ne(e.path);return(0,j.jsxs)(`div`,{className:`workspace-row ${e.path===i.workspaceRoot?`is-active`:``}`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`workspace-option`,title:e.path,onClick:()=>{c(null),w(``),ee(d_.selectWorkspace(e.path))},children:[(0,j.jsx)(Ux,{name:`folder`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:Yx(e.path)}),(0,j.jsx)(`small`,{children:e.path})]}),e.path===i.workspaceRoot&&(0,j.jsx)(`span`,{role:`img`,"aria-label":n(`sessions.currentWorkspace`),children:`✓`})]}),(0,j.jsx)(`button`,{type:`button`,className:`icon-btn row-remove`,disabled:T||t!==null,"aria-label":n(`sessions.removeWorkspaceAria`,{name:Yx(e.path)}),"aria-describedby":t?`workspace-remove-${e.path}`:void 0,title:t??n(`sessions.removeWorkspace`),onClick:()=>{v(e.path),b(``),c(null)},children:(0,j.jsx)(Ux,{name:`trash`})}),t&&(0,j.jsx)(`span`,{className:`sr-only`,id:`workspace-remove-${e.path}`,children:t})]},e.path)})}),(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row add-workspace`,onClick:()=>{c(null),f(!0)},children:[(0,j.jsx)(Ux,{name:`plus`}),n(`sessions.addWorkspace`)]})]})}),u&&(0,j.jsx)(wF,{initialPath:i.workspaceRoot,onClose:()=>f(!1)}),_&&(0,j.jsx)(qx,{title:n(`sessions.removeWorkspace`),locked:i.operating||x,onClose:()=>v(null),children:(0,j.jsxs)(`div`,{className:`confirm-body`,children:[(0,j.jsx)(`p`,{children:(0,j.jsx)(`strong`,{children:Yx(_)})}),(0,j.jsx)(`p`,{className:`path-text`,title:_,children:_}),(0,j.jsxs)(`ul`,{className:`confirm-notes`,children:[(0,j.jsx)(`li`,{children:n(`sessions.removeWorkspaceNoFiles`)}),(0,j.jsx)(`li`,{children:n(`sessions.removeWorkspaceHidden`,{count:Hg(i.sessions,_).length})}),(0,j.jsx)(`li`,{children:n(`sessions.removeWorkspaceRestore`)})]}),y&&(0,j.jsx)(`p`,{role:`alert`,className:`error-text`,children:y}),(0,j.jsxs)(`div`,{className:`actions`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:i.operating||x,onClick:()=>v(null),children:n(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,className:`btn-danger`,disabled:i.operating||x,onClick:()=>{S(!0),b(``),d_.removeWorkspace(_).then(()=>v(null)).catch(e=>b(Jg(e instanceof Error?e.message:String(e)))).finally(()=>S(!1))},children:n(`sessions.confirmRemoveWorkspace`)})]})]})}),p&&(0,j.jsx)(qx,{title:n(`sessions.archive`),locked:i.operating,onClose:()=>m(null),children:(0,j.jsxs)(`div`,{className:`confirm-body`,children:[(0,j.jsx)(`p`,{children:n(`sessions.archiveConfirm`,{name:Ji(i.sessions.find(e=>e.id===p)??{title:``,firstPromptPreview:``},r)})}),h&&(0,j.jsx)(`p`,{role:`alert`,className:`error-text`,children:h}),(0,j.jsxs)(`div`,{className:`actions`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:i.operating,onClick:()=>m(null),children:n(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:i.operating,onClick:()=>{d_.archiveSession(p).then(()=>m(null)).catch(e=>g(String(e)))},children:n(`sessions.confirmArchive`)})]})]})})]})}function EF(){let{shell:e}=$g(),t=z(),[n,r]=(0,d.useState)(null),i=xS(e),a=e?.status===`missing`?JSON.stringify([e.reason,e.detail]):null;return i===void 0||n===a?null:(0,j.jsxs)(`div`,{className:`discrete-in flex items-center gap-2 border-b border-sakura-300 bg-sakura-100 py-1 pr-2 pl-9 text-xs text-sakura-900`,role:`alert`,"data-shell-notice":!0,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:i}),(0,j.jsx)(Xx,{label:t(`shell.dismiss`),onClick:()=>r(a)})]})}function DF(e,t){let n=new Map(e.map(e=>[e.key,e]));for(let e of t){let t=n.get(e.key);(t?.type!==`tool`||e.type!==`tool`||t.phase!==`done`||e.phase===`done`)&&n.set(e.key,e)}return[...n.values()].sort((e,t)=>(e.order??0)-(t.order??0))}function OF({entry:e,active:t,target:n}){let r=z(),{phase:i,operating:a,view:o}=$g(),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)([]),[m,h]=(0,d.useState)(),[g,_]=(0,d.useState)(!1),[,v]=(0,d.useState)(Date.now);(0,d.useEffect)(()=>{if(!t||e.activeRoundId===null)return;let n=setInterval(()=>v(Date.now()),1e3);return()=>clearInterval(n)},[t,e.activeRoundId]);let y=i===`ready`&&!a&&o!==null,b=(0,d.useMemo)(()=>y&&t?d_.subagent(e.agentId):null,[y,t,e.agentId]),x=(0,d.useRef)(0);(0,d.useEffect)(()=>{let e=++x.current;if(_(!1),h(void 0),!b)return;let t=b.view.subscribe(t=>{e===x.current&&b.error&&u(b.error),e===x.current&&t&&(c(e=>(e?.items.length&&!t.items.some(t=>e.items.some(e=>e.key===t.key))&&h(t.historyBefore),{...t,items:DF(e?.items??[],t.items)})),h(e=>e===void 0?t.historyBefore:e),b.error||u(``))});return()=>{x.current++,t()}},[b]);let S=(0,d.useMemo)(()=>b?(e,t)=>Ki(n=>b.getImage({entryId:e,contentIndex:t,offset:n})):null,[b]),C=(0,d.useMemo)(()=>s?{...s,items:DF(f,s.items)}:null,[s,f]),w=(0,d.useCallback)(async()=>{if(!b||g||m==null)return;let e=x.current;_(!0);try{let t=await b.history(m==null?{}:{before:m});if(e!==x.current)return;p(e=>DF(e,t.items)),h(t.next)}catch(t){e===x.current&&u(String(t))}finally{e===x.current&&_(!1)}},[b,g,m]),T=n?s?.rounds?.find(e=>e.taskId===n.taskId)?.inputEntryId:void 0,E=s?.rounds?.find(t=>t.taskId===(e.activeRoundId??e.lastRoundId));return(0,d.useEffect)(()=>{t&&T!==void 0&&C&&!C.items.some(e=>e.type===`user`&&e.id===T)&&m!=null&&!g&&w()},[t,T,C,m,g,w]),(0,j.jsxs)(`div`,{className:`${t?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-sakura-100 p-3 text-xs`,children:[(0,j.jsxs)(`span`,{children:[e.historyThrough===void 0?``:r(`subagent.history`),r(`task.status.${e.status}`)]}),s&&(0,j.jsxs)(`span`,{title:r(`subagent.usage`),children:[`↑`,s.usage.input,` ↓`,s.usage.output,` · $`,s.usage.cost.toFixed(4)]}),E&&(0,j.jsxs)(`span`,{title:r(`subagent.duration`),children:[Math.max(0,Math.round(((E.endedAt??Date.now())-E.createdAt)/1e3)),`s`]}),e.historyThrough===void 0&&(e.status===`running`||e.status===`queued`)&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-2 leading-[14px]`,onClick:()=>{b?.stop({taskId:e.activeRoundId}).catch(e=>u(String(e)))},children:r(`subagent.stop`)})]}),l&&(0,j.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-sakura-800`,children:l}),(0,j.jsx)(uO.Provider,{value:S,children:(0,j.jsx)($P,{view:C,focusEntry:T!==void 0&&n?{id:T,nonce:n.nonce}:void 0,onLoadEarlier:t&&m!=null?w:void 0,busy:s?.busy??!1,emptyLabel:e.status===`queued`?r(`subagent.queued`):r(`subagent.noContent`)})})]})}function kF({entries:e,selected:t,open:n,onSelect:r,onClose:i,approval:a,target:o}){let s=z(),c=JS(),[l,u]=(0,d.useState)([]),f=(0,d.useRef)(null),p=(0,d.useRef)(null),[m,h]=(0,d.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);return(0,d.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>h(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,d.useEffect)(()=>{t!==null&&u(e=>e.includes(t)?e:[...e,t])},[t]),(0,d.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=m&&p.current?.parentElement?[...p.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==p.current):[],r=t.map(e=>e.inert);return t.forEach(e=>{e.inert=!0}),f.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,m]),(0,j.jsxs)(`aside`,{ref:p,role:m?`dialog`:`complementary`,"aria-modal":m&&n?!0:void 0,"aria-label":s(`subagent.title`),style:{"--panel-w":`${c.width}px`},className:`${n?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:relative lg:z-auto lg:w-[var(--panel-w)] lg:max-w-[60vw] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),i())}},children:[(0,j.jsx)(XS,{width:c.width,onChange:c.set,onCommit:c.commit,onReset:c.reset}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,j.jsx)(`strong`,{className:`text-sm text-ink-800`,children:s(`subagent.title`)}),(0,j.jsx)(`button`,{ref:f,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,onClick:i,children:s(`common.close`)})]}),(0,j.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:e.map(e=>(0,j.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.agentId,className:`focus-neko flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm ${t===e.agentId?`bg-tianyi-100`:`hover:bg-sakura-50`}`,onClick:()=>r(e.agentId),children:[(0,j.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,j.jsx)(`span`,{className:`text-tianyi-700`,children:e.role}),` · `,e.title]}),(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:s(`subagent.rounds`,{count:e.roundCount})})]},e.agentId))}),l.map(r=>{let i=e.find(e=>e.agentId===r);return i?(0,j.jsx)(OF,{entry:i,active:n&&r===t,target:r===t?o:void 0},r):null}),a]})}var AF={pending:`border-ink-300 bg-surface text-ink-600`,in_progress:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`,completed:`border-ink-200 bg-ink-50 text-ink-600`};function jF(e){let t=z(),n=j_($g());return n===null||n.total===0?null:(0,j.jsxs)(`button`,{type:`button`,className:`focus-neko shrink-0 whitespace-nowrap rounded-full border border-sakura-300 px-2.5 py-0.5 text-xs text-sakura-800 hover:bg-sakura-50`,"aria-expanded":e.open,"aria-controls":e.panelId,"aria-label":t(`todo.aria`,{done:n.completed,total:n.total,offline:n.offline?t(`todo.ariaOffline`):``}),title:t(`todo.progressTitle`),onClick:e.onToggle,children:[(0,j.jsxs)(`span`,{className:`max-sm:hidden`,"aria-hidden":!0,children:[t(`todo.label`),` `]}),(0,j.jsxs)(`span`,{"aria-hidden":!0,children:[n.completed,`/`,n.total]})]})}function MF(e){let t=z(),n=j_($g());return n===null||n.total===0?null:(0,j.jsxs)(`section`,{id:e.id,"aria-label":t(`todo.panel`),"data-todo-panel":!0,className:`flex max-h-[min(45dvh,20rem)] min-h-[3rem] shrink-[10] flex-col border-b border-sakura-200 bg-base`,onKeyDown:t=>{t.key===`Escape`&&(t.stopPropagation(),e.onClose())},children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 px-4 py-1.5 text-xs`,children:[(0,j.jsx)(`strong`,{className:`text-ink-800`,children:t(`todo.heading`,{done:n.completed,total:n.total})}),n.offline&&(0,j.jsx)(`output`,{className:`rounded-full border border-sakura-300 bg-sakura-50 px-2 py-0.5 text-sakura-800`,children:t(`todo.offlineNote`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko ml-auto rounded-lg px-2 py-1 text-ink-600 hover:bg-sakura-50`,onClick:e.onClose,children:t(`common.close`)})]}),(0,j.jsx)(`div`,{className:`chat-column flex min-h-0 flex-1 flex-col`,children:(0,j.jsx)(`section`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-2`,"data-todo-scroll":!0,tabIndex:0,"aria-label":t(`todo.items`),children:(0,j.jsx)(`ol`,{className:`space-y-1.5`,children:n.items.map(e=>(0,j.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,"data-status":e.status,children:[(0,j.jsxs)(`span`,{className:`mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${AF[e.status]}`,children:[(0,j.jsx)(Ux,{name:e.status===`completed`?`check`:e.status===`in_progress`?`spinner`:`clock`,size:12}),F_(e.status)]}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-ink-800`,children:z_(e.text)})]},e.id))})})})]})}var NF=class extends Error{constructor(){super(R()(`export.cancelled`)),this.name=`ExportCancelledError`}};async function PF(e){let{snapshot:t}=e,n=e.now??new Date,r=!1,i=await lT(e.format,{...t,exportedAt:n},{includeThinking:e.includeThinking,loadImage:n=>e.currentSessionId()===t.sessionId?e.readImage(n,t.sessionId):(r=!0,Promise.reject(new NF))});if(r)throw new NF;return{...i,fileName:cT(t.title,e.format,n)}}function FF(e){let t=R();return e.skippedImages>0?t(`export.doneSkipped`,{name:e.fileName,count:e.skippedImages}):t(`export.done`,{name:e.fileName})}function IF(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.hidden=!0,document.body.append(i);try{i.click()}finally{i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}}var LF=[{format:`markdown`,label:`Markdown (.md)`},{format:`html`,label:`HTML (.html)`},{format:`json`,label:`JSON (.json)`}];function RF(){let e=z(),{view:t,currentSessionId:n,sessions:r}=$g(),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(!1),f=t===null||n===null||t.items.length===0,p=e(c?`export.busy`:f?`export.empty`:`export.title`),m=async i=>{if(u.current||t===null||n===null)return;u.current=!0,l(!0),a(null);let s=r.find(e=>e.id===n);try{let r=await PF({format:i,includeThinking:o,snapshot:{sessionId:n,title:s?Ji(s,e(`common.newSession`)):e(`common.newSession`),model:t.model,cwd:t.cwd,items:t.items},currentSessionId:()=>e_().currentSessionId,readImage:(e,t)=>d_.image(e.entryId,e.contentIndex,t)});IF(r.fileName,r.content,r.mimeType),t_.notice({level:`info`,text:FF(r)})}catch(t){t_.notice({level:`error`,text:t instanceof NF?t.message:e(`export.failed`,{error:t instanceof Error?t.message:String(t)})})}finally{u.current=!1,l(!1)}};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`button`,{type:`button`,className:`icon-btn export-btn`,"aria-label":e(`export.title`),"aria-haspopup":`dialog`,"aria-expanded":i!==null,"aria-disabled":c||void 0,disabled:f&&!c,title:p,onClick:e=>{c||a(i===null?e.currentTarget:null)},children:[(0,j.jsx)(Ux,{name:`download`}),(0,j.jsx)(`span`,{className:`export-label`,children:e(c?`export.busy`:`export.button`)})]}),i&&(0,j.jsxs)(Jx,{anchor:i,label:e(`export.title`),onClose:()=>a(null),children:[(0,j.jsx)(`div`,{className:`section-label`,children:e(`export.format`)}),LF.map(({format:e,label:t})=>(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>void m(e),children:[(0,j.jsx)(Ux,{name:`download`}),t]},e)),(0,j.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":o,className:`chrome-row export-option`,onClick:()=>s(!o),children:[(0,j.jsx)(`span`,{className:`export-check`,"aria-hidden":`true`,children:o?`✓`:``}),e(`export.thinking`)]})]})]})}var zF={资源管理器:`open.explorer`,文件管理器:`open.fileManager`,"未找到 VS Code(Code.exe)":`open.noVscodeExe`,"未找到 VS Code(命令 code 不在 PATH 中)":`open.noVscodeCommand`,"未找到 explorer.exe(需启用 Windows 互操作)":`open.noExplorer`,"未找到 xdg-open":`open.noXdg`};function BF(e,t=R()){let n=zF[e];return n===void 0?e:t(n)}var VF=`neko.openTarget`;function HF(e=localStorage){try{let t=e.getItem(VF);return t===`vscode`||t===`file-manager`?t:void 0}catch{return}}function UF(e,t=localStorage){try{t.setItem(VF,e)}catch{}}function WF(e,t){return e.find(e=>e.id===t&&e.available)??e.find(e=>e.available)}function GF(e){if(typeof e!=`object`||!e)return!1;let{csrf:t,targets:n}=e;return typeof t==`string`&&Array.isArray(n)&&n.every(e=>typeof e==`object`&&!!e&&(e.id===`vscode`||e.id===`file-manager`)&&typeof e.label==`string`&&typeof e.available==`boolean`)}async function KF(){try{let e=await fetch(`/api/local/session`,{cache:`no-store`});if(!e.ok)return null;let t=await e.json();return GF(t)?t:null}catch{return null}}var qF=class extends Error{constructor(e){super(e),this.name=`OpenWorkspaceError`}};async function JF(e){let t,n;try{let r=await e.json();typeof r.code==`string`&&(t=r.code),typeof r.message==`string`&&(n=r.message)}catch{}let r=R();return e.status===403?r(`open.forbidden`):t===`invalid_path`?r(`open.invalidPath`):(t===`unavailable`||t===`launch_failed`)&&n!==void 0&&n!==``?BF(n,r):r(`open.requestFailedStatus`,{status:e.status})}async function YF(e,t,n){let r;try{r=await fetch(`/api/open`,{method:`POST`,headers:{"content-type":`application/json`,"x-neko-csrf":e},body:JSON.stringify({target:t,path:n})})}catch(e){throw new qF(R()(`open.requestFailed`,{error:e instanceof Error?e.message:String(e)}))}if(!r.ok)throw new qF(await JF(r))}function XF({size:e=18}){return(0,j.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,j.jsx)(`path`,{d:`M21.6 4.1 17.4 2 9.2 9.6 4.9 6.3 3 7.2v9.6l1.9.9 4.3-3.3 8.2 7.6 4.2-2.1z`,fill:`#0078D4`}),(0,j.jsx)(`path`,{d:`M17.4 7.4 11.6 12l5.8 4.6z`,fill:`#fff`}),(0,j.jsx)(`path`,{d:`M4.9 6.3 9.2 9.6 3 7.2zM4.9 17.7l4.3-3.3L3 16.8z`,fill:`#2AA1F5`,opacity:`0.9`})]})}function ZF({size:e=18}){return(0,j.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,j.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`18`,rx:`4.5`,fill:`#2F8CF7`}),(0,j.jsx)(`path`,{d:`M12 3h5.5A4.5 4.5 0 0 1 22 7.5v9a4.5 4.5 0 0 1-4.5 4.5H12z`,fill:`#E8F1FE`}),(0,j.jsx)(`path`,{d:`M8 9.5v2M16 9.5v2M7.5 15.5c2.7 2 6.3 2 9 0`,stroke:`#0B3A7A`,strokeWidth:`1.4`,strokeLinecap:`round`,fill:`none`})]})}function QF({size:e=18}){return(0,j.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,j.jsx)(`path`,{d:`M2 6.5A1.5 1.5 0 0 1 3.5 5h5.3l2 2.2h9.7A1.5 1.5 0 0 1 22 8.7V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#F4B63F`}),(0,j.jsx)(`path`,{d:`M2 10.2h20V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#FFD76A`})]})}function $F({size:e=18}){return(0,j.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,j.jsx)(`path`,{d:`M2 6.5A1.5 1.5 0 0 1 3.5 5h5.3l2 2.2h9.7A1.5 1.5 0 0 1 22 8.7V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#7FA6C9`}),(0,j.jsx)(`path`,{d:`M2 10.2h20V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#A9C6E0`})]})}function eI({id:e,label:t,size:n}){return e===`vscode`?(0,j.jsx)(XF,{size:n}):t===`Finder`?(0,j.jsx)(ZF,{size:n}):t===`资源管理器`?(0,j.jsx)(QF,{size:n}):(0,j.jsx)($F,{size:n})}function tI({ready:e}){let t=z(),{workspaceRoot:n,currentSessionId:r,sessions:i,view:a}=$g(),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(()=>HF()),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1),h=(0,d.useRef)(!1),g=(0,d.useRef)(!0);if((0,d.useEffect)(()=>(g.current=!0,KF().then(e=>{g.current&&s(e)}),()=>{g.current=!1}),[]),o===null)return null;let _=i.find(e=>e.id===r),v=a?.cwd??_?.workspaceRoot??n,y=WF(o.targets,c),b=e&&r!==null&&v!==``&&y!==void 0&&!p,x=y===void 0?t(`open.title`):t(`open.withTarget`,{target:BF(y.label,t)}),S=y===void 0?t(`open.noTargets`):r===null?t(`open.pickSession`):e?void 0:t(`open.notReady`),C=async e=>{if(!(h.current||v===``)){h.current=!0,m(!0),f(null);try{await YF(o.csrf,e,v),UF(e),l(e)}catch(e){t_.notice({level:`error`,text:t(`open.failed`,{error:e instanceof Error?e.message:String(e)})}),KF().then(e=>{g.current&&e!==null&&s(e)})}finally{h.current=!1,m(!1)}}},w=e=>{u===null?(f(e),KF().then(e=>{g.current&&e!==null&&s(e)})):f(null)};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`open-split`,"data-open-workspace":!0,children:[(0,j.jsx)(`button`,{type:`button`,className:`icon-btn open-main`,"aria-label":x,title:b||p?x:t(`open.disabledTitle`,{label:x,reason:S??t(`open.unavailable`)}),disabled:!b,onClick:()=>y!==void 0&&void C(y.id),children:y===void 0?(0,j.jsx)(Ux,{name:`folder`}):(0,j.jsx)(eI,{id:y.id,label:y.label})}),(0,j.jsx)(`button`,{type:`button`,className:`icon-btn open-more`,"aria-label":t(`open.choose`),title:t(`open.choose`),"aria-haspopup":`dialog`,"aria-expanded":u!==null,disabled:!e||r===null||p,onClick:e=>w(e.currentTarget),children:(0,j.jsx)(Ux,{name:`chevron`,size:16})})]}),u&&(0,j.jsxs)(Jx,{anchor:u,label:t(`open.title`),onClose:()=>f(null),children:[(0,j.jsx)(`div`,{className:`section-label`,children:t(`open.title`)}),o.targets.map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:!e.available,title:e.available||e.reason===void 0?void 0:BF(e.reason,t),onClick:()=>void C(e.id),children:[(0,j.jsx)(eI,{id:e.id,label:e.label}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate`,children:BF(e.label,t)}),!e.available&&e.reason!==void 0&&(0,j.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:BF(e.reason,t)})]})]},e.id))]})]})}var nI={ready:`common.connected`,connecting:`common.connecting`,reconnecting:`common.reconnecting`,error:`common.connectionFailed`};function rI(e){let t=z(),{workspaceRoot:n,currentSessionId:r,operating:i,sessions:a,view:o}=$g(),s=o?.jobs,c=s?.filter(e=>e.status===`running`).length??0,l=a.find(e=>e.id===r);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`header`,{className:`chrome topbar`,children:[(0,j.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":t(`topbar.toggleSidebar`),title:t(`topbar.toggleSidebar`),"aria-expanded":e.sidebarOpen,onClick:e.onToggleSessions,children:(0,j.jsx)(Ux,{name:`panel`})}),(0,j.jsxs)(`span`,{className:`topbar-path`,title:n,children:[(0,j.jsx)(Ux,{name:`folder`}),(0,j.jsx)(`span`,{className:`truncate min-w-0`,children:Yx(n)||t(`common.workspace`)})]}),(0,j.jsx)(`span`,{className:`text-ink-500`,children:`/`}),(0,j.jsx)(`span`,{className:`truncate min-w-0`,title:l?Ji(l,t(`common.newSession`)):void 0,children:l?Ji(l,t(`common.newSession`)):t(`common.newSession`)}),(0,j.jsx)(`output`,{className:`conn-status ${e.conn===`ready`?`is-connected`:e.conn===`error`?`is-error`:``}`,children:t(i?`topbar.switching`:nI[e.conn])}),e.todos&&(0,j.jsx)(jF,{open:e.todos.open,onToggle:e.todos.onToggle,panelId:e.todos.panelId}),s!==void 0&&s.length>0&&e.onToggleJobs&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 whitespace-nowrap rounded-full border border-sakura-300 px-2.5 py-0.5 text-xs text-sakura-800 hover:bg-sakura-50`,"aria-expanded":e.jobsOpen,title:t(`job.panel`),onClick:e.onToggleJobs,children:t(`topbar.jobs`,{state:c>0?t(`topbar.jobsRunning`,{count:c}):t(`topbar.jobsCount`,{count:s.length})})}),(0,j.jsx)(tI,{ready:e.conn===`ready`&&!i}),e.workspace&&(0,j.jsxs)(`button`,{type:`button`,"data-workspace-entry":!0,className:`icon-btn workspace-entry`,"aria-expanded":e.workspace.open,"aria-label":e.workspace.count>0?t(`topbar.workspaceAria`,{count:e.workspace.count}):t(`common.workspace`),title:t(`topbar.workspaceTitle`),onClick:e.workspace.onToggle,children:[(0,j.jsx)(Ux,{name:`panel-right`}),e.workspace.count>0&&(0,j.jsx)(`span`,{className:`workspace-badge`,"aria-hidden":`true`,children:e.workspace.count>99?`99+`:e.workspace.count})]}),(0,j.jsx)(RF,{})]}),(0,j.jsx)(bS,{})]})}var iI=e=>e instanceof Error?e.message:String(e),aI=e=>e!==void 0&&/not found|ENOENT|不存在/i.test(e);function oI(e){let t=e.lastIndexOf(`/`);return t<0?{name:e,dir:``}:{name:e.slice(t+1),dir:e.slice(0,t)}}function sI(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KiB`:`${(e/1048576).toFixed(1)} MiB`}var cI=e=>e===`main`?R()(`agent.main`):e;function lI(e){if(e===``)return 1;let t=e.split(`
391
+ `).length;return e.endsWith(`
392
+ `)?t-1:t}function uI(e){let t=e.split(`/`).slice(0,-1);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function dI(e,t,n,r=0){let[i,a]=(0,d.useState)({key:e,status:`loading`,data:void 0,error:void 0}),[o,s]=(0,d.useState)(0),c=(0,d.useRef)(n);c.current=n,(0,d.useEffect)(()=>{if(!t)return;let n=new AbortController;a(t=>({key:e,status:`loading`,data:t.key===e?t.data:void 0,error:void 0}));let r=e=>{n.signal.aborted||a(e)};return Promise.resolve().then(()=>c.current(n.signal)).then(t=>r(()=>({key:e,status:`ready`,data:t,error:void 0})),t=>r(n=>({key:e,status:`error`,data:n.key===e?n.data:void 0,error:iI(t)}))),()=>n.abort()},[e,t,r,o]);let l=(0,d.useCallback)(()=>s(e=>e+1),[]),u=i.key===e;return{status:u?i.status:`loading`,data:u?i.data:void 0,error:u?i.error:void 0,reload:l}}var fI=(e,t)=>(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,j.jsxs)(`span`,{className:`text-[#117555]`,children:[`+`,e]}),` `,(0,j.jsxs)(`span`,{className:`text-sakura-800`,children:[`-`,t]})]}),pI=`shrink-0 rounded-full border px-1.5 py-px text-[11px] leading-4`;function mI(e){let t=z(),{list:n}=e;return(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`changes-list`,children:[(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1.5`,children:[e.status===`error`&&(0,j.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 p-2 text-xs text-sakura-800`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`changes.listFailed`,{error:e.error??``})}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-sakura-300 px-2 py-0.5`,onClick:e.onRetry,children:t(`common.retry`)})]}),!n&&e.status===`loading`&&(0,j.jsx)(`output`,{className:`block p-2 text-xs text-ink-500`,children:t(`common.loadingEllipsis`)}),n&&n.files.length===0&&(0,j.jsx)(`div`,{"data-testid":`changes-empty`,className:`p-3 text-sm text-ink-700`,children:(0,j.jsx)(`p`,{className:`font-medium`,children:t(`changes.empty`)})}),n?.files.map(n=>{let{name:r,dir:i}=oI(n.path);return(0,j.jsxs)(`button`,{type:`button`,"data-path":n.path,title:n.path,className:`focus-neko flex w-full min-w-0 flex-col gap-0.5 rounded-lg px-2 py-1.5 text-left hover:bg-sakura-50`,onClick:()=>e.onSelect(n.path),children:[(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-ink-800`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:r}),fI(n.added,n.removed),(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:t(`changes.ops`,{count:n.ops})})]}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-ink-500`,children:[n.outside&&(0,j.jsx)(`span`,{className:`${pI} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.outside`)}),(0,j.jsx)(`span`,{className:`min-w-0 max-w-full truncate`,dir:`ltr`,children:i===``?t(`changes.root`):i}),n.agents.map(e=>(0,j.jsx)(`span`,{className:`${pI} border-tianyi-200 bg-tianyi-50 text-tianyi-900`,children:cI(e)},e))]})]},n.path)}),n?.truncated&&(0,j.jsx)(`p`,{role:`note`,className:`p-2 text-xs text-sakura-800`,children:t(`changes.listIncomplete`)})]}),(0,j.jsx)(`p`,{className:`shrink-0 border-t border-sakura-100 px-3 py-1.5 text-[11px] text-ink-500`,children:t(`changes.scopeNote`)})]})}function hI({detail:e}){let t=z(),n=(0,d.useMemo)(()=>[...e.ops].sort((e,t)=>e.seq-t.seq),[e.ops]);return(0,j.jsx)(`ol`,{className:`flex flex-col gap-3 p-3`,children:n.map((n,r)=>(0,j.jsxs)(`li`,{"data-testid":`change-op`,className:`min-w-0 rounded-lg border border-tianyi-200 bg-surface`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 border-b border-tianyi-100 px-2 py-1 text-xs text-ink-700`,children:[(0,j.jsx)(`span`,{className:`font-medium`,children:r+1}),(0,j.jsx)(`span`,{children:cI(n.agent)}),(0,j.jsx)(`span`,{className:`font-mono text-tianyi-800`,children:n.tool}),fI(n.added,n.removed),n.truncated&&(0,j.jsx)(`span`,{className:`${pI} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.truncated`)})]}),(0,j.jsx)(QD,{diff:n.diff,path:e.path,format:n.tool===`write`?`write`:`edit`,className:`max-h-80 overflow-auto p-2 font-mono text-xs text-ink-700`})]},n.seq))})}function gI(e){let t=z(),n=dI(`change:${e.path}`,e.active,()=>e.api().change(e.path),e.revision),{name:r,dir:i}=oI(e.path),a=n.data,o=a?a.outside===!0:e.outside===!0;return(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`change-detail`,children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 px-3 py-2 text-xs`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,onClick:e.onBack,children:t(`changes.backToList`)}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm text-ink-800`,title:e.path,children:r}),!o&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,onClick:()=>e.onView(e.path),children:t(`changes.viewCurrent`)})]}),(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-ink-500`,children:[o&&(0,j.jsx)(`span`,{className:`${pI} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.outside`)}),(0,j.jsx)(`span`,{className:`min-w-0 break-all`,title:e.path,children:i===``?t(`viewer.workspaceRoot`):i})]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:[n.status===`error`&&(0,j.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 p-3 text-xs text-sakura-800`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`changes.detailFailed`,{error:n.error??``})}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-sakura-300 px-2 py-0.5`,onClick:n.reload,children:t(`common.retry`)})]}),!a&&n.status===`loading`&&(0,j.jsx)(`output`,{className:`block p-3 text-xs text-ink-500`,children:t(`common.loadingEllipsis`)}),a===null&&(0,j.jsx)(`p`,{className:`p-3 text-sm text-ink-600`,children:t(`changes.noRecords`)}),a&&(0,j.jsxs)(j.Fragment,{children:[a.truncated&&(0,j.jsx)(`p`,{role:`note`,className:`px-3 pt-2 text-xs text-sakura-800`,children:t(`changes.detailIncomplete`)}),(0,j.jsx)(hI,{detail:a})]})]})]})}var _I=`focus-neko flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm text-ink-800 hover:bg-sakura-50 aria-selected:bg-tianyi-100`;function vI(e,t,n,r){let i=e.currentTarget.closest(`[role=tree]`);if(!i)return;let a=[...i.querySelectorAll(`[role=treeitem][data-path]`)],o=a.indexOf(e.currentTarget),s=t.kind===`directory`,c=r.expanded.has(t.path),l=t=>{t&&(e.preventDefault(),t.focus())};switch(e.key){case`ArrowDown`:return l(a[o+1]);case`ArrowUp`:return l(a[o-1]);case`Home`:return l(a[0]);case`End`:return l(a.at(-1));case`ArrowRight`:return s?c?l(a[o+1]?.dataset.parent===t.path?a[o+1]:void 0):(e.preventDefault(),r.onToggle(t.path)):void 0;case`ArrowLeft`:return s&&c?(e.preventDefault(),r.onToggle(t.path)):l(a.find(e=>e.dataset.path===n));case`Enter`:case` `:return e.preventDefault(),s?r.onToggle(t.path):r.onOpen(t.path)}}function yI({entry:e,parent:t,depth:n,first:r,ctx:i}){let a=z(),o=e.kind===`directory`,s=o&&i.expanded.has(e.path),c=(0,d.useRef)(i.onRowGone);return c.current=i.onRowGone,(0,d.useEffect)(()=>{let t=e.path;return()=>c.current(t)},[e.path]),(0,j.jsxs)(`div`,{role:`treeitem`,tabIndex:i.focusPath===e.path||i.focusPath===null&&r?0:-1,"aria-level":n+1,"aria-expanded":o?s:void 0,"aria-selected":i.selected===e.path,"data-path":e.path,"data-parent":t,title:e.path,className:_I,style:{paddingLeft:`${.375+n*.875}rem`},onFocus:()=>i.onFocusPath(e.path),onClick:()=>o?i.onToggle(e.path):i.onOpen(e.path),onKeyDown:n=>vI(n,e,t,i),children:[(0,j.jsx)(`span`,{"aria-hidden":!0,className:`w-3 shrink-0 text-ink-400`,children:o?s?`▾`:`▸`:``}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:`w-3.5 shrink-0 text-ink-400`,children:o&&(0,j.jsx)(Ux,{name:`folder`,size:14})}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.kind===`symlink`&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,title:a(`tree.symlinkTitle`),role:`img`,"aria-label":a(`tree.symlink`),children:`↪`}),e.protected&&(0,j.jsx)(`span`,{className:`shrink-0 text-ink-500`,title:a(`tree.protectedTitle`),role:`img`,"aria-label":a(`tree.protected`),children:(0,j.jsx)(Ux,{name:`key`,size:13})})]})}function bI({path:e,depth:t,ctx:n}){let r=z(),i=dI(e,n.active,t=>n.api().dir(e,t),n.version),a={paddingLeft:`${.375+t*.875+1.25}rem`},o=i.data?.entries;return(0,j.jsxs)(j.Fragment,{children:[o?.map((r,i)=>(0,j.jsx)(xI,{entry:r,parent:e,depth:t,first:t===0&&i===0,ctx:n},r.path)),o&&o.length===0&&i.status!==`error`&&(0,j.jsx)(`div`,{className:`py-1 pr-2 text-xs text-ink-500`,style:a,children:r(`tree.emptyDir`)}),!o&&i.status===`loading`&&(0,j.jsx)(`output`,{className:`block py-1 pr-2 text-xs text-ink-500`,style:a,children:r(`common.loadingEllipsis`)}),i.status===`error`&&(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1 pr-2 text-xs text-sakura-800`,style:a,role:`alert`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:r(`tree.readFailed`,{error:i.error??``})}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-md border border-sakura-300 px-2 py-0.5`,onClick:i.reload,children:r(`common.retry`)})]}),i.data&&(i.data.incomplete||i.data.limited)&&(0,j.jsx)(`div`,{className:`py-1 pr-2 text-xs text-sakura-800`,style:a,role:`note`,children:r(`tree.incomplete`,{reason:i.data.limited?r(`tree.limitedDir`):r(`tree.limitedWorkspace`)})})]})}function xI({entry:e,parent:t,depth:n,first:r,ctx:i}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(yI,{entry:e,parent:t,depth:n,first:r,ctx:i}),e.kind===`directory`&&i.expanded.has(e.path)&&(0,j.jsx)(bI,{path:e.path,depth:n+1,ctx:i})]})}function SI(e){let t=z(),[n,r]=(0,d.useState)(null),i={api:e.api,active:e.active,version:e.version,expanded:e.expanded,selected:e.selected,focusPath:n,onToggle:t=>{r(t),e.onToggle(t)},onOpen:e.onOpen,onFocusPath:r,onRowGone:e=>r(t=>t===e?null:t)};return(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-sakura-100 px-3 py-1.5 text-xs`,children:[(0,j.jsx)(`span`,{className:`text-ink-600`,children:t(`tree.readOnly`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,"aria-label":t(`tree.refreshAria`),onClick:e.onRefresh,children:t(`tree.refresh`)})]}),(0,j.jsx)(`div`,{role:`tree`,"aria-label":t(`tree.aria`),className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1.5`,children:(0,j.jsx)(bI,{path:``,depth:0,ctx:i})})]})}var CI=2e5,wI=`neko.fileZoom`,TI=50,EI=300,DI=10,OI=e=>Math.min(EI,Math.max(TI,Math.round(e)));function kI(){try{let e=Number(localStorage.getItem(wI));return Number.isFinite(e)&&e>0?OI(e):100}catch{return 100}}function AI(e){let t=z(),n=(e.file.content??``).replace(/\n$/,``),r=(0,d.useMemo)(()=>{let t=n.length>CI?void 0:JD(e.file.path);return KE.sanitize(WD(n,t),{USE_PROFILES:{html:!0}})},[n,e.file.path]),i=(0,d.useMemo)(()=>Array.from({length:lI(n)},(e,t)=>t+1).join(`
393
+ `),[n]),a=(0,d.useRef)(null),o=(0,d.useRef)(e.onZoom);return o.current=e.onZoom,(0,d.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),o.current(e.deltaY<0?DI:-10))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,j.jsx)(`section`,{ref:a,"aria-label":t(`viewer.content`),"data-testid":`file-code`,tabIndex:0,className:`focus-neko min-h-0 flex-1 overflow-auto bg-base`,children:(0,j.jsxs)(`div`,{"data-testid":`file-code-scale`,className:`flex min-w-max font-mono`,style:{fontSize:`${12*e.zoom/100}px`,lineHeight:`${20*e.zoom/100}px`},children:[(0,j.jsx)(`pre`,{"aria-hidden":!0,"data-testid":`file-gutter`,className:`sticky left-0 shrink-0 select-none border-r border-sakura-100 bg-base px-2 py-2 text-right text-ink-400`,children:i}),(0,j.jsx)(`pre`,{className:`hljs px-3 py-2 whitespace-pre`,children:(0,j.jsx)(`code`,{dangerouslySetInnerHTML:{__html:r}})})]})})}function jI(e){return(0,j.jsxs)(`div`,{role:e.tone===`error`?`alert`:`status`,"data-testid":`file-notice`,className:`flex flex-col items-start gap-2 p-4 text-sm`,children:[(0,j.jsx)(`p`,{className:`font-medium ${e.tone===`error`?`text-sakura-800`:`text-ink-800`}`,children:e.title}),e.detail&&(0,j.jsx)(`p`,{className:`break-words text-xs text-ink-600`,children:e.detail}),e.action&&(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-3 py-1 text-xs text-sakura-800 hover:bg-sakura-50`,onClick:e.action.run,children:e.action.label})]})}function MI(e){let t=z(),n=dI(e.path,e.active,t=>e.api().file(e.path,t)),{name:r,dir:i}=oI(e.path),a=(0,d.useRef)(null);(0,d.useEffect)(()=>a.current?.focus(),[]);let o=e.changes?.files.find(t=>t.path===e.path)?.lastSeq??0,s=e.changes!==void 0,c=(0,d.useRef)(void 0),[l,u]=(0,d.useState)(!1),f=n.data;(0,d.useEffect)(()=>{c.current=s?o:void 0,u(!1)},[f]),(0,d.useEffect)(()=>{s&&(c.current===void 0?c.current=o:o>c.current&&u(!0))},[s,o]);let[p,m]=(0,d.useState)(kI);(0,d.useEffect)(()=>{try{localStorage.setItem(wI,String(p))}catch{}},[p]);let h=e=>m(t=>OI(t+e)),g=`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50 disabled:opacity-50`,_=n.data,v=n.status===`error`&&!_&&aI(n.error);return(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`file-viewer`,children:[(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 px-3 py-2 text-xs`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`button`,{ref:a,type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,onClick:e.onBack,children:e.backLabel}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm text-ink-800`,title:e.path,children:r}),(0,j.jsxs)(`fieldset`,{"aria-label":t(`viewer.zoom`),className:`flex min-w-0 shrink-0 items-center gap-1`,children:[(0,j.jsx)(`button`,{type:`button`,className:g,"aria-label":t(`viewer.zoomOut`),disabled:p<=TI,onClick:()=>h(-10),children:`−`}),(0,j.jsxs)(`button`,{type:`button`,className:`${g} min-w-12`,"aria-label":t(`viewer.zoomReset`),title:t(`viewer.zoomResetTitle`),disabled:p===100,onClick:()=>m(100),children:[p,`%`]}),(0,j.jsx)(`button`,{type:`button`,className:g,"aria-label":t(`viewer.zoomIn`),disabled:p>=EI,onClick:()=>h(DI),children:`+`})]}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50 disabled:opacity-50`,"aria-label":t(`viewer.refreshAria`),disabled:n.status===`loading`,onClick:n.reload,children:n.status===`loading`&&_?t(`viewer.refreshing`):t(`viewer.refresh`)})]}),(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-ink-500`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-all`,title:e.path,children:i===``?t(`viewer.workspaceRoot`):i}),_&&(0,j.jsx)(`span`,{className:`shrink-0`,children:sI(_.size)})]})]}),l&&(0,j.jsxs)(`output`,{className:`flex shrink-0 flex-wrap items-center gap-2 bg-tianyi-50 px-3 py-1.5 text-xs text-tianyi-900`,children:[(0,j.jsx)(`span`,{children:t(`viewer.stale`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-tianyi-300 px-2 py-0.5`,onClick:n.reload,children:t(`viewer.reload`)})]}),v?(0,j.jsx)(jI,{title:t(`viewer.missing`),detail:t(`viewer.missingDetail`),action:{label:t(`common.retry`),run:n.reload}}):n.status===`error`&&!_?(0,j.jsx)(jI,{tone:`error`,title:t(`viewer.readFailed`,{error:n.error??``}),action:{label:t(`common.retry`),run:n.reload}}):_?_.kind===`protected`?(0,j.jsx)(jI,{title:t(`viewer.protected`),detail:t(`viewer.protectedDetail`)}):_.kind===`binary`?(0,j.jsx)(jI,{title:t(`viewer.binary`),detail:t(`viewer.binarySize`,{size:sI(_.size)})}):(0,j.jsxs)(j.Fragment,{children:[n.status===`error`&&(0,j.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-wrap items-center gap-2 px-3 py-1.5 text-xs text-sakura-800`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`viewer.refreshFailed`,{error:n.error??``})}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-sakura-300 px-2 py-0.5`,onClick:n.reload,children:t(`common.retry`)})]}),_.truncated&&(0,j.jsx)(`div`,{role:`note`,className:`shrink-0 bg-sakura-50 px-3 py-1.5 text-xs text-sakura-900`,children:t(`viewer.truncated`,{size:sI(_.size)})}),(0,j.jsx)(AI,{file:_,zoom:p,onZoom:h})]}):(0,j.jsx)(jI,{title:t(`common.loadingEllipsis`)})]})}function NI({sessionId:e,open:t,onClose:n,changes:r}){let i=z(),a=JS(),o=(0,d.useCallback)(()=>d_.workspace(e),[e]),[s,c]=(0,d.useState)(`files`),[l,u]=(0,d.useState)(()=>new Set),[f,p]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(0),v=r?.revision??0,y=(0,d.useId)(),b=e=>`${y}-tab-${e}`,x=`${y}-panel`,S=t&&s===`files`&&f===null,C=t&&s===`files`&&f!==null,w=t&&s===`changes`&&m===null,T=t&&s===`changes`&&m!==null,E=dI(`changes`,w||C,()=>o().changes(),v),ee=(0,d.useRef)(null),te=(0,d.useRef)(null),[ne,D]=(0,d.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,d.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>D(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,d.useEffect)(()=>{if(!t)return;let e=document.activeElement,n=ne&&te.current?.parentElement?[...te.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==te.current):[],r=n.map(e=>e.inert);return n.forEach(e=>{e.inert=!0}),ee.current?.focus(),()=>{n.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[t,ne]);let re=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=re.current;e!==null&&f===null&&s===`files`&&(re.current=null,[...te.current?.querySelectorAll(`[role=treeitem][data-path]`)??[]].find(t=>t.dataset.path===e)?.focus())},[f,s]);let ie=e=>u(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),O=e=>{u(t=>new Set([...t,...uI(e)])),p(e),c(`files`)},ae=e=>{c(e),document.getElementById(b(e))?.focus()},oe=e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`Home`||e.key===`End`)&&(e.preventDefault(),ae(e.key===`ArrowLeft`||e.key===`Home`?`files`:`changes`))},se=r?.files??0,ce=e=>`focus-neko rounded-t-lg border-b-2 px-3 py-1.5 text-sm ${s===e?`border-sakura-500 font-medium text-sakura-900`:`border-transparent text-ink-600 hover:bg-sakura-50`}`;return(0,j.jsxs)(`aside`,{ref:te,role:ne?`dialog`:`complementary`,"aria-modal":ne&&t?!0:void 0,"aria-label":i(`common.workspace`),"data-workspace-panel":!0,style:{"--panel-w":`${a.width}px`},className:`${t?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:relative lg:z-auto lg:w-[var(--panel-w)] lg:max-w-[60vw] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0'],[role=treeitem][tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),n())}},children:[(0,j.jsx)(XS,{width:a.width,onChange:a.set,onCommit:a.commit,onReset:a.reset}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,j.jsx)(`strong`,{className:`text-sm text-ink-800`,children:i(`common.workspace`)}),(0,j.jsx)(`button`,{ref:ee,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,"aria-label":i(`wspanel.close`),onClick:n,children:i(`common.close`)})]}),(0,j.jsxs)(`div`,{role:`tablist`,"aria-label":i(`wspanel.views`),className:`flex shrink-0 gap-1 border-b border-sakura-100 px-2 pt-1`,children:[(0,j.jsx)(`button`,{type:`button`,role:`tab`,id:b(`files`),"aria-selected":s===`files`,"aria-controls":x,tabIndex:s===`files`?0:-1,className:ce(`files`),onClick:()=>c(`files`),onKeyDown:oe,children:i(`wspanel.files`)}),(0,j.jsx)(`button`,{type:`button`,role:`tab`,id:b(`changes`),"aria-selected":s===`changes`,"aria-controls":x,tabIndex:s===`changes`?0:-1,className:ce(`changes`),onClick:()=>c(`changes`),onKeyDown:oe,children:i(`wspanel.changes`,{count:se})})]}),(0,j.jsxs)(`div`,{role:`tabpanel`,id:x,"aria-labelledby":b(s),className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,j.jsx)(`div`,{className:`${s===`files`&&f===null?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:(0,j.jsx)(SI,{api:o,active:S,version:`${g}:${v}`,expanded:l,selected:f,onToggle:ie,onOpen:p,onRefresh:()=>_(e=>e+1)})}),s===`files`&&f!==null&&(0,j.jsx)(MI,{api:o,path:f,active:C,changes:E.data,backLabel:i(`wspanel.backToTree`),onBack:()=>{re.current=f,p(null)}},f),s===`changes`&&m===null&&(0,j.jsx)(mI,{list:E.data,status:E.status,error:E.error,onRetry:E.reload,onSelect:h}),s===`changes`&&m!==null&&(0,j.jsx)(gI,{api:o,path:m,active:T,revision:v,outside:E.data?.files.some(e=>e.path===m&&e.outside),onBack:()=>h(null),onView:O},m)]})]})}function PI(e,t=!1){let n=Lg();(0,d.useEffect)(()=>{let n=null,r=()=>{let r=document.title,i=n!==null&&r===n.title?n.base:r;if(!(document.hidden&&(e>0||t))){n!==null&&r===n.title&&(document.title=i),n=null;return}let a=$_(i,e,t);document.title=a,n={base:i,title:a}};return r(),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`visibilitychange`,r),n!==null&&document.title===n.title&&(document.title=n.base)}},[e,t,n])}var FI=8e3;function II(){let e=z(),{view:t,phase:n,notice:r,operating:i,workspaceRoot:a,currentSessionId:o,retained:s}=$g(),c=Wx();(0,d.useEffect)(()=>{if(r?.level!==`info`)return;let e=setTimeout(t_.clearNotice,FI);return()=>clearTimeout(e)},[r]);let l=(0,d.useRef)(0),[u,f]=(0,d.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,d.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>f(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let[p,m]=(0,d.useState)({}),h=t?.agents,[g,_]=(0,d.useState)(null),v=(0,d.useRef)(g);v.current=g,(0,d.useEffect)(()=>{_(e=>e&&e.sessionId!==o?null:e)},[o]),(0,d.useEffect)(()=>{o&&h?.length&&m(e=>({...e,[o]:{open:e[o]?e[o].open:v.current?.sessionId!==o,...e[o]?.target?{target:e[o].target}:{},selected:e[o]?.selected??h[0].agentId,entries:h}}))},[h,o]);let y=g?.kind===`jobs`&&g.sessionId===o,b=g?.kind===`workspace`&&g.sessionId===o,x=e=>{if(o){if(g?.kind===e&&g.sessionId===o)return _(null);m(e=>e[o]?{...e,[o]:{...e[o],open:!1}}:e),_({sessionId:o,kind:e})}},[S,C]=(0,d.useState)(null);(0,d.useEffect)(()=>{o&&t?.changes!==void 0&&C(o)},[o,t?.changes]);let w=(0,d.useId)(),[T,E]=(0,d.useState)(null),ee=j_({view:t,phase:n,operating:i,currentSessionId:o,retained:s}),te=T!==null&&T===o&&(ee?.total??0)>0;PI(M_({view:t,phase:n,operating:i,currentSessionId:o,retained:s})?.pending.length??0,(q_({view:t,phase:n,operating:i})?.awaiting??null)!==null);let ne=(e,t)=>{if(!o)return;_(null);let n=++l.current;m(r=>({...r,[o]:{open:!0,selected:e,entries:h??[],...t===void 0?{}:{target:{taskId:t,nonce:n}}}}))},D=e=>{let n=t?.subagents?.find(t=>t.taskId===e);n?.agentId&&ne(n.agentId,e)},[re,ie]=(0,d.useState)(()=>!window.matchMedia(zx).matches);(0,d.useEffect)(()=>{ie(!c)},[c]);let O=u&&!!p[o??``]?.open,ae=t?.busy??!1,oe=t?.status??null;return(0,j.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,j.jsx)(`a`,{href:`#main-content`,className:`skip-link`,children:e(`chat.skip`)}),(0,j.jsx)(TF,{open:re,onClose:()=>ie(!1)}),(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,j.jsx)(rI,{sidebarOpen:re,conn:n,onToggleSessions:()=>ie(!re),jobsOpen:y,todos:{open:te,panelId:w,onToggle:()=>E(te?null:o??null)},onToggleJobs:()=>x(`jobs`),workspace:t?.changes===void 0?void 0:{open:b,count:t.changes.files,onToggle:()=>x(`workspace`)}}),(0,j.jsx)(EF,{}),r!==null&&(0,j.jsxs)(`div`,{className:`discrete-in flex items-center gap-2 border-b py-1 pr-2 pl-9 text-xs ${r.level===`error`?`border-sakura-300 bg-sakura-100 text-sakura-900`:`border-tianyi-200 bg-tianyi-50 text-tianyi-900`}`,role:`alert`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:r.text}),(0,j.jsx)(Xx,{label:e(`chat.dismissNotice`),onClick:t_.clearNotice})]}),(0,j.jsxs)(`main`,{id:`main-content`,tabIndex:-1,className:`flex min-h-0 flex-1 flex-col focus:outline-none`,children:[te&&(0,j.jsx)(MF,{id:w,onClose:()=>E(null)}),!o&&n===`ready`&&!i?(0,j.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-semibold text-ink-900`,children:Yx(a)}),(0,j.jsx)(`p`,{className:`text-sm text-ink-600`,children:e(`chat.startHere`)}),(0,j.jsx)(`button`,{type:`button`,className:`btn-primary focus-neko rounded-xl px-4 py-2`,onClick:()=>{d_.createSession().catch(p_)},children:e(`sessions.new`)})]}):(0,j.jsx)($P,{view:t,busy:ae,onSubagent:D,tray:(h?.length??0)>0?(0,j.jsxs)(`button`,{type:`button`,className:`focus-neko rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,onClick:()=>ne(p[o??``]?.selected??h[0].agentId),children:[e(`chat.subagents`,{count:h.length}),h.some(e=>e.approvalCount)?e(`chat.subagentsApproval`,{count:h.reduce((e,t)=>e+(t.approvalCount??0),0)}):``,h.some(e=>e.historyThrough===void 0&&e.status===`running`)?e(`chat.subagentsRunning`,{count:h.filter(e=>e.historyThrough===void 0&&e.status===`running`).length}):``]}):void 0}),(0,j.jsxs)(`div`,{className:`flex max-h-[60dvh] shrink-[0.01] flex-col overflow-y-auto overscroll-contain`,"data-attention-stack":!0,children:[!O&&(0,j.jsx)(ES,{}),(0,j.jsx)(lF,{}),(0,j.jsx)(tF,{})]}),(0,j.jsx)(pS,{disabled:n!==`ready`||i,busy:ae,status:oe})]})]}),Object.entries(p).map(([e,t])=>(0,j.jsx)(kF,{entries:e===o?h??t.entries:t.entries,approval:O&&e===o?(0,j.jsx)(ES,{}):void 0,selected:t.selected,open:e===o&&t.open,onSelect:ne,target:t.target,onClose:()=>m(n=>({...n,[e]:{...t,open:!1}}))},e)),o&&t?.jobs!==void 0&&(0,j.jsx)(eC,{sessionId:o,jobs:t.jobs,open:y,onClose:()=>_(null)},o),o&&S===o&&(0,j.jsx)(NI,{sessionId:o,open:b,onClose:()=>_(null),changes:t?.changes},`workspace:${o}`)]})}var LI=[{id:`sakura`,label:`appearance.theme.sakura`,blurb:`appearance.theme.sakuraBlurb`},{id:`light`,label:`appearance.theme.light`,blurb:`appearance.theme.lightBlurb`},{id:`dark`,label:`appearance.theme.dark`,blurb:`appearance.theme.darkBlurb`}],RI=[{id:`sans`,label:`appearance.font.sans`},{id:`serif`,label:`appearance.font.serif`},{id:`mono`,label:`appearance.font.mono`}],zI=[{id:`13`,label:`appearance.size.13`},{id:`14`,label:`appearance.size.14`},{id:`16`,label:`appearance.size.16`},{id:`18`,label:`appearance.size.18`}],BI=[{id:`regular`,label:`appearance.weight.regular`},{id:`medium`,label:`appearance.weight.medium`},{id:`semibold`,label:`appearance.weight.semibold`}],VI=[{id:`compact`,label:`appearance.leading.compact`},{id:`normal`,label:`appearance.leading.normal`},{id:`relaxed`,label:`appearance.leading.relaxed`}],HI=e=>[e(`appearance.sampleAssistantIntro`),``,"```ts",`function total(items: number[]) {`,` return items.reduce((sum, n) => sum + n, 0);`,`}`,"```",``,`- ${e(`appearance.sampleItem1`)}`,`- ${e(`appearance.sampleItem2`)}`].join(`
394
+ `);function UI(e){return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`appearance-${e.id}`,children:[(0,j.jsx)(`h2`,{id:`appearance-${e.id}`,className:`text-base font-bold text-ink-900`,children:e.title}),e.blurb&&(0,j.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:e.blurb}),(0,j.jsx)(`div`,{className:`mt-3`,children:e.children})]})}function WI(e){let t=z();return(0,j.jsxs)(`fieldset`,{className:`m-0 min-w-0 border-0 p-0`,children:[(0,j.jsx)(`legend`,{className:`text-sm font-semibold text-ink-900`,children:e.label}),(0,j.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.options.map(n=>(0,j.jsxs)(`label`,{className:`choice-focus cursor-pointer rounded-full border px-3 py-1 text-xs transition-colors ${e.value===n.id?`border-sakura-400 bg-sakura-100 font-semibold text-sakura-800`:`border-sakura-200 bg-surface text-ink-700 hover:bg-sakura-50`}`,children:[(0,j.jsx)(`input`,{type:`radio`,className:`sr-only`,name:e.name,value:n.id,checked:e.value===n.id,onChange:()=>e.onPick(n.id)}),t(n.label)]},n.id))}),e.hint&&(0,j.jsx)(`p`,{className:`mt-1.5 text-[11px] text-ink-400`,children:e.hint})]})}function GI({theme:e}){let t=z();return(0,j.jsxs)(`span`,{"data-theme":e,className:`block rounded-xl border border-ink-200 bg-base p-2.5 text-ink-900`,children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-1.5 pb-2`,children:[(0,j.jsx)(`span`,{className:`size-2 rounded-full bg-sakura-500`}),(0,j.jsx)(`span`,{className:`size-2 rounded-full bg-tianyi-500`}),(0,j.jsx)(`span`,{className:`h-1.5 w-8 rounded-full bg-ink-200`})]}),(0,j.jsx)(`span`,{className:`ml-auto block w-3/5 rounded-lg border border-sakura-300 bg-sakura-100 px-2 py-1 text-xs text-sakura-900`,children:t(`appearance.previewUser`)}),(0,j.jsx)(`span`,{className:`mt-1.5 block w-4/5 rounded-lg border border-tianyi-200 bg-surface px-2 py-1 text-xs text-ink-900`,children:t(`appearance.previewAssistant`)})]})}function KI(e){let t=z();return(0,j.jsxs)(`fieldset`,{className:`m-0 min-w-0 border-0 p-0`,children:[(0,j.jsx)(`legend`,{className:`sr-only`,children:t(`appearance.theme`)}),(0,j.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:LI.map(n=>{let r=e.value===n.id;return(0,j.jsxs)(`label`,{className:`choice-focus block cursor-pointer rounded-2xl border-2 p-2 transition-colors ${r?`border-sakura-500 bg-sakura-50`:`border-sakura-200 hover:bg-sakura-50`}`,children:[(0,j.jsx)(`input`,{type:`radio`,className:`sr-only`,name:`appearance-theme`,value:n.id,checked:r,onChange:()=>e.onPick(n.id)}),(0,j.jsx)(GI,{theme:n.id}),(0,j.jsxs)(`span`,{className:`mt-2 flex items-baseline gap-2 px-1 pb-0.5`,children:[(0,j.jsx)(`span`,{className:`text-sm ${r?`font-bold text-sakura-800`:`font-semibold text-ink-900`}`,children:t(n.label)}),(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(n.blurb)})]})]},n.id)})})]})}function qI({store:e=Ii()}){let t=Li(e),n=z();return(0,j.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,j.jsx)(UI,{id:`theme`,title:n(`appearance.theme`),children:(0,j.jsx)(KI,{value:t.theme,onPick:t=>e.set({theme:t})})}),(0,j.jsx)(UI,{id:`typography`,title:n(`appearance.typography`),blurb:n(`appearance.typographyBlurb`),children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,j.jsx)(WI,{name:`appearance-font`,label:n(`appearance.font`),hint:n(`appearance.fontHint`),options:RI,value:t.font,onPick:t=>e.set({font:t})}),(0,j.jsx)(WI,{name:`appearance-size`,label:n(`appearance.size`),options:zI,value:t.size,onPick:t=>e.set({size:t})}),(0,j.jsx)(WI,{name:`appearance-weight`,label:n(`appearance.weight`),options:BI,value:t.weight,onPick:t=>e.set({weight:t})}),(0,j.jsx)(WI,{name:`appearance-leading`,label:n(`appearance.leading`),options:VI,value:t.leading,onPick:t=>e.set({leading:t})})]})}),(0,j.jsx)(UI,{id:`preview`,title:n(`appearance.sample`),blurb:n(`appearance.sampleBlurb`),children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-base p-3`,"data-testid":`appearance-sample`,children:[(0,j.jsx)(`div`,{className:`bubble-user ml-auto max-w-[85%] px-4 py-2.5 whitespace-pre-wrap`,children:n(`appearance.sampleUser`)}),(0,j.jsx)(`div`,{className:`bubble-assistant max-w-full px-4 py-2.5`,children:(0,j.jsx)(BP,{text:HI(n)})})]})}),(0,j.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:Ai(t)?n(`appearance.isDefault`):n(`appearance.customized`)}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>e.reset(),disabled:Ai(t),className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,children:n(`appearance.reset`)})]})]})}function JI(){let e=z();return(0,j.jsxs)(_S,{active:`appearance`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`settings.appearance.title`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`settings.appearance.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsx)(qI,{})})]})}var YI={off:{label:`codemode.mode.off.label`,description:`codemode.mode.off.description`},on:{label:`codemode.mode.on.label`,description:`codemode.mode.on.description`},only:{label:`codemode.mode.only.label`,description:`codemode.mode.only.description`}},XI={default:`context.source.default`,config:`context.source.config`,saved:`context.source.saved`};function ZI(e){let{settings:t,ready:n,onSelect:r,onReset:i}=e,a=z(),[o,s]=(0,d.useState)(!1),c=(0,d.useRef)(!1),[l,u]=(0,d.useState)(``),f=o||!n||!t;async function p(e,t){if(!c.current){c.current=!0,s(!0),u(``);try{await e(),u(t)}catch{u(a(`codemode.saveFailed`))}finally{c.current=!1,s(!1)}}}if(!t)return(0,j.jsx)(`p`,{className:`text-sm text-ink-500`,children:a(`common.loading`)});let m=t.effective.mode;return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`codemode-mode`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`h2`,{id:`codemode-mode`,className:`text-base font-bold text-ink-900`,children:a(`codemode.modeTitle`)}),(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:a(`codemode.current`,{mode:a(YI[m].label),source:a(XI[t.source])})})]}),(0,j.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:a(`codemode.newSessionsOnly`)}),(0,j.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-2 border-0 p-0`,disabled:f,children:[(0,j.jsx)(`legend`,{className:`sr-only`,children:a(`codemode.modeTitle`)}),am.map(e=>(0,j.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-xl border px-3 py-2.5 text-sm ${e===m?`border-sakura-400 bg-sakura-50`:`border-sakura-100`} ${f?`opacity-60`:``}`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`codemode-mode`,value:e,checked:e===m,onChange:()=>e!==m&&void p(()=>r(e),a(`codemode.saved`)),className:`mt-1`}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`font-semibold text-ink-900`,children:a(YI[e].label)}),(0,j.jsx)(`span`,{className:`block text-xs text-ink-500`,children:a(YI[e].description)})]})]},e))]}),t.source===`config`&&(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-ink-400`,children:a(`codemode.fromConfig`)}),(0,j.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,j.jsx)(`button`,{type:`button`,disabled:f||t.source!==`saved`,onClick:()=>void p(i,a(`codemode.restored`)),className:`focus-neko rounded-full border border-sakura-200 bg-surface px-4 py-1.5 text-xs text-ink-700 hover:bg-sakura-50 disabled:opacity-50`,children:a(`codemode.restore`)}),(0,j.jsx)(`output`,{"aria-live":`polite`,className:`min-h-4 text-xs text-tianyi-800`,children:l})]})]})}function QI(){let{codemodeSettings:e,phase:t}=$g(),n=z();return(0,j.jsxs)(_S,{active:`codemode`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.codemode.title`)}),(0,j.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.codemode.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsx)(ZI,{settings:e,ready:t===`ready`,onSelect:e=>d_.setCodemodeMode(e),onReset:()=>d_.resetCodemodeMode()})})]})}var $I={compaction:{group:`compaction`,field:`enabled`,key:`compaction.enabled`},pruning:{group:`pruning`,field:`enabled`,key:`pruning.enabled`}},eL=[{key:`compaction.triggerPercent`,group:`compaction`,field:`triggerPercent`,label:`context.row.compactionTrigger.label`,description:`context.row.compactionTrigger.description`,unit:`percent`,presets:[30,40,50,60,70,80]},{key:`compaction.keepRecentTokens`,group:`compaction`,field:`keepRecentTokens`,label:`context.row.keepRecentTokens.label`,description:`context.row.keepRecentTokens.description`,unit:`tokens`,presets:[1e4,2e4,4e4,8e4]},{key:`pruning.triggerPercent`,group:`pruning`,field:`triggerPercent`,label:`context.row.pruningTrigger.label`,description:`context.row.pruningTrigger.description`,unit:`percent`,presets:[20,30,35,45,55]},{key:`pruning.keepRecent`,group:`pruning`,field:`keepRecent`,label:`context.row.keepRecent.label`,description:`context.row.keepRecent.description`,unit:`count`,presets:[5,10,20,40]},{key:`pruning.minChars`,group:`pruning`,field:`minChars`,label:`context.row.minChars.label`,description:`context.row.minChars.description`,unit:`chars`,presets:[2e3,4e3,8e3,16e3]},{key:`pruning.minSavePercent`,group:`pruning`,field:`minSavePercent`,label:`context.row.minSave.label`,description:`context.row.minSave.description`,unit:`percent`,presets:[2,5,10,15]}],tL={default:`context.source.default`,config:`context.source.config`,saved:`context.source.saved`};function nL(e,t){let n=e.effective[t.group],r=e.sources[t.group];return{value:n[t.field]??null,source:r[t.field]??`default`}}function rL(e,t){let n=R();switch(e){case`percent`:return`${t}%`;case`tokens`:return t>=1e3?`${Number((t/1e3).toFixed(1))}k`:String(t);case`chars`:return t>=1e3?n(`context.value.charsK`,{value:Number((t/1e3).toFixed(1))}):n(`context.value.chars`,{value:t});default:return n(`context.value.count`,{value:t})}}function iL(e,t){let n=R(),{value:r,source:i}=nL(t,e),a=typeof r==`number`?r:null,o=[{id:`default`,label:n(`context.chipDefault`),value:null,selected:i!==`saved`}];for(let t of e.presets)o.push({id:String(t),label:rL(e.unit,t),value:t,selected:i===`saved`&&a===t});return a!==null&&i!=="default"&&!e.presets.includes(a)&&o.push({id:`custom-${a}`,label:n(`context.chipCustom`,{value:rL(e.unit,a)}),value:a,selected:i===`saved`}),o}function aL(e,t){let n=R(),{value:r,source:i}=nL(t,e);return n(`context.current`,{value:typeof r==`number`?rL(e.unit,r):n(`context.nearLimit`),source:n(tL[i])})}function oL(e,t){return{[e.group]:{[e.field]:t}}}function sL(e){let t=R(),n=[],{compaction:r,pruning:i}=e.effective;return i.enabled&&n.push({id:`pruning`,label:t(`context.marker.pruning`),percent:i.triggerPercent,native:!1}),r.enabled&&n.push({id:`compaction`,label:t(`context.marker.compaction`),percent:r.triggerPercent??98,native:r.triggerPercent===null}),n}var cL=[{id:`compaction`,title:`context.group.compaction.title`,blurb:`context.group.compaction.blurb`},{id:`pruning`,title:`context.group.pruning.title`,blurb:`context.group.pruning.blurb`}];function lL(e){return(0,j.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.checked,"aria-label":e.label,disabled:e.disabled,onClick:()=>e.onChange(!e.checked),className:`focus-neko relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-60 ${e.checked?`bg-sakura-500`:`bg-ink-200`}`,children:(0,j.jsx)(`span`,{className:`inline-block size-5 rounded-full bg-white shadow transition-transform ${e.checked?`translate-x-[22px]`:`translate-x-0.5`}`})})}function uL({items:e}){let t=z();return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-label":t(`context.threshold.aria`),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-ink-500`,children:[(0,j.jsx)(`span`,{className:`font-semibold text-ink-900`,children:t(`context.threshold.title`)}),(0,j.jsx)(`span`,{children:t(`context.threshold.window`)})]}),(0,j.jsx)(`div`,{className:`px-6`,children:(0,j.jsx)(`div`,{className:`relative mt-9 mb-9 h-2.5 rounded-full bg-gradient-to-r from-tianyi-100 via-sakura-100 to-sakura-200`,children:e.map(e=>(0,j.jsxs)(`div`,{className:`absolute top-1/2 -translate-x-1/2 -translate-y-1/2`,style:{left:`${e.percent}%`},children:[(0,j.jsx)(`span`,{className:`block size-4 rounded-full border-2 border-surface shadow ${e.id===`pruning`?`bg-tianyi-500`:`bg-sakura-600`}`}),(0,j.jsxs)(`span`,{className:`absolute left-1/2 -translate-x-1/2 whitespace-nowrap text-xs font-semibold ${e.id===`pruning`?`-top-7 text-tianyi-800`:`top-6 text-sakura-800`}`,children:[e.label,` `,e.native?`≈`:``,e.percent,`%`]})]},e.id))})}),(0,j.jsxs)(`div`,{className:`flex justify-between text-[11px] text-ink-400`,children:[(0,j.jsx)(`span`,{children:`0%`}),(0,j.jsx)(`span`,{children:`100%`})]}),e.length===0&&(0,j.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`context.threshold.allOff`)})]})}function dL(e){let{row:t,settings:n,disabled:r,dim:i,onPick:a}=e,o=z(),{source:s}=nL(n,t);return(0,j.jsxs)(`div`,{className:`transition-opacity ${i?`opacity-55`:``}`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3`,children:[(0,j.jsx)(`span`,{className:`text-sm font-semibold text-ink-900`,children:o(t.label)}),(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:aL(t,n)})]}),(0,j.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:o(t.description)}),(0,j.jsxs)(`fieldset`,{className:`m-0 mt-2 flex min-w-0 flex-wrap gap-1.5 border-0 p-0`,children:[(0,j.jsx)(`legend`,{className:`sr-only`,children:o(t.label)}),iL(t,n).map(e=>(0,j.jsx)(`button`,{type:`button`,"aria-pressed":e.selected,disabled:r,"data-row":t.key,"data-chip":e.id,onClick:()=>!e.selected&&a(e.value),className:`focus-neko rounded-full border px-3 py-1 text-xs transition-colors disabled:opacity-60 ${e.selected?`border-sakura-400 bg-sakura-100 font-semibold text-sakura-800`:`border-sakura-200 bg-surface text-ink-700 hover:bg-sakura-50`}`,children:e.label},e.id))]}),s===`config`&&(0,j.jsx)(`p`,{className:`mt-1 text-[11px] text-ink-400`,children:o(`context.fromConfig`)})]})}function fL(e){let{settings:t,ready:n,onChange:r,onReset:i}=e,a=z(),[o,s]=(0,d.useState)(0),[c,l]=(0,d.useState)(``),u=!n||!t,f=(0,d.useRef)(0);async function p(e,t){let n=++f.current;s(e=>e+1),l(``);try{await e(),n===f.current&&l(t)}catch{n===f.current&&l(a(`context.saveFailed`))}finally{s(e=>e-1)}}let m=(e,t)=>void p(()=>r(oL(e,t)),t===null?a(`context.restored`,{label:e.label}):a(`context.saved`));if(!t)return(0,j.jsx)(`p`,{className:`text-sm text-ink-500`,children:a(`common.loading`)});let h=[...Object.values(t.sources.compaction),...Object.values(t.sources.pruning)].includes(`saved`);return(0,j.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,j.jsx)(uL,{items:sL(t)}),cL.map(e=>{let n=$I[e.id],{value:r,source:i}=nL(t,n);return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`ctx-${e.id}`,children:[(0,j.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,j.jsx)(`span`,{className:`mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-xl bg-sakura-50 text-sakura-700`,children:(0,j.jsx)(Ux,{name:e.id===`compaction`?`layers`:`sparkles`,size:16})}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`h2`,{id:`ctx-${e.id}`,className:`text-base font-bold text-ink-900`,children:a(e.title)}),(0,j.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:a(e.blurb)})]}),(0,j.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,j.jsx)(lL,{checked:r===!0,label:e.id===`compaction`?a(`context.switch.compaction`):a(`context.switch.pruning`),disabled:u,onChange:t=>m({...n,label:a(e.title)},t)}),(0,j.jsx)(`span`,{className:`text-[11px] text-ink-400`,children:a(tL[i])})]})]}),(0,j.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-sakura-100 pt-4`,children:eL.filter(t=>t.group===e.id).map(e=>(0,j.jsx)(dL,{row:e,settings:t,disabled:u,dim:r!==!0,onPick:t=>m({...e,label:a(e.label)},t)},e.key))})]},e.id)}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,j.jsx)(`button`,{type:`button`,disabled:u||!h,onClick:()=>void p(i,a(`context.allRestored`)),className:`focus-neko rounded-full border border-sakura-200 bg-surface px-4 py-1.5 text-xs text-ink-700 hover:bg-sakura-50 disabled:opacity-50`,children:a(`context.restoreAll`)}),(0,j.jsx)(`output`,{"aria-live":`polite`,className:`min-h-4 text-xs text-tianyi-800`,children:o>0?a(`context.saving`):c})]})]})}function pL(){let{contextSettings:e,phase:t}=$g(),n=z();return(0,j.jsxs)(_S,{active:`context`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.context.title`)}),(0,j.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.context.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsx)(fL,{settings:e,ready:t===`ready`,onChange:e=>d_.setContextSettings(e),onReset:()=>d_.resetContextSettings()})})]})}function mL({store:e=Fg()}){let t=z(),n=Lg(e),r={zh:t(`language.option.zh`),en:t(`language.option.en`)};return(0,j.jsxs)(`fieldset`,{className:`m-0 min-w-0 rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsx)(`legend`,{className:`sr-only`,children:t(`language.legend`)}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Tg.map(t=>(0,j.jsxs)(`label`,{className:`choice-focus cursor-pointer rounded-full border px-4 py-1.5 text-sm transition-colors ${n===t?`border-sakura-400 bg-sakura-100 font-semibold text-sakura-800`:`border-sakura-200 bg-surface text-ink-700 hover:bg-sakura-50`}`,children:[(0,j.jsx)(`input`,{type:`radio`,className:`sr-only`,name:`ui-language`,value:t,lang:t===`zh`?`zh-CN`:`en`,checked:n===t,onChange:()=>e.set(t)}),r[t]]},t))})]})}function hL(){let e=z();return(0,j.jsxs)(_S,{active:`language`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`language.title`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`language.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsx)(mL,{})})]})}var gL=function(e,t){let n=e,r=vL[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=bL.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=bL.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=bL.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=bL.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=bL.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=bL.getErrorCorrectPolynomial(l),d=SL(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=CL.getRSBlocks(e,t),i=wL();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),bL.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=TL(e);break;case`Alphanumeric`:n=EL(e);break;case`Byte`:n=DL(e);break;case`Kanji`:n=OL(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=CL.getRSBlocks(e,r),n=wL();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),bL.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return NL(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`&lt;`;break;case`>`:t+=`&gt;`;break;case`&`:t+=`&amp;`;break;case`"`:t+=`&quot;`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
395
+ `}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
396
+ `}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};gL.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},gL.createStringToBytes=function(e,t){let n=function(){let n=jL(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var _L={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},vL={L:1,M:0,Q:3,H:2},yL={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},bL=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case yL.PATTERN000:return function(e,t){return(e+t)%2==0};case yL.PATTERN001:return function(e,t){return e%2==0};case yL.PATTERN010:return function(e,t){return t%3==0};case yL.PATTERN011:return function(e,t){return(e+t)%3==0};case yL.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case yL.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case yL.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case yL.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=SL([1],0);for(let n=0;n<e;n+=1)t=t.multiply(SL([1,xL.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case _L.MODE_NUMBER:return 10;case _L.MODE_ALPHA_NUM:return 9;case _L.MODE_8BIT_BYTE:return 8;case _L.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case _L.MODE_NUMBER:return 12;case _L.MODE_ALPHA_NUM:return 11;case _L.MODE_8BIT_BYTE:return 16;case _L.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case _L.MODE_NUMBER:return 14;case _L.MODE_ALPHA_NUM:return 13;case _L.MODE_8BIT_BYTE:return 16;case _L.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),xL=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),SL=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=xL.gexp(xL.glog(r.getAt(n))+xL.glog(e.getAt(i)));return SL(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=xL.glog(r.getAt(0))-xL.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=xL.gexp(xL.glog(e.getAt(r))+t);return SL(n,0).mod(e)},r},CL=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case vL.L:return e[(t-1)*4+0];case vL.M:return e[(t-1)*4+1];case vL.Q:return e[(t-1)*4+2];case vL.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),wL=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},TL=function(e){let t=_L.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},EL=function(e){let t=_L.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},DL=function(e){let t=_L.MODE_8BIT_BYTE,n=gL.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},OL=function(e){let t=_L.MODE_KANJI,n=gL.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},kL=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},AL=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},jL=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},ML=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=kL(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},NL=function(e,t,n){let r=ML(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=kL();r.write(i);let a=AL(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};gL.stringToBytes;var PL=class extends Error{constructor(){super(`gateway_unsupported`),this.name=`GatewayUnsupportedError`}},FL;function IL(){FL=void 0}async function LL(){return FL??=fetch(`/api/mobile/session`,{cache:`no-store`}).then(async e=>{if(!e.ok)throw Error(R()(`pairing.getFailed`,{path:`/api/mobile/session`,status:e.status}));return await e.json()}).catch(e=>{throw FL=void 0,e}),FL}async function RL(e,t,n=!0){let{csrf:r}=await LL(),i=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`,"x-neko-csrf":r},body:JSON.stringify(t??null)});if(i.status===501)throw new PL;if(i.status===403&&n)return IL(),RL(e,t,!1);if(!i.ok){let e=R()(`pairing.requestFailed`,{status:i.status});try{let t=await i.json();typeof t.message==`string`&&t.message!==``&&(e=t.message)}catch{}throw Error(e)}return await i.json()}async function zL(e){let t=await fetch(e,{cache:`no-store`});if(t.status===501)throw new PL;if(!t.ok)throw Error(R()(`pairing.getFailed`,{path:e,status:t.status}));return await t.json()}var BL={session:()=>LL(),state:()=>zL(`/api/mobile/state`),enable:e=>RL(`/api/mobile/enable`,e),disable:()=>RL(`/api/mobile/disable`,null),createPairing:()=>RL(`/api/mobile/pairing`,null),cancelPairing:()=>RL(`/api/mobile/pairing/cancel`,null),revoke:e=>RL(`/api/mobile/revoke`,{deviceId:e}),regenerateCertificate:()=>RL(`/api/mobile/certificate/regenerate`,null)},VL=2592e6,HL=5e3;function UL(e){return e instanceof Error?e.message:String(e)}function WL(e){let t=z(),n=gL(0,`M`);n.addData(e.text,`Byte`),n.make();let r=n.getModuleCount(),i=r+4,a=[];for(let e=0;e<r;e+=1)for(let t=0;t<r;t+=1)n.isDark(e,t)&&a.push(`M${t+2} ${e+2}h1v1h-1z`);return(0,j.jsxs)(`svg`,{role:`img`,viewBox:`0 0 ${i} ${i}`,shapeRendering:`crispEdges`,className:`h-44 w-44 rounded-xl bg-white p-2 text-ink-900`,children:[(0,j.jsx)(`title`,{children:t(`pairing.qrTitle`)}),(0,j.jsx)(`path`,{d:a.join(` `),fill:`currentColor`})]})}function GL(){let{webInfo:e}=$g(),t=z(),n=Lg(),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(`8323`),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(null),[b,x]=(0,d.useState)(0),[S,C]=(0,d.useState)(null),w=(0,d.useRef)(0),T=(0,d.useCallback)(async()=>{let e=++w.current;try{let t=await BL.state();if(e!==w.current)return;o(t),c(``),p(e=>e===``?t.candidates[0]??``:e),h(String(t.port))}catch(t){e===w.current&&c(UL(t))}},[]),E=(0,d.useCallback)(async()=>{if(document.hidden)return;let e=++w.current;try{let t=await BL.state();if(e!==w.current)return;o(t),c(``)}catch{}},[]);(0,d.useEffect)(()=>{let e=!1;return BL.session().then(t=>{e||(i(t.supported),t.supported&&T())}).catch(t=>{e||c(UL(t))}),()=>{e=!0}},[T]),(0,d.useEffect)(()=>{if(r!==!0)return;let e,t=()=>{e!==void 0&&(clearInterval(e),e=void 0)},n=()=>{e===void 0&&(e=setInterval(()=>void E(),HL))},i=()=>{document.hidden?t():(E(),n())};return document.addEventListener(`visibilitychange`,i),n(),()=>{t(),document.removeEventListener(`visibilitychange`,i)}},[r,E]),(0,d.useEffect)(()=>{if(v===null)return;let e=()=>x(Math.max(0,Math.ceil((v.expiresAt-Date.now())/1e3)));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[v]);let ee=a?.state.status===`listening`,te=ee?`${a.state.address}:${a.state.port}`:``;async function ne(){if(!(a===null||g)){_(!0),c(``),u(``);try{if(ee)await BL.disable(),y(null),u(t(`pairing.disabledNotice`));else{let e=Number(m);if(f.trim()===``)throw Error(t(`pairing.addressRequired`));if(!Number.isInteger(e)||e<1||e>65535)throw Error(t(`pairing.portInvalid`));await BL.enable({address:f.trim(),port:e}),u(t(`pairing.enabledNotice`,{address:`${f.trim()}:${e}`}))}await T()}catch(e){c(UL(e))}finally{_(!1)}}}async function D(){_(!0),c(``);try{let e=await BL.createPairing();y(e),u(t(`pairing.qrGenerated`))}catch(e){y(null),c(UL(e))}finally{_(!1)}}async function re(){C(null),_(!0),c(``);try{let e=await BL.regenerateCertificate();y(null),u(t(`pairing.certRotated`,{fingerprint:e.fingerprint.slice(0,12)})),await T()}catch(e){c(UL(e))}finally{_(!1)}}async function ie(e){C(null),_(!0),c(``);try{let n=await BL.revoke(e);u(n.revoked?t(`pairing.revoked`):t(`pairing.revokeMissing`)),await T()}catch(e){c(UL(e))}finally{_(!1)}}if(r===null)return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-ink-500`,children:t(`common.loading`)})]});if(!r)return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,role:`alert`,children:t(`pairing.unsupported`)})]});let O=a?.certificate??null,ae=O!==null&&O.expiresAt-Date.now()<VL,oe=a?.wsl??null,se=a?.state.status===`listening`&&a.state.mode===`wsl-relay`,ce=a===null?t(`common.loading`):a.state.status===`listening`?t(`pairing.stateOn`,{address:te,relay:se?t(`pairing.relayed`):``}):a.state.status===`error`?t(`pairing.stateError`):a.state.status===`disabled`?t(`pairing.stateOff`):t(`credential.working`);return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:ce})]}),(0,j.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:t(`pairing.intro`)}),oe!==null&&(0,j.jsx)(`p`,{className:`mb-3 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:t(`pairing.wslNote`)}),oe?.error!=null&&(0,j.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:oe.error}),a?.state.status===`error`&&(0,j.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:t(`pairing.startFailed`,{error:a.state.error})}),s!==``&&(0,j.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:s}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,j.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:ee===!0,disabled:g||a===null||!ee&&(a?.candidates.length??0)===0&&f===``,onChange:()=>void ne(),className:`focus-neko h-4 w-4 rounded border-sakura-300 accent-sakura-600`}),t(`pairing.allow`)]}),(0,j.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[t(`pairing.address`),(0,j.jsxs)(`select`,{value:f,disabled:g||ee===!0,onChange:e=>p(e.target.value),className:`focus-neko rounded-xl border border-sakura-200 bg-base px-2 py-1.5 text-sm`,children:[a?.candidates.length===0&&(0,j.jsx)(`option`,{value:``,children:t(oe===null?`pairing.noAddress`:`pairing.noAddressWindows`)}),(a?.candidates??[]).map(e=>(0,j.jsx)(`option`,{value:e,children:e===a?.lastConnectedAddress?t(`pairing.lastConnected`,{address:e}):e},e))]})]}),(0,j.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,htmlFor:`mobile-port`,children:[t(`pairing.port`),(0,j.jsx)(`input`,{id:`mobile-port`,type:`number`,min:1,max:65535,value:m,disabled:g||ee===!0,onChange:e=>h(e.target.value),className:`focus-neko w-24 rounded-xl border border-sakura-200 bg-base px-2 py-1.5 text-sm`})]})]}),ee!==!0&&(a?.candidates.length??0)===0&&(0,j.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(oe===null?`pairing.noUsable`:`pairing.noUsableWindows`)}),ee===!0&&(0,j.jsx)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[v!==null&&b>0?(0,j.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,j.jsx)(WL,{text:v.pairingText}),(0,j.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.qrRemaining`,{seconds:b})}),(0,j.jsx)(lO,{text:v.pairingText,label:t(`pairing.copyText`)}),(0,j.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>void D(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:t(`pairing.refreshQr`)})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[v!==null&&b<=0&&(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.qrExpired`)}),(0,j.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>void D(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:t(`pairing.generateQr`)})]}),(0,j.jsx)(`p`,{className:`max-w-64 text-xs text-ink-500`,children:t(`pairing.scanHint`,{relay:se?t(`pairing.relayFirewall`):``})})]})}),(0,j.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:t(`pairing.certificate`)}),O!==null&&(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.certInfo`,{fingerprint:O.fingerprint.slice(0,16),date:hF(O.expiresAt,n)})}),(0,j.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>C(`regenerate`),className:`focus-neko ml-auto rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:t(`pairing.regenerate`)})]}),ae&&(0,j.jsx)(`p`,{className:`mt-2 text-xs text-sakura-800`,role:`alert`,children:t(`pairing.certExpiring`)}),(0,j.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`pairing.regenerateWarning`)})]}),(0,j.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:t(`pairing.devices`)}),a===null||a.devices.length===0?(0,j.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`pairing.noDevices`)}):(0,j.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2`,children:a.devices.map(e=>(0,j.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:(0,j.jsx)(Ux,{name:`phone`,size:15,className:`text-ink-400`})}),(0,j.jsx)(`span`,{className:`text-ink-800`,children:e.name}),(0,j.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${e.online?`bg-tianyi-50 text-tianyi-800`:`bg-ink-100 text-ink-500`}`,children:e.online?t(`pairing.online`):t(`pairing.offline`)}),(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.lastSeen`,{time:mF(e.lastSeenAt,n)})}),(0,j.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>C({deviceId:e.deviceId,name:e.name}),className:`focus-neko ml-auto rounded-full px-3 py-1.5 text-sm text-sakura-800 disabled:opacity-50`,children:t(`pairing.revoke`)})]},e.deviceId))})]}),e?.gatewaySpawned===!0&&(0,j.jsxs)(`p`,{className:`mt-4 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:[t(`pairing.spawnedBefore`),(0,j.jsx)(`code`,{className:`mx-1`,children:`neko serve`}),t(`pairing.spawnedAfter`)]}),(0,j.jsx)(`output`,{className:`mt-3 block min-h-4 text-xs text-tianyi-800`,"aria-live":`polite`,children:l}),S===`regenerate`&&(0,j.jsxs)(qx,{title:t(`pairing.regenerate`),onClose:()=>C(null),children:[(0,j.jsx)(`p`,{className:`text-sm text-ink-700`,children:t(`pairing.regenerateConfirm`)}),(0,j.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,onClick:()=>C(null),children:t(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void re(),children:t(`pairing.confirmRegenerate`)})]})]}),typeof S==`object`&&!!S&&(0,j.jsxs)(qx,{title:t(`pairing.revokeTitle`,{name:S.name}),onClose:()=>C(null),children:[(0,j.jsx)(`p`,{className:`text-sm text-ink-700`,children:t(`pairing.revokeConfirm`)}),(0,j.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,onClick:()=>C(null),children:t(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void ie(S.deviceId),children:t(`pairing.confirmRevoke`)})]})]})]})}function KL(){let e=z();return(0,j.jsxs)(_S,{active:`mobile`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`settings.mobile.title`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`settings.mobile.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsx)(GL,{})})]})}var qL={saved:`credential.source.saved`,environment:`credential.source.environment`,runtime:`credential.source.runtime`,keyless:`credential.source.keyless`,none:`credential.source.none`};function JL(e){let{spec:t,status:n,ready:r,enable:i,note:a}=e,o=t.name,s=z(),[c,l]=(0,d.useState)(``),[u,f]=(0,d.useState)(!1),p=(0,d.useRef)(!1),[m,h]=(0,d.useState)(``);async function g(e,t){if(!p.current){p.current=!0,f(!0),h(``);try{await e(),h(t)}catch{h(s(`credential.failed`))}finally{p.current=!1,f(!1)}}}async function _(e){await g(async()=>{e?await d_.removeCredential(t.id):await d_.saveCredential(t.id,c),l(``)},s(e?`credential.removed`:`credential.saved`))}let v=u||!r||!n;return(0,j.jsxs)(`section`,{id:`credential-${t.id}`,className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:o}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i&&(0,j.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 rounded-full border border-sakura-200 px-3 py-1 text-xs ${i.locked?`text-ink-500`:`cursor-pointer text-ink-700`}`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.enabled,disabled:v||i.locked,"aria-label":s(`credential.enableAria`,{name:o}),onChange:e=>void g(()=>i.onChange(e.target.checked),e.target.checked?s(`credential.enabledDone`):s(`credential.disabledDone`))}),i.locked?s(`credential.alwaysOn`):s(`credential.enable`)]}),(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:s(n?qL[n.source]:`common.loading`)})]})]}),(0,j.jsxs)(`p`,{className:`mb-3 text-xs text-ink-500`,children:[s(`credential.envVar`,{state:n?n.environmentConfigured?s(`credential.envConfigured`):s(`credential.envMissing`):s(`common.loading`),envVar:t.envVar}),t.keyless?s(`credential.keylessNote`):``,a?` · ${a}`:``]}),(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_(!1)},children:[(0,j.jsx)(`label`,{className:`sr-only`,htmlFor:`${t.id}-key`,children:s(`credential.keyLabel`,{name:o})}),(0,j.jsx)(`input`,{id:`${t.id}-key`,type:`password`,autoComplete:`off`,spellCheck:!1,value:c,maxLength:4096,disabled:v,onChange:e=>l(e.target.value),placeholder:n?.savedConfigured?s(`credential.placeholderReplace`):s(`credential.placeholderNew`),className:`focus-neko w-full min-w-0 rounded-xl border border-sakura-200 bg-base px-3 py-2.5 text-sm`}),(0,j.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,j.jsx)(`button`,{type:`submit`,disabled:v||!c.trim(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:s(u?`credential.working`:`credential.save`)}),n?.savedConfigured&&(0,j.jsx)(`button`,{type:`button`,disabled:v,onClick:()=>void _(!0),className:`focus-neko rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:s(`credential.remove`)}),(0,j.jsx)(`a`,{href:t.signupUrl,target:`_blank`,rel:`noreferrer`,className:`focus-neko ml-auto inline-block rounded text-xs text-sakura-700`,children:s(`credential.getKey`,{name:o})})]})]}),(0,j.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:m})]})}var YL=`credential-`;function XL(){let e=typeof window>`u`?``:window.location.hash.slice(1),t=e.startsWith(YL)?e.slice(11):``;return tv.some(e=>e.id===t)?t:`deepseek`}function ZL(){let{credentials:e,phase:t}=$g(),n=z(),r=t===`ready`&&e!==null,[i,a]=(0,d.useState)(XL);(0,d.useEffect)(()=>{let e=()=>a(XL());return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[]);let o=tv.find(e=>e.id===i)??tv[0],s=t=>e?.statuses[t.id]?.enabled!==!1,c=tv.map(t=>{let r=e?.statuses[t.id],i=s(t);return{id:t.id,name:t.name,keywords:t.envVar,detail:i?r&&r.source!==`none`?n(`settings.credentials.configured`):n(`settings.credentials.keyMissing`):n(`settings.credentials.disabled`),tone:i?r&&r.source!==`none`?`on`:`warn`:`off`}}),l=tv.filter(s).length,u=e!==null;return(0,d.useEffect)(()=>{u&&window.location.hash===`#${YL}${i}`&&document.getElementById(`${YL}${i}`)?.scrollIntoView?.({block:`center`})},[u,i]),(0,j.jsxs)(_S,{active:`credentials`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.credentials.title`)}),(0,j.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.credentials.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,j.jsx)(`div`,{className:`w-full min-w-0 sm:w-80`,children:(0,j.jsx)(Qx,{label:n(`settings.credentials.providerLabel`),options:c,value:o.id,onChange:a})}),(0,j.jsx)(`span`,{className:`text-xs text-ink-500`,children:n(`settings.credentials.enabledCount`,{enabled:l,total:tv.length})})]}),(0,j.jsx)(JL,{spec:o,status:e?.statuses[o.id],ready:r,enable:{enabled:s(o),locked:o.id===`deepseek`,onChange:e=>d_.setProviderEnabled(o.id,e)}},o.id)]})})]})}var QL=[`tavily`,`deepseek`],$L={tavily:`Tavily`,deepseek:`DeepSeek`},eR={saved:`search.source.saved`,environment:`search.source.environment`,runtime:`search.source.runtime`,keyless:`search.source.keyless`,none:`search.source.none`};function tR(e,t){let n=R(),r=e=>{let r=t?.statuses[e];return n(r?eR[r.source]:`common.loading`)},i={tavily:n(`search.tavilyDescription`,{source:r(`tavily`)}),deepseek:n(`search.deepseekDescription`,{source:r(`deepseek`)})};return QL.map(t=>({value:t,label:$L[t],description:i[t],selected:e?.selected===t}))}function nR(e,t){return e?.selected===`deepseek`&&t?.statuses.deepseek?.source===`none`?R()(`search.deepseekWarning`):null}function rR(e){let{settings:t,credentials:n,ready:r,onSelect:i}=e,a=z(),[o,s]=(0,d.useState)(!1),c=(0,d.useRef)(!1),[l,u]=(0,d.useState)(``),f=nR(t,n);async function p(e){if(!(c.current||e===t?.selected)){c.current=!0,s(!0),u(``);try{await i(e),u(a(`search.switched`,{name:$L[e]}))}catch{u(a(`search.saveFailed`))}finally{c.current=!1,s(!1)}}}let m=o||!r||!t;return(0,j.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`search-service`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`h2`,{id:`search-service`,className:`text-base font-bold text-ink-900`,children:a(`search.service`)}),(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:t?a(`search.current`,{name:$L[t.selected]}):a(`common.loading`)})]}),(0,j.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:a(`search.intro`)}),(0,j.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,disabled:m,children:[(0,j.jsx)(`legend`,{className:`sr-only`,children:a(`search.service`)}),tR(t,n).map(e=>(0,j.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-xl border px-3 py-2.5 text-sm ${e.selected?`border-sakura-400 bg-sakura-50`:`border-sakura-100`} ${m?`opacity-60`:``}`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`search-provider`,value:e.value,checked:e.selected,onChange:()=>void p(e.value),className:`mt-1`}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`font-semibold text-ink-900`,children:e.label}),(0,j.jsx)(`span`,{className:`block text-xs text-ink-500`,children:e.description})]})]},e.value))]}),f&&(0,j.jsx)(`p`,{className:`mt-3 text-xs text-sakura-800`,children:f}),(0,j.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:l})]})}var iR=tv.find(e=>e.id===`deepseek`);function aR(){let{credentials:e,searchSettings:t,phase:n}=$g(),r=z(),i=n===`ready`&&e!==null;return(0,j.jsxs)(_S,{active:`search`,children:[(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:r(`settings.search.title`)}),(0,j.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:r(n===`ready`?`common.connected`:`common.connecting`)})]}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:r(`settings.search.intro`)})]}),(0,j.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,j.jsx)(rR,{settings:t,credentials:e,ready:i,onSelect:e=>d_.setSearchProvider(e)}),nv.map(t=>(0,j.jsx)(JL,{spec:t,status:e?.statuses[t.id],ready:i},t.id)),iR&&(0,j.jsx)(JL,{spec:iR,status:e?.statuses[iR.id],ready:i,note:r(`settings.search.deepseekNote`)})]})})]})}var oR=[`documents`,`development`,`frontend`,`research`,`skills`,`automation`,`database`,`writing`,`uncategorized`],sR=(e,t)=>oR.includes(t)?e(`skills.category.${t}`):t,cR=(e,t)=>e(`skills.scope.${t}`),lR=e=>e>=1048576?`${(e/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`,uR=e=>e===``?``:e.slice(0,10),dR=e=>e instanceof P?e.reason??null:null;function fR(e,t,n){let r=new Map;for(let i of e){let e=t===`category`?sR(n,i.category):i.source,a=r.get(e)??[];a.push(i),r.set(e,a)}return[...r.entries()].sort((e,t)=>t[1].length-e[1].length||e[0].localeCompare(t[0]))}function pR({skill:e}){let t=z();return(0,j.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs`,children:[e.installed.project&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,j.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-sakura-500`}),e.activeLevel===`project`?t(`skills.badge.active`,{level:t(`skills.badge.project`)}):t(`skills.badge.project`)]}),e.installed.user&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,j.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-sakura-500`}),e.activeLevel===`user`?t(`skills.badge.active`,{level:t(`skills.badge.user`)}):t(`skills.badge.user`)]}),e.installed.builtin&&(0,j.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 py-0.5 text-ink-600`,children:t(`skills.badge.builtin`)})]})}function mR({confirm:e,onClose:t}){let n=z(),[r,i]=(0,d.useState)(!1);return(0,j.jsx)(hR,{children:(0,j.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,j.jsx)(`button`,{type:`button`,"aria-label":n(`common.cancel`),onClick:t,className:`absolute inset-0 bg-ink-900/20`}),(0,j.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-label":e.title,className:`relative w-full max-w-sm rounded-card border border-sakura-200 bg-surface p-5 shadow-lift`,children:[(0,j.jsx)(`h3`,{className:`text-base font-bold text-ink-900`,children:e.title}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,children:e.body}),(0,j.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:t,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,children:n(`common.cancel`)}),(0,j.jsx)(`button`,{type:`button`,disabled:r,className:`focus-neko rounded-full px-4 py-1.5 text-sm font-semibold disabled:opacity-50 ${e.danger?`bg-sakura-100 text-sakura-800`:`bg-tianyi-100 text-tianyi-800`}`,onClick:()=>{i(!0),e.action().finally(()=>{i(!1),t()})},children:r?n(`skills.processing`):e.confirmLabel})]})]})]})})}function hR({children:e}){return(0,cb.createPortal)(e,document.body)}function gR({name:e,onClose:t,onChanged:n}){let r=z(),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(`about`),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(null),[h,g]=(0,d.useState)(null),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(null);(0,d.useEffect)(()=>{let t=!1;return a(null),s(null),f(null),l(`about`),v(``),d_.marketDetail(e).then(e=>{t||a(e)}).catch(e=>{t||s(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e]),(0,d.useEffect)(()=>{if(c!==`preview`||u!==null||p!==null)return;let t=!1;return d_.marketPreview(e).then(e=>{t||f(e)}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[c,e,u,p]);let x=async(t,i)=>{g(t),v(``);try{let o=await d_.marketInstall(e,t,i);v(o.shadowedBy===`project`?r(`skills.installedShadowed`):r(`skills.installed`)),n();let s=await d_.marketDetail(e);a(s)}catch(n){dR(n)===`skill_exists`&&!i?b({title:r(`skills.overwriteTitle`),body:r(`skills.overwriteBody`,{scope:cR(r,t),name:e}),confirmLabel:r(`skills.overwrite`),action:()=>x(t,!0)}):v(r(`skills.opFailed`,{error:n instanceof Error?n.message:String(n)}))}finally{g(null)}},S=t=>{if(i===null)return;let n=t===`user`?i.installed.user:i.installed.project,a=t===`user`&&i.installed.project;n?b({title:r(`skills.overwriteTitle`),body:r(`skills.overwriteBodyVersion`,{scope:cR(r,t),name:e,version:i.version}),confirmLabel:r(`skills.overwrite`),action:()=>x(t,!0)}):a?b({title:r(`skills.shadowTitle`),body:r(`skills.shadowBody`,{name:e}),confirmLabel:r(`skills.installAnyway`),action:()=>x(t,!1)}):x(t,!1)},C=t=>{b({title:r(`skills.uninstallTitle`),body:r(`skills.uninstallBody`,{scope:cR(r,t),name:e}),confirmLabel:r(`skills.uninstall`),danger:!0,action:async()=>{g(t),v(``);try{await d_.marketUninstall(e,t),v(r(`skills.uninstalled`)),n(),a(await d_.marketDetail(e))}catch(e){v(r(`skills.opFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{g(null)}}})};return(0,j.jsxs)(hR,{children:[(0,j.jsx)(`button`,{type:`button`,"aria-label":r(`skills.closeDetail`),onClick:t,className:`fixed inset-0 z-40 bg-ink-900/10`}),(0,j.jsxs)(`aside`,{role:`dialog`,"aria-label":r(`skills.detailAria`,{name:e}),className:`fixed inset-0 z-50 flex flex-col bg-base sm:inset-y-0 sm:left-auto sm:right-0 sm:w-[26rem] sm:border-l sm:border-sakura-200 sm:shadow-lift`,children:[(0,j.jsxs)(`header`,{className:`flex items-center justify-between gap-2 border-b border-sakura-100 px-4 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`text-sakura-500`,children:(0,j.jsx)(Ux,{name:`sparkles`,size:16})}),(0,j.jsx)(`h2`,{className:`truncate text-lg font-bold text-ink-900`,children:e}),i&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-ink-400`,children:i.version})]}),(0,j.jsx)(`button`,{type:`button`,onClick:t,"aria-label":r(`skills.closeDetail`),className:`focus-neko rounded-lg p-1 text-ink-500 hover:bg-ink-100`,children:(0,j.jsx)(Ux,{name:`close`,size:16})})]}),(0,j.jsx)(`div`,{className:`flex gap-1 border-b border-sakura-100 px-4 py-2`,children:[`about`,`preview`].map(e=>(0,j.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:`focus-neko rounded-full px-3 py-1 text-sm ${c===e?`bg-tianyi-100 font-semibold text-tianyi-800`:`text-ink-500`}`,children:r(e===`about`?`skills.tab.about`:`skills.tab.preview`)},e))}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:[o!==null&&(0,j.jsx)(`p`,{className:`text-sm text-sakura-800`,children:r(`skills.loadFailed`,{error:o})}),i===null&&o===null&&(0,j.jsx)(`p`,{className:`text-sm text-ink-500`,children:r(`common.loadingEllipsis`)}),i!==null&&c===`about`&&(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsx)(`p`,{className:`text-sm text-ink-700`,children:i.description}),(0,j.jsx)(`dl`,{className:`space-y-1.5 text-xs text-ink-600`,children:[[r(`skills.field.category`),sR(r,i.category)],[r(`skills.field.source`),i.source],[r(`skills.field.size`),lR(i.sizeBytes)],[`SHA-256`,`${i.sha256.slice(0,12)}…`],[r(`skills.field.uploaded`),uR(i.uploadedAt)],...i.license===``?[]:[[r(`skills.field.license`),i.license]]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{className:`w-14 shrink-0 text-ink-400`,children:e}),(0,j.jsx)(`dd`,{className:`min-w-0 font-mono`,children:t})]},e))}),(0,j.jsxs)(`div`,{className:`rounded-xl bg-ink-50 px-3 py-2 text-xs text-ink-600`,children:[(0,j.jsx)(pR,{skill:i}),!i.installed.project&&!i.installed.user&&!i.installed.builtin&&r(`skills.notInstalled`)]})]}),i!==null&&c===`preview`&&(0,j.jsxs)(`div`,{children:[u===null&&p===null&&(0,j.jsx)(`p`,{className:`text-sm text-ink-500`,children:r(`skills.previewLoading`)}),p!==null&&(0,j.jsx)(`p`,{className:`text-sm text-sakura-800`,children:r(`skills.previewFailed`,{error:p})}),u!==null&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(BP,{text:u.body}),(0,j.jsx)(`h3`,{className:`mb-1 mt-4 text-xs font-medium text-ink-400`,children:r(`skills.packageFiles`)}),(0,j.jsx)(`ul`,{className:`space-y-0.5 font-mono text-xs text-ink-600`,children:u.files.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})]}),i!==null&&(0,j.jsxs)(`footer`,{className:`space-y-2 border-t border-sakura-100 px-4 py-3`,children:[_!==``&&(0,j.jsx)(`output`,{className:`block text-xs text-tianyi-800`,children:_}),i.installed.builtin&&!i.installed.user&&!i.installed.project?(0,j.jsx)(`p`,{className:`text-xs text-ink-500`,children:r(`skills.builtinNote`)}):(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`user`,`project`].map(e=>{let t=e===`user`?i.installed.user:i.installed.project,n=cR(r,e);return t?(0,j.jsxs)(`button`,{type:`button`,disabled:h!==null,onClick:()=>C(e),className:`focus-neko inline-flex items-center gap-1.5 rounded-full border border-ink-200 px-3 py-1.5 text-sm text-ink-600 disabled:opacity-50`,children:[(0,j.jsx)(Ux,{name:`trash`,size:14}),h===e?r(`skills.processing`):r(`skills.uninstallScope`,{scope:n})]},e):(0,j.jsxs)(`button`,{type:`button`,disabled:h!==null,onClick:()=>S(e),className:`focus-neko inline-flex items-center gap-1.5 rounded-full bg-tianyi-100 px-3 py-1.5 text-sm font-semibold text-tianyi-800 disabled:opacity-50`,children:[(0,j.jsx)(Ux,{name:`download`,size:14}),h===e?r(`skills.installing`):r(`skills.installScope`,{scope:n})]},e)})})]})]}),y&&(0,j.jsx)(mR,{confirm:y,onClose:()=>b(null)})]})}function _R(){let e=z(),{phase:t}=$g(),[n,r]=(0,d.useState)([]),[i,a]=(0,d.useState)(!0),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(``),[u,f]=(0,d.useState)(`category`),[p,m]=(0,d.useState)(null),h=(0,d.useRef)(0),g=()=>{let e=++h.current;a(!0),s(null),d_.marketList().then(t=>{e===h.current&&r(t)}).catch(t=>{e===h.current&&s(t instanceof Error?t.message:String(t))}).finally(()=>{e===h.current&&a(!1)})};(0,d.useEffect)(()=>{t===`ready`&&g()},[t]);let _=(0,d.useMemo)(()=>{let e=c.trim().toLowerCase();return e===``?n:n.filter(t=>t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e))},[n,c]),v=(0,d.useMemo)(()=>fR(_,u,e),[_,u,e]);return(0,j.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base`,children:[(0,j.jsx)(`header`,{className:`sticky top-0 z-10 border-b border-sakura-100 bg-surface/90 px-4 py-3 backdrop-blur-md sm:px-6`,children:(0,j.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-wrap items-center gap-3`,children:[(0,j.jsx)(Br,{to:`/`,className:`focus-neko inline-flex shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-sm font-medium text-sakura-700 hover:bg-sakura-50`,children:e(`skills.back`)}),(0,j.jsx)(`span`,{className:`text-ink-300`,children:`/`}),(0,j.jsx)(`h1`,{className:`text-base font-bold text-ink-900 sm:text-lg`,children:e(`skills.title`)}),(0,j.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2 sm:gap-3`,children:[(0,j.jsx)(`div`,{className:`flex rounded-full border border-sakura-200 p-0.5 text-xs`,children:[`category`,`source`].map(t=>(0,j.jsx)(`button`,{type:`button`,onClick:()=>f(t),className:`focus-neko rounded-full px-3 py-1 ${u===t?`bg-sakura-100 font-semibold text-sakura-800`:`text-ink-500 hover:text-ink-800`}`,children:e(t===`category`?`skills.groupCategory`:`skills.groupSource`)},t))}),(0,j.jsxs)(`label`,{className:`relative`,children:[(0,j.jsx)(`span`,{className:`sr-only`,children:e(`skills.search`)}),(0,j.jsx)(`span`,{className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-400`,children:(0,j.jsx)(Ux,{name:`search`,size:14})}),(0,j.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:e(`skills.searchPlaceholder`),className:`focus-neko w-36 rounded-full border border-sakura-200 bg-surface py-1.5 pl-8 pr-3 text-sm sm:w-56`})]}),(0,j.jsx)(`span`,{className:`text-xs text-ink-400`,children:e(t===`ready`?`common.connected`:`common.connecting`)})]})]})}),(0,j.jsxs)(`main`,{className:`mx-auto w-full max-w-7xl flex-1 px-4 py-6 sm:px-6`,children:[i&&(0,j.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e(t===`ready`?`skills.loadingCatalog`:`skills.waitingGateway`)}),o!==null&&(0,j.jsxs)(`div`,{className:`mx-auto max-w-md rounded-card border border-sakura-200 bg-surface p-6 text-center shadow-soft`,children:[(0,j.jsx)(`p`,{className:`text-sm text-ink-700`,children:e(`skills.catalogFailed`)}),(0,j.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-ink-400`,children:o}),(0,j.jsx)(`button`,{type:`button`,onClick:g,className:`focus-neko mt-4 rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,children:e(`common.retry`)})]}),!i&&o===null&&_.length===0&&(0,j.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e(`skills.noMatch`)}),v.map(([e,t])=>(0,j.jsxs)(`section`,{className:`mb-7`,children:[(0,j.jsxs)(`h2`,{className:`mb-2.5 flex items-baseline gap-2 text-lg font-bold text-ink-900`,children:[e,(0,j.jsx)(`span`,{className:`text-xs font-normal text-ink-400`,children:t.length})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`,children:t.map(e=>(0,j.jsxs)(`button`,{type:`button`,onClick:()=>m(e.name),className:`focus-neko rounded-2xl border border-sakura-200 bg-surface p-4 text-left shadow-soft transition-shadow hover:shadow-lift`,children:[(0,j.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`truncate text-base font-bold text-ink-900`,children:e.name}),(0,j.jsx)(pR,{skill:e})]}),(0,j.jsx)(`p`,{className:`mb-2.5 line-clamp-2 min-h-10 text-sm text-ink-500`,children:e.description}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-400`,children:[(0,j.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2 py-0.5 text-tianyi-800`,children:e.source}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.version}),(0,j.jsx)(`span`,{children:lR(e.sizeBytes)})]})]},e.name))})]},e))]}),p!==null&&(0,j.jsx)(gR,{name:p,onClose:()=>m(null),onChanged:()=>g()})]})}var vR=Gr({component:()=>(0,j.jsx)(ti,{})}),yR=Ur({getParentRoute:()=>vR,path:`/`,component:II}),bR=Ur({getParentRoute:()=>vR,path:`/settings`,component:ZL}),xR=Ur({getParentRoute:()=>vR,path:`/settings/search`,component:aR}),SR=Ur({getParentRoute:()=>vR,path:`/settings/codemode`,component:QI}),CR=Ur({getParentRoute:()=>vR,path:`/settings/context`,component:pL}),wR=Ur({getParentRoute:()=>vR,path:`/settings/appearance`,component:JI}),TR=Ur({getParentRoute:()=>vR,path:`/settings/language`,component:hL}),ER=Ur({getParentRoute:()=>vR,path:`/settings/mobile`,component:KL}),DR=Ur({getParentRoute:()=>vR,path:`/skills`,component:_R}),OR=Ur({getParentRoute:()=>vR,path:`/about`,component:CS}),kR=si({routeTree:vR.addChildren([yR,bR,xR,CR,SR,wR,TR,ER,DR,OR])});Ii().start(),Fg().start(),l_();var AR=document.getElementById(`root`);AR!==null&&(0,gi.createRoot)(AR).render((0,j.jsx)(d.StrictMode,{children:(0,j.jsx)(ui,{router:kR})}));