neko-harness 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/client/assets/index-10n4trvc.css +2 -0
- package/dist/client/assets/index-CYjEttGJ.js +398 -0
- package/dist/client/index.html +2 -2
- package/dist/gateway.js +607 -108
- package/dist/neko.js +824 -128
- package/package.json +2 -1
- package/dist/client/assets/index-DCZeTvcw.css +0 -2
- package/dist/client/assets/index-PcV-h5ox.js +0 -396
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(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 u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.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 ae(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 oe(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,oe(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,`$&/`)+`/`),oe(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+=oe(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+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(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 se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(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 le=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 ue(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,le)}catch(e){le(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function de(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 ue(de.bind(null,e))}var fe={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(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=fe,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=de,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:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ue,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`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1),p=f.useLayoutEffect;function m(e){return e[e.length-1]}function h(e,t){return typeof e==`function`?e(t):e}var g=Object.prototype.hasOwnProperty;function _(e){for(let t in e)if(g.call(e,t))return!0;return!1}var v=()=>Object.create(null),y=(e,t)=>b(e,t,!0);function b(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&&!(x(e)&&x(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&&m(a)!==`${o-1}`||c&&m(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`?b(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`?b(d,o,n,r):o,i&&=u===d&&(a[l]===f||g.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 p=i?s.fill(0):n?v():{};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`?b(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function x(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function S(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&&!S(a,o,n,r))return!1}return!0}if(x(e)&&x(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!S(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||!S(e[a],t[a],n,r)))return!1;return i===0}return!1}var C=/[\x00-\x1f\x7f"<>`{}]/g;function w(e){return e.replace(C,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function T(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 w(t)}var E=[`http:`,`https:`,`mailto:`,`tel:`];function ee(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 te=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function ne(e,t){if(!e)return!1;if(te.test(e))return!0;let n=ee(e);return n?!t.has(n):!1}function D(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+=T(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=T(r?e.slice(r):e)}return t}function re(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ie(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 ae(){throw Error(`Invariant failed`)}function oe(e){return e.replace(/\/{2,}/g,`/`)}function se(e){return e===`/`?e:e.replace(/^\/+/,``)}function ce(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function le(e){return ce(se(e))}function ue(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function de(e,t,n=`never`,r){if(t.includes(`//`)&&(t=oe(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=oe(e)),o=e.split(`/`);o.length>1&&m(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&&(m(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?oe(s):s)||`/`;return a&&r&&r.set(a,c),c}function fe(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 pe(e){return e==null||e===``}function me(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 he(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&&pe(f)){if(c===`/`&&!d)continue;f=``}o+=c+me(s,f,r)+(d||``)}}return o+a||`/`}function ge(e){return e?.isNotFound===!0}function _e(){try{return sessionStorage}catch{return}}var ve=`tsr-scroll-restoration-v1_3`,ye=_e();function be(){try{return JSON.parse(ye?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var O=be(),xe=`data-scroll-restoration-id`,Se=e=>e.state.__TSR_key||e.href;function Ce(e){let t=e.getAttribute(xe);if(t)return`[${xe}="${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 we=!1,Te=`window`;function Ee(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function De(e){let t=new Set;for(let n of e){if(n===Te)continue;let e=Ee(n);e&&t.add(e)}return t}function Oe(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Se,a=new Set,o=e=>{let t=O[e]||={};for(let e of a)e===document?t[Te]={scrollX,scrollY}:e.isConnected&&(t[Ce(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,we=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{we||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{ye?.setItem(ve,JSON.stringify(O))}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=O[d];if(e){let t=O[u];for(let n in e){if(n===Te){if(s)continue}else{let e=Ee(n);if(!e||s&&o&&(l??=De(o),l.has(e)))continue}t||=O[u]={},t[n]??=e[n]}}}we=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=De(o));let t=e&&i&&c,s=r.e?O[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Te){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ee(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{we=!1}}))}function ke(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 Ae(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function je(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]=Ae(r):Array.isArray(t)?t.push(Ae(r)):n[e]=[t,Ae(r)]}return n}var Me=/^(?:\s|["[{\d-]|fa|nu|tr)/,Ne=Fe(JSON.parse),Pe=Ie(JSON.stringify,JSON.parse);function Fe(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=je(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Me.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Ie(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&&!Me.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=ke(e,r);return t?`?${t}`:``}}var Le=`__root__`;function Re(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 ze(e){return e instanceof Response&&!!e.options}function Be(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 Ve=4,He=5;function Ue(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 We(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 Ge(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,p,h=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=m(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.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=We(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=qe(r);c=n,t.set(e,n)}}else{let t=a[0],m=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&h<n&&(h<e-1&&p.push(s.slice(h,e-1)),a[2]=`/`+m,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),h=n),!r)continue;let _=d&&!!(m||g);d||(m=m.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===m&&e.suffix===g);if(y)c=y;else{let e=qe(r,t,_,m,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&h<u&&p.push(s.slice(h,u));let g=p?.slice();if(!r)return g;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=qe(r,He);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&u<l){let e=qe(r,Ve);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 Ke(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 qe(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 Je(e,t){let n=qe(),r=[];function i(e,t,n,a){let[o,s,c]=Ge(!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(Ke);t.masksTree=n,t.flatCache=Be(1e3)}function Ye(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=$e(e,t.masksTree);return t.flatCache.set(e,r),r}function Xe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=qe(),Ge(t,{from:e},1,o),i.singleCache.set(a,o)),$e(r,o,n)}function Ze(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=$e(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=tt(a.route)),t.matchCache.set(r,a),a}function Qe(e,t=!1){let n=qe(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&ae(),i[e.id]=e,o!==0&&e.path){let t=ce(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Ge(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(Ke);return{processedTree:{segmentTree:n,singleCache:Be(1e3),matchCache:Be(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function $e(e,t,n=!1){let r=e.split(`/`),i=rt(e,r,t,n);if(!i)return null;let[a]=et(e,r,i);return{route:i.node.route,rawParams:a}}function et(e,t,n){let r=nt(n.node),i=n.node.data&&Ue(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===Ve)break;if(u.kind===He){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 tt(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function nt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function rt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!m(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&&!st(l,n))continue;if(i.parse){if(!ot(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Ve&&st(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Ve||i.kind===2)&&st(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&&(ot(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&at(f,o))return n;st(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+it(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+it(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+it(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+it(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 it(e,t){return 2**(e-t-1)}function at(e,t){return e===2**(t-1)-1}function ot(e,t,n){let r,i;try{[r,i]=et(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 st(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===Ve)>(e.node.kind===Ve)||t.node.kind===Ve==(e.node.kind===Ve)&&t.node.depth>e.node.depth)))}function ct(e,t,n){let r=le(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=oe(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>lt(n,s.input({url:e})),output:({url:e})=>s.output({url:ut(n,e)})}:s}function lt(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 ut(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 dt(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(()=>{ie(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 ft=`__TSR_index`,pt=`popstate`,mt=`beforeunload`,ht=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function gt(e){let t=ht.exec(e);return t?`/`+e.slice(t[0].length):e}function _t(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
+
\r`.includes(e)?``:encodeURIComponent(e))),gt(e)}function vt(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=xt(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[ft];i=yt(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[ft];i=yt(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[ft]!==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 yt(e,t){let n=St();return{...t,key:n,__TSR_key:n,[ft]:e}}function bt(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=>_t(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>xt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=St();t.history.replaceState({[ft]: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=xt(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[ft]-l.state[ft],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=vt({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(mt,x,{capture:!0}),t.removeEventListener(pt,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(mt,x,{capture:!0}),t.addEventListener(pt,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 xt(e,t){let n=_t(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=St();t={[ft]: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 St(){return(Math.random()+1).toString(36).slice(7)}function Ct(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function wt(e){return e.pathname+e.search+e.hash}function Tt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Et(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Dt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ot(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function kt(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 At=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:bt()),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!==`/`&&le(n)?ct(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=dt(this.latestLocation,e),Oe(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Qe(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Je(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Be(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:D(e),external:!1,searchStr:o,search:y(t?.search,i),hash:D(r.slice(1)),state:b(t?.state,a)}}let o=lt(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:D(gt(o.pathname)),external:!!this.rewrite&&Ct(o,this.origin),searchStr:c,search:y(t?.search,s),hash:D(o.hash.slice(1)),state:b(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=Ze(ce(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=xt(n.href,{});n={...n,to:lt(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=de(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[ce(c)],u=c.includes(`$`),d;if(l)d=l._branch??=tt(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??Ge(!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??=Ft(n.params,e),!_(p))break;p===e&&(p=Object.assign(v(),p));try{Object.assign(p,t(p))}catch{}}}p??=Ft(n.params,It(n.params,f)?o()[3]:Lt);let m=e.leaveParams?c:gt(D(f?he(c,f,p,this.pathParamsDecoder):c)),h=Rt(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Pt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},y=h.length?zt(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Lt,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:Lt,w=`${m}${b}${S}`,T,E,ee=!1;if(this.rewrite){let e=new URL(w,this.origin),t=e.origin,n=ut(this.rewrite,e);T=wt(e),Ct(n,t)?(E=n.href,ee=!0):E=gt(wt(n))}else T=re(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=Ye(r.pathname,this.processedTree);if(t){let i=Object.assign(v(),t.rawParams),{from:a,params:o,...s}=t.route,c=Ft(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 jt(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=ce(this.latestLocation.href)===ce(n.href)&&S(Dt(n.state),Dt(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?ee(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 jt(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 Nn(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(Et(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`)&&Tt(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(te.test(n)||(r=ee(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:Ct(e,this.origin)||(n=wt(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=Wt,this.preloadRoute=e=>Pn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?de(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=Xe(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!S(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?S(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=fe(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??Pe,parseSearch:e.parseSearch??Ne,protocolAllowlist:e.protocolAllowlist??E}),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=Ge(!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[`**`]:ce(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Bt(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=Pt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof Mt||(r=new Mt(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=v(),_=i._interpolation?he(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,x=i.id+_+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{Vt(i,d)}catch(e){if(w=ge(e)||ze(e)?e:new Nt(e.message,{cause:e}),t?.throwOnError)throw w}let T=S?`stay`:`enter`,E;if(C)E={...C,cause:T,search:y(S?S.search:C.search,l),_strictSearch:f,searchError:p};else{let e=Tt(i)?`pending`:`success`;E={id:x,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:S?y(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?b(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`?y(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=m(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=m(a),c={...e.search};for(let e of a)try{Object.assign(c,Pt(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{Vt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function jt(e,t,{replace:n,ignoreBlocker:r}){if(!ne(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 Mt=class extends Error{},Nt=class extends Error{};function Pt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Mt(`Async validation not supported`);if(n.issues)throw new Mt(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 Ft(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 It(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!g.call(e,t[1]))}var Lt=Object.freeze({});function Rt(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=Pt(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 zt(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=h(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 Bt(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 Le}function Vt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Ht(e,t){return e.options[t]?.preload?.()}function Ut(e,t){let n=Ht(e,`component`),r=Ht(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Wt(e,t,n){let r=()=>t===!1?void 0:t?Ht(e,t):Ut(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 Gt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Kt(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var qt=0,Jt=1,Yt=2,Xt=3,Zt=[4];function Qt(e){return typeof e[0]==`number`}function $t(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 en(e,t){return e.routesById[t.routeId]}function tn(e,t,n){return ze(e)?[Xt,e]:ge(e)?(e.routeId||=n,[Yt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Jt,e]):[qt,e]}function nn(e,t){let n=tn(t,!0,e.id);if(n[0]!==Jt)return n;try{e.options.onError?.(n[1])}catch(t){n=tn(t,!0,e.id)}return n}function rn(e,t,n,r,i){return i[0].signal.aborted?Zt:bn(e,t,n,nn(n,r),i)}async function an(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=en(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 sn(e,r),[i,rn(e,t,u,a,n)]}if(c.aborted)return[i,Zt];let p=r.paramsError??r.searchError;if(p!==void 0)return sn(e,r),[i,rn(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{un(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?$t(a,c):a);if(c.aborted)return[i,Zt];let s=bn(e,t,u,tn(o,!1,u.id),n);if(s[0]!==qt)return sn(e,r),[i,s];r.context={...r.context,...o}}catch(a){return sn(e,r),[i,rn(e,t,u,a,n)]}finally{r.status=h,un(e,r,!1,n[0])}}i()}function on(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 sn(e,t){let n=t._flight;t._flight=void 0,on(e,t,n)?.abort()}function cn(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=on(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function ln(e){for(let t of e){let e=t._flight;e&&e[2]++}}function un(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 dn(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 fn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Zt;if(!i)return[qt,void 0];let l=n._flight;un(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(dn(e,t,n,r,s,a,!!o[3]))).then(e=>tn(e,!1,r.id),e=>tn(e,!0,r.id)).then(t=>(t[0]!==qt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Jt&&l[2]?nn(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],bn(e,t,r,await $t(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return sn(e,n),Zt}finally{un(e,n,!1,s)}}function pn(e,t,n){t[0]!==Xt&&(e.status=`success`,e.error=void 0,t[0]===qt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function mn(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&&sn(e,r)}function hn(e,t){return t[0]===Jt||t[0]===Yt?{...e,status:t[0]===Jt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function gn(e,t,n,r,i,a,o){let s=t[1][n],c=en(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(dn(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Zt)),!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,sn(e,s),p=rn(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,on(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?fn(e,t,s,c,g,i,a).then(t=>(pn(s,t,l),t[0]===qt&&(m&&!a[0].signal.aborted&&mn(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[qt,s.loaderData]),T=(async()=>{try{let e=Wt(c,void 0,C);e&&await $t(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,rn(e,t,c,r,a)]}let r=await w;x&&r[0]===qt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>hn(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ee=fn(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,pn(E,e,!1),e));return(t[2]??=[]).push([n,ee,T,E]),ee.then(e=>hn(E,e))}async function _n(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=en(e,t[n]);try{let e=Wt(i,!1);e&&await $t(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function vn(e,t){t[2]&&=(cn(e,t[2].map(e=>e[3])),void 0)}async function yn(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]>=Xt)throw[a,t];!i&&t[0]!==qt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Xt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function bn(e,t,n,r,i,a){for(;r[0]===Xt;){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]?[Xt,t]:[Xt,t,a]}return[Xt,o,n]}catch(e){r=a?[Jt,e]:nn(n,e),a=!0}}return r}async function xn(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]===Yt?_n(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Xt)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]!==qt&&t[0]<Xt&&!(`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)>=Xt){let n=s[1];if(n[0]!==Xt||n[1].options.reloadDocument||n[2])return vn(e,t),n;c=!0,s=[0,[Jt,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===Jt?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=en(e,u);try{await $t(i?Promise.resolve().then(()=>Wt(m,l===Jt?`errorComponent`:`notFoundComponent`)):Promise.all([Wt(m),Wt(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return vn(e,t),Zt}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),vn(e,t),cn(e,o),p()):u.status=`success`}return t}async function Sn(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=en(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 $t(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 Cn(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 _n(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=gn(e,i,t,u,f,r,l)},m=await an(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Yt){let t=await _n(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Xt&&(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=xn(e,i,u,r[0],yn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=yn(i[2],void 0,void 0,h.then(e=>Qt(e)?0:Gt(n).length,()=>0))),o=await h}catch(t){if(vn(e,i),t===a&&a.aborted)return Zt;throw t}return Qt(o)?o:Sn(e,o,a,r[6]===n.length?r[6]:0)}function wn(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=en(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(()=>wn(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 Tn(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 En(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Gt(t[3]).some(e=>e.id===n[1]))return;let i;try{await $t(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Dn(e,t){e._committed=t,e.stores.setMatches(t)}function On(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=Gt(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=en(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=Ot(n);Dn(e,n),cn(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),kt(e,i,n,a,l,t)}async function kn(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function An(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 jn(e,t,n,r,i){let a=n.map(e=>({...e}));ln(a);for(let t of r)sn(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await xn(e,o,r,t[0],i)}catch(t){throw cn(e,a),t}if(Qt(s))cn(e,a),s[0]===Xt&&e._tx===t&&e._committed===n&&await An(e,t,s);else if(await Sn(e,s,t[0].signal),e._tx!==t||e._committed!==n)cn(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),sn(e,n))}Dn(e,a),cn(e,n,a)}}async function Mn(e,t,n,r,i,a){let o=await Cn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Qt(o)){let n=o[0]===Xt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Tn(e,t),cn(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Tn(e,t);return}await An(e,t,o);return}let s=o[1];if(e._tx===t&&await En(e,t),e._tx!==t){Tn(e,t),cn(e,s),vn(e,o);return}let c=t[2],l=Et(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await En(e,t),e._tx!==t){Tn(e,t),cn(e,s),vn(e,o);return}let n=await e.startTransition(()=>{Tn(e,t),On(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&&jn(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)):vn(e,o)})}async function Nn(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=Et(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await kn(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});ln(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){cn(e,m),await kn(e,n);return}e._preflight=void 0;let g,_=()=>Mn(e,y,f,()=>wn(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(()=>kn(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&un(e,t,!1)}n[0].abort(),cn(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))&&wn(e,y),g?.(_()),await y[5]):(cn(e,y[3]),y[3]=[],g?.(),await kn(e,y))}async function Pn(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}),ln(a),o=(e._preloads??=new Map).set(i,a),s=await Cn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),cn(e,a)),i.abort()}if(!Qt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){ge(e)||console.error(e);return}}}var Fn=`Error preloading route! ☝️`,In=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=Le:this.parentRoute||ae();let r=n?Le:t?.path;r&&r!==`/`&&(r=se(r));let i=t?.id||r,a=n?Le:oe((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:oe(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ce(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=>Re({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.`)}},Ln=class extends In{constructor(e){super(e)}},Rn=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})),k=o(((e,t)=>{t.exports=Rn()}))(),zn=class extends f.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?f.createElement(this.props.errorComponent??Bn,{error:e[0],reset:this.reset}):this.props.children}};function Bn({error:e}){let[t,n]=f.useState(!1);return(0,k.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,k.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,k.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,k.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,k.jsx)(`div`,{children:(0,k.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,k.jsx)(`code`,{children:e.message}):null})}):null]})}var Vn=()=>!0,Hn=()=>!1;function Un({children:e,fallback:t=null}){return(0,k.jsx)(f.Fragment,{children:Wn()?e:t})}function Wn(e=!0){return f.useSyncExternalStore(Gn,Vn,e?Hn:Vn)}function Gn(){return()=>{}}var Kn=f.createContext(null);function qn(e){return f.useContext(Kn)}function Jn(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Kt(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 Yn=f.createContext(void 0),Xn=f.createContext(void 0);function Zn({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 Qn(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 $n=[],er=0,{link:tr,unlink:nr,propagate:rr,checkDirty:ir,shallowPropagate:ar}=Zn({update(e){return e._update()},notify(e){$n[sr++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,dr(e))}}),or=0,sr=0,cr,lr=0;function ur(e){try{++lr,e()}finally{--lr||fr()}}function dr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=nr(n,e)}function fr(){if(!(lr>0)){for(;or<sr;){let e=$n[or];$n[or++]=void 0,e.notify()}or=0,sr=0}}function pr(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 cr!==void 0&&tr(i,cr,er),i._snapshot},subscribe(e){let t=Qn(e),n={current:!1},r=mr(()=>{i.get(),n.current?(cr=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=cr,o=t?.compare??Object.is;if(n)cr=i,++er,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{cr=a,n&&(i.flags&=-5),dr(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&ir(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ar(e)}}else e&32&&(i.flags=e&-33);return cr!==void 0&&tr(i,cr,er),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(rr(e),ar(e),fr())}},i}function mr(e){let t=()=>{let t=cr;cr=n,++er,n.depsTail=void 0,n.flags=6;try{return e()}finally{cr=t,n.flags&=-5,dr(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&&ir(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,dr(this)}};return t(),n}var hr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),gr=o(((e,t)=>{t.exports=hr()})),_r=o((e=>{var t=d(),n=gr();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}})),vr=o(((e,t)=>{t.exports=_r()}))();function yr(e,t){return e===t}function br(e,t=e=>e,n){let r=n?.compare??yr,i=(0,f.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,f.useCallback)(()=>e.get(),[e]);return(0,vr.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var xr={};function Sr(e,t){let n=f.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=b(n.current,i):i}}function Cr(e){let t=qn(),n=f.useContext(e.from?Xn:Yn),r=e.from??n,i=t.stores.getMatchStore(r),a=Sr(e,t),o=br(i,e=>e?a(e):xr);if(o!==xr)return o;(e.shouldThrow??!0)&&ae()}function wr(e){return Cr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Tr(e){let{select:t,...n}=e;return Cr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Er(e){return Cr({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 Dr(e){return Cr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Or(e){let t=qn();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function kr(e){return Cr({...e,select:t=>e.select?e.select(t.context):t.context})}function Ar(...e){let t=f.useRef(e),n=t.current;return e.forEach((e,t)=>{S(n[t],e,!1,!0)||(n[t]=e)}),t.current}function jr(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Fn)})}function Mr(e,t){let n=typeof e==`string`&&ee(e);if(n)return t.has(n)?e:null}function Nr(e,t,n,r){let i=ue(e.pathname,r),a=ue(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!S(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function Pr(e,t,n){let r=qn(),i=f.useRef(null),a=f.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:d,onClick:p,onBlur:m,onFocus:h,onMouseEnter:g,onMouseLeave:_,onTouchStart:v}=e,[y,b,x]=Ar(e.search,e.params,o),S=f.useContext(Yn),C=(r.stores._linkScopes??={})[S]??=Jn(r,S),[w,T,E]=f.useMemo(()=>{let t=Mr(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=Hr(t,r,u),s=u||o&&!ee(o)?Nr(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]=f.useSyncExternalStore(C[1],T,E||T),D=ne===void 0&&te,re=u||te===void 0,ie=f.useRef(!1),ae=e.reloadDocument||D||re?!1:c??r.options.defaultPreload,oe=l??r.options.defaultPreloadDelay??0,se=f.useCallback(e=>{let t=e?.isIntersecting;t??ae===`intent`?oe?i.t??=setTimeout(()=>{i.t=void 0,jr(r,w)},oe):jr(r,w):t===!1&&Br(i)},[r,w,i,ae,oe]);f.useEffect(()=>{if(!ae)return;ae===`render`&&!ie.current&&(ie.current=!0,jr(r,w));let e=!0,t;return ae===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&se(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),Br(i)}},[r,w,ae,se,i]);let ce=Rr(e,n);if(ce.ref=t?a:i,D)return ce.href=D,ce;let le=t=>{let n=d??t.currentTarget.getAttribute(`target`);!re&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(!n||n===`_self`)&&t.button===0&&(t.preventDefault(),Br(i),r.navigate({...e,_fromLocation:w._fromLocation}))},ue=()=>{ae===`intent`&&jr(r,w)},de=()=>{ae===`intent`&&Br(i)};return ce.onClick=Vr(p,le),ce.onBlur=Vr(m,de),ce.onFocus=Vr(h,se),ce.onMouseEnter=Vr(g,se),ce.onMouseLeave=Vr(_,de),ce.onTouchStart=Vr(v,ue),zr(ce,e,ne,te,re,n)}var Fr={},Ir={className:`active`},Lr=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 Rr(e,t){let n={};for(let r in e)Lr.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function zr(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=h(n?o:s,{})??(n?Ir:Fr);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 Br=e=>{clearTimeout(e.t),e.t=void 0},Vr=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function Hr(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||!ne(i,t.protocolAllowlist))return i}var Ur=f.memo(f.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Pr(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return f.createElement(n,r,i)}),Wr);function Wr(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Lr.has(r)||!S(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Gr=class extends In{constructor(e){super(e),this.useMatch=e=>Cr({...e,from:this.id}),this.useRouteContext=e=>kr({...e,from:this.id}),this.useSearch=e=>Dr({...e,from:this.id}),this.useParams=e=>Er({...e,from:this.id}),this.useLoaderDeps=e=>Tr({...e,from:this.id}),this.useLoaderData=e=>wr({...e,from:this.id}),this.useNavigate=()=>Or({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,k.jsx)(Ur,{ref:t,from:this.fullPath,...e}))}};function Kr(e){return new Gr(e)}var qr=class extends Ln{constructor(e){super(e),this.useMatch=e=>Cr({...e,from:this.id}),this.useRouteContext=e=>kr({...e,from:this.id}),this.useSearch=e=>Dr({...e,from:this.id}),this.useParams=e=>Er({...e,from:this.id}),this.useLoaderDeps=e=>Tr({...e,from:this.id}),this.useLoaderData=e=>wr({...e,from:this.id}),this.useNavigate=()=>Or({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,k.jsx)(Ur,{ref:t,from:this.fullPath,...e}))}};function Jr(e){return new qr(e)}function Yr(e){let t=qn(),n=`not-found-${br(t.stores.location,e=>e.pathname)}-${br(t.stores.status)}`;return(0,k.jsx)(zn,{getResetKey:()=>n,onCatch:(t,n)=>{if(ge(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ge(t))return e.fallback?.(t);throw t},children:e.children})}function Xr(){return(0,k.jsx)(`p`,{children:`Not Found`})}function Zr(e,t,n){return t.options.notFoundComponent?(0,k.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,k.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,k.jsx)(Xr,{})}function Qr(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,k.jsx)(n,{}):null}var $r=(e,t)=>e[0]===t[0]&&e[1]===t[1],ei=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ti=f.memo(function({routeId:e}){let t=qn();return ni(t,br(t.stores.getMatchStore(e)))});function ni(e,t){let n=e.routesById[t.routeId],r=Qr(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=ei(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,k.jsx)(ri,{match:t});s&&(l=(0,k.jsx)(Un,{fallback:r,children:l})),o&&(l=(0,k.jsx)(Yr,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return f.createElement(o,e)},children:l})),i&&(l=(0,k.jsx)(zn,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(ge(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,k.jsx)(f.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,k.jsx)(Yn.Provider,{value:t.routeId,children:(0,k.jsxs)(u,{children:[l,null]})}):(0,k.jsxs)(Yn.Provider,{value:t.routeId,children:[l,null]})}var ri=f.memo(function({match:e}){let t=qn(),n=e.routeId,r=t.routesById[n],i=f.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=f.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,k.jsx)(e,{},i):(0,k.jsx)(ii,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ei(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Qr(t,r)}if(e.status===`notFound`)return Zr(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ii=f.memo(function(){let e=qn(),t=f.useContext(Yn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=br(a,e=>[!!e._notFound,e.error],{compare:$r}),i=br(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Zr(e,e.routesById[t],r);if(!i)return null;let a=(0,k.jsx)(ti,{routeId:i});return t===`__root__`?(0,k.jsx)(f.Suspense,{fallback:Qr(e),children:a}):a});function ai(e,t){let n=e[1];e.length=0,n?.(t)}function oi({t:e}){let t=qn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ai(n,!1),n.push(i,a),e(t),f.startTransition(r)}),p(()=>{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(ce(r.publicHref)!==ce(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`,...Et(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function si(){let e=qn(),t=e.routesById[Le],n=Qr(e,t),r=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(oi,{t:f.useState()[1]}),e.ssr?(0,k.jsx)(ci,{}):(0,k.jsx)(f.Suspense,{fallback:n,children:(0,k.jsx)(ci,{})})]});return e.options.InnerWrap?(0,k.jsx)(e.options.InnerWrap,{children:r}):r}function ci(){let e=qn(),t=e._rendered,n=br(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;p(()=>{t[0]===n&&ai(t,!0)},[t,n]);let a=i?(0,k.jsx)(ti,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,k.jsx)(zn,{getResetKey:()=>r,onCatch:void 0,children:a})}var li=e=>({createMutableStore:pr,createReadonlyStore:pr,batch:ur}),ui=e=>new di(e),di=class extends At{constructor(e){super(e,li)}};function fi({router:e,children:t,...n}){_(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,k.jsx)(Kn.Provider,{value:e,children:t});return e.options.Wrap?(0,k.jsx)(e.options.Wrap,{children:r}):r}function pi({router:e,...t}){return(0,k.jsx)(fi,{router:e,...t,children:(0,k.jsx)(si,{})})}var mi=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}}}})),hi=o(((e,t)=>{t.exports=mi()})),gi=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),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 u(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=u(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=u(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=u(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=u(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`})),_i=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=gi()})),vi=o((e=>{var t=hi(),n=d(),r=_i();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 u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}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`),ae=Symbol.for(`react.context`),oe=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?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 se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case te:return`Portal`;case ae:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se={pending:!1,data:null,method:null,action:null},Ce=[],we=-1;function Te(e){return{current:e}}function Ee(e){0>we||(e.current=Ce[we],Ce[we]=null,we--)}function De(e,t){we++,Ce[we]=e.current,e.current=t}var Oe=Te(null),ke=Te(null),Ae=Te(null),je=Te(null);function Me(e,t){switch(De(Ae,t),De(ke,e),De(Oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Op(t),e=kp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ee(Oe),De(Oe,e)}function Ne(){Ee(Oe),Ee(ke),Ee(Ae)}function Pe(e){var t=e.memoizedState;t!==null&&(Th._currentValue=t.memoizedState,De(je,e)),t=Oe.current;var n=kp(t,e.type);t!==n&&(De(ke,e),De(Oe,n))}function Fe(e){ke.current===e&&(Ee(Oe),Ee(ke)),je.current===e&&(Ee(je),Th._currentValue=Se)}var Ie,Le;function Re(e){if(Ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ie=t&&t[1]||``,Le=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+Ie+e+Le}var ze=!1;function Be(e,t){if(!e||ze)return``;ze=!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{ze=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Re(n):``}function Ve(e,t){switch(e.tag){case 26:case 27:case 5:return Re(e.type);case 16:return Re(`Lazy`);case 13:return e.child!==t&&t!==null?Re(`Suspense Fallback`):Re(`Suspense`);case 19:return Re(`SuspenseList`);case 0:case 15:return Be(e.type,!1);case 11:return Be(e.type.render,!1);case 1:return Be(e.type,!0);case 31:return Re(`Activity`);case 30:return Re(`ViewTransition`);default:return``}}function He(e){try{var t=``,n=null;do t+=Ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Ue=Object.prototype.hasOwnProperty,We=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,Ke=t.unstable_shouldYield,qe=t.unstable_requestPaint,Je=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,Xe=t.unstable_ImmediatePriority,Ze=t.unstable_UserBlockingPriority,Qe=t.unstable_NormalPriority,$e=t.unstable_LowPriority,et=t.unstable_IdlePriority,tt=t.log,nt=t.unstable_setDisableYieldValue,rt=null,it=null;function at(e){if(typeof tt==`function`&&nt(e),it&&typeof it.setStrictMode==`function`)try{it.setStrictMode(rt,e)}catch{}}var ot=Math.clz32?Math.clz32:lt,st=Math.log,ct=Math.LN2;function lt(e){return e>>>=0,e===0?32:31-(st(e)/ct|0)|0}var ut=256,dt=262144,ft=4194304;function pt(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 mt(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=pt(n))):i=pt(o):i=pt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=pt(n))):i=pt(o)):i=pt(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 ht(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gt(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-ot(n),i=1<<r;t|=e[r],n&=~i}return t}function _t(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 vt(){var e=ft;return ft<<=1,!(ft&62914560)&&(ft=4194304),e}function yt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function bt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xt(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-ot(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&&St(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function St(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ot(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function wt(e,t){var n=t&-t;return n=n&42?1:Tt(n),(n&(e.suspendedLanes|t))===0?n:0}function Tt(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 Et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Dt(){var e=xe.p;return e===0?(e=window.event,e===void 0?32:Vh(e.type)):e}function Ot(e,t){var n=xe.p;try{return xe.p=e,t()}finally{xe.p=n}}var kt=Math.random().toString(36).slice(2),At=`__reactFiber$`+kt,jt=`__reactProps$`+kt,Mt=`__reactContainer$`+kt,Nt=`__reactEvents$`+kt,Pt=`__reactListeners$`+kt,Ft=`__reactHandles$`+kt,It=`__reactResources$`+kt,Lt=`__reactMarker$`+kt,Rt=`__reactLoad$`+kt;function zt(e){delete e[At],delete e[jt],delete e[Pt],delete e[Ft]}function Bt(e){var t;if(t=e[At])return t;for(var n=e.parentNode;n;){if(t=n[Mt]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Am(e);e!==null;){if(n=e[At])return n;e=Am(e)}return t}e=n,n=e.parentNode}return null}function Vt(e){if(e=e[At]||e[Mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ut(e){var t=e[It];return t||=e[It]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Wt(e){e[Lt]=!0}function Gt(e){e[Rt]=void 0}var Kt=new Set,qt={};function Jt(e,t){Yt(e,t),Yt(e+`Capture`,t)}function Yt(e,t){for(qt[e]=t,e=0;e<t.length;e++)Kt.add(t[e])}var Xt=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]*$`),Zt={},Qt={};function $t(e){return Ue.call(Qt,e)?!0:Ue.call(Zt,e)?!1:Xt.test(e)?Qt[e]=!0:(Zt[e]=!0,!1)}var en=!1;function tn(){var e=en;return en=!1,e}function nn(e,t,n){if($t(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 rn(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 an(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 on(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function sn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function cn(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 ln(e){if(!e._valueTracker){var t=sn(e)?`checked`:`value`;e._valueTracker=cn(e,t,``+e[t])}}function un(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=sn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var dn=/[\n"\\]/g;function fn(e){return e.replace(dn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function pn(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=``+on(t)):e.value!==``+on(t)&&(e.value=``+on(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):hn(e,on(n)):o===`number`&&e.value==t?hn(e,on(e.value)):hn(e,on(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=``+on(s):e.removeAttribute(`name`)}function mn(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)){ln(e);return}n=n==null?``:``+on(n),t=t==null?n:``+on(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),ln(e)}function hn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function gn(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=``+on(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 _n(e,t,n){t!=null&&(t=``+on(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+on(n)}function vn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(be(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=on(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),ln(e)}function yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bn=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 xn(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||bn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Sn(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]=``,en=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(xn(e,a,r),en=!0)}else for(var o in t)t.hasOwnProperty(o)&&xn(e,o,t[o])}function Cn(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 wn=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`]]),Tn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function En(e){return Tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Dn(){}var On=null;function kn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var An=null,jn=null;function Mn(e){var t=Vt(e);if(t&&(e=t.stateNode)){var n=e[jt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(pn(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="`+fn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[jt]||null;if(!a)throw Error(i(90));pn(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&&un(r)}break a;case`textarea`:_n(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&gn(e,!!n.multiple,t,!1)}}}var Nn=!1;function Pn(e,t,n){if(Nn)return e(t,n);Nn=!0;try{return e(t)}finally{if(Nn=!1,(An!==null||jn!==null)&&(ef(),An&&(t=An,e=jn,jn=An=null,Mn(t),e)))for(t=0;t<e.length;t++)Mn(e[t])}}function Fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[jt]||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 In=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ln=!1;if(In)try{var Rn={};Object.defineProperty(Rn,"passive",{get:function(){Ln=!0}}),window.addEventListener(`test`,Rn,Rn),window.removeEventListener(`test`,Rn,Rn)}catch{Ln=!1}var k=null,zn=null,Bn=null;function Vn(){if(Bn)return Bn;var e,t=zn,n=t.length,r,i=`value`in k?k.value:k.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 Bn=i.slice(e,1<r?1-r:void 0)}function Hn(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 Un(){return!0}function Wn(){return!1}function Gn(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)?Un:Wn,this.isPropagationStopped=Wn,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=Un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Un)},persist:function(){},isPersistent:Un}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qn=Gn(Kn),Jn=T({},Kn,{view:0,detail:0}),Yn=Gn(Jn),Xn,Zn,Qn,$n=T({},Jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ur,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!==Qn&&(Qn&&e.type===`mousemove`?(Xn=e.screenX-Qn.screenX,Zn=e.screenY-Qn.screenY):Zn=Xn=0,Qn=e),Xn)},movementY:function(e){return`movementY`in e?e.movementY:Zn}}),er=Gn($n),tr=Gn(T({},$n,{dataTransfer:0})),nr=Gn(T({},Jn,{relatedTarget:0})),rr=Gn(T({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0})),ir=Gn(T({},Kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),ar=Gn(T({},Kn,{data:0})),or={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},sr={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`},cr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function lr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cr[e])?!!t[e]:!1}function ur(){return lr}var dr=Gn(T({},Jn,{key:function(e){if(e.key){var t=or[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?sr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ur,charCode:function(e){return e.type===`keypress`?Hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),fr=Gn(T({},$n,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),pr=Gn(T({},Kn,{submitter:0})),mr=Gn(T({},Jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ur})),hr=Gn(T({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),gr=Gn(T({},$n,{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})),_r=Gn(T({},Kn,{newState:0,oldState:0,source:0})),vr=[9,13,27,32],yr=In&&`CompositionEvent`in window,br=null;In&&`documentMode`in document&&(br=document.documentMode);var xr=In&&`TextEvent`in window&&!br,Sr=In&&(!yr||br&&8<br&&11>=br),Cr=` `,wr=!1;function Tr(e,t){switch(e){case`keyup`:return vr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Dr=!1;function Or(e,t){switch(e){case`compositionend`:return Er(t);case`keypress`:return t.which===32?(wr=!0,Cr):null;case`textInput`:return e=t.data,e===Cr&&wr?null:e;default:return null}}function kr(e,t){if(Dr)return e===`compositionend`||!yr&&Tr(e,t)?(e=Vn(),Bn=zn=k=null,Dr=!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 Sr&&t.locale!==`ko`?null:t.data;default:return null}}var Ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Ar[e.type]:t===`textarea`}function Mr(e,t,n,r){An?jn?jn.push(r):jn=[r]:An=r,t=dp(t,`onChange`),0<t.length&&(n=new qn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Nr=null,Pr=null;function Fr(e){rp(e,0)}function Ir(e){if(un(Ht(e)))return e}function Lr(e,t){if(e===`change`)return t}var Rr=!1;if(In){var zr;if(In){var Br=`oninput`in document;if(!Br){var Vr=document.createElement(`div`);Vr.setAttribute(`oninput`,`return;`),Br=typeof Vr.oninput==`function`}zr=Br}else zr=!1;Rr=zr&&(!document.documentMode||9<document.documentMode)}function Hr(){Nr&&(Nr.detachEvent(`onpropertychange`,Ur),Pr=Nr=null)}function Ur(e){if(e.propertyName===`value`&&Ir(Pr)){var t=[];Mr(t,Pr,e,kn(e)),Pn(Fr,t)}}function Wr(e,t,n){e===`focusin`?(Hr(),Nr=t,Pr=n,Nr.attachEvent(`onpropertychange`,Ur)):e===`focusout`&&Hr()}function Gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ir(Pr)}function Kr(e,t){if(e===`click`)return Ir(t)}function qr(e,t){if(e===`input`||e===`change`)return Ir(t)}function Jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Yr=typeof Object.is==`function`?Object.is:Jr;function Xr(e,t){if(Yr(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(!Ue.call(t,i)||!Yr(e[i],t[i]))return!1}return!0}function Zr(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 Qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $r(e,t){var n=Qr(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=Qr(n)}}function ei(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ei(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ti(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zr(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=Zr(e.document)}return t}function ni(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 ri=In&&`documentMode`in document&&11>=document.documentMode,ii=null,ai=null,oi=null,si=!1;function ci(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;si||ii==null||ii!==Zr(r)||(r=ii,`selectionStart`in r&&ni(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}),oi&&Xr(oi,r)||(oi=r,r=dp(ai,`onSelect`),0<r.length&&(t=new qn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ii)))}function li(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ui={animationend:li(`Animation`,`AnimationEnd`),animationiteration:li(`Animation`,`AnimationIteration`),animationstart:li(`Animation`,`AnimationStart`),transitionrun:li(`Transition`,`TransitionRun`),transitionstart:li(`Transition`,`TransitionStart`),transitioncancel:li(`Transition`,`TransitionCancel`),transitionend:li(`Transition`,`TransitionEnd`)},di={},fi={};In&&(fi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ui.animationend.animation,delete ui.animationiteration.animation,delete ui.animationstart.animation),`TransitionEvent`in window||delete ui.transitionend.transition);function pi(e){if(di[e])return di[e];if(!ui[e])return e;var t=ui[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fi)return di[e]=t[n];return e}var mi=pi(`animationend`),gi=pi(`animationiteration`),vi=pi(`animationstart`),yi=pi(`transitionrun`),bi=pi(`transitionstart`),xi=pi(`transitioncancel`),Si=pi(`transitionend`),Ci=new Map,wi=`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(` `);wi.push(`scrollEnd`);function Ti(e,t){Ci.set(e,t),Jt(t,[e])}var Ei=0;function Di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Fd.identifierPrefix;var n=Ei++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Oi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ud;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 ki(e,t){return e=Oi(e),t=Oi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ai=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)},ji=[],Mi=0,Ni=0;function Pi(){for(var e=Mi,t=Ni=Mi=0;t<e;){var n=ji[t];ji[t++]=null;var r=ji[t];ji[t++]=null;var i=ji[t];ji[t++]=null;var a=ji[t];if(ji[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&&Ri(n,i,a)}}function Fi(e,t,n,r){ji[Mi++]=e,ji[Mi++]=t,ji[Mi++]=n,ji[Mi++]=r,Ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ii(e,t,n,r){return Fi(e,t,n,r),zi(e)}function Li(e,t){return Fi(e,null,null,t),zi(e)}function Ri(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-ot(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function zi(e){if(50<Wd)throw Wd=0,Gd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bi={};function Vi(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 Hi(e,t,n,r){return new Vi(e,t,n,r)}function Ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wi(e,t){var n=e.alternate;return n===null?(n=Hi(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 Gi(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 Ki(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ui(r)&&(s=1);else if(typeof r==`string`)s=dh(e,n,Oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=Hi(31,n,t,a),e.elementType=de,e.lanes=o,e;case ne:return qi(n.children,a,o,t);case D:s=8,a|=24;break;case re:return e=Hi(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case se:return e=Hi(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=Hi(19,n,t,a),e.elementType=ce,e.lanes=o,e;case fe:case me:return e=a|32,e=Hi(30,n,t,e),e.elementType=me,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ae:s=10;break a;case ie:s=9;break a;case oe:s=11;break a;case le:s=14;break a;case ue:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Hi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function qi(e,t,n,r){return e=Hi(7,e,r,t),e.lanes=n,e}function Ji(e,t,n){return e=Hi(6,e,null,t),e.lanes=n,e}function Yi(e){var t=Hi(18,null,null,0);return t.stateNode=e,t}function Xi(e,t,n){return t=Hi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zi=new WeakMap;function Qi(e,t){if(typeof e==`object`&&e){var n=Zi.get(e);return n===void 0?(t={value:e,source:t,stack:He(t)},Zi.set(e,t),t):n}return{value:e,source:t,stack:He(t)}}var $i=[],ea=0,ta=null,na=0,ra=[],ia=0,aa=null,oa=1,sa=``;function ca(e,t){$i[ea++]=na,$i[ea++]=ta,ta=e,na=t}function la(e,t,n){ra[ia++]=oa,ra[ia++]=sa,ra[ia++]=aa,aa=e;var r=oa;e=sa;var i=32-ot(r)-1;r&=~(1<<i),n+=1;var a=32-ot(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,oa=1<<32-ot(t)+i|n<<i|r,sa=a+e}else oa=1<<a|n<<i|r,sa=e}function ua(e){e.return!==null&&(ca(e,1),la(e,1,0))}function da(e){for(;e===ta;)ta=$i[--ea],$i[ea]=null,na=$i[--ea],$i[ea]=null;for(;e===aa;)aa=ra[--ia],ra[ia]=null,sa=ra[--ia],ra[ia]=null,oa=ra[--ia],ra[ia]=null}function fa(e,t){ra[ia++]=oa,ra[ia++]=sa,ra[ia++]=aa,oa=t.id,sa=t.overflow,aa=e}var pa=null,ma=null,ha=!1,ga=null,_a=!1,va=Error(i(519));function ya(e){throw Ta(Qi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),va}function ba(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[At]=e,t[jt]=r,n){case`dialog`:ip(`cancel`,t),ip(`close`,t);break;case`iframe`:case`object`:case`embed`:ip(`load`,t);break;case`video`:case`audio`:for(n=0;n<tp.length;n++)ip(tp[n],t);break;case`source`:ip(`error`,t);break;case`img`:case`image`:case`link`:ip(`error`,t),ip(`load`,t);break;case`details`:ip(`toggle`,t);break;case`input`:ip(`invalid`,t),mn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:ip(`invalid`,t);break;case`textarea`:ip(`invalid`,t),vn(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||_p(t.textContent,n)?(r.popover!=null&&(ip(`beforetoggle`,t),ip(`toggle`,t)),r.onScroll!=null&&ip(`scroll`,t),r.onScrollEnd!=null&&ip(`scrollend`,t),r.onClick!=null&&(t.onclick=Dn),t=!0):t=!1,t||ya(e,!0)}function xa(e){for(pa=e.return;pa;)switch(pa.tag){case 5:case 31:case 13:_a=!1;return;case 27:case 3:_a=!0;return;default:pa=pa.return}}function Sa(e){if(e!==pa)return!1;if(!ha)return xa(e),ha=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||jp(e.type,e.memoizedProps)),n=!n),n&&ma&&ya(e),xa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ma=km(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ma=km(e)}else t===27?(t=ma,Bp(e.type)?(e=Om,Om=null,ma=e):ma=t):ma=pa?Dm(e.stateNode.nextSibling):null;return!0}function Ca(){ma=pa=null,ha=!1}function wa(){var e=ga;return e!==null&&(Dd===null?Dd=e:Dd.push.apply(Dd,e),ga=null),e}function Ta(e){ga===null?ga=[e]:ga.push(e)}var Ea=Te(null),Da=null,Oa=null;function ka(e,t,n){De(Ea,t._currentValue),t._currentValue=n}function Aa(e){e._currentValue=Ea.current,Ee(Ea)}function ja(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 Ma(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),ja(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),ja(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),ja(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 A(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;Yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===je.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Th]:e.push(Th))}a=a.return}return e!==null&&Ma(t,e,n,r),t.flags|=262144,e!==null}function Na(e){for(e=e.firstContext;e!==null;){if(!Yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Pa(e){Da=e,Oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Fa(e){return La(Da,e)}function Ia(e,t){return Da===null&&Pa(e),La(e,t)}function La(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Oa===null){if(e===null)throw Error(i(308));Oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Oa=Oa.next=t;return n}var Ra=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()})}},za=t.unstable_scheduleCallback,Ba=t.unstable_NormalPriority,Va={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ha(){return{controller:new Ra,data:new Map,refCount:0}}function Ua(e){e.refCount--,e.refCount===0&&za(Ba,function(){e.controller.abort()})}function Wa(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 Ga=null;function Ka(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var qa=null,Ja=0,Ya=0,j=null;function Xa(e,t){if(qa===null){var n=qa=[];Ja=0,Ya=Xf(),j={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ja++,t.then(Za,Za),t}function Za(){if(--Ja===0&&(Ga=null,qa!==null)){j!==null&&(j.status=`fulfilled`);var e=qa;qa=null,Ya=0,j=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var $a=O.S;O.S=function(e,t){if(Ad=Je(),typeof t==`object`&&t&&typeof t.then==`function`&&Xa(e,t),Ga!==null)for(var n=If;n!==null;)Wa(n,Ga),n=n.next;if(n=e.types,n!==null){for(var r=If;r!==null;)Wa(r,n),r=r.next;if(Ya!==0){r=Ga,r===null&&(r=Ga=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}$a!==null&&$a(e,t)};var eo=Te(null);function to(){var e=eo.current;return e===null?dd.pooledCache:e}function no(e,t){t===null?De(eo,eo.current):De(eo,t.pool)}function ro(){var e=to();return e===null?null:{parent:Va._currentValue,pool:e}}var io=Error(i(460)),ao=Error(i(474)),oo=Error(i(542)),so={then:function(){}};function co(e){return e=e.status,e===`fulfilled`||e===`rejected`}function lo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Dn,Dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,mo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(Dn,Dn);else{if(e=dd,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,mo(e),e}throw fo=t,io}}function uo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(fo=e,io):e}}var fo=null;function po(){if(fo===null)throw Error(i(459));var e=fo;return fo=null,e}function mo(e){if(e===io||e===oo)throw Error(i(483))}var ho=null,go=0;function _o(e){var t=go;return go+=1,ho===null&&(ho=[]),lo(ho,e,t)}function vo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function yo(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 bo(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=Wi(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=Ji(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),vo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ue&&uo(i)===t.type)?(t=a(t,n.props),vo(t,n),t.return=e,t):(t=Ki(n.type,n.key,n.props,null,e.mode,r),vo(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=Xi(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=qi(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=Ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ee:return n=Ki(t.type,t.key,t.props,null,e.mode,n),vo(n,t),n.return=e,n;case te:return t=Xi(t,e.mode,n),t.return=e,t;case ue:return t=uo(t),f(e,t,n)}if(be(t)||_e(t))return t=qi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,_o(t),n);if(t.$$typeof===ae)return f(e,Ia(e,t),n);yo(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 ue:return n=uo(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,_o(n),r);if(n.$$typeof===ae)return p(e,t,Ia(e,n),r);yo(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 ue:return r=uo(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,_o(r),i);if(r.$$typeof===ae)return m(e,t,n,Ia(t,r),i);yo(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),ha&&ca(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 ha&&ca(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)}),ha&&ca(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),ha&&ca(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 ha&&ca(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)}),ha&&ca(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),vo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&uo(l)===r.type){n(e,r.sibling),c=a(r,o.props),vo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ne?(c=qi(o.props.children,e.mode,c,o.key),vo(c,o),c.return=e,e=c):(c=Ki(o.type,o.key,o.props,null,e.mode,c),vo(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=Xi(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=uo(o),_(e,r,o,c)}if(be(o))return h(e,r,o,c);if(_e(o)){if(l=_e(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,_o(o),c);if(o.$$typeof===ae)return _(e,r,Ia(e,o),c);yo(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=Ji(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{go=0;var i=_(e,t,n,r);return ho=null,i}catch(t){if(t===io||t===oo)throw t;var a=Hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var xo=bo(!0),So=bo(!1),Co=!1;function wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function To(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 Eo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Do(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ud&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=zi(e),Ri(e,null,n),t}return Fi(e,r,t,n),zi(e)}function Oo(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,Ct(e,n)}}function ko(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 Ao=!1;function jo(){if(Ao){var e=j;if(e!==null)throw e}}function Mo(e,t,n,r){Ao=!1;var i=e.updateQueue;Co=!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?(pd&f)===f:(r&f)===f){f!==0&&f===Ya&&(Ao=!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:Co=!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),xd|=o,e.lanes=o,e.memoizedState=d}}function No(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Po(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)No(n[e],t)}var Fo=Te(null),Io=Te(0);function Lo(e,t){e=yd,De(Io,e),De(Fo,t),yd=e|t.baseLanes}function Ro(){De(Io,yd),De(Fo,Fo.current)}function zo(){yd=Io.current,Ee(Fo),Ee(Io)}var Bo=Te(null),Vo=null;function Ho(e){var t=e.alternate;De(qo,qo.current&1),De(Bo,e),Vo===null&&(t===null||Fo.current!==null||t.memoizedState!==null)&&(Vo=e)}function Uo(e){De(qo,qo.current),De(Bo,e),Vo===null&&(Vo=e)}function Wo(e){e.tag===22?(De(qo,qo.current),De(Bo,e),Vo===null&&(Vo=e)):Go()}function Go(){De(qo,qo.current),De(Bo,Bo.current)}function Ko(e){Ee(Bo),Vo===e&&(Vo=null),Ee(qo)}var qo=Te(0);function Jo(e,t){De(Bo,Bo.current),De(qo,t)}function Yo(e){Ee(qo),Ee(Bo),Vo===e&&(Vo=null)}function Xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||wm(n)||Tm(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 Zo=0,Qo=null,$o=null,es=null,ts=!1,ns=!1,rs=!1,is=0,as=0,os=null,ss=0;function cs(){throw Error(i(321))}function ls(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function M(e,t,n,r,i,a){return Zo=a,Qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Tc:Ec,rs=!1,a=n(r,i),rs=!1,ns&&(a=ds(t,n,r,i)),us(e),a}function us(e){O.H=wc;var t=$o!==null&&$o.next!==null;if(Zo=0,es=$o=Qo=null,ts=!1,as=0,os=null,t)throw Error(i(300));e===null||Vc||(e=e.dependencies,e!==null&&Na(e)&&(Vc=!0))}function ds(e,t,n,r){Qo=e;var a=0;do{if(ns&&(os=null),as=0,ns=!1,25<=a)throw Error(i(301));if(a+=1,es=$o=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=P,o=t(n,r)}while(ns);return o}function fs(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?vs(t):t,e=e.useState()[0],($o===null?null:$o.memoizedState)!==e&&(Qo.flags|=1024),t}function ps(){var e=is!==0;return is=0,e}function N(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ms(e){if(ts){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ts=!1}Zo=0,es=$o=Qo=null,ns=!1,as=is=0,os=null}function hs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return es===null?Qo.memoizedState=es=e:es=es.next=e,es}function gs(){if($o===null){var e=Qo.alternate;e=e===null?null:e.memoizedState}else e=$o.next;var t=es===null?Qo.memoizedState:es.next;if(t!==null)es=t,$o=e;else{if(e===null)throw Qo.alternate===null?Error(i(467)):Error(i(310));$o=e,e={memoizedState:$o.memoizedState,baseState:$o.baseState,baseQueue:$o.baseQueue,queue:$o.queue,next:null},es===null?Qo.memoizedState=es=e:es=es.next=e}return es}function _s(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vs(e){var t=as;return as+=1,os===null&&(os=[]),e=lo(os,e,t),t=Qo,(es===null?t.memoizedState:es.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Tc:Ec),e}function ys(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return vs(e);if(e.$$typeof===he)return;if(e.$$typeof===ae)return Fa(e)}throw Error(i(438,String(e)))}function bs(e){var t=null,n=Qo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Qo.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(),Qo.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]=pe;return t.index++,n}function xs(e,t){return typeof t==`function`?t(e):t}function Ss(e){return Cs(gs(),$o,e)}function Cs(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?(Zo&f)===f:(pd&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===Ya&&(d=!0);else if((Zo&p)===p){u=u.next,p===Ya&&(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,Qo.lanes|=p,xd|=p;f=u.action,rs&&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,Qo.lanes|=f,xd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Yr(o,e.memoizedState)&&(Vc=!0,d&&(n=j,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 ws(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);Yr(o,t.memoizedState)||(Vc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ts(e,t,n){var r=Qo,a=gs(),o=ha;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Yr(($o||a).memoizedState,n);if(s&&(a.memoizedState=n,Vc=!0),a=a.queue,Xs(Os.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||es!==null&&!!(es.memoizedState.tag&1),Gs(e?9:8,{destroy:void 0},Ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,dd===null)throw Error(i(349));o||Zo&127||Es(r,t,n)}return n}function Es(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qo.updateQueue,t===null?(t=_s(),Qo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ds(e,t,n,r){t.value=n,t.getSnapshot=r,ks(t)&&As(e)}function Os(e,t,n){return n(function(){ks(t)&&As(e)})}function ks(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch{return!0}}function As(e){var t=Li(e,2);t!==null&&Yd(t,e,2)}function js(e){var t=hs();if(typeof e==`function`){var n=e;if(e=n(),rs){at(!0);try{n()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:e},t}function Ms(e,t,n,r){return e.baseState=n,Cs(e,$o,typeof r==`function`?r:xs)}function Ns(e,t,n,r,a){if(xc(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)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ps(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ps(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};o.types=a===null?null:a.types,O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),Fs(e,t,s)}catch(n){Ls(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),Fs(e,t,a)}catch(n){Ls(e,t,n)}}function Fs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Is(e,t,n)},function(n){return Ls(e,t,n)}):Is(e,t,n)}function Is(e,t,n){t.status=`fulfilled`,t.value=n,Rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ps(e,n)))}function Ls(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Rs(t),t=t.next;while(t!==r)}e.action=null}function Rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function zs(e,t){return t}function Bs(e,t){if(ha){var n=dd.formState;if(n!==null){a:{var r=Qo;if(ha){if(ma){b:{for(var i=ma,a=_a;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){ma=Dm(i.nextSibling),r=i.data===`F!`;break a}}ya(r)}r=!1}r&&(t=n[0])}}return n=hs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zs,lastRenderedState:t},n.queue=r,n=vc.bind(null,Qo,r),r.dispatch=n,r=js(!1),a=bc.bind(null,Qo,!1,r.queue),r=hs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ns.bind(null,Qo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Vs(e){return Hs(gs(),$o,e)}function Hs(e,t,n){if(t=Cs(e,t,zs)[0],e=Ss(xs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=vs(t)}catch(e){throw e===io?oo:e}else r=t;t=gs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Qo.flags|=2048,Gs(9,{destroy:void 0},Us.bind(null,i,n),null)),[r,a,e]}function Us(e,t){e.action=t}function Ws(e){var t=gs(),n=$o;if(n!==null)return Hs(t,n,e);gs(),t=t.memoizedState,n=gs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Gs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Qo.updateQueue,t===null&&(t=_s(),Qo.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 Ks(){return gs().memoizedState}function qs(e,t,n,r){var i=hs();Qo.flags|=e,i.memoizedState=Gs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Js(e,t,n,r){var i=gs();r=r===void 0?null:r;var a=i.memoizedState.inst;$o!==null&&r!==null&&ls(r,$o.memoizedState.deps)?i.memoizedState=Gs(t,a,n,r):(Qo.flags|=e,i.memoizedState=Gs(1|t,a,n,r))}function Ys(e,t){qs(8390656,8,e,t)}function Xs(e,t){Js(2048,8,e,t)}function Zs(e){Qo.flags|=4;var t=Qo.updateQueue;if(t===null)t=_s(),Qo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Qs(e){var t=gs().memoizedState;return Zs({ref:t,nextImpl:e}),function(){if(ud&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function $s(e,t){return Js(4,2,e,t)}function ec(e,t){return Js(4,4,e,t)}function tc(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 nc(e,t,n){n=n==null?null:n.concat([e]),Js(4,4,tc.bind(null,t,e),n)}function rc(){}function ic(e,t){var n=gs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ls(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ac(e,t){var n=gs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ls(t,r[1]))return r[0];if(r=e(),rs){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r}function oc(e,t,n){return n===void 0||Zo&1073741824&&!(pd&261930)?e.memoizedState=t:(e.memoizedState=n,e=qd(),Qo.lanes|=e,xd|=e,n)}function sc(e,t,n,r){return Yr(n,t)?n:Fo.current===null?!(Zo&106)||Zo&1073741824&&!(pd&261930)?(Vc=!0,e.memoizedState=n):(e=qd(),Qo.lanes|=e,xd|=e,t):(e=oc(e,n,r),Yr(e,t)||(Vc=!0),e)}function cc(e,t,n,r,i){var a=xe.p;xe.p=a!==0&&8>a?a:8;var o=O.T,s={};s.types=o===null?null:o.types,O.T=s,bc(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?yc(e,t,Qa(c,r),Kd(e)):yc(e,t,r,Kd(e))}catch(n){yc(e,t,{then:function(){},status:`rejected`,reason:n},Kd())}finally{xe.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function lc(){}function uc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=dc(e).queue;cc(e,a,t,Se,n===null?lc:function(){return fc(e),n(r)})}function dc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Se,baseState:Se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:Se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function fc(e){var t=dc(e);t.next===null&&(t=e.alternate.memoizedState),yc(e,t.next.queue,{},Kd())}function pc(){return Fa(Th)}function mc(){return gs().memoizedState}function hc(){return gs().memoizedState}function gc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Kd();e=Eo(n);var r=Do(t,e,n);r!==null&&(Yd(r,t,n),Oo(r,t,n)),t={cache:Ha()},e.payload=t;return}t=t.return}}function _c(e,t,n){var r=Kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},xc(e)?Sc(t,n):(n=Ii(e,t,n,r),n!==null&&(Yd(n,e,r),Cc(n,t,r)))}function vc(e,t,n){yc(e,t,n,Kd())}function yc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(xc(e))Sc(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,Yr(s,o))return Fi(e,t,i,0),dd===null&&Pi(),!1}catch{}if(n=Ii(e,t,i,r),n!==null)return Yd(n,e,r),Cc(n,t,r),!0}return!1}function bc(e,t,n,r){if(r={lane:2,revertLane:Xf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},xc(e)){if(t)throw Error(i(479))}else t=Ii(e,n,r,2),t!==null&&Yd(t,e,2)}function xc(e){var t=e.alternate;return e===Qo||t!==null&&t===Qo}function Sc(e,t){ns=ts=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}var wc={readContext:Fa,use:ys,useCallback:cs,useContext:cs,useEffect:cs,useImperativeHandle:cs,useLayoutEffect:cs,useInsertionEffect:cs,useMemo:cs,useReducer:cs,useRef:cs,useState:cs,useDebugValue:cs,useDeferredValue:cs,useTransition:cs,useSyncExternalStore:cs,useId:cs,useHostTransitionStatus:cs,useFormState:cs,useActionState:cs,useOptimistic:cs,useMemoCache:cs,useCacheRefresh:cs,useEffectEvent:cs},Tc={readContext:Fa,use:ys,useCallback:function(e,t){return hs().memoizedState=[e,t===void 0?null:t],e},useContext:Fa,useEffect:Ys,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),qs(4194308,4,tc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qs(4194308,4,e,t)},useInsertionEffect:function(e,t){qs(4,2,e,t)},useMemo:function(e,t){var n=hs();t=t===void 0?null:t;var r=e();if(rs){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=hs();if(n!==void 0){var i=n(t);if(rs){at(!0);try{n(t)}finally{at(!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=_c.bind(null,Qo,e),[r.memoizedState,e]},useRef:function(e){var t=hs();return e={current:e},t.memoizedState=e},useState:function(e){e=js(e);var t=e.queue,n=vc.bind(null,Qo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:rc,useDeferredValue:function(e,t){return oc(hs(),e,t)},useTransition:function(){var e=js(!1);return e=cc.bind(null,Qo,e.queue,!0,!1),hs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Qo,a=hs();if(ha){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),dd===null)throw Error(i(349));pd&127||Es(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ys(Os.bind(null,r,o,e),[e]),r.flags|=2048,Gs(9,{destroy:void 0},Ds.bind(null,r,o,n,t),null),n},useId:function(){var e=hs(),t=dd.identifierPrefix;if(ha){var n=sa,r=oa;n=(r&~(1<<32-ot(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=is++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ss++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:pc,useFormState:Bs,useActionState:Bs,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=bc.bind(null,Qo,!0,n),n.dispatch=t,[e,t]},useMemoCache:bs,useCacheRefresh:function(){return hs().memoizedState=gc.bind(null,Qo)},useEffectEvent:function(e){var t=hs(),n={impl:e};return t.memoizedState=n,function(){if(ud&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ec={readContext:Fa,use:ys,useCallback:ic,useContext:Fa,useEffect:Xs,useImperativeHandle:nc,useInsertionEffect:$s,useLayoutEffect:ec,useMemo:ac,useReducer:Ss,useRef:Ks,useState:function(){return Ss(xs)},useDebugValue:rc,useDeferredValue:function(e,t){return sc(gs(),$o.memoizedState,e,t)},useTransition:function(){var e=Ss(xs)[0],t=gs().memoizedState;return[typeof e==`boolean`?e:vs(e),t]},useSyncExternalStore:Ts,useId:mc,useHostTransitionStatus:pc,useFormState:Vs,useActionState:Vs,useOptimistic:function(e,t){return Ms(gs(),$o,e,t)},useMemoCache:bs,useCacheRefresh:hc,useEffectEvent:Qs},P={readContext:Fa,use:ys,useCallback:ic,useContext:Fa,useEffect:Xs,useImperativeHandle:nc,useInsertionEffect:$s,useLayoutEffect:ec,useMemo:ac,useReducer:ws,useRef:Ks,useState:function(){return ws(xs)},useDebugValue:rc,useDeferredValue:function(e,t){var n=gs();return $o===null?oc(n,e,t):sc(n,$o.memoizedState,e,t)},useTransition:function(){var e=ws(xs)[0],t=gs().memoizedState;return[typeof e==`boolean`?e:vs(e),t]},useSyncExternalStore:Ts,useId:mc,useHostTransitionStatus:pc,useFormState:Ws,useActionState:Ws,useOptimistic:function(e,t){var n=gs();return $o===null?(n.baseState=e,[e,n.queue.dispatch]):Ms(n,$o,e,t)},useMemoCache:bs,useCacheRefresh:hc,useEffectEvent:Qs};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=Kd(),i=Eo(r);i.payload=t,n!=null&&(i.callback=n),t=Do(e,i,r),t!==null&&(Yd(t,e,r),Oo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Kd(),i=Eo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Do(e,i,r),t!==null&&(Yd(t,e,r),Oo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kd(),r=Eo(n);r.tag=2,t!=null&&(r.callback=t),t=Do(e,r,n),t!==null&&(Yd(t,e,n),Oo(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?!Xr(n,r)||!Xr(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){Ai(e)}function Nc(e){console.error(e)}function Pc(e){Ai(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=Eo(n),n.tag=3,n.payload={element:null},n.callback=function(){Fc(e,t)},n}function Rc(e){return e=Eo(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`&&(Nd===null?Nd=new Set([this]):Nd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function F(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&A(t,n,a,!0),n=Bo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Vo===null?cf():n.alternate===null&&bd===0&&(bd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===so?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Af(e,r,a)),!1;case 22:return n.flags|=65536,r===so?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)),Af(e,r,a)),!1}throw Error(i(435,n.tag))}return Af(e,r,a),cf(),!1}if(ha)return t=Bo.current,t===null?(r!==va&&(t=Error(i(423),{cause:r}),Ta(Qi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Qi(r,n),a=Lc(e.stateNode,r,a),ko(e,a),bd!==4&&(bd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==va&&(e=Error(i(422),{cause:r}),Ta(Qi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Qi(o,n),Ed===null?Ed=[o]:Ed.push(o),bd!==4&&(bd=2),t===null)return!0;r=Qi(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),ko(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`&&(Nd===null||!Nd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Rc(a),zc(a,e,n,r),ko(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Bc=Error(i(461)),Vc=!1;function Hc(e,t,n,r){t.child=e===null?So(t,null,n,r):xo(t,e.child,n,r)}function Uc(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 Pa(t),r=M(e,t,n,o,a,i),s=ps(),e!==null&&!Vc?(N(e,t,i),_l(e,t,i)):(ha&&s&&ua(t),t.flags|=1,Hc(e,t,r,i),t.child)}function Wc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Gc(e,t,a,r,i)):(e=Ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!vl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Xr:n,n(o,r)&&e.ref===t.ref)return _l(e,t,i)}return t.flags|=1,e=Wi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Gc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Xr(a,r)&&e.ref===t.ref){if(Vc=!1,t.pendingProps=r=a,vl(e,i))e.flags&131072&&(Vc=!0);else return t.lanes=e.lanes,_l(e,t,i)}}return $c(e,t,n,r,i)}function Kc(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 Jc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&no(t,a===null?null:a.cachePool),a===null?Ro():Lo(t,a),Wo(t);else return r=t.lanes=536870912,Jc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&no(t,null),Ro(),Go()):(no(t,a.cachePool),Lo(t,a),Go(),t.memoizedState=null);return Hc(e,t,i,n),t.child}function qc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jc(e,t,n,r,i){var a=to();return a=a===null?null:{parent:Va._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&no(t,null),Ro(),Wo(t),e!==null&&A(e,t,r,!0),t.childLanes=i,null}function Yc(e,t){return t=cl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xc(e,t,n){return xo(t,e.child,null,n),e=Yc(t,t.pendingProps),e.flags|=2,Ko(t),t.memoizedState=null,e}function Zc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ha){if(r.mode===`hidden`)return e=Yc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},qc(null,e);if(Uo(t),(e=ma)?(e=Cm(e,_a),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:aa===null?null:{id:oa,overflow:sa},retryLane:536870912,hydrationErrors:null},n=Yi(e),n.return=t,t.child=n,pa=t,ma=null)):e=null,e===null)throw ya(t);return t.lanes=536870912,null}return Yc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Uo(t),a){if(t.flags&256)t.flags&=-257,t=Xc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Vc||A(e,t,n,!1),a=(n&e.childLanes)!==0,Vc||a){if(Fo.current===null){if(r=dd,r!==null&&(s=wt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Li(e,s),Yd(r,e,s),Bc;cf()}t=Xc(e,t,n)}else e=o.treeContext,ma=Dm(s.nextSibling),pa=t,ha=!0,ga=null,_a=!1,e!==null&&fa(t,e),t=Yc(t,r),t.flags|=134221824;return t}return e=Wi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qc(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 $c(e,t,n,r,i){return Pa(t),n=M(e,t,n,r,void 0,i),r=ps(),e!==null&&!Vc?(N(e,t,i),_l(e,t,i)):(ha&&r&&ua(t),t.flags|=1,Hc(e,t,n,i),t.child)}function el(e,t,n,r,i,a){return Pa(t),t.updateQueue=null,n=ds(t,r,n,i),us(e),r=ps(),e!==null&&!Vc?(N(e,t,a),_l(e,t,a)):(ha&&r&&ua(t),t.flags|=1,Hc(e,t,n,a),t.child)}function tl(e,t,n,r,i){if(Pa(t),t.stateNode===null){var a=Bi,o=n.contextType;typeof o==`object`&&o&&(a=Fa(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={},wo(t),o=n.contextType,a.context=typeof o==`object`&&o?Fa(o):Bi,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),Mo(t,r,a,i),jo(),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=Bi,typeof u==`object`&&u&&(o=Fa(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),Co=!1;var f=t.memoizedState;a.state=f,Mo(t,r,a,i),jo(),l=t.memoizedState,s||f!==l||Co?(typeof d==`function`&&(Dc(t,n,d,r),l=t.memoizedState),(c=Co||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,To(e,t),o=t.memoizedProps,u=jc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Bi,typeof l==`object`&&l&&(c=Fa(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),Co=!1,f=t.memoizedState,a.state=f,Mo(t,r,a,i),jo();var p=t.memoizedState;o!==d||f!==p||Co||e!==null&&e.dependencies!==null&&Na(e.dependencies)?(typeof s==`function`&&(Dc(t,n,s,r),p=t.memoizedState),(u=Co||kc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Na(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,Qc(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=xo(t,e.child,null,i),t.child=xo(t,null,n,i)):Hc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=_l(e,t,i),e}function nl(e,t,n,r){return Ca(),t.flags|=256,Hc(e,t,n,r),t.child}var rl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function il(e){return{baseLanes:e,cachePool:ro()}}function al(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=wd),e}function ol(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(qo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ha){if(i?Ho(t):Go(),(e=ma)?(e=Cm(e,_a),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:aa===null?null:{id:oa,overflow:sa},retryLane:536870912,hydrationErrors:null},n=Yi(e),n.return=t,t.child=n,pa=t,ma=null)):e=null,e===null)throw ya(t);return t.lanes=Tm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Go(),i=t.mode,a=cl({mode:`hidden`,children:a},i),r=qi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=il(n),r.childLanes=al(e,o,n),t.memoizedState=rl,qc(null,r)):(Ho(t),sl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return ul(e,t,a,o,r,c,s,n)}return i?(Go(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Wi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=qi(i,a,n,null),i.flags|=2):i=Wi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,qc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=il(n):(a=i.cachePool,a===null?a=ro():(s=Va._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=al(e,o,n),t.memoizedState=rl,qc(e.child,r)):(Ho(t),n=e.child,e=n.sibling,n=Wi(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 sl(e,t){return t=cl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function cl(e,t){return e=Hi(22,e,null,t),e.lanes=0,e}function ll(e,t,n){return xo(t,e.child,null,n),e=sl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ul(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ho(t),t.flags&=-257,ll(e,t,c)):t.memoizedState===null?(Go(),o=a.fallback,s=t.mode,a=cl({mode:`visible`,children:a.children},s),o=qi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,xo(t,e.child,null,c),a=t.child,a.memoizedState=il(c),a.childLanes=al(e,r,c),t.memoizedState=rl,qc(null,a)):(Go(),t.child=e.child,t.flags|=128,null);if(Ho(t),Tm(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,Ta({value:a,source:null,stack:null})),ll(e,t,c)}if(Vc||A(e,t,c,!1),r=(c&e.childLanes)!==0,Vc||r){if(Fo.current!==null)return ll(e,t,c);if(r=dd,r!==null&&(a=wt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Li(e,a),Yd(r,e,a),Bc;return wm(o)||cf(),ll(e,t,c)}return wm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ma=Dm(o.nextSibling),pa=t,ha=!0,ga=null,_a=!1,e!==null&&fa(t,e),t=sl(t,a.children),t.flags|=134221824,t)}function dl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ja(e.return,t,n)}function fl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Xo(n)===null&&(t=e),e=e.sibling}return t}function pl(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 ml(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 hl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=qo.current;if(t.flags&128)return Jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Jo(t,o),i===`backwards`&&e!==null?(ml(e),Hc(e,t,r,n),ml(e)):Hc(e,t,r,n),r=ha?na:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dl(e,n,t);else if(e.tag===19)dl(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=fl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ml(t)),pl(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&&Xo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pl(t,!0,n,null,a,r);break;case`together`:pl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=fl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pl(t,!1,i,n,a,r)}return t.child}function gl(e,t,n){var r=t.pendingProps;return ka(t,t.type,r.value),Hc(e,t,r.children,n),t.child}function _l(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(A(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=Wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Na(e)))}function yl(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),ka(t,Va,e.memoizedState.cache),Ca();break;case 27:case 5:Pe(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:ka(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Uo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ho(t),t.flags|=128,null;r=A(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?ol(e,t,n):(Ho(t),e=_l(e,t,n),e===null?null:e.sibling)}Ho(t);break;case 19:if(t.flags&128)return hl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(A(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return hl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Jo(t,qo.current),r)break;return null;case 22:return t.lanes=0,Kc(e,t,n,t.pendingProps);case 24:ka(t,Va,e.memoizedState.cache)}return _l(e,t,n)}function bl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Vc=!0;else{if(!vl(e,n)&&!(t.flags&128))return Vc=!1,yl(e,t,n);Vc=!!(e.flags&131072)}}else Vc=!1,ha&&t.flags&1048576&&la(t,na,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=uo(t.elementType),t.type=e,typeof e==`function`)Ui(e)?(r=jc(e,r),t.tag=1,t=tl(null,t,e,r,n)):(t.tag=0,t=$c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===oe){t.tag=11,t=Uc(null,t,e,r,n);break a}if(a===le){t.tag=14,t=Wc(null,t,e,r,n);break a}if(a===ae){t.tag=10,t.type=e,t=gl(null,t,n);break a}}throw t=ye(e)||e,Error(i(306,t,``))}}return t;case 0:return $c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=jc(r,t.pendingProps),tl(e,t,r,a,n);case 3:a:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,To(e,t),Mo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ka(t,Va,r),r!==o.cache&&Ma(t,[Va],n,!0),jo(),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=nl(e,t,r,n);break a}if(r!==a){a=Qi(Error(i(424)),t),Ta(a),t=nl(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(ma=Dm(e.firstChild),pa=t,ha=!0,ga=null,_a=!0,n=So(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Ca(),r===a){t=_l(e,t,n);break a}Hc(e,t,r,n)}t=t.child}return t;case 26:return Qc(e,t),e===null?(n=Zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ha||(t.stateNode=Ap(t.type,t.pendingProps,Ae.current,t)):t.memoizedState=Zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Pe(t),e===null&&ha&&(r=t.stateNode=Nm(t.type,t.pendingProps,Ae.current),pa=t,_a=!0,a=ma,Bp(t.type)?(Om=a,ma=Dm(r.firstChild)):ma=a),Hc(e,t,t.pendingProps.children,n),Qc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ha&&((a=r=ma)&&(r=xm(r,t.type,t.pendingProps,_a),r===null?a=!1:(t.stateNode=r,pa=t,ma=Dm(r.firstChild),_a=!1,a=!0)),a||ya(t)),Pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,jp(a,o)?r=null:s!==null&&jp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=M(e,t,fs,null,null,n),Th._currentValue=a),Qc(e,t),Hc(e,t,r,n),t.child;case 6:return e===null&&ha&&((e=n=ma)&&(n=Sm(n,t.pendingProps,_a),n===null?e=!1:(t.stateNode=n,pa=t,ma=null,e=!0)),e||ya(t)),null;case 13:return ol(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xo(t,null,r,n):Hc(e,t,r,n),t.child;case 11:return Uc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Qc(e,t),Hc(e,t,r,n),t.child;case 8:return Hc(e,t,t.pendingProps.children,n),t.child;case 12:return Hc(e,t,t.pendingProps.children,n),t.child;case 10:return gl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Pa(t),a=Fa(a),r=r(a),t.flags|=1,Hc(e,t,r,n),t.child;case 14:return Wc(e,t,t.type,t.pendingProps,n);case 15:return Gc(e,t,t.type,t.pendingProps,n);case 19:return hl(e,t,n);case 31:return Zc(e,t,n);case 22:return Kc(e,t,n,t.pendingProps);case 24:return Pa(t),r=Fa(Va),e===null?(a=to(),a===null&&(a=dd,o=Ha(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},wo(t),ka(t,Va,a)):((e.lanes&n)!==0&&(To(e,t),Mo(t,null,null,n),jo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ka(t,Va,r),r!==a.cache&&Ma(t,[Va],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ka(t,Va,r))),Hc(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:ha&&ua(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Qc(e,t),Hc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function xl(e){e.flags|=4}function Sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?fh(t,r):fh(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(af())e.flags|=8192;else throw fo=so,ao}}else e.flags&=-16777217}function Cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ph(t)){if(af())e.flags|=8192;else throw fo=so,ao}}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:vt(),e.lanes|=t,Td|=t)}function Tl(e,t){if(!ha)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 El(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 Dl(e,t,n){var r=t.pendingProps;switch(da(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return El(t),null;case 1:return El(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Aa(Va),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Sa(t)?xl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wa())),El(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(xl(t),o===null?(El(t),Sl(t,a,null,r,n)):(El(t),Cl(t,o))):o?o===e.memoizedState?(El(t),t.flags&=-16777217):(xl(t),El(t),Cl(t,o)):(e=e.memoizedProps,e!==r&&xl(t),El(t),Sl(t,a,e,r,n)),null;case 27:if(Fe(t),n=Ae.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return El(t),t.subtreeFlags&=-33554433,null}e=Oe.current,Sa(t)?ba(t,e):(e=Nm(a,r,n),t.stateNode=e,xl(t))}return El(t),t.subtreeFlags&=-33554433,null;case 5:if(Fe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return El(t),t.subtreeFlags&=-33554433,null}if(o=Oe.current,Sa(t))ba(t,o);else{var s=Dp(Ae.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[At]=t,o[jt]=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(bp(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&&xl(t)}}return El(t),t.subtreeFlags&=-33554433,Sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ae.current,Sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=pa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[At]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||_p(e.nodeValue,n)),e||ya(t,!0)}else e=Dp(e).createTextNode(r),e[At]=t,t.stateNode=e}return El(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Sa(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[At]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;El(t),e=!1}else n=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ko(t),t):(Ko(t),null);if(t.flags&128)throw Error(i(558))}return El(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Sa(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[At]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;El(t),a=!1}else a=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ko(t),t):(Ko(t),null)}return Ko(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),wl(t,t.updateQueue),El(t),null);case 4:return Ne(),e===null&&sp(t.stateNode.containerInfo),t.flags|=67108864,El(t),null;case 10:return Aa(t.type),El(t),null;case 19:if(Yo(t),r=t.memoizedState,r===null)return El(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Tl(r,!1);else{if(bd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Xo(e),o!==null){for(t.flags|=128,Tl(r,!1),e=o.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Gi(n,e),n=n.sibling;return Jo(t,qo.current&1|2),ha&&ca(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Je()>jd&&(t.flags|=128,a=!0,Tl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Xo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),Tl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ha)return El(t),null}else 2*Je()-r.renderingStartTime>jd&&n!==536870912&&(t.flags|=128,a=!0,Tl(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=Je(),e.sibling=null,o=qo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ha?Jo(t,o):(n=o,De(Bo,t),De(qo,n),Vo===null&&(Vo=t)),ha&&ca(t,r.treeForkCount),e}return El(t),null;case 22:case 23:return Ko(t),zo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(El(t),t.subtreeFlags&6&&(t.flags|=8192)):El(t),n=t.updateQueue,n!==null&&wl(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&&Ee(eo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Aa(Va),El(t),null;case 25:return null;case 30:return t.flags|=33554432,El(t),null}throw Error(i(156,t.tag))}function Ol(e,t){switch(da(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(Va),Ne(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fe(t),null;case 31:if(t.memoizedState!==null){if(Ko(t),t.alternate===null)throw Error(i(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yo(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 Ne(),null;case 10:return Aa(t.type),null;case 22:case 23:return Ko(t),zo(),e!==null&&Ee(eo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Aa(Va),null;case 25:return null;default:return null}}function kl(e,t){switch(da(t),t.tag){case 3:Aa(Va),Ne();break;case 26:case 27:case 5:Fe(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&Ko(t);break;case 13:Ko(t);break;case 19:Yo(t);break;case 10:Aa(t.type);break;case 22:case 23:Ko(t),zo(),e!==null&&Ee(eo);break;case 24:Aa(Va)}}function Al(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){kf(t,t.return,e)}}function jl(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){kf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){kf(t,t.return,e)}}function Ml(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Po(t,n)}catch(t){kf(e,e.return,t)}}}function Nl(e,t,n){n.props=jc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){kf(e,t,n)}}function Pl(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=Di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Qp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new $p(e);p(e.child,!1,gm,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){kf(e,t,n)}}function Fl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){kf(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){kf(e,t,n)}else n.current=null}}function Il(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++)vm(e.stateNode,t[n])}function Ll(e){for(var t=e.return;t!==null&&(Bl(t)&&vm(e.stateNode,t.stateNode),!zl(t));)t=t.return}function Rl(e){for(var t=e.return;t!==null&&(Bl(t)&&ym(e.stateNode,t.stateNode),!zl(t));)t=t.return}function zl(e){return e.tag===5||e.tag===3||e.tag===27}function Bl(e){return e&&e.tag===7&&e.stateNode!==null}function Vl(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){kf(e,e.return,t)}}function Hl(e,t,n){try{var r=e.stateNode;Sp(r,e.type,n,t),r[jt]=t}catch(t){kf(e,e.return,t)}}function Ul(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bp(e.type)||e.tag===4}function Wl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ul(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&&Bp(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 Gl(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=Dn)),Il(e,r),en=!0;else if(i!==4&&(i===27&&(Il(e,r),r=null,Bp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Gl(e,t,n,r),e=e.sibling;e!==null;)Gl(e,t,n,r),e=e.sibling}function Kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Il(e,r),en=!0;else if(i!==4&&(i===27&&(Il(e,r),r=null,Bp(e.type)&&(n=e.stateNode)),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);bp(t,r,n),t[At]=e,t[jt]=n}catch(t){kf(e,e.return,t)}}var Jl=!1,Yl=null;function Xl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Jl=!0)}var Zl=null;function Ql(){var e=Zl;return Zl=null,e}var $l=0;function eu(e,t,n,r,i){return $l=0,tu(e.child,t,n,r,i)}function tu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Kp(o);r.push(s),s.view&&(a=!0)}else a||Kp(o).view&&(a=!0);Jl=!0,Up(o,$l===0?t:t+`_`+$l,n),$l++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||tu(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function nu(e,t){for(;e!==null;)e.tag===5?Wp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||nu(e.child,t)),e=e.sibling}function ru(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ru(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=ki(t.default,t.share),t!==`none`&&(eu(e,n,t,null,!1)||nu(e.child,!1))}e=e.sibling}}function iu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Di(r,n),a=ki(r.default,n.paired?r.share:r.enter);a===`none`?ru(e):eu(e,i,a,null,!1)?(ru(e),n.paired||t||Jd(e,r.onEnter)):nu(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)iu(e,t),e=e.sibling;else ru(e)}function au(e){if(Yl!==null&&Yl.size!==0){var t=Yl;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=ki(n.default,n.share);if(a!==`none`&&(eu(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Jd(e,n.onShare)):nu(e.child,!1)),t.delete(r),t.size===0)break}}}au(e)}e=e.sibling}}}function ou(e){if(e.tag===30){var t=e.memoizedProps,n=Di(t,e.stateNode),r=Yl===null?void 0:Yl.get(n),i=ki(t.default,r===void 0?t.exit:t.share);i!==`none`&&(eu(e,n,i,null,!1)?r===void 0?Jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Yl.delete(n),Jd(e,t.onShare)):nu(e.child,!1)),Yl!==null&&au(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else Yl!==null&&au(e)}function su(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Di(t,e.stateNode);t=ki(t.default,t.update),e.flags&=-5,t!==`none`&&eu(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&su(e);e=e.sibling}}function cu(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,nu(e.child,!1))}cu(e)}e=e.sibling}}function lu(e){if(e.tag===30)e.stateNode.paired=null,nu(e.child,!1),cu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)lu(e),e=e.sibling;else cu(e)}function uu(e){for(e=e.child;e!==null;)e.tag===30?nu(e.child,!1):e.subtreeFlags&33554432&&uu(e),e=e.sibling}function du(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&$l<a.length){var l=a[$l],u=Kp(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&&Up(c,$l===0?n:n+`_`+$l,i),s&&e.flags&4||(Zl===null&&(Zl=[]),Zl.push(c,$l===0?r:r+`_`+$l,t.memoizedProps)),$l++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:du(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function fu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Di(n,r),a=ki(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(qp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;$l=0,i=du(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&fu(e,t);e=e.sibling}}var pu=!1,mu=!1,hu=!1,gu=!1,_u=typeof WeakSet==`function`?WeakSet:Set,vu=null,yu=!1,bu=!1,xu=!1,Su=!1;function Cu(e,t,n){if(e=e.containerInfo,Tp=Ph,e=ti(e),ni(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(Ep={focusedElem:e,selectionRange:r},Ph=!1,n=(n&335544064)===n,vu=t,t=n?9270:1024;vu!==null;){if(e=vu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ou(r[a]);if(e.alternate===null&&e.flags&2)n&&Xl(e),wu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ou(r),wu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Xl(e),wu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,vu=r):(n&&su(e),wu(n))}}Yl=null}function wu(e){for(;vu!==null;){var t=vu,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){kf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)bm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:bm(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=Di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=ki(a.default,a.update),a!==`none`&&eu(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,vu=r;break}vu=t.return}}function Tu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gu(e,n),r&4&&Al(5,n);break;case 1:if(Gu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){kf(n,n.return,e)}else{var i=jc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){kf(n,n.return,e)}}}r&64&&Ml(n),r&512&&Pl(n,n.return);break;case 3:if(Gu(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{Po(e,t)}catch(e){kf(n,n.return,e)}}break;case 27:t===null&&r&4&&ql(n);case 26:case 5:Gu(e,n),t===null&&r&4&&Vl(n),r&512&&Pl(n,n.return);break;case 12:Gu(e,n);break;case 31:Gu(e,n),r&4&&Pu(e,n);break;case 13:Gu(e,n),r&4&&Fu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Nf.bind(null,n),Em(e,n))));break;case 22:if(r=n.memoizedState!==null||pu,!r){var a=t!==null&&t.memoizedState!==null||mu;t=pu,i=mu,pu=r,(mu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),qu(e,n,r)):Gu(e,n),pu=t,mu=i}break;case 30:Gu(e,n),r&512&&Pl(n,n.return);break;case 7:r&512&&Pl(n,n.return);default:Gu(e,n)}}function Eu(e,t){for(e=e.child;e!==null;)Du(e,t),e=e.sibling}function Du(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){kf(e,e.return,t)}Ou(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,en=!0}catch(t){kf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Hp(s,!0):Hp(e.stateNode,!1)}catch(t){kf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Eu(e,t);break;default:Eu(e,t)}}function Ou(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Du(n,r);break a;case 22:n.memoizedState===null&&Ou(n,r);break a;default:Ou(n,r)}}e=e.sibling}}function ku(e){var t=e.alternate;t!==null&&(e.alternate=null,ku(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zt(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 Au=null,ju=!1;function Mu(e,t,n){for(n=n.child;n!==null;)Nu(e,t,n),n=n.sibling}function Nu(e,t,n){if(it&&typeof it.onCommitFiberUnmount==`function`)try{it.onCommitFiberUnmount(rt,n)}catch{}switch(n.tag){case 26:mu||Fl(n,t),Mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!mu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mu||Fl(n,t),Rl(n);var r=Au,i=ju;Bp(n.type)&&(Au=n.stateNode,ju=!1),Mu(e,t,n),Pm(n.stateNode,n.type,n.memoizedProps),Au=r,ju=i;break;case 5:mu||Fl(n,t),Rl(n);case 6:if(n.tag===6&&Rl(n),r=Au,i=ju,Au=null,Mu(e,t,n),Au=r,ju=i,Au!==null){if(ju)try{(Au.nodeType===9?Au.body:Au.nodeName===`HTML`?Au.ownerDocument.body:Au).removeChild(n.stateNode),en=!0}catch(e){kf(n,t,e)}else try{Au.removeChild(n.stateNode),en=!0}catch(e){kf(n,t,e)}}break;case 18:Au!==null&&(ju?(e=Au,Vp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),og(e)):Vp(Au,n.stateNode));break;case 4:r=Au,i=ju,Au=n.stateNode.containerInfo,ju=!0,Mu(e,t,n),Au=r,ju=i;break;case 0:case 11:case 14:case 15:jl(2,n,t),mu||jl(4,n,t),Mu(e,t,n);break;case 1:mu||(Fl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Nl(n,t,r)),Mu(e,t,n);break;case 21:Mu(e,t,n);break;case 22:mu=(r=mu)||n.memoizedState!==null,Mu(e,t,n),mu=r;break;case 30:Fl(n,t),Mu(e,t,n);break;case 7:mu||Fl(n,t),Mu(e,t,n);break;default:Mu(e,t,n)}}function Pu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{og(e)}catch(e){kf(t,t.return,e)}}}function Fu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{og(e)}catch(e){kf(t,t.return,e)}}function Iu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _u),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _u),t;default:throw Error(i(435,e.tag))}}function Lu(e,t){var n=Iu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Pf.bind(null,e,t);t.then(r,r)}})}function Ru(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(Bp(l.type)){Au=l.stateNode,ju=!1;break a}break;case 5:Au=l.stateNode,ju=!1;break a;case 3:case 4:Au=l.stateNode.containerInfo,ju=!0;break a}l=l.return}if(Au===null)throw Error(i(160));Nu(s,c,o),Au=null,ju=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bu(t,e,n),t=t.sibling}var zu=null;function Bu(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}Ru(t,e,n),Vu(e),a&4&&(jl(3,e,e.return),Al(3,e),jl(5,e,e.return));break;case 1:Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),a&64&&pu&&(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=zu,Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Fl(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(pu)e.stateNode=Ap(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[Lt]||r[At]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),bp(r,t,n),r[At]=e,Wt(r),t=r;break a;case`link`:if(o=lh(`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),bp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=lh(`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),bp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[At]=e,Wt(r),t=r}e.stateNode=t}}else pu||uh(o,e.type,e.stateNode)}else e.stateNode=ih(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Hl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||mu||t.parentNode.removeChild(t)):a.count--,n===null?pu||uh(o,e.type,e.stateNode):ih(o,n,e.memoizedProps))}break;case 27:Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),r!==null&&a&4&&Hl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=hu,hu=!1,Ru(t,e,n),hu=o,Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),e.flags&32){t=e.stateNode;try{yn(t,``),en=!0}catch(t){kf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Hl(e,t,r===null?t:r.memoizedProps)),a&1024&&(gu=!0);break;case 6:if(Ru(t,e,n),Vu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,en=!0}catch(t){kf(e,e.return,t)}}break;case 3:if(en=!1,ch=null,o=zu,zu=Rm(t.containerInfo),Ru(t,e,n),zu=o,Vu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{og(t.containerInfo)}catch(t){kf(e,e.return,t)}gu&&(gu=!1,Hu(e)),en=!1;break;case 4:a=hu,hu=pu,r=tn(),o=zu,zu=Rm(e.stateNode.containerInfo),Ru(t,e,n),Vu(e),zu=o,en&&bu&&(xu=!0),en=r,hu=a;break;case 12:Ru(t,e,n),Vu(e);break;case 31:Ru(t,e,n),Vu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 13:Ru(t,e,n),Vu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(kd=Je()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=pu,l=mu,u=hu;pu=c||o,hu=u||o,mu=l||s,Ru(t,e,n),mu=l,hu=u,pu=c,Vu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||pu||mu||(t=s||mu,n=pu,r=mu,pu=o||pu,mu=t,Ku(e,2),pu=n,mu=r),!o&&hu||Eu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Lu(e,n))));break;case 19:Ru(t,e,n),Vu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 30:a&512&&(mu||r===null||Fl(r,r.return)),a=tn(),o=bu,s=(n&335544064)===n,c=e.memoizedProps,bu=s&&ki(c.default,c.update)!==`none`,Ru(t,e,n),Vu(e),s&&r!==null&&en&&(e.flags|=4),bu=o,en=a;break;case 21:break;case 7:a&512&&(mu||r===null||Fl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ru(t,e,n),Vu(e)}}function Vu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ul(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Bl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(zl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Kl(e,Wl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(yn(l,``),n.flags&=-33),Kl(e,Wl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Gl(e,Wl(e),u,s);break;default:throw Error(i(161))}}catch(t){kf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Hu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ph=!0,t.reset(),Ph=!1),e=e.sibling}}function Uu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Wu(t,e),t=t.sibling;else fu(t,!1)}function Wu(e,t){var n=e.alternate;if(n===null)iu(e,!1);else switch(e.tag){case 3:if(Su=yu=!1,Ql(),Uu(t,e),!yu&&!xu){if(e=Zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Wp(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`})),Su=!0}Zl=null;break;case 5:Uu(t,e);break;case 4:r=yu,yu=!1,Uu(t,e),yu&&(xu=!0),yu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Uu(t,e):iu(e,!1));break;case 30:r=yu,i=Ql(),yu=!1,Uu(t,e),yu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Di(a,o),o=Di(n.memoizedProps,o);var s=ki(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,$l=0,t=du(e,n,t,o,s,a,!0),$l!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Jd(e,e.memoizedProps.onUpdate),Zl=i):i!==null&&(i.push.apply(i,Zl),Zl=i),yu=e.flags&32?!0:r;break;default:Uu(t,e)}}function Gu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tu(e,t.alternate,t),t=t.sibling}function Ku(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:jl(4,n,n.return),Ku(n,r);break;case 1:Fl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Nl(n,n.return,i),Ku(n,r);break;case 27:r&2&&Pm(n.stateNode,n.type,n.memoizedProps);case 5:Fl(n,n.return),n.tag!==5&&n.tag!==27||Rl(n),Ku(n,r);break;case 6:Rl(n);break;case 26:Fl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||mu||i.parentNode.removeChild(i),Ku(n,r);break;case 22:n.memoizedState===null&&Ku(n,r);break;case 30:Fl(n,n.return),Ku(n,r);break;case 7:Fl(n,n.return);default:Ku(n,r)}e=e.sibling}}function qu(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:qu(i,a,n),Al(4,a);break;case 1:if(qu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){kf(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++)No(l[i],c)}catch(e){kf(r,r.return,e)}}s&&o&64&&Ml(a),Pl(a,a.return);break;case 27:n&2&&ql(a);case 5:a.tag!==5&&a.tag!==27||Ll(a),qu(i,a,n),s&&r===null&&o&4&&Vl(a),Pl(a,a.return);break;case 6:Ll(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||pu||uh(Rm(c.ownerDocument),a.type,c),qu(i,a,n),s&&r===null&&o&4&&Vl(a),Pl(a,a.return);break;case 12:qu(i,a,n);break;case 31:qu(i,a,n),s&&o&4&&Pu(i,a);break;case 13:qu(i,a,n),s&&o&4&&Fu(i,a);break;case 22:a.memoizedState===null&&qu(i,a,n),Pl(a,a.return);break;case 30:qu(i,a,n),Pl(a,a.return);break;case 7:Pl(a,a.return);default:qu(i,a,n)}t=t.sibling}}function Ju(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&&Ua(n))}function Yu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ua(e))}function Xu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Zu(e,t,n,r),t=t.sibling;else i&&uu(t)}function Zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&lu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Xu(e,t,n,r),a&2048&&Al(9,t);break;case 1:Xu(e,t,n,r);break;case 3:Xu(e,t,n,r),i&&Su&&(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&&Ua(a)));break;case 12:if(a&2048){Xu(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){kf(t,t.return,e)}}else Xu(e,t,n,r);break;case 31:Xu(e,t,n,r);break;case 13:Xu(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&&lu(t),o._visibility&2?Xu(e,t,n,r):(o._visibility|=2,Qu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&lu(s),o._visibility&2?Xu(e,t,n,r):$u(e,t)),a&2048&&Ju(s,t);break;case 24:Xu(e,t,n,r),a&2048&&Yu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(nu(a.child,!0),nu(t.child,!0))),Xu(e,t,n,r);break;default:Xu(e,t,n,r)}}function Qu(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:Qu(a,o,s,c,i),Al(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Qu(a,o,s,c,i)):u._visibility&2?Qu(a,o,s,c,i):$u(a,o),i&&l&2048&&Ju(o.alternate,o);break;case 24:Qu(a,o,s,c,i),i&&l&2048&&Yu(o.alternate,o);break;default:Qu(a,o,s,c,i)}t=t.sibling}}function $u(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:$u(n,r),i&2048&&Ju(r.alternate,r);break;case 24:$u(n,r),i&2048&&Yu(r.alternate,r);break;default:$u(n,r)}t=t.sibling}}var ed=8192;function td(e,t,n){if(e.subtreeFlags&ed)for(e=e.child;e!==null;)nd(e,t,n),e=e.sibling}function nd(e,t,n){switch(e.tag){case 26:td(e,t,n),e.flags&ed&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&hh(n,e)):gh(n,zu,e.memoizedState,e.memoizedProps));break;case 5:td(e,t,n),e.flags&ed&&(e=e.stateNode,(t&335544128)===t&&hh(n,e));break;case 3:case 4:var r=zu;zu=Rm(e.stateNode.containerInfo),td(e,t,n),zu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ed,ed=16777216,td(e,t,n),ed=r):td(e,t,n));break;case 30:if((e.flags&ed)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Yl===null&&(Yl=new Map),Yl.set(r,i)}td(e,t,n);break;default:td(e,t,n)}}function rd(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 id(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ad(e),e=e.sibling}function ad(e){switch(e.tag){case 0:case 11:case 15:id(e),e.flags&2048&&jl(9,e,e.return);break;case 3:id(e);break;case 12:id(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,od(e)):id(e);break;default:id(e)}}function od(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),od(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,od(t));break;default:od(t)}e=e.sibling}}function sd(e,t){for(;vu!==null;){var n=vu;switch(n.tag){case 0:case 11:case 15:jl(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:Ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,vu=r;else a:for(n=e;vu!==null;){r=vu;var i=r.sibling,a=r.return;if(ku(r),r===n){vu=null;break a}if(i!==null){i.return=a,vu=i;break a}vu=a}}}var cd={getCacheForType:function(e){var t=Fa(Va),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Fa(Va).controller.signal}},ld=typeof WeakMap==`function`?WeakMap:Map,ud=0,dd=null,fd=null,pd=0,md=0,hd=null,gd=!1,_d=!1,vd=!1,yd=0,bd=0,xd=0,Sd=0,Cd=0,wd=0,Td=0,Ed=null,Dd=null,Od=!1,kd=0,Ad=0,jd=1/0,Md=null,Nd=null,Pd=0,Fd=null,Id=null,Ld=0,Rd=0,zd=null,Bd=null,Vd=null,Hd=null,Ud=null,Wd=0,Gd=null;function Kd(){return ud&2&&pd!==0?pd&-pd:O.T===null?Dt():Xf()}function qd(){if(wd===0){if(!(pd&536870912)||ha){var e=dt;dt<<=1,!(dt&3932160)&&(dt=262144),wd=e}else wd=536870912}return e=Bo.current,e!==null&&(e.flags|=32),wd}function Jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Qp(Di(e.memoizedProps,n))),Hd===null&&(Hd=[]),Hd.push(t.bind(null,r))}}function Yd(e,t,n){(e===dd&&(md===2||md===9)||e.cancelPendingCommit!==null)&&(nf(e,0),$d(e,pd,wd,!1)),bt(e,n),(!(ud&2)||e!==dd)&&(e===dd&&(!(ud&2)&&(Sd|=n),bd===4&&$d(e,pd,wd,!1)),Hf(e))}function Xd(e,t,n){if(ud&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ht(e,t),a=r?df(e,t):lf(e,t,!0),o=r;do{if(a===0){_d&&!r&&$d(e,t,0,!1);break}if(n=e.current.alternate,o&&!Qd(n))a=lf(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=Ed;var l=c.current.memoizedState.isDehydrated;if(l&&(nf(c,s).flags|=256),s=lf(c,s,!1),s!==2&&s!==6){if(vd&&!l){c.errorRecoveryDisabledLanes|=o,Sd|=o,a=4;break a}o=Dd,Dd=a,o!==null&&(Dd===null?Dd=o:Dd.push.apply(Dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){nf(e,0),$d(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:$d(r,t,wd,!gd);break a;case 2:Dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=kd+300-Je(),10<a)){if($d(r,t,wd,!gd),mt(r,0,!0)!==0)break a;Ld=t,r.timeoutHandle=Pp(Zd.bind(null,r,n,Dd,Md,Od,t,wd,Sd,Td,gd,o,`Throttled`,-0,0),a);break a}Zd(r,n,Dd,Md,Od,t,wd,Sd,Td,gd,o,null,-0,0)}break}}while(1);Hf(e)}function Zd(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:Dn},Yl=null,nd(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=bh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?kd-Je():(a&4194048)===a?Ad-Je():0,m=vh(d,m),m!==null)?(Ld=a,e.cancelPendingCommit=m(vf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),$d(e,a,o,!l)):vf(e,t,a,n,r,i,o,s,c,l,u,d)}function Qd(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(!Yr(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 $d(e,t,n,r){t=gt(e,t),t&=~Cd,t&=~Sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ot(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&St(e,n,t)}function ef(){return ud&6?!0:(Uf(0,!1),!1)}function tf(){if(fd!==null){if(md===0)var e=fd.return;else e=fd,Oa=Da=null,ms(e),ho=null,go=0,e=fd;for(;e!==null;)kl(e.alternate,e),e=e.return;fd=null}}function nf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Fp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ld=0,tf(),dd=e,fd=n=Wi(e.current,null),pd=t,md=0,hd=null,gd=!1,_d=ht(e,t),vd=!1,Td=wd=Cd=Sd=xd=bd=0,Dd=Ed=null,Od=!1,yd=gt(e,t),Pi(),n}function rf(e,t){Qo=null,O.H=wc,t===io||t===oo?(t=po(),md=3):t===ao?(t=po(),md=4):md=t===Bc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,hd=t,fd===null&&(bd=1,Fc(e,Qi(t,e.current)))}function af(){var e=Bo.current;return e===null?!0:(pd&4194048)===pd?Vo===null:(pd&62914560)===pd||pd&536870912?e===Vo:!1}function of(){var e=O.H;return O.H=wc,e===null?wc:e}function sf(){var e=O.A;return O.A=cd,e}function cf(){bd=4,gd||(pd&4194048)!==pd&&Bo.current!==null||(_d=!0),!(xd&134217727)&&!(Sd&134217727)||dd===null||$d(dd,pd,wd,!1)}function lf(e,t,n){var r=ud;ud|=2;var i=of(),a=sf();(dd!==e||pd!==t)&&(Md=null,nf(e,t)),t=!1;var o=bd;a:do try{if(md!==0&&fd!==null){var s=fd,c=hd;switch(md){case 8:tf(),o=6;break a;case 3:case 2:case 9:case 6:Bo.current===null&&(t=!0);var l=md;if(md=0,hd=null,hf(e,s,c,l),n&&_d){o=0;break a}break;default:l=md,md=0,hd=null,hf(e,s,c,l)}}uf(),o=bd;break}catch(t){rf(e,t)}while(1);return t&&e.shellSuspendCounter++,Oa=Da=null,ud=r,O.H=i,O.A=a,fd===null&&(dd=null,pd=0,Pi()),o}function uf(){for(;fd!==null;)pf(fd)}function df(e,t){var n=ud;ud|=2;var r=of(),a=sf();dd!==e||pd!==t?(Md=null,jd=Je()+500,nf(e,t)):_d=ht(e,t);a:do try{if(md!==0&&fd!==null){t=fd;var o=hd;b:switch(md){case 1:md=0,hd=null,hf(e,t,o,1);break;case 2:case 9:if(co(o)){md=0,hd=null,mf(t);break}t=function(){md!==2&&md!==9||dd!==e||(md=7),Hf(e)},o.then(t,t);break a;case 3:md=7;break a;case 4:md=5;break a;case 7:co(o)?(md=0,hd=null,mf(t)):(md=0,hd=null,hf(e,t,o,7));break;case 5:var s=null;switch(fd.tag){case 26:s=fd.memoizedState;case 5:case 27:var c=fd;if(s?ph(s):c.stateNode.complete){md=0,hd=null;var l=c.sibling;if(l!==null)fd=l;else{var u=c.return;u===null?fd=null:(fd=u,gf(u))}break b}}md=0,hd=null,hf(e,t,o,5);break;case 6:md=0,hd=null,hf(e,t,o,6);break;case 8:tf(),bd=6;break a;default:throw Error(i(462))}}ff();break}catch(t){rf(e,t)}while(1);return Oa=Da=null,O.H=r,O.A=a,ud=n,fd===null?(dd=null,pd=0,Pi(),bd):0}function ff(){for(;fd!==null&&!Ke();)pf(fd)}function pf(e){var t=bl(e.alternate,e,yd);e.memoizedProps=e.pendingProps,t===null?gf(e):fd=t}function mf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=el(n,t,t.pendingProps,t.type,void 0,pd);break;case 11:t=el(n,t,t.pendingProps,t.type.render,t.ref,pd);break;case 5:ms(t);var r=t;r===pa&&(ha?(xa(r),r.tag===5&&r.stateNode!=null&&(ma=r.stateNode)):(xa(r),ha=!0));default:kl(n,t),t=fd=Gi(t,yd),t=bl(n,t,yd)}e.memoizedProps=e.pendingProps,t===null?gf(e):fd=t}function hf(e,t,n,r){Oa=Da=null,ms(t),ho=null,go=0;var i=t.return;try{if(F(e,i,t,n,pd)){bd=1,Fc(e,Qi(n,e.current)),fd=null;return}}catch(t){if(i!==null)throw fd=i,t;bd=1,Fc(e,Qi(n,e.current)),fd=null;return}t.flags&32768?(ha||r===1?e=!0:_d||pd&536870912?e=!1:(gd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Bo.current,r!==null&&r.tag===13&&(r.flags|=16384))),_f(t,e)):gf(t)}function gf(e){var t=e;do{if(t.flags&32768){_f(t,gd);return}e=t.return;var n=Dl(t.alternate,t,yd);if(n!==null){fd=n;return}if(t=t.sibling,t!==null){fd=t;return}fd=t=e}while(t!==null);bd===0&&(bd=5)}function _f(e,t){do{var n=Ol(e.alternate,e);if(n!==null){n.flags&=32767,fd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){fd=e;return}fd=e=n}while(e!==null);bd=6,fd=null}function vf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Ef();while(Pd!==0);if(ud&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===dd&&(fd=dd=null,pd=0),Id=t,Fd=e,Ld=n,zd=a,Bd=r,yf(e,t,n,s,c,l,f)}}function yf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Rd=s,s|=Ni,xt(e,n,s,r,i,a),Hd=null,(n&335544064)===n?(Ud=Ka(e),r=10262):(Ud=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Ff(Qe,function(){return Df(),null})):(e.callbackNode=null,e.callbackPriority=0),Jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,i=xe.p,xe.p=2,a=ud,ud|=4;try{Cu(e,t,n)}finally{ud=a,xe.p=i,O.T=r}}Pd=1,Jl?Vd=Xp(o,e.containerInfo,Ud,Sf,Cf,xf,wf,Df,bf,null,null):(Sf(),Cf(),wf())}function bf(e){if(Pd!==0){var t=Fd.onRecoverableError;t(e,{componentStack:null})}}function xf(){Pd===3&&(Pd=0,Wu(Id,Fd),Pd=4)}function Sf(){if(Pd===1){Pd=0;var e=Fd,t=Id,n=Ld,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=O.T,O.T=null;var i=xe.p;xe.p=2;var a=ud;ud|=4;try{bu=xu=!1,Bu(t,e,n),n=Ep;var o=ti(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ei(s.ownerDocument.documentElement,s)){if(c!==null&&ni(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 _=$r(s,h),v=$r(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}}Ph=!!Tp,Ep=Tp=null}finally{ud=a,xe.p=i,O.T=r}}e.current=t,Pd=2}}function Cf(){if(Pd===2){Pd=0;var e=Fd,t=Id,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=xe.p;xe.p=2;var i=ud;ud|=4;try{Tu(e,t.alternate,t)}finally{ud=i,xe.p=r,O.T=n}}Pd=3}}function wf(){if(Pd===4||Pd===3){Pd=0;var e=Vd;Vd=null,qe();var t=Fd,n=Id,r=Ld,i=Bd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Pd=5:(Pd=0,Id=Fd=null,Tf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Nd=null),Et(r),n=n.stateNode,it&&typeof it.onCommitFiberRoot==`function`)try{it.onCommitFiberRoot(rt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=O.T,a=xe.p,xe.p=2,O.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{O.T=n,xe.p=a}}if(i=Hd,o=Ud,Ud=null,i!==null&&(Hd=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);Ld&3&&Ef(),Hf(t),a=t.pendingLanes,r&261930&&a&42?t===Gd?Wd++:(Wd=0,Gd=t):(Wd=0,Gd=null),Uf(0,!1)}}function Tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ua(t)))}function Ef(){return Vd!==null&&(Vd.skipTransition(),Vd=null),Sf(),Cf(),wf(),Df()}function Df(){if(Pd!==5)return!1;var e=Fd,t=Rd;Rd=0;var n=Et(Ld),r=O.T,a=xe.p;try{xe.p=32>n?32:n,O.T=null,n=zd,zd=null;var o=Fd,s=Ld;if(Pd=0,Id=Fd=null,Ld=0,ud&6)throw Error(i(331));var c=ud;if(ud|=4,ad(o.current),Zu(o,o.current,s,n),ud=c,Uf(0,!1),it&&typeof it.onPostCommitFiberRoot==`function`)try{it.onPostCommitFiberRoot(rt,o)}catch{}return!0}finally{xe.p=a,O.T=r,Tf(e,t)}}function Of(e,t,n){t=Qi(n,t),t=Lc(e.stateNode,t,2),e=Do(e,t,2),e!==null&&(bt(e,2),Hf(e))}function kf(e,t,n){if(e.tag===3)Of(e,e,n);else for(;t!==null;){if(t.tag===3){Of(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Nd===null||!Nd.has(r))){e=Qi(n,e),n=Rc(2),r=Do(t,n,2),r!==null&&(zc(n,r,t,e),bt(r,2),Hf(r));break}}t=t.return}}function Af(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ld;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)||(vd=!0,i.add(n),e=jf.bind(null,e,t,n),t.then(e,e))}function jf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,dd===e&&(pd&n)===n&&(bd===4||bd===3&&(pd&62914560)===pd&&300>Je()-kd?ud&2?Cd|=n:nf(e,0):Cd|=n,Td===pd&&(Td=0)),Hf(e)}function Mf(e,t){t===0&&(t=vt()),e=Li(e,t),e!==null&&(bt(e,t),Hf(e))}function Nf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mf(e,n)}function Pf(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),Mf(e,n)}function Ff(e,t){return We(e,t)}var If=null,Lf=null,Rf=!1,zf=!1,Bf=!1,Vf=0;function Hf(e){e!==Lf&&e.next===null&&(Lf===null?If=Lf=e:Lf=Lf.next=e),zf=!0,Rf||(Rf=!0,Yf())}function Uf(e,t){if(!Bf&&zf){Bf=!0;do for(var n=!1,r=If;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-ot(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Jf(r,a))}else a=pd,a=mt(r,r===dd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ht(r,a)||(n=!0,Jf(r,a))}r=r.next}while(n);Bf=!1}}function Wf(){Gf()}function Gf(){zf=Rf=!1;var e=0;Vf!==0&&Np()&&(e=Vf);for(var t=Je(),n=null,r=If;r!==null;){var i=r.next,a=Kf(r,t);a===0?(r.next=null,n===null?If=i:n.next=i,i===null&&(Lf=n)):(n=r,(e!==0||a&3)&&(zf=!0)),r=i}Pd!==0&&Pd!==5||Uf(e,!1),Vf!==0&&(Vf=0)}function Kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ot(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=_t(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=dd,n=pd,n=mt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(md===2||md===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ht(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ge(r),Et(n)){case 2:case 8:n=Ze;break;case 32:n=Qe;break;case 268435456:n=et;break;default:n=Qe}return r=qf.bind(null,e),n=We(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ge(r),e.callbackPriority=2,e.callbackNode=null,2}function qf(e,t){if(Pd!==0&&Pd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ef()&&e.callbackNode!==n)return null;var r=pd;return r=mt(e,e===dd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Xd(e,r,t),Kf(e,Je()),e.callbackNode!=null&&e.callbackNode===n?qf.bind(null,e):null)}function Jf(e,t){if(Ef())return null;Xd(e,t,!0)}function Yf(){Rp(function(){ud&6?We(Xe,Wf):Gf()})}function Xf(){if(Vf===0){var e=Ya;e===0&&(e=ut,ut<<=1,!(ut&261888)&&(ut=256)),Vf=e}return Vf}function Zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:En(e)}function Qf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Zf((i[jt]||null).action),o=r.submitter;o&&(t=(t=o[jt]||null)?Zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new qn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Vf!==0){var e=new FormData(i,o);uc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),uc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var $f=0;$f<wi.length;$f++){var ep=wi[$f];Ti(ep.toLowerCase(),`on`+(ep[0].toUpperCase()+ep.slice(1)))}Ti(mi,`onAnimationEnd`),Ti(gi,`onAnimationIteration`),Ti(vi,`onAnimationStart`),Ti(`dblclick`,`onDoubleClick`),Ti(`focusin`,`onFocus`),Ti(`focusout`,`onBlur`),Ti(yi,`onTransitionRun`),Ti(bi,`onTransitionStart`),Ti(xi,`onTransitionCancel`),Ti(Si,`onTransitionEnd`),Yt(`onMouseEnter`,[`mouseout`,`mouseover`]),Yt(`onMouseLeave`,[`mouseout`,`mouseover`]),Yt(`onPointerEnter`,[`pointerout`,`pointerover`]),Yt(`onPointerLeave`,[`pointerout`,`pointerover`]),Jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var tp=`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(` `),np=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(tp));function rp(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){Ai(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){Ai(e)}i.currentTarget=null,a=c}}}}function ip(e,t){var n=t[Nt];n===void 0&&(n=t[Nt]=new Set);var r=e+`__bubble`;n.has(r)||(cp(t,e,2,!1),n.add(r))}function ap(e,t,n){var r=0;t&&(r|=4),cp(n,e,r,t)}var op=`_reactListening`+Math.random().toString(36).slice(2);function sp(e){if(!e[op]){e[op]=!0,Kt.forEach(function(t){t!==`selectionchange`&&(np.has(t)||ap(t,!1,e),ap(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[op]||(t[op]=!0,ap(`selectionchange`,!1,t))}}function cp(e,t,n,r){switch(Vh(t)){case 2:var i=Fh;break;case 8:i=Ih;break;default:i=Lh}n=i.bind(null,t,n,e),i=void 0,!Ln||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 lp(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=Bt(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}Pn(function(){var r=a,i=kn(n),s=[];a:{var c=Ci.get(e);if(c!==void 0){var l=qn,u=e;switch(e){case`keypress`:if(Hn(n)===0)break a;case`keydown`:case`keyup`:l=dr;break;case`focusin`:u=`focus`,l=nr;break;case`focusout`:u=`blur`,l=nr;break;case`beforeblur`:case`afterblur`:l=nr;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=er;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=tr;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=mr;break;case mi:case gi:case vi:l=rr;break;case Si:l=hr;break;case`scroll`:case`scrollend`:l=Yn;break;case`wheel`:l=gr;break;case`copy`:case`cut`:case`paste`:l=ir;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=fr;break;case`submit`:l=pr;break;case`toggle`:case`beforetoggle`:l=_r}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=Fn(m,p),g!=null&&d.push(up(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!==On&&(u=n.relatedTarget||n.fromElement)&&(Bt(u)||u[Mt]))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?Bt(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=er,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=fr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ht(c),h=l==null?u:Ht(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Bt(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,fp):null,c!==null&&pp(s,u,c,d,!1),l!==null&&f!==null&&pp(s,f,l,d,!0)))}a:{if(c=r?Ht(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Lr;else if(jr(c)){if(Rr)_=qr;else{_=Gr;var v=Wr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Cn(r.elementType)&&(_=Lr):_=Kr;if(_&&=_(e,r)){Mr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ht(r):window,e){case`focusin`:(jr(v)||v.contentEditable===`true`)&&(ii=v,ai=r,oi=null);break;case`focusout`:oi=ai=ii=null;break;case`mousedown`:si=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:si=!1,ci(s,n,i);break;case`selectionchange`:if(ri)break;case`keydown`:case`keyup`:ci(s,n,i)}var y;if(yr)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 Dr?Tr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Sr&&n.locale!==`ko`&&(Dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Dr&&(y=Vn()):(k=i,zn=`value`in k?k.value:k.textContent,Dr=!0)),v=dp(r,b),0<v.length&&(b=new ar(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Er(n),y!==null&&(b.data=y)))),(y=xr?Or(e,n):kr(e,n))&&(b=dp(r,`onBeforeInput`),0<b.length&&(v=new ar(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Qf(s,e,r,n,i)}rp(s,t)})}function up(e,t,n){return{instance:e,listener:t,currentTarget:n}}function dp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Fn(e,n),i!=null&&r.unshift(up(e,i,a)),i=Fn(e,t),i!=null&&r.push(up(e,i,a))),e.tag===3)return r;e=e.return}return[]}function fp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Fn(n,a),l!=null&&o.unshift(up(n,l,c))):i||(l=Fn(n,a),l!=null&&o.push(up(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var mp=/\r\n?/g,hp=/\u0000|\uFFFD/g;function gp(e){return(typeof e==`string`?e:``+e).replace(mp,`
|
|
10
|
+
`).replace(hp,``)}function _p(e,t){return t=gp(t),gp(e)===t}function vp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&yn(e,``+r);else return;break;case`className`:rn(e,`class`,r);break;case`tabIndex`:rn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:rn(e,n,r);break;case`style`:Sn(e,r,o);return;case`data`:if(t!==`object`){rn(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=En(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`&&vp(e,t,`name`,a.name,a,null),vp(e,t,`formEncType`,a.formEncType,a,null),vp(e,t,`formMethod`,a.formMethod,a,null),vp(e,t,`formTarget`,a.formTarget,a,null)):(vp(e,t,`encType`,a.encType,a,null),vp(e,t,`method`,a.method,a,null),vp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Dn);return;case`onScroll`:r!=null&&ip(`scroll`,e);return;case`onScrollEnd`:r!=null&&ip(`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=En(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`:ip(`beforetoggle`,e),ip(`toggle`,e),nn(e,`popover`,r);break;case`xlinkActuate`:an(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:an(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:an(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:an(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:an(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:an(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:nn(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=wn.get(n)||n,nn(e,n,r);else return}en=!0}function yp(e,t,n,r,a,o){switch(n){case`style`:Sn(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`)yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)yn(e,``+r);else return;break;case`onScroll`:r!=null&&ip(`scroll`,e);return;case`onScrollEnd`:r!=null&&ip(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!qt.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[jt]||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}en=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):nn(e,n,r)}return}en=!0}function bp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:ip(`error`,e),ip(`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:vp(e,t,o,s,n,null)}}a&&vp(e,t,`srcSet`,n.srcSet,n,null),r&&vp(e,t,`src`,n.src,n,null);return;case`input`:ip(`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:vp(e,t,r,d,n,null)}}mn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in ip(`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:vp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&gn(e,!!r,n,!0):gn(e,!!r,t,!1);return;case`textarea`:for(s in ip(`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:vp(e,t,s,c,n,null)}vn(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:vp(e,t,l,r,n,null)}return;case`dialog`:ip(`beforetoggle`,e),ip(`toggle`,e),ip(`cancel`,e),ip(`close`,e);break;case`iframe`:case`object`:ip(`load`,e);break;case`video`:case`audio`:for(r=0;r<tp.length;r++)ip(tp[r],e);break;case`image`:ip(`error`,e),ip(`load`,e);break;case`details`:ip(`toggle`,e);break;case`embed`:case`source`:case`link`:ip(`error`,e),ip(`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:vp(e,t,u,r,n,null)}return;default:if(Cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&yp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&vp(e,t,c,r,n,null))}var xp={};function Sp(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)||vp(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&&(en=!0),o=m;break;case`name`:m!==f&&(en=!0),a=m;break;case`checked`:m!==f&&(en=!0),u=m;break;case`defaultChecked`:m!==f&&(en=!0),d=m;break;case`value`:m!==f&&(en=!0),s=m;break;case`defaultValue`:m!==f&&(en=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&vp(e,t,p,m,r,f)}}pn(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)||vp(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&&(en=!0),p=o;break;case`defaultValue`:o!==l&&(en=!0),c=o;break;case`multiple`:o!==l&&(en=!0),s=o;default:o!==l&&vp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?gn(e,!!n,n?[]:``,!1):gn(e,!!n,t,!0)):gn(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:vp(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&&(en=!0),p=a;break;case`defaultValue`:a!==o&&(en=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&vp(e,t,s,a,r,o)}_n(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:vp(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&&(en=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:vp(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)&&vp(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:vp(e,t,u,p,r,m)}return;default:if(Cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&yp(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||yp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&vp(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||vp(e,t,f,p,r,m)}function Cp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function wp(){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&&Cp(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&&Cp(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 Tp=null,Ep=null;function Dp(e){return e.nodeType===9?e:e.ownerDocument}function Op(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 kp(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 Ap(e,t,n,r){return n=Dp(n).createElement(e),n[At]=r,n[jt]=t,bp(n,e,t),Wt(n),n}function jp(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 Mp=null;function Np(){var e=window.event;return e&&e.type===`popstate`?e!==Mp&&(Mp=e,!0):(Mp=null,!1)}var Pp=typeof setTimeout==`function`?setTimeout:void 0,Fp=typeof clearTimeout==`function`?clearTimeout:void 0,Ip=typeof Promise==`function`?Promise:void 0,Lp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Pp,Rp=typeof queueMicrotask==`function`?queueMicrotask:Ip===void 0?Pp:function(e){return Ip.resolve(null).then(e).catch(zp)};function zp(e){setTimeout(function(){throw e})}function Bp(e){return e===`head`}function Vp(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),og(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Fm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Fm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Fm(e.ownerDocument.body)}n=i}while(n);og(t)}function Hp(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 Up(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 Wp(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 Gp(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 Kp(e){return Gp(e.getBoundingClientRect(),getComputedStyle(e),e)}function qp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Gp(t,n,e)}function Jp(e){return e.documentElement.clientHeight}function Yp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Xp(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`&&(Jp(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+=mh(f),u>_h){s.length=o;break}f=new Promise(Yp.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 Zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Zp.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},Zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Qp(e){return{name:e,group:new Zp(`group`,e),imagePair:new Zp(`image-pair`,e),old:new Zp(`old`,e),new:new Zp(`new`,e)}}function $p(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}$p.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(im(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=nm(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,em,e,s,r)}this._eventListeners=a}};function em(e,t,n,r){return v(e).addEventListener(t,n,r),!1}$p.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=im(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=nm(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,tm,e,n,i),r.splice(t,1),a!==null&&a()}};function tm(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function nm(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function rm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function im(e,t,n,r){if(e.length===0)return-1;r=rm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&rm(a.optionsOrUseCapture)===r)return i}return-1}$p.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,nm(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,nm(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},$p.prototype.focus=function(e){p(this._fragmentFiber.child,!0,am,e,void 0,void 0)};function am(e,t){return e.tag!==6&&(e=v(e),jm(e,t))}$p.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,om,t,void 0,void 0);for(var n=t.length-1;0<=n&&!am(t[n],e);n--);};function om(e,t){return t.push(e),!1}$p.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=Dp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,sm,e,void 0,void 0))};function sm(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}$p.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,cm,e,void 0,void 0)};function cm(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}$p.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,lm,e,void 0,void 0);for(var n=t=0;n<um.length;n++){var r=um[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):um[t++]=r}um.length=t}};function lm(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var um=[],dm=!1;function fm(e,t,n){um.push({fragmentInstance:e,observer:t,instance:n}),dm||(dm=!0,Mm(function(){dm=!1;var e=um;um=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}$p.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,pm,e,void 0,void 0),e};function pm(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}$p.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},$p.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,om,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||mm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function mm(e,t,n,r,i){var a=Bt(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 hm(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)}$p.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,om,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),hm(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),hm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function gm(e,t){return e=v(e),_m(e,t),!1}function _m(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function vm(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,nm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<um.length;i++){var a=um[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(um[r++]=a)}um.length=r,n.observe(e)}),_m(e,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.removeEventListener(i.type,i.attachedListener,nm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?fm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function bm(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`:bm(n),zt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function xm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Dm(e.nextSibling),e===null)break}return null}function Sm(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 Cm(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 wm(e){return e.data===`$?`||e.data===`$~`}function Tm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Em(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 km(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 Am(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 jm(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 Mm(e){Lp(function(){Lp(function(t){return e(t)})})}function Nm(e,t,n){switch(t=Dp(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 Pm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&vp(e,t,r,null,xp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Dn&&(e.onclick=null),zt(e)}function Fm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zt(e)}var Im=new Map,Lm=new Set;function Rm(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 zm=xe.d;xe.d={f:Bm,r:Vm,D:Wm,C:Gm,L:Km,m:qm,X:Ym,S:Jm,M:Xm};function Bm(){var e=zm.f(),t=ef();return e||t}function Vm(e){var t=Vt(e);t!==null&&t.tag===5&&t.type===`form`?fc(t):zm.r(e)}var Hm=typeof document>`u`?null:document;function Um(e,t,n){var r=Hm;if(r&&typeof t==`string`&&t){var i=fn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Lm.has(i)||(Lm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),bp(t,`link`,e),Wt(t),r.head.appendChild(t)))}}function Wm(e){zm.D(e),Um(`dns-prefetch`,e,null)}function Gm(e,t){zm.C(e,t),Um(`preconnect`,e,t)}function Km(e,t,n){zm.L(e,t,n);var r=Hm;if(r&&e&&t){var i=`link[rel="preload"][as="`+fn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+fn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+fn(n.imageSizes)+`"]`)):i+=`[href="`+fn(e)+`"]`;var a=i;switch(t){case`style`:a=Qm(e);break;case`script`:a=nh(e)}if(!(Im.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Im.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector($m(a))||t===`script`&&r.querySelector(rh(a))))){var o=r.createElement(`link`);bp(o,`link`,e),t===`style`&&(o[Rt]=!0,o.onload=o.onerror=function(){Gt(o)}),Wt(o),r.head.appendChild(o)}}}function qm(e,t){zm.m(e,t);var n=Hm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+fn(r)+`"][href="`+fn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=nh(e)}if(!Im.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Im.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(rh(a)))return}r=n.createElement(`link`),bp(r,`link`,e),Wt(r),n.head.appendChild(r)}}}function Jm(e,t,n){zm.S(e,t,n);var r=Hm;if(r&&e){var i=Ut(r).hoistableStyles,a=Qm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector($m(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Im.get(a))&&oh(e,n);var c=o=r.createElement(`link`);Wt(c),bp(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,ah(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ym(e,t){zm.X(e,t);var n=Hm;if(n&&e){var r=Ut(n).hoistableScripts,i=nh(e),a=r.get(i);a||(a=n.querySelector(rh(i)),a||(e=T({src:e,async:!0},t),(t=Im.get(i))&&sh(e,t),a=n.createElement(`script`),Wt(a),bp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Xm(e,t){zm.M(e,t);var n=Hm;if(n&&e){var r=Ut(n).hoistableScripts,i=nh(e),a=r.get(i);a||(a=n.querySelector(rh(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Im.get(i))&&sh(e,t),a=n.createElement(`script`),Wt(a),bp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Zm(e,t,n,r){var a=(a=Ae.current)?Rm(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=Qm(n.href),t=Ut(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=Qm(n.href);var o=Ut(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($m(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Im.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},Im.set(e,o)),th(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=nh(n),t=Ut(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 Qm(e){return`href="`+fn(e)+`"`}function $m(e){return`link[rel="stylesheet"][`+e+`]`}function eh(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function th(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Rt]){r.loading=1;return}}else t=e.createElement(`link`),t[Rt]=!0,t.onload=t.onerror=Gt.bind(null,t),bp(t,`link`,n),Wt(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 nh(e){return`[src="`+fn(e)+`"]`}function rh(e){return`script[async]`+e}function ih(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+fn(n.href)+`"]`);if(r)return t.instance=r,Wt(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`),Wt(r),bp(r,`style`,a),ah(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Qm(n.href);var o=e.querySelector($m(a));if(o)return t.state.loading|=4,t.instance=o,Wt(o),o;r=eh(n),(a=Im.get(a))&&oh(r,a),o=(e.ownerDocument||e).createElement(`link`),Wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),bp(o,`link`,r),t.state.loading|=4,ah(o,n.precedence,e),t.instance=o;case`script`:return o=nh(n.src),(a=e.querySelector(rh(o)))?(t.instance=a,Wt(a),a):(r=n,(a=Im.get(o))&&(r=T({},n),sh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Wt(a),bp(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,ah(r,n.precedence,e));return t.instance}function ah(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 oh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function sh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ch=null;function lh(e,t,n){if(ch===null){var r=new Map,i=ch=new Map;i.set(n,r)}else i=ch,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Lt]||a[At]||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 uh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function dh(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 fh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ph(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function mh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function hh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=mh(t),e.suspenseyImages.push(t)),e=xh.bind(e),t.decode().then(e,e))}function gh(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=Qm(r.href),a=t.querySelector($m(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=bh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Wt(a);return}a=t.ownerDocument||t,r=eh(r),(i=Im.get(i))&&oh(r,i),a=a.createElement(`link`),Wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),bp(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=bh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var _h=0;function vh(e,t){return e.stylesheets&&e.count===0&&Ch(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Ch(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&_h===0&&(_h=62500*wp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ch(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>_h?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function yh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ch(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function bh(){this.count--,yh(this)}function xh(){this.imgCount--,yh(this)}var Sh=null;function Ch(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Sh=new Map,t.forEach(wh,e),Sh=null,bh.call(e))}function wh(e,t){if(!(t.state.loading&4)){var n=Sh.get(e);if(n)var r=n.get(null);else{n=new Map,Sh.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=bh.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 Th={$$typeof:ae,Provider:null,Consumer:null,_currentValue:Se,_currentValue2:Se,_threadCount:0};function Eh(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=yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.hiddenUpdates=yt(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 Dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Eh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Hi(3,null,null,t),e.current=a,a.stateNode=e,t=Ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},wo(a),e}function Oh(e){return e?(e=Bi,e):Bi}function kh(e,t,n,r,i,a){i=Oh(i),r.context===null?r.context=i:r.pendingContext=i,r=Eo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Do(e,r,t),n!==null&&(Yd(n,e,t),Oo(n,e,t))}function Ah(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jh(e,t){Ah(e,t),(e=e.alternate)&&Ah(e,t)}function Mh(e){if(e.tag===13||e.tag===31){var t=Li(e,67108864);t!==null&&Yd(t,e,67108864),jh(e,67108864)}}function Nh(e){if(e.tag===13||e.tag===31){var t=Kd();t=Tt(t);var n=Li(e,t);n!==null&&Yd(n,e,t),jh(e,t)}}var Ph=!0;function Fh(e,t,n,r){var i=O.T;O.T=null;var a=xe.p;try{xe.p=2,Lh(e,t,n,r)}finally{xe.p=a,O.T=i}}function Ih(e,t,n,r){var i=O.T;O.T=null;var a=xe.p;try{xe.p=8,Lh(e,t,n,r)}finally{xe.p=a,O.T=i}}function Lh(e,t,n,r){if(Ph){var i=Rh(r);if(i===null)lp(e,t,r,zh,n),Xh(e,r);else if(Qh(i,e,t,n,r))r.stopPropagation();else if(Xh(e,r),t&4&&-1<Yh.indexOf(e)){for(;i!==null;){var a=Vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=pt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ot(o);s.entanglements[1]|=c,o&=~c}Hf(a),!(ud&6)&&(jd=Je()+500,Uf(0,!1))}}break;case 31:case 13:s=Li(a,2),s!==null&&Yd(s,a,2),ef(),jh(a,2)}if(a=Rh(r),a===null&&lp(e,t,r,zh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else lp(e,t,r,null,n)}}function Rh(e){return e=kn(e),Bh(e)}var zh=null;function Bh(e){if(zh=null,e=Bt(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 zh=e,null}function Vh(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(Ye()){case Xe:return 2;case Ze:return 8;case Qe:case $e:return 32;case et:return 268435456;default:return 32}default:return 32}}var Hh=!1,Uh=null,Wh=null,Gh=null,Kh=new Map,qh=new Map,Jh=[],Yh=`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 Xh(e,t){switch(e){case`focusin`:case`focusout`:Uh=null;break;case`dragenter`:case`dragleave`:Wh=null;break;case`mouseover`:case`mouseout`:Gh=null;break;case`pointerover`:case`pointerout`:Kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:qh.delete(t.pointerId)}}function Zh(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=Vt(t),t!==null&&Mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Qh(e,t,n,r,i){switch(t){case`focusin`:return Uh=Zh(Uh,e,t,n,r,i),!0;case`dragenter`:return Wh=Zh(Wh,e,t,n,r,i),!0;case`mouseover`:return Gh=Zh(Gh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Kh.set(a,Zh(Kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,qh.set(a,Zh(qh.get(a)||null,e,t,n,r,i)),!0}return!1}function $h(e){var t=Bt(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,Ot(e.priority,function(){Nh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ot(e.priority,function(){Nh(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 eg(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);On=r,n.target.dispatchEvent(r),On=null}else return t=Vt(n),t!==null&&Mh(t),e.blockedOn=n,!1;t.shift()}return!0}function tg(e,t,n){eg(e)&&n.delete(t)}function ng(){Hh=!1,Uh!==null&&eg(Uh)&&(Uh=null),Wh!==null&&eg(Wh)&&(Wh=null),Gh!==null&&eg(Gh)&&(Gh=null),Kh.forEach(tg),qh.forEach(tg)}function rg(e,n){e.blockedOn===n&&(e.blockedOn=null,Hh||(Hh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ng)))}var ig=null;function ag(e){ig!==e&&(ig=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ig===e&&(ig=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(Bh(r||n)===null)continue;break}var a=Vt(n);a!==null&&(e.splice(t,3),t-=3,uc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function og(e){function t(t){return rg(t,e)}Uh!==null&&rg(Uh,e),Wh!==null&&rg(Wh,e),Gh!==null&&rg(Gh,e),Kh.forEach(t),qh.forEach(t);for(var n=0;n<Jh.length;n++){var r=Jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Jh.length&&(n=Jh[0],n.blockedOn===null);)$h(n),n.blockedOn===null&&Jh.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[jt]||null;if(typeof a==`function`)o||ag(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[jt]||null)s=o.formAction;else if(Bh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),ag(n)}}}function sg(){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 cg(e){this._internalRoot=e}lg.prototype.render=cg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;kh(n,Kd(),e,t,null,null)},lg.prototype.unmount=cg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kh(e.current,2,null,e,null,null),ef(),t[Mt]=null}};function lg(e){this._internalRoot=e}lg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jh.length&&t!==0&&t<Jh[n].priority;n++);Jh.splice(n,0,e),n===0&&$h(e)}};var ug=n.version;if(ug!==`19.3.0`)throw Error(i(527,ug,`19.3.0`));xe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var dg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var fg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fg.isDisabled&&fg.supportsFiber)try{rt=fg.inject(dg),it=fg}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=Dh(e,1,!1,null,null,n,r,null,o,s,c,sg),e[Mt]=t.current,sp(e),new cg(t)}})),yi=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=vi()}))(),bi=`neko.appearance`,xi=[`sakura`,`light`,`dark`],Si=[`sans`,`serif`,`mono`],Ci=[`13`,`14`,`16`,`18`],wi=[`regular`,`medium`,`semibold`],Ti=[`compact`,`normal`,`relaxed`],Ei={theme:`sakura`,font:`sans`,size:`14`,weight:`regular`,leading:`normal`},Di={theme:`data-theme`,font:`data-chat-font`,size:`data-chat-size`,weight:`data-chat-weight`,leading:`data-chat-leading`},Oi={theme:xi,font:Si,size:Ci,weight:wi,leading:Ti},ki=Object.keys(Oi);function Ai(e,t){return Oi[e].includes(t)?t:Ei[e]}function ji(e){let t;try{t=e?JSON.parse(e):void 0}catch{t=void 0}let n=typeof t==`object`&&t?t:{};return{theme:Ai(`theme`,n.theme),font:Ai(`font`,n.font),size:Ai(`size`,n.size),weight:Ai(`weight`,n.weight),leading:Ai(`leading`,n.leading)}}function Mi(e){return JSON.stringify({v:1,...e})}function Ni(e){return ki.every(t=>e[t]===Ei[t])}function Pi(e=localStorage){try{return ji(e.getItem(bi))}catch{return Ei}}function Fi(e,t=localStorage){try{Ni(e)?t.removeItem(bi):t.setItem(bi,Mi(e))}catch{}}function Ii(e,t=document){let n=t.documentElement;for(let t of ki)e[t]===Ei[t]?n.removeAttribute(Di[t]):n.setAttribute(Di[t],e[t]);t.querySelector(`meta[name="color-scheme"]`)?.setAttribute(`content`,e.theme===`dark`?`dark`:`light`)}function Li(e={}){let t=e.storage??localStorage,n=e.doc??document,r=e.target??window,i=Pi(t),a=new Set;function o(e){if(!ki.every(t=>e[t]===i[t])){i=e,Ii(i,n);for(let e of a)e()}}let s=e=>{let n=e.key;(n===null||n===`neko.appearance`)&&o(Pi(t))};return{get:()=>i,set(e){let n=ji(Mi({...i,...e}));Fi(n,t),o(n)},reset(){Fi(Ei,t),o(Ei)},start(){i=Pi(t),Ii(i,n),r.addEventListener(`storage`,s)},stop(){r.removeEventListener(`storage`,s)},subscribe(e){return a.add(e),()=>a.delete(e)}}}var Ri;function zi(){return Ri??=Li(),Ri}function Bi(e=zi()){return(0,f.useSyncExternalStore)(e.subscribe,e.get,()=>Ei)}var Vi=`0.5.3`;function Hi(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 Ui(e,t){if(!Hi(e)||!Hi(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 Wi(e){let{gateway:t,frontend:n,installed:r,web:i}=e;if(t&&t.protocolVersion!==10)return`incompatible`;if(t&&(Ui(t.installedVersion,t.runningVersion)||Ui(r,t.runningVersion)||Ui(n,t.runningVersion))||i&&(Ui(i.installedVersion,i.runningVersion)||Ui(t?.runningVersion,i.runningVersion)||Ui(n,i.runningVersion)))return`restart-service`;if(i){if(Ui(i.runningVersion,n))return`refresh-page`}else if(Ui(r,n)||Ui(t?.runningVersion,n))return`restart-tui`;return t?.checkState===`ok`&&Ui(t.latestVersion,r)?`install`:`none`}var Gi=class extends Error{constructor(){super(`Application protocol incompatible. Update neko, then restart its TUI/Web or serve.`),this.name=`ApplicationProtocolError`}};function Ki(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function qi(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}async function Ji(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:Ki(e.bytes.subarray(r,r+262144))});return await t.finish(n),n}catch(e){throw await t.release(n).catch(()=>{}),e}}async function Yi(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=qi(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 Xi(e){let t=/^\/compact(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}var Zi=(e,t=`New session`)=>e.title||e.firstPromptPreview||t,Qi=e=>e.lastMessageAt??e.createdAt,$i=(e,t)=>Qi(t)-Qi(e)||Number(t.id)-Number(e.id),ea=(e,t)=>t.lastUsedAt-e.lastUsedAt||Number(t.id)-Number(e.id),ta=(e,t)=>`${e.title} ${e.firstPromptPreview} ${e.id}`.toLocaleLowerCase().includes(t.trim().toLocaleLowerCase());function na(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]}`}var ra={assign:0,create:0,clone:0,discard:0,update:0};function ia(e,t,n){return e>=t&&e<=n}function aa(e){return e===8205}function oa(e){return ia(e,55296,56319)}function sa(e){return ia(e,127462,127487)}function ca(e){return ia(e,65024,65039)}function la(e){return ia(e,768,879)||ia(e,6832,6911)||ia(e,7616,7679)||ia(e,65056,65071)}function ua(e){return e>65535?2:1}function da(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(la(n)||ca(n))t+=ua(n);else break}return t}function fa(e,t){let n=e.codePointAt(t),r=t+ua(n);for(r=da(e,r);r<e.length-1&&aa(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+ua(t),r=da(e,r)}return sa(n)&&r<e.length&&sa(e.codePointAt(r))&&(r+=ua(e.codePointAt(r))),r}function pa(e){return e>=768&&(oa(e)||la(e)||ca(e)||aa(e))}function ma(e){let t=0,n=0;for(;n<e.length;)n=fa(e,n),t++;return t}function ha(e,t){let n=0,r=0;for(;r<e.length;)if(r=fa(e,r),++n>=t)return!0;return!1}function ga(e,t){let n=0,r=0;for(;r<e.length;)if(r=fa(e,r),++n>t)return!1;return!0}function _a(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(pa(e.charCodeAt(n)))return ha(e,t);if(++n>=t)return!0}}function va(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(pa(e.charCodeAt(n)))return ga(e,t);if(++n>t)return!1}}var ya=s({Counted:()=>qa,Entries:()=>Za,EntriesRegExp:()=>Xa,Every:()=>Ua,EveryAll:()=>Wa,GraphemeCount:()=>Ba,HasPropertyKey:()=>j,IsArray:()=>ba,IsBigInt:()=>xa,IsBoolean:()=>Sa,IsClassInstance:()=>Ra,IsConstructor:()=>Ca,IsDeepEqual:()=>ro,IsEqual:()=>A,IsFunction:()=>wa,IsGreaterEqualThan:()=>Ia,IsGreaterThan:()=>Na,IsInteger:()=>Ta,IsLessEqualThan:()=>Fa,IsLessThan:()=>Pa,IsMaxLength:()=>Va,IsMinLength:()=>Ha,IsMultipleOf:()=>La,IsNull:()=>Ea,IsNumber:()=>Da,IsObject:()=>ka,IsObjectNotArray:()=>Oa,IsString:()=>Aa,IsSymbol:()=>ja,IsUndefined:()=>Ma,IsUnsafePropertyKey:()=>Ya,IsValueLike:()=>za,Keys:()=>Qa,ShiftLeft:()=>Ja,Some:()=>Ga,SomeAll:()=>Ka,Symbols:()=>$a,Values:()=>eo});function ba(e){return Array.isArray(e)}function xa(e){return A(typeof e,`bigint`)}function Sa(e){return A(typeof e,`boolean`)}function Ca(e){if(Ma(e)||!wa(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function wa(e){return A(typeof e,`function`)}function Ta(e){return Number.isInteger(e)}function Ea(e){return A(e,null)}function Da(e){return Number.isFinite(e)}function Oa(e){return ka(e)&&!ba(e)}function ka(e){return A(typeof e,`object`)&&!Ea(e)}function Aa(e){return A(typeof e,`string`)}function ja(e){return A(typeof e,`symbol`)}function Ma(e){return A(e,void 0)}function A(e,t){return e===t}function Na(e,t){return e>t}function Pa(e,t){return e<t}function Fa(e,t){return e<=t}function Ia(e,t){return e>=t}function La(e,t){if(xa(e)||xa(t))return BigInt(e)%BigInt(t)===0n;if(!Da(e)||Ta(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function Ra(e){if(!ka(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Ea(t)&&A(typeof t.constructor,`function`)&&!(A(t.constructor,globalThis.Object)||A(t.constructor.name,`Object`))}function za(e){return xa(e)||Sa(e)||Ea(e)||Da(e)||Aa(e)||Ma(e)}function Ba(e){return ma(e)}function Va(e,t){return va(e,t)}function Ha(e,t){return _a(e,t)}function Ua(e,t,n){return e.every((e,r)=>r<t||n(e,r))}function Wa(e,t,n){let r=!0;return e.forEach((e,i)=>{i>=t&&!n(e,i)&&(r=!1)}),r}function Ga(e,t){return e.some((e,n)=>t(e,n))}function Ka(e,t){let n=!1;return e.forEach((e,r)=>{t(e,r)&&(n=!0)}),n}function qa(e,t){return e.reduce((e,n,r)=>t(n,r)?++e:e,0)}function Ja(e,t,n){return A(e.length,0)?n():t(e[0],e.slice(1))}function Ya(e){return A(e,`__proto__`)||A(e,`constructor`)||A(e,`prototype`)}function j(e,t){return Ya(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Xa(e){return Qa(e).map(t=>[RegExp(`^${t}$`),e[t]])}function Za(e){return Object.entries(e)}function Qa(e){return Object.getOwnPropertyNames(e)}function $a(e){return Object.getOwnPropertySymbols(e)}function eo(e){return Object.values(e)}function to(e,t){if(!ka(t))return!1;let n=Qa(e);return A(n.length,Qa(t).length)&&n.every(n=>ro(e[n],t[n]))}function no(e,t){return ba(t)&&A(e.length,t.length)&&e.every((n,r)=>ro(e[r],t[r]))}function ro(e,t){return ba(e)?no(e,t):ka(e)?to(e,t):A(e,t)}function io(e){return e instanceof Boolean}function ao(e){return e instanceof Number}function oo(e){return e instanceof String}function so(e){return globalThis.ArrayBuffer.isView(e)}function co(e){return e instanceof globalThis.RegExp}function lo(e){return e instanceof globalThis.Date}function uo(e){return e instanceof globalThis.Set}function fo(e){return e instanceof globalThis.Map}var po=ya,mo={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function ho(){return mo}function go(e){return ho().immutableTypes?Object.freeze(e):e}function _o(e,t){return ra.assign+=1,go({...e,...t})}function vo(e){return e}function yo(e){return j(e,`~kind`)||j(e,`~unsafe`)}function bo(e){let t={};for(let n of Qa(e)){if(Ya(n))continue;let r=Object.getOwnPropertyDescriptor(e,n);r.value=Oo(r.value),A(r.enumerable,!0)?t[n]=r.value:Object.defineProperty(t,n,r)}return t}function xo(e){let t={};for(let n of Qa(e))Ya(n)||(t[n]=Oo(e[n]));for(let n of $a(e))t[n]=Oo(e[n]);return t}function So(e){return Ra(e)?vo(e):yo(e)?bo(e):xo(e)}function Co(e){return e.map(e=>Oo(e))}function wo(e){return e.slice()}function To(e){return new RegExp(e.source,e.flags)}function Eo(e){return new Map(Oo([...e.entries()]))}function Do(e){return new Set(Oo([...e.values()]))}function Oo(e){return so(e)?wo(e):co(e)?To(e):fo(e)?Eo(e):uo(e)?Do(e):ba(e)?Co(e):ka(e)?So(e):e}function ko(e){return ra.clone+=1,Oo(e)}function Ao(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function jo(e,t){return{...e,...t}}function Mo(e,t,n={}){ra.create+=1;let r=jo(t,n);return go(ho().enumerableKind?jo(r,e):Ao(r,e))}function No(e,t){ra.discard+=1;let n={};for(let r of Qa(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=ko(i.value),Object.defineProperty(n,r,i)}return go(n)}function Po(e,t,n){ra.update+=1;let r=ho(),i=ko(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return go(i)}function Fo(e,t){return ka(e)&&j(e,`~kind`)&&A(e[`~kind`],t)}function Io(e){return ka(e)}function Lo(e,t,n){return Mo({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function Ro(e){return Fo(e,`Deferred`)}function zo(e){return Po(e,{"~readonly":!0},{})}function Bo(e,t){return Po(zo(e),{},t)}function Vo(e,t,n,r){return Bo(rv(e,t,n),r)}function Ho(e){return Po(e,{"~optional":!0},{})}function Uo(e,t){return Po(Ho(e),{},t)}function Wo(e,t,n,r){return Uo(rv(e,t,n),r)}function Go(e,t){return Mo({"~kind":`Array`},{type:`array`,items:e},t)}function Ko(e){return Fo(e,`Array`)}function qo(e){return No(e,[`~kind`,`type`,`items`])}function Jo(e,t,n={}){return Mo({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function Yo(e){return Fo(e,`Constructor`)}function Xo(e){return No(e,[`~kind`,`type`,`parameters`,`instanceType`])}function Zo(e,t,n={}){return Mo({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function Qo(e){return Fo(e,`Function`)}function $o(e){return No(e,[`~kind`,`type`,`parameters`,`returnType`])}function es(e,t){return Mo({"~kind":`Ref`},{$ref:e},t)}function ts(e){return Fo(e,`Ref`)}function ns(e,t){return Mo({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function rs(e){return Fo(e,`Generic`)}function is(e){return Mo({"~kind":`Any`},{},e)}function as(e){return Fo(e,`Any`)}var os=`(?!)`;function ss(e){return Mo({"~kind":`Never`},{not:{}},e)}function cs(e){return Fo(e,`Never`)}function ls(e,t={}){return Uo(e,t)}function M(e){return ls(e)}function us(e){return Io(e)&&j(e,`~optional`)}function ds(e){return Qa(e).filter(t=>!us(e[t]))}function fs(e){return Qa(e)}function ps(e){return eo(e)}function N(e,t={}){let n=ds(e);return Mo({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function ms(e){return Fo(e,`Object`)}function hs(e){return No(e,[`~kind`,`type`,`properties`,`required`])}function gs(e){return Mo({"~kind":`Unknown`},{},e)}function _s(e){return Fo(e,`Unknown`)}function vs(e,t,n){return Mo({"~kind":`Cyclic`},{$defs:Qa(e).reduce((t,n)=>({...t,[n]:Po(e[n],{},{$id:n})}),{}),$ref:t},n)}function ys(e){return Fo(e,`Cyclic`)}function bs(e){return Po(e,{"~unsafe":null},{})}function xs(e){return Oa(e)&&j(e,`~unsafe`)&&Ea(e[`~unsafe`])}function Ss(e,t){return t[e.length]?.(...e)??(()=>{throw Error(`Invalid Arguments`)})()}function Cs(e){return Fo(e,`Infer`)}function ws(e,t,n,r={}){return Mo({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function Ts(e){return Fo(e,`Dependent`)}function Es(e){return No(e,[`~kind`,`if`,`then`,`else`])}function Ds(e){return Oa(e)}function Os(e){return Qa(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function ks(e,t){return Mo({"~kind":`Enum`},{enum:Ds(e)?Os(e):e},t)}function As(e){return Fo(e,`Enum`)}function js(e,t={}){return Mo({"~kind":`Intersect`},{allOf:e},t)}function Ms(e){return Fo(e,`Intersect`)}function Ns(e){return No(e,[`~kind`,`allOf`])}function Ps(){throw Error(`Unreachable`)}function Fs(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Is(e){return typeof e==`number`}var Ls;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Ls||={});var Rs=BigInt(`14695981039346656037`),[zs,Bs]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Vs=Array.from({length:256}).map((e,t)=>BigInt(t)),Hs=new Float64Array(1),Us=new DataView(Hs.buffer),Ws=new Uint8Array(Hs.buffer);function Gs(e){Rs^=Vs[e],Rs=Rs*zs%Bs}function Ks(e){Gs(Ls.Array);for(let t of e)sc(t)}function qs(e){Gs(Ls.BigInt),Us.setBigInt64(0,e);for(let e of Ws)Gs(e)}function Js(e){Gs(Ls.Boolean),Gs(+!!e)}function Ys(e){Gs(Ls.Constructor),sc(e.toString())}function Xs(e){Gs(Ls.Date),sc(e.getTime())}function Zs(e){Gs(Ls.Function),sc(e.toString())}function Qs(e){Gs(Ls.Null)}function $s(e){Gs(Ls.Number),Us.setFloat64(0,e,!0);for(let e of Ws)Gs(e)}function ec(e){Gs(Ls.Object);for(let t of Fs(e).sort())sc(t),sc(e[t])}function tc(e){Gs(Ls.RegExp),rc(e.toString())}var nc=new TextEncoder;function rc(e){Gs(Ls.String);for(let t of nc.encode(e))Gs(t)}function ic(e){Gs(Ls.Symbol),sc(e.toString())}function ac(e){Gs(Ls.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)Gs(t[e])}function oc(e){return Gs(Ls.Undefined)}function sc(e){return so(e)?ac(e):lo(e)?Xs(e):co(e)?tc(e):io(e)?Js(e.valueOf()):oo(e)?rc(e.valueOf()):ao(e)?$s(e.valueOf()):Is(e)?$s(e):ba(e)?Ks(e):Sa(e)?Js(e):xa(e)?qs(e):Ca(e)?Ys(e):Ea(e)?Qs(e):ka(e)?ec(e):Aa(e)?rc(e):ja(e)?ic(e):Ma(e)?oc(e):wa(e)?Zs(e):Ps()}function cc(e){return Rs=BigInt(`14695981039346656037`),sc(e),Rs}function lc(e){return cc(e).toString(16).padStart(16,`0`)}function uc(e){switch(e.keyword){case`additionalProperties`:return`must not have additional properties`;case`anyOf`:return`must match a schema in anyOf`;case`boolean`:return`schema is false`;case`const`:return`must be equal to constant`;case`contains`:return`must contain at least 1 valid item`;case`dependencies`:return`must have properties ${e.params.dependencies.join(`, `)} when property ${e.params.property} is present`;case`dependentRequired`:return`must have properties ${e.params.dependencies.join(`, `)} when property ${e.params.property} is present`;case`enum`:return`must be equal to one of the allowed values`;case`exclusiveMaximum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`exclusiveMinimum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`format`:return`must match format "${e.params.format}"`;case`if`:return`must match "${e.params.failingKeyword}" schema`;case`maxItems`:return`must not have more than ${e.params.limit} items`;case`maxLength`:return`must not have more than ${e.params.limit} characters`;case`maxProperties`:return`must not have more than ${e.params.limit} properties`;case`maximum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`minItems`:return`must not have fewer than ${e.params.limit} items`;case`minLength`:return`must not have fewer than ${e.params.limit} characters`;case`minProperties`:return`must not have fewer than ${e.params.limit} properties`;case`minimum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`multipleOf`:return`must be multiple of ${e.params.multipleOf}`;case`not`:return`must not be valid`;case`oneOf`:return`must match exactly one schema in oneOf`;case`pattern`:return`must match pattern "${e.params.pattern}"`;case`propertyNames`:return`property names ${e.params.propertyNames.join(`, `)} are invalid`;case`required`:return`must have required properties ${e.params.requiredProperties.join(`, `)}`;case`type`:return typeof e.params.type==`string`?`must be ${e.params.type}`:`must be either ${e.params.type.join(` or `)}`;case`unevaluatedItems`:return`must not have unevaluated items`;case`unevaluatedProperties`:return`must not have unevaluated properties`;case`uniqueItems`:return`must not have duplicate items`;case`~refine`:return e.params.message;default:return`an unknown validation error occurred`}}var dc=uc;function fc(){return dc}function pc(e){return cv(e)}function mc(e){return Io(e)&&j(e,`~immutable`)}function hc(e,t={}){return Bo(e,t)}function gc(e){return Io(e)&&j(e,`~readonly`)}var _c=`-?(?:0|[1-9][0-9]*)n`;function vc(e){return Mo({"~kind":`BigInt`},{type:`bigint`},e)}function yc(e){return Fo(e,`BigInt`)}function bc(e){return Mo({"~kind":`Boolean`},{type:`boolean`},e)}function xc(e){return Fo(e,`Boolean`)}var Sc=`-?(?:0|[1-9][0-9]*)`;function Cc(e){return Mo({"~kind":`Integer`},{type:`integer`},e)}function wc(e){return Fo(e,`Integer`)}var Tc=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function Ec(e){return xa(e)?`bigint`:Sa(e)?`boolean`:Da(e)?`number`:Aa(e)?`string`:(()=>{throw new Tc(e)})()}function P(e,t){return Mo({"~kind":`Literal`},{type:Ec(e),const:e},t)}function Dc(e){return xa(e)||Sa(e)||Da(e)||Aa(e)}function Oc(e){return Ac(e)&&Da(e.const)}function kc(e){return Ac(e)&&Aa(e.const)}function Ac(e){return Fo(e,`Literal`)}function jc(e){return Mo({"~kind":`Null`},{type:`null`},e)}function Mc(e){return Fo(e,`Null`)}var Nc=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Pc(e){return Mo({"~kind":`Number`},{type:`number`},e)}function Fc(e){return Fo(e,`Number`)}function Ic(e){return Mo({"~kind":`Symbol`},{type:`symbol`},e)}function Lc(e){return Fo(e,`Symbol`)}function Rc(e){return Mo({"~kind":`String`},{type:`string`},e)}function zc(e){return Fo(e,`String`)}function F(e,t={}){return Mo({"~kind":`Union`},{anyOf:e},t)}function Bc(e){return Fo(e,`Union`)}function Vc(e){return No(e,[`~kind`,`anyOf`])}function Hc(e){let t=vd(e);return A(t.length,2)?t[0]:[]}function Uc(e){return!0}function Wc(e){return Ja(e,(e,t)=>Kc(e)?Wc(t):!1,()=>!0)}function Gc(e){return!A(e.length,0)&&Wc(e)}function Kc(e){return Bc(e)?Gc(e.anyOf):Ac(e)?Uc(e.const):!1}function qc(e){return Gc(e)}function Jc(e){return Mo({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Yc(e,t,n=[]){return Ja(e,(e,r)=>Yc(r,t,[...n,`${e}${t}`]),()=>n)}function Xc(e,t){return A(e.length,0)?[`${t}`]:Yc(e,t)}function Zc(e,t,n=[]){return Ja(t,(t,r)=>Zc(e,r,[...n,...Qc(e,t)]),()=>n)}function Qc(e,t){return Bc(t)?Zc(e,t.anyOf):Ac(t)?Xc(e,t.const):Ps()}function $c(e,t){return Ja(t,(t,n)=>$c(Qc(e,t),n),()=>e)}function el(e){return e.map(e=>P(e))}function tl(e){return F(el($c([],e)))}function nl(e){return A(e.length,0)?Ps():A(e.length,1)&&Ac(e[0])?e[0]:tl(e)}function rl(e){let t=Hc(e);return A(t.length,0)?Rc():qc(t)?nl(t):Jc(e)}function il(e){let t=rl(e);return zd(t)?Rc():t}function al(e,t){return Mo({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function ol(e){return al(fu,e)}function sl(e){return N({true:e,false:e})}function cl(e,t={}){let[n,r,i]=[e,e.length,!1];return Mo({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function ll(e){return Fo(e,`Tuple`)}function ul(e){return No(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function dl(e){return No(e,[`~readonly`])}function fl(e,t){return Po(dl(e),{},t)}function pl(e,t,n,r){return fl(rv(e,t,n),r)}function ml(e,t={}){return fl(e,t)}function hl(e){return No(e,[`~optional`])}function gl(e,t){return Po(hl(e),{},t)}function _l(e,t,n,r){return gl(rv(e,t,n),r)}function vl(e,t={}){return gl(e,t)}function yl(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function bl(e){return N(yl(e.items))}function xl(e){return ms(e)||ll(e)}function Sl(e,t){return gc(e)?!!gc(t):!1}function Cl(e,t){return us(e)?!!us(t):!1}function wl(e,t){let n=Sl(e,t),r=Cl(e,t),i=ml(vl(Hl([e,t])));return n&&r?hc(ls(i)):n&&!r?hc(i):!n&&r?ls(i):i}function Tl(e,t,n){return n in e?n in t?wl(e[n],t[n]):e[n]:n in t?t[n]:ss()}function El(e,t){return[...new Set([...Qa(e),...Qa(t)])].reduce((n,r)=>({...n,[r]:Tl(e,t,r)}),{})}function Dl(e){return ms(e)?e.properties:ll(e)?yl(e.items):{}}function Ol(e,t){return N(El(Dl(e),Dl(t)))}function kl(e,t){let n=Wp(e,t);return A(n,2)?e:A(n,3)||A(n,0)?t:ss()}function Al(e,t){let n=xl(e),r=xl(t);return n&&r?Ol(e,t):n&&!r?e:!n&&r?t:kl(e,t)}function jl(e,t){return cs(e)||as(e)?e:_s(e)||cs(t)||as(t)?t:_s(t)?e:Al(e,t)}function Ml(e,t){return Bc(e)||Bc(t)}function Nl(e,t){let n=Gl(e),r=Gl(t);return Ml(n,r)?Hl([n,r]):jl(n,r)}function Pl(e,t,n=[]){return Ja(t,(t,r)=>Pl(e,r,[...n,Nl(t,e)]),()=>A(n.length,0)?[e]:n)}function Fl(e,t,n=[]){return Ja(e,(e,r)=>Fl(r,t,[...n,...Il([e],t)]),()=>n)}function Il(e,t=[]){return Ja(e,(e,n)=>Bc(e)?Il(n,Fl(e.anyOf,t)):Il(n,Pl(e,t)),()=>t)}function Ll(e,t){return Kd(Up({},e,t))?[]:[e]}function Rl(e,t,n=[]){return Ja(e,(e,r)=>Rl(r,t,[...n,...Ll(e,t)]),()=>n)}function zl(e,t){let n=Gl(e);return Wl(Rl(Bc(n)?n.anyOf:[n],t))}function Bl(e,t,n){return Wl([Hl([e,t]),zl(n,e)])}function Vl(e,t=[]){return Ja(e,(e,n)=>Vl(n,[...t,P(e)]),()=>Wl(t))}function Hl(e){return Wl(Jp(Il(e)))}function Ul(e){return Gl(il(e))}function Wl(e){return Kl(Jp(e))}function Gl(e){return Ts(e)?Bl(e.if,e.then,e.else):As(e)?Vl(e.enum):Ms(e)?Hl(e.allOf):zd(e)?Ul(e.pattern):Bc(e)?Wl(e.anyOf):e}function Kl(e){return A(e.length,1)?e[0]:A(e.length,0)?ss():F(e)}function ql(e,t){return su(Vl(e),t)}function Jl(e,t){return al(uu,t)}function Yl(e,t){return su(Hl(e),t)}function Xl(e,t){return Aa(e)||Da(e)?N({[e]:t}):A(e,!1)?N({false:t}):A(e,!0)?N({true:t}):N({})}function Zl(e,t){return al(du,t)}function Ql(e,t){return j(e,`pattern`)&&(Aa(e.pattern)||e.pattern instanceof RegExp)?al(e.pattern.toString(),t):al(fu,t)}function $l(e,t){return qc(Hc(e))?su(Ul(e),t):al(e,t)}function eu(e){return Bc(e)?tu(e.anyOf):[e]}function tu(e,t=[]){return Ja(e,(e,n)=>tu(n,[...t,...eu(e)]),()=>t)}function nu(e){return e.some(e=>zc(e)||Fc(e)||wc(e))}function ru(e,t){return A(nu(e),!0)?al(fu,t):void 0}function iu(e,t){return e.reduce((e,n)=>Ac(n)&&(Aa(n.const)||Da(n.const))?{...e,[n.const]:t}:e,{})}function au(e,t){return N(iu(e,t))}function ou(e,t){let n=tu(e),r=ru(n,t);return Io(r)?r:au(n,t)}function su(e,t){return as(e)?ol(t):xc(e)?sl(t):As(e)?ql(e.enum,t):wc(e)?Jl(e,t):Ms(e)?Yl(e.allOf,t):Ac(e)?Xl(e.const,t):Fc(e)?Zl(e,t):Bc(e)?ou(e.anyOf,t):zc(e)?Ql(e,t):zd(e)?$l(e.pattern,t):N({})}function cu(e,t,n){return X_([e])?Po(su(e,t),{},n):pu(e,t,n)}function lu(e,t,n,r,i){return cu(rv(e,t,n),rv(e,t,r),i)}var uu=`^${Sc}$`,du=`^${Nc}$`,fu=`^.*$`;function pu(e,t,n={}){return Lo(`Record`,[e,t],n)}function mu(e,t,n={}){return cu(e,t,n)}function hu(e,t){return al(e,t)}function gu(e){return A(e,fu)?Rc():A(e,uu)?Cc():A(e,du)?Pc():rl(e)}function _u(e){return Qa(e.patternProperties)[0]}function vu(e){return gu(_u(e))}function yu(e){return e.patternProperties[_u(e)]}function bu(e){return Fo(e,`Record`)}function xu(e){return Mo({"~kind":`Rest`},{type:`rest`,items:e},{})}function Su(e){return Fo(e,`Rest`)}function Cu(e){return Fo(e,`This`)}function wu(e){return Mo({"~kind":`Undefined`},{type:`undefined`},e)}function Tu(e){return Fo(e,`Undefined`)}function Eu(e){return Fo(e,`Void`)}function Du(e){return vc()}function Ou(e){return Rc()}function ku(e){return Pc()}function Au(e){return Cc()}function ju(e){return ss()}function Mu(e){return P(e)}function Nu(e){return e}function Pu(e){return F(e[1])}function Fu(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Iu(e){return[e[0],...e[1]]}function Lu(e){return e}function Ru(e){return e[1]}function zu(e){return A(e.length,2)}function Bu(e,t,n){return zu(e)?t(e[0],e[1]):n()}function Vu(e,t){return A(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Hu(e,t){for(let n=0;n<e.length;n++){let r=Vu(e[n],t);if(zu(r))return r}return[]}function Uu(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Wu=[...Uu(97,122),...Uu(65,90)],Gu=[`0`,...Uu(49,57)],Ku=`//`,qu=`/*`,Ju=`*/`;function Yu(e){let t=e.indexOf(Ju);return A(t,-1)?``:e.slice(t+2)}function Xu(e){let t=e.indexOf(`
|
|
11
|
+
`);return A(t,-1)?``:e.slice(t)}function Zu(e){return e.replace(/^[ \t\r\f\v]+/,``)}function Qu(e){let t=Zu(e);return t.startsWith(qu)?Qu(Yu(t.slice(2))):t.startsWith(Ku)?Qu(Xu(t.slice(2))):t}function $u(e){let t=e.trimStart();return t.startsWith(qu)?$u(Yu(t.slice(2))):t.startsWith(Ku)?$u(Xu(t.slice(2))):t}[...Gu];function ed(e,t){return Hu([e],t)}function td(e,t){return A(e,``)?[``,t]:e.startsWith(`
|
|
12
|
+
`)?ed(e,Qu(t)):e.startsWith(` `)?ed(e,t):ed(e,$u(t))}[...Wu,...Gu],[...Gu];function nd(e){return A(e,``)?[]:[e.slice(0,1),e.slice(1)]}function rd(e,t){return Ja(e,(e,n)=>t.startsWith(e)?!0:rd(n,t),()=>!1)}function id(e,t,n=``){return Bu(nd(t),(r,i)=>rd(e,t)?[n,t]:id(e,i,`${n}${r}`),()=>[])}function ad(e,t){return Bu(id(e,t),(e,t)=>A(e,``)?[]:[e,t],()=>[])}var od=(e,t,n=()=>[])=>e.length===2?t(e):n(),sd=e=>od(td(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[Du(e),t]),cd=e=>od(td(`.*`,e),([e,t])=>[Ou(e),t]),ld=e=>od(td(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[ku(e),t]),ud=e=>od(td(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[Au(e),t]),dd=e=>od(td(`(?!)`,e),([e,t])=>[ju(e),t]),fd=e=>od(ad([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[Mu(e),t]),pd=e=>od(od(sd(e),([e,t])=>[e,t],()=>od(cd(e),([e,t])=>[e,t],()=>od(ld(e),([e,t])=>[e,t],()=>od(ud(e),([e,t])=>[e,t],()=>od(dd(e),([e,t])=>[e,t],()=>od(md(e),([e,t])=>[e,t],()=>od(fd(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[Nu(e),t]),md=e=>od(od(td(`(`,e),([e,t])=>od(_d(t),([t,n])=>od(td(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Pu(e),t]),hd=e=>od(od(od(gd(e),([e,t])=>od(td(`|`,t),([t,n])=>od(hd(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>od(od(gd(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>od([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[Fu(e),t]),gd=e=>od(od(pd(e),([e,t])=>od(_d(t),([t,n])=>[[e,t],n])),([e,t])=>[Iu(e),t]),_d=e=>od(od(hd(e),([e,t])=>[e,t],()=>od(gd(e),([e,t])=>[e,t],()=>[])),([e,t])=>[Lu(e),t]),vd=e=>od(od(td(`^`,e),([e,t])=>od(_d(t),([t,n])=>od(td(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Ru(e),t]);function yd(e){return e.join(`|`)}function bd(e){return e.slice(1,e.length-1)}function xd(e,t,n){return Md(t,`${n}${e}`)}function Sd(e,t){return Md(e,`${t}${_c}`)}function Cd(e,t){return Md(e,`${t}${Sc}`)}function wd(e,t){return Md(e,`${t}${Nc}`)}function Td(e,t){return jd(F([P(`false`),P(`true`)]),e,t)}function Ed(e,t){return Md(e,`${t}.*`)}function Dd(e,t,n){return Md(t,`${n}${bd(e)}`)}function Od(e,t,n){return jd(Fd(e,{}),t,n)}function kd(e,t,n){return jd(Vl(e),t,n)}function Ad(e,t,n,r=[]){return Ja(e,(e,i)=>Ad(i,t,n,[...r,jd(e,[],``)]),()=>Md(t,`${n}(${yd(r)})`))}function jd(e,t,n){return As(e)?kd(e.enum,t,n):wc(e)?Cd(t,n):Ac(e)?xd(e.const,t,n):yc(e)?Sd(t,n):xc(e)?Td(t,n):Fc(e)?wd(t,n):zc(e)?Ed(t,n):zd(e)?Dd(e.pattern,t,n):Rd(e)?Od(e.parameters[0],t,n):Bc(e)?Ad(e.anyOf,t,n):os}function Md(e,t){return Ja(e,(e,n)=>jd(e,n,t),()=>t)}function Nd(e){return`^${Md(e,``)}$`}function Pd(e){return Jc(Nd(e))}function Fd(e,t){return X_(e)?Po(Pd(e),{},t):Ld(e,t)}function Id(e,t,n,r){return Fd($_(e,t,n),r)}function Ld(e,t={}){return Lo(`TemplateLiteral`,[e],t)}function Rd(e){return Io(e)&&j(e,`action`)&&A(e.action,`TemplateLiteral`)}function zd(e){return Fo(e,`TemplateLiteral`)}function Bd(e){return Mo({"~kind":`ExtendsUnion`},{inferred:e})}function Vd(e){return ka(e)&&j(e,`~kind`)&&j(e,`inferred`)&&A(e[`~kind`],`ExtendsUnion`)&&ka(e.inferred)}function Hd(e){return Mo({"~kind":`ExtendsTrue`},{inferred:e})}function Ud(e){return ka(e)&&j(e,`~kind`)&&j(e,`inferred`)&&A(e[`~kind`],`ExtendsTrue`)&&ka(e.inferred)}function Wd(){return Mo({"~kind":`ExtendsFalse`},{})}function Gd(e){return ka(e)&&j(e,`~kind`)&&A(e[`~kind`],`ExtendsFalse`)}function Kd(e){return Vd(e)||Ud(e)}function qd(e,t,n){return Kd(e)?t(e.inferred):n()}function Jd(e,t,n,r){return qd(pp(e,n,r),r=>Hd(_o(_o(e,r),{[t]:n})),()=>Wd())}function Yd(e,t){return Hd(e)}function Xd(e,t,n,r,i){return qd(pp(e,t,n),e=>qd(pp(e,t,r),e=>Hd(e),()=>Wd()),()=>qd(pp(e,t,i),e=>Hd(e),()=>Wd()))}function Zd(e,t,n){return pp(e,t,Vl(n))}function Qd(e,t,n){return Ja(n,(n,r)=>qd(pp(e,t,n),e=>Qd(e,t,r),()=>Wd()),()=>Hd(e))}function $d(e,t,n){return pp(e,t,Ul(n))}function ef(e,t,n){return Ja(n,(n,r)=>qd(pp(e,t,n),e=>Hd(e),()=>ef(e,t,r)),()=>Wd())}function tf(e,t,n){return as(n)?Yd(e,t):Ts(n)?Xd(e,t,n.if,n.then,n.else):As(n)?Zd(e,t,n.enum):Cs(n)?Jd(e,n.name,t,n.extends):Ms(n)?Qd(e,t,n.allOf):zd(n)?$d(e,t,n.pattern):Bc(n)?ef(e,t,n.anyOf):_s(n)?Hd(e):Wd()}function nf(e,t,n){return Cs(n)?tf(e,t,n):as(n)||_s(n)?Hd(e):Bd(e)}function rf(e,t){let n=mc(e),r=mc(t);return n&&r||!n&&r?!0:!(n&&!r)}function af(e,t,n,r){return Ko(r)?rf(t,r)?pp(e,n,r.items):Wd():tf(e,t,r)}function of(e,t,n){return yc(n)?Hd(e):tf(e,t,n)}function sf(e,t,n){return xc(n)?Hd(e):tf(e,t,n)}function cf(e,t,n,r,i){let a=Cs(r)?t:r,o=Cs(r)?r:t,s=us(t),c=us(r);return!s&&c?Wd():qd(pp(e,a,o),e=>df(e,n,i),()=>Wd())}function lf(e,t,n,r){return Ja(r,(r,i)=>cf(e,t,n,r,i),()=>us(t)?Hd(e):Wd())}function uf(e,t,n){return Ja(t,(t,r)=>lf(e,t,r,n),()=>Hd(e))}function df(e,t,n){return uf(e,t,n)}function ff(e,t,n){return Eu(n)?Hd(e):pp(e,t,n)}function pf(e,t,n,r){return as(r)||_s(r)?Hd(e):Yo(r)?qd(df(e,t,r.parameters),e=>ff(e,n,r.instanceType),()=>Wd()):Wd()}function mf(e,t,n,r,i){return qd(pp(e,t,i),()=>pp(e,n,i),()=>pp(e,r,i))}function hf(e,t,n){return pp(e,Vl(t),n)}function gf(e,t,n,r){return as(r)||_s(r)?Hd(e):Qo(r)?qd(df(e,t,r.parameters),e=>ff(e,n,r.returnType),()=>Wd()):Wd()}function _f(e,t,n){return wc(n)||Fc(n)?Hd(e):tf(e,t,n)}function vf(e,t,n){return pp(e,Hl(t),n)}function yf(e,t,n){return t===n?Hd(e):Wd()}function bf(e,t,n){return Ac(n)?yf(e,t,n.const):yc(n)?Hd(e):tf(e,P(t),n)}function xf(e,t,n){return Ac(n)?yf(e,t,n.const):xc(n)?Hd(e):tf(e,P(t),n)}function Sf(e,t,n){return Ac(n)?yf(e,t,n.const):Fc(n)?Hd(e):tf(e,P(t),n)}function Cf(e,t,n){return Ac(n)?yf(e,t,n.const):zc(n)?Hd(e):tf(e,P(t),n)}function wf(e,t,n){return xa(t.const)?bf(e,t.const,n):Sa(t.const)?xf(e,t.const,n):Da(t.const)?Sf(e,t.const,n):Aa(t.const)?Cf(e,t.const,n):Ps()}function Tf(e,t,n){return Cs(n)?tf(e,t,n):Hd(e)}function Ef(e,t,n){return Mc(n)?Hd(e):tf(e,t,n)}function Df(e,t,n){return Fc(n)?Hd(e):tf(e,t,n)}function Of(e,t,n){return us(t)?us(n)?Hd(e):Wd():Hd(e)}function kf(e,t,n){return Cs(n)&&cs(n.extends)?Wd():qd(pp(e,t,n),e=>Of(e,t,n),()=>Wd())}function Af(e,t){return e.reduce((e,n)=>n in t&&Kd(t[n])?{...e,...t[n].inferred}:Ps(),{})}function jf(e,t,n){let r={};for(let i of Qa(n))r[i]=i in t?kf({},t[i],n[i]):us(n[i])?Cs(n[i])?Hd(_o(e,{[n[i].name]:n[i].extends})):Hd(e):Wd();let i=eo(r).every(e=>Kd(e)),a=i?Af(Qa(r),r):{};return i?Hd(a):Wd()}function Mf(e,t,n){let r=jf(e,t,n);return Kd(r)?Hd(_o(e,r.inferred)):Wd()}function Nf(e,t,n){return Mf(e,t,n)}function Pf(e,t){return Qa(t).reduce((n,r)=>({...n,[r]:j(e,r)?Bc(n[r])?F([...n[r].anyOf,t[r]]):F([e[r],t[r]]):t[r]}),e)}function Ff(e,t,n,r){return Ja(t,(t,i)=>qd(pp({},e[t],n),t=>Ff(e,i,n,Pf(r,t)),()=>Wd()),()=>Hd(r))}function If(e,t,n,r){return Ff(t,Qa(t),r,e)}function Lf(e,t,n){return bu(n)?If(e,t,_u(n),yu(n)):ms(n)?Nf(e,t,n.properties):tf(e,N(t),n)}function Rf(e,t){return A(Qa(t).length,0)?Hd(e):Wd()}function zf(e,t,n,r,i){return pp(e,n,i)}function Bf(e,t,n,r){return bu(r)?zf(e,gu(t),n,gu(_u(r)),yu(r)):ms(r)?Rf(e,r.properties):as(r)||_s(r)?Hd(e):Wd()}function Vf(e,t,n){return zc(n)?Hd(e):tf(e,t,n)}function Hf(e,t,n){return Lc(n)?Hd(e):tf(e,t,n)}function Uf(e,t,n){return pp(e,Ul(t),n)}function Wf(e,t){return Mo({"~kind":`Inferrable`},{name:e,type:t},{})}function Gf(e){return ka(e)&&j(e,`~kind`)&&j(e,`name`)&&j(e,`type`)&&A(e[`~kind`],`Inferrable`)&&Aa(e.name)&&ka(e.type)}function Kf(e){return Su(e)?Cs(e.items)?Ko(e.items.extends)?Wf(e.items.name,e.items.extends.items):_s(e.items.extends)?Wf(e.items.name,e.items.extends):void 0:Ps():void 0}function qf(e){return Cs(e)?Wf(e.name,e.extends):void 0}function Jf(e,t,n=[]){return Ja(e,(e,r)=>qd(pp({},e,t),()=>Jf(r,t,[...n,e]),()=>void 0),()=>n)}function Yf(e,t,n,r){let i=Jf(n,r);return ba(i)?Hd(_o(e,{[t]:cl(i)})):Wd()}function Xf(e,t,n,r){let i=Jf(n,r);return ba(i)?Hd(_o(e,{[t]:F(i)})):Wd()}function Zf(e){return[...e].reverse()}function Qf(e,t){return t?Zf(e):e}function $f(e){let t=e.length>0?e[0]:void 0;return Io(Io(t)?Kf(t):void 0)}function ep(e,t,n,r,i,a){return qd(pp(e,n,i),e=>rp(e,t,r,a),()=>Wd())}function tp(e,t,n,r,i){let a=Kf(r);return Gf(a)?Yf(e,a.name,Qf(n,t),a.type):Ja(n,(n,a)=>ep(e,t,n,a,r,i),()=>Wd())}function np(e,t,n,r){return Ja(r,(r,i)=>tp(e,t,n,r,i),()=>A(n.length,0)?Hd(e):Wd())}function rp(e,t,n,r){return np(e,t,n,r)}function ip(e,t,n){let r=Q_(e,Y_([],[]),n),i=$f(r);return rp(e,i,Qf(t,i),Qf(r,i))}function ap(e,t,n){let r=qf(n);return Gf(r)?Xf(e,r.name,t,r.type):Ja(t,(t,r)=>qd(pp(e,t,n),e=>ap(e,r,n),()=>Wd()),()=>Hd(e))}function op(e,t,n){let r=Q_(e,Y_([],[]),t);return ll(n)?ip(e,r,n.items):Ko(n)?ap(e,r,n.items):tf(e,cl(r),n)}function sp(e,t,n){return Eu(n)||Tu(n)?Hd(e):tf(e,t,n)}function cp(e,t,n){return Ja(n,(n,r)=>qd(pp(e,t,n),e=>Hd(e),()=>cp(e,t,r)),()=>Wd())}function lp(e,t,n){return Ja(t,(t,r)=>qd(cp(e,t,n),e=>lp(e,r,n),()=>Wd()),()=>Hd(e))}function up(e,t,n){let r=qf(n);return Gf(r)?Xf(e,r.name,t,r.type):Bc(n)?lp(e,t,n.anyOf):lp(e,t,[n])}function dp(e,t,n){return Cs(n)?tf(e,t,n):as(n)||_s(n)?Hd(e):Wd()}function fp(e,t,n){return Eu(n)?Hd(e):tf(e,t,n)}function pp(e,t,n){return as(t)?nf(e,t,n):Ko(t)?af(e,t,t.items,n):yc(t)?of(e,t,n):xc(t)?sf(e,t,n):Yo(t)?pf(e,t.parameters,t.instanceType,n):Ts(t)?mf(e,t.if,t.then,t.else,n):As(t)?hf(e,t.enum,n):Qo(t)?gf(e,t.parameters,t.returnType,n):wc(t)?_f(e,t,n):Ms(t)?vf(e,t.allOf,n):Ac(t)?wf(e,t,n):cs(t)?Tf(e,t,n):Mc(t)?Ef(e,t,n):Fc(t)?Df(e,t,n):ms(t)?Lf(e,t.properties,n):bu(t)?Bf(e,_u(t),yu(t),n):zc(t)?Vf(e,t,n):Lc(t)?Hf(e,t,n):zd(t)?Uf(e,t.pattern,n):ll(t)?op(e,t.items,n):Tu(t)?sp(e,t,n):Bc(t)?up(e,t.anyOf,n):_s(t)?dp(e,t,n):Eu(t)?fp(e,t,n):Wd()}function mp(e,t){return Hl([...e,N(t)])}function hp(e,t,n){return X_(e)?Po(mp(e,t),{},n):_p(e,t,n)}function gp(e,t,n,r,i){return hp($_(e,t,n),Z_(e,t,r),i)}function _p(e,t,n={}){return Lo(`Interface`,[e,t],n)}function vp(e){return Io(e)&&j(e,`action`)&&A(e.action,`Interface`)}function yp(e,t,n){return e.includes(n)?!0:Sp([...e,n],t,t[n])}function bp(e,t,n){return xp(e,t,ps(n))}function xp(e,t,n){return Ja(n,(n,r)=>Sp(e,t,n)?!0:xp(e,t,r),()=>!1)}function Sp(e,t,n){return ts(n)?yp(e,t,n.$ref):Ko(n)?Sp(e,t,n.items):Yo(n)?xp(e,t,[...n.parameters,n.instanceType]):Qo(n)?xp(e,t,[...n.parameters,n.returnType]):vp(n)?bp(e,t,n.parameters[1]):Ms(n)?xp(e,t,n.allOf):ms(n)?bp(e,t,n.properties):Bc(n)?xp(e,t,n.anyOf):ll(n)?xp(e,t,n.items):bu(n)?Sp(e,t,yu(n)):!1}function Cp(e,t,n){return Sp(e,t,n)}function wp(e,t){return t.reduce((t,n)=>Cp([n],e,e[n])?[...t,n]:t,[])}function Tp(e){return wp(e,fs(e))}function Ep(e,t,n){return n.includes(t)?n:t in e?kp(e,e[t],[...n,t]):Ps()}function Dp(e,t,n){return Op(e,ps(t),n)}function Op(e,t,n){return t.reduce((t,n)=>kp(e,n,t),n)}function kp(e,t,n){return ts(t)?Ep(e,t.$ref,n):Ko(t)?kp(e,t.items,n):Yo(t)?Op(e,[...t.parameters,t.instanceType],n):Qo(t)?Op(e,[...t.parameters,t.returnType],n):vp(t)?Dp(e,t.parameters[1],n):Ms(t)?Op(e,t.allOf,n):ms(t)?Dp(e,t.properties,n):Bc(t)?Op(e,t.anyOf,n):ll(t)?Op(e,t.items,n):bu(t)?kp(e,yu(t),n):n}function Ap(e,t,n){return kp(e,n,[t])}function jp(e){return is()}function Mp(e){return Qa(e).reduce((t,n)=>({...t,[n]:Pp(e[n])}),{})}function Np(e){return e.reduce((e,t)=>[...e,Pp(t)],[])}function Pp(e){return ts(e)?jp(e.$ref):Ko(e)?Go(Pp(e.items),qo(e)):Yo(e)?Jo(Np(e.parameters),Pp(e.instanceType)):Qo(e)?Zo(Np(e.parameters),Pp(e.returnType)):Ms(e)?js(Np(e.allOf)):ms(e)?N(Mp(e.properties)):bu(e)?mu(vu(e),Pp(yu(e))):Bc(e)?F(Np(e.anyOf)):ll(e)?cl(Np(e.items)):e}function Fp(e,t){return t in e?Pp(e[t]):gs()}function Ip(e){return Fp(e.$defs,e.$ref)}function Lp(e,t,n){let r=$_(e,Y_([],[]),t),i=Z_({},Y_([],[]),n);return Hl([...r,N(i)])}function Rp(e,t){return Qa(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=vp(r)?Lp(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function zp(e,t,n){return vs(Rp(e,Ap(e,t,n)),t)}function Bp(e,t){return t in e?ts(e[t])?Bp(e,e[t].$ref):e[t]:ss()}function Vp(e,t){return Bp(e,t)}function Hp(e){return ys(e)?Ip(e):xs(e)?gs():e}function Up(e,t,n){return pp(e,Hp(t),Hp(n))}function Wp(e,t){let n=[Up({},e,t),Up({},t,e)];return Kd(n[0])&&Kd(n[1])?0:Kd(n[0])&&Gd(n[1])?2:Gd(n[0])&&Kd(n[1])?3:1}function Gp(e,t,n=[],r=t){return Ja(t,(t,i)=>{let a=Wp(e,t);return A(a,2)||A(a,0)?r:A(a,1)?Gp(e,i,[...n,t],r):Gp(e,i,n,r)},()=>[...n,e])}function Kp(e,t,n){let r=Gl(e);return as(r)||_s(r)?[r]:cs(r)?qp(t,n):ms(r)?qp(t,[...n,r]):qp(t,Gp(r,n))}function qp(e,t=[]){return Ja(e,(e,n)=>Kp(e,n,t),()=>t)}function Jp(e){return tu(qp(e))}function Yp(e,t){return Po(Gl(e),{},t)}function Xp(e,t,n,r){return Yp(rv(e,t,n),r)}function Zp(e,t=[]){return Ro(e)&&A(e.action,`Conditional`)?ts(e.parameters[0])?Zp(e.parameters[2],Zp(e.parameters[3],[...t,e.parameters[0].$ref])):Zp(e.parameters[2],Zp(e.parameters[3],t)):Ro(e)&&A(e.action,`Mapped`)&&Ro(e.parameters[1])&&A(e.parameters[1].action,`KeyOf`)&&ts(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Qp(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function $p(e,t,n=[]){return Ja(e,(e,r)=>Ja(t,(t,i)=>$p(r,i,[...n,[t,e]]),()=>n),()=>n)}function em(e){return zd(e)?Ul(e.pattern):As(e)?Vl(e.enum):e}function tm(e){let t=em(e);return Bc(t)?[...t.anyOf]:[t]}function nm(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function rm(e,t){return t.reduce((t,n)=>[...t,...nm(e,n)],[])}function im(e){return e.reduce((e,t)=>A(t[0],!0)?rm(e,tm(t[1])):rm(e,[t[1]]),[[]])}function am(e,t,n){let r=$p(t,Qp(e,Zp(n)));return Ro(n)&&A(n.action,`Conditional`)||Ro(n)&&A(n.action,`Mapped`)?im(r):[t]}function om(){return[`(not-resolvable)`,ss()]}function sm(){return[`(not-generic)`,ss()]}function cm(e,t,n){return[e,ns(t,n)]}function lm(e,t,n){return t in e?um(e,t,e[t],n):om()}function um(e,t,n,r){return rs(n)?cm(t,n.parameters,n.expression):ts(n)?lm(e,n.$ref,r):sm()}function dm(e,t,n){return um(e,`(anonymous)`,t,n)}function fm(e,t,n){if(Cs(t)||km(t)||Kd(Up({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function pm(e,t,n,r,i){let a=rv(e,t,i);return fm(n,a,r),_o(e,{[n]:a})}function mm(e,t,n,r,i){let a=rv(e,t,n.extends),o=rv(e,t,n.equals);return Ja(i,(i,o)=>hm(pm(e,t,n.name,a,i),t,r,o),()=>hm(pm(e,t,n.name,a,o),t,r,[]))}function hm(e,t,n,r){return Ja(n,(n,i)=>mm(e,t,n,i,r),()=>e)}function gm(e,t,n,r){return hm(e,t,n,r)}var _m=0,vm=0;function ym(){if(!Pa(vm,ho().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function bm(){ym(),vm++,_m++}function xm(){_m--,A(_m,0)&&(vm=0)}function Sm(e){return Na(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function Cm(e,t){return A(Sm(e),t)}function wm(e,t,n,r,i,a){bm();try{let o=gm(e,t,r,a),s=rv(o,Y_([...t.callstack,n.$ref],t.visited),i);return rv(o,Y_([],[]),s)}finally{xm()}}function Tm(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=wm(e,t,n,r,i,o);return[...a,s]},[])}function Em(e,t,n,r,i,a){let o=Tm(e,t,n,r,i,am(r,a,i));return A(o.length,1)?o[0]:Wl(o)}function Dm(e,t,n,r){let i=$_(e,t,r),a=dm(e,n,r),o=a[0],s=a[1];return rs(s)?Cm(t,o)?Om(es(o),i):Em(e,t,es(o),s.parameters,s.expression,i):Om(n,i)}function Om(e,t){return Mo({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function km(e){return Fo(e,`Call`)}function Am(e){return No(e,[`~immutable`])}function jm(e,t){return Po(Am(e),{},t)}function Mm(e,t,n,r){return jm(rv(e,t,n),r)}function Nm(e,t){return e(t)}function Pm(e,t){return Aa(t)?P(Nm(e,t)):P(t)}function Fm(e,t){return Lm(e,Ul(t))}function Im(e,t){return F(t.map(t=>Lm(e,t)))}function Lm(e,t){return Ac(t)?Pm(e,t.const):zd(t)?Fm(e,t.pattern):Bc(t)?Im(e,t.anyOf):t}function Rm(e,t={}){return Lo(`Capitalize`,[e],t)}function zm(e,t={}){return Lo(`Lowercase`,[e],t)}function Bm(e,t={}){return Lo(`Uncapitalize`,[e],t)}function Vm(e,t={}){return Lo(`Uppercase`,[e],t)}var Hm=e=>e[0].toUpperCase()+e.slice(1),Um=e=>e.toLowerCase(),Wm=e=>e[0].toLowerCase()+e.slice(1),Gm=e=>e.toUpperCase();function Km(e,t){return X_([e])?Po(Lm(Hm,e),{},t):Rm(e,t)}function qm(e,t){return X_([e])?Po(Lm(Um,e),{},t):zm(e,t)}function Jm(e,t){return X_([e])?Po(Lm(Wm,e),{},t):Bm(e,t)}function Ym(e,t){return X_([e])?Po(Lm(Gm,e),{},t):Vm(e,t)}function Xm(e,t,n,r){return Km(rv(e,t,n),r)}function Zm(e,t,n,r){return qm(rv(e,t,n),r)}function Qm(e,t,n,r){return Jm(rv(e,t,n),r)}function $m(e,t,n,r){return Ym(rv(e,t,n),r)}function eh(e,t,n,r,i={}){return Lo(`Conditional`,[e,t,n,r],i)}function th(e,t,n,r,i,a){let o=Up(e,n,r);return Vd(o)?F([rv(o.inferred,t,i),rv(e,t,a)]):Ud(o)?rv(o.inferred,t,i):rv(e,t,a)}function nh(e,t,n,r,i,a,o){return X_([n,r])?Po(th(e,t,n,r,i,a),{},o):eh(n,r,i,a,o)}function rh(e,t,n,r,i,a,o){return nh(e,t,rv(e,t,n),rv(e,t,r),i,a,o)}function ih(e,t={}){return Lo(`ConstructorParameters`,[e],t)}function ah(e){let t=Yo(e)?e.parameters:[];return cl(Q_({},Y_([],[]),t))}function oh(e,t){return X_([e])?Po(ah(e),{},t):ih(e,t)}function sh(e,t,n,r){return oh(rv(e,t,n),r)}function ch(e,t,n={}){return Lo(`Exclude`,[e,t],n)}function lh(e,t,n){return X_([e,t])?Po(zl(e,t),{},n):ch(e,t,n)}function uh(e,t,n,r,i){return lh(rv(e,t,n),rv(e,t,r),i)}function dh(e,t,n={}){return Lo(`Extract`,[e,t],n)}function fh(e,t){return Kd(Up({},e,t))?[e]:[]}function ph(e,t,n=[]){return Ja(e,(e,r)=>ph(r,t,[...n,...fh(e,t)]),()=>n)}function mh(e,t){let n=Gl(e);return Wl(ph(Bc(n)?n.anyOf:[n],t))}function hh(e,t,n){return X_([e,t])?Po(mh(e,t),{},n):dh(e,t,n)}function gh(e,t,n,r,i){return hh(rv(e,t,n),rv(e,t,r),i)}function _h(e,t,n={}){return Lo(`Index`,[e,t],n)}function vh(e,t){return Dh(Vp(e,t))}function yh(e,t,n){return Dh(Bl(e,t,n))}function bh(e,t){let n=Qa(e).filter(e=>!j(t,e)),r=Qa(t).filter(t=>!j(e,t)),i=Qa(e).filter(e=>j(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:Hl([e[r],t[r]])}),{});return _o(_o(a,o),s)}function xh(e){return e.reduce((e,t)=>bh(e,Dh(t)),{})}function Sh(e){return e}function Ch(e){return Dh(bl(cl(e)))}function wh(e,t){return Qa(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:Wl([e[r],t[r]])}),{})}function Th(e,t){return Ja(e,(e,n)=>Th(n,wh(t,Dh(e))),()=>t)}function Eh(e){return Ja(e,(e,t)=>Th(t,Dh(e)),()=>Ps())}function Dh(e){return ys(e)?vh(e.$defs,e.$ref):Ts(e)?yh(e.if,e.then,e.else):Ms(e)?xh(e.allOf):Bc(e)?Eh(e.anyOf):ll(e)?Ch(e.items):ms(e)?Sh(e.properties):{}}function Oh(e){return N(Dh(e))}var kh=RegExp(`^(?:0|[1-9][0-9]*)$`);function Ah(e){let t=`${e}`;return kh.test(t)?parseInt(t):e}function jh(e){return P(Ah(e))}function Mh(e){return e.map(e=>Nh(e))}function Nh(e){return Ms(e)?js(Mh(e.allOf)):Bc(e)?F(Mh(e.anyOf)):Ac(e)?jh(e.const):e}function Ph(e,t){return Kd(Up({},Nh(t),Pc()))?e:Ac(t)&&A(t.const,`length`)?Pc():ss()}function Fh(e,t){return Hh(Vp(e,t))}function Ih(e,t,n){return Hh(Bl(e,t,n))}function Lh(e){return Hh(Vl(e))}function Rh(e){return Hh(Hl(e))}function zh(e){return[`${e}`]}function Bh(e){return Hh(Ul(e))}function Vh(e){return e.reduce((e,t)=>[...e,...Hh(t)],[])}function Hh(e){return ys(e)?Fh(e.$defs,e.$ref):Ts(e)?Ih(e.if,e.then,e.else):As(e)?Lh(e.enum):Ms(e)?Rh(e.allOf):Ac(e)?zh(e.const):zd(e)?Bh(e.pattern):Bc(e)?Vh(e.anyOf):[]}function Uh(e){return Hh(e)}function Wh(e,t){return t.map(t=>Gh(e,t))}function Gh(e,t){return Ko(t)?Go(Gh(e,t.items)):Yo(t)?Jo(Wh(e,t.parameters),Gh(e,t.instanceType)):Qo(t)?Zo(Wh(e,t.parameters),Gh(e,t.returnType)):ll(t)?cl(Wh(e,t.items)):Bc(t)?F(Wh(e,t.anyOf)):Ms(t)?js(Wh(e,t.allOf)):Cu(t)?N(e):t}function Kh(e,t){return Gh(e,t)}function qh(e,t){return Kh(e,t in e?e[t]:ss())}function Jh(e,t){return t.reduce((t,n)=>[...t,qh(e,n)],[])}function Yh(e,t){return Wl(Jh(e,Uh(t)))}var Xh=new RegExp(uu);function Zh(e){return e.filter(e=>Xh.test(e))}function Qh(e){return Wl(Jh(e,Zh(fs(e))))}function $h(e,t){return Fc(t)?Qh(e):Yh(e,t)}function eg(e){return P(Ah(e))}function tg(e){return e.map(e=>ng(e))}function ng(e){return Ms(e)?js(tg(e.allOf)):Bc(e)?F(tg(e.anyOf)):Ac(e)?eg(e.const):e}function rg(e,t){return e.reduceRight((e,n,r)=>Kd(Up({},P(r),t))?[n,...e]:e,[])}function ig(e,t){return Kl(rg(e,ng(t)))}function ag(e){return Kl(e)}function og(e,t){return Ac(t)&&A(t.const,`length`)?P(e.length):Fc(t)||wc(t)?ag(e):ig(e,t)}function sg(e,t){return Ko(e)?Ph(e.items,t):ms(e)?$h(e.properties,t):ll(e)?og(e.items,t):ss()}function cg(e){return ys(e)||Ts(e)||Ms(e)||Bc(e)?Oh(e):e}function lg(e,t,n){return X_([e,t])?Po(sg(cg(e),t),{},n):_h(e,t,n)}function ug(e,t,n,r,i){return lg(rv(e,t,n),rv(e,t,r),i)}function dg(e,t={}){return Lo(`InstanceType`,[e],t)}function fg(e){return Yo(e)?e.instanceType:ss()}function pg(e,t){return X_([e])?Po(fg(e),{},t):dg(e,t)}function mg(e,t,n,r={}){return pg(rv(e,t,n),r)}function hg(e,t={}){return Lo(`KeyOf`,[e],t)}function gg(){return F([Pc(),Rc(),Ic()])}function _g(e){return Pc()}function vg(e){return e.reduce((e,t)=>Dc(t)?[...e,P(Ah(t))]:Ps(),[])}function yg(e){return Kl(vg(Qa(e)))}function bg(e){return vu(e)}function xg(e){return Kl(e.map((e,t)=>P(t)))}function Sg(e){return as(e)?gg():Ko(e)?_g(e.items):ms(e)?yg(e.properties):bu(e)?bg(e):ll(e)?xg(e.items):ss()}function Cg(e){return ys(e)||Ts(e)||Ms(e)||Bc(e)?Oh(e):e}function wg(e,t){return X_([e])?Po(Sg(Cg(e)),{},t):hg(e,t)}function Tg(e,t,n,r){return wg(rv(e,t,n),r)}function Eg(e,t,n,r,i={}){return Lo(`Mapped`,[e,t,n,r],i)}function Dg(e){return jg(Ul(e))}function Og(e){return e.reduce((e,t)=>[...e,...jg(t)],[])}function kg(e){return jg(Vl(e))}function Ag(e){return Da(e)?[P(`${e}`)]:[P(e)]}function jg(e){return As(e)?kg(e.enum):Ac(e)?Ag(e.const):zd(e)?Dg(e.pattern):Bc(e)?Og(e.anyOf):[e]}function Mg(e){return jg(e)}function Ng(e){return zd(e)?Ul(e.pattern):e}function Pg(e,t,n,r,i,a){let o=_o(e,{[n.name]:r}),s=Ng(rv(o,t,i)),c=rv(o,t,a);return Oc(s)||kc(s)?{[s.const]:c}:{}}function Fg(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,Pg(e,t,n,o,i,a)],[])}function Ig(e){return e.reduce((e,t)=>[...e,N(t)],[])}function Lg(e,t,n,r,i,a){return Hl(Ig(Fg(e,t,n,Mg(r),i,a)))}function Rg(e,t,n,r,i,a,o){return X_([r])?Po(Lg(e,t,n,r,i,a),{},o):Eg(n,r,i,a,o)}function zg(e,t,n,r,i,a,o){return Rg(e,t,n,rv(e,t,r),i,a,o)}function Bg(e,t,n){let r=_o(e,t);return Qa(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:zp(r,n,t[n])}),{})}function Vg(e,t,n){let r=_o(e,t);return Qa(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:rv(r,Y_([],[]),t[n])}),{})}function Hg(e,t,n){let r=Tp(t),i=Bg(e,t,r),a=Vg(e,t,r);return Po({...i,...a},{},n)}function Ug(e,t,n,r){return Hg(e,n,r)}function Wg(e,t={}){return Lo(`NonNullable`,[e],t)}function Gg(e){return lh(e,F([jc(),wu()]),{})}function Kg(e,t){return X_([e])?Po(Gg(e),{},t):Wg(e,t)}function qg(e,t,n,r){return Kg(rv(e,t,n),r)}function Jg(e,t,n={}){return Lo(`Omit`,[e,t],n)}function Yg(e){let t=Oh(e);return ms(t)?t.properties:Ps()}function Xg(e,t){return Qa(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function Zg(e,t){return N(Xg(Yg(e),Uh(t)))}function Qg(e,t,n){return X_([e,t])?Po(Zg(e,t),{},n):Jg(e,t,n)}function $g(e,t,n,r,i){return Qg(rv(e,t,n),rv(e,t,r),i)}function e_(e,t={}){return Lo(`Parameters`,[e],t)}function t_(e){let t=Qo(e)?e.parameters:[];return cl(Q_({},Y_([],[]),t))}function n_(e,t){return X_([e])?Po(t_(e),{},t):e_(e,t)}function r_(e,t,n,r){return n_(rv(e,t,n),r)}function i_(e,t={}){return Lo(`Partial`,[e],t)}function a_(e,t){let n=u_(Vp(e,t));return vs(_o(e,{[t]:n}),t)}function o_(e,t,n){return u_(Bl(e,t,n))}function s_(e){return u_(Hl(e))}function c_(e){return F(e.map(e=>u_(e)))}function l_(e){return N(Qa(e).reduce((t,n)=>({...t,[n]:ls(e[n])}),{}))}function u_(e){return ys(e)?a_(e.$defs,e.$ref):Ts(e)?o_(e.if,e.then,e.else):Ms(e)?s_(e.allOf):Bc(e)?c_(e.anyOf):ms(e)?l_(e.properties):N({})}function d_(e,t){return X_([e])?Po(u_(e),{},t):i_(e,t)}function f_(e,t,n,r){return d_(rv(e,t,n),r)}function p_(e,t,n={}){return Lo(`Pick`,[e,t],n)}function m_(e,t){return Qa(e).reduce((n,r)=>t.includes(r)?_o(n,{[r]:e[r]}):n,{})}function h_(e,t){return N(m_(Yg(e),Uh(t)))}function g_(e,t,n){return X_([e,t])?Po(h_(e,t),{},n):p_(e,t,n)}function __(e,t,n,r,i){return g_(rv(e,t,n),rv(e,t,r),i)}function v_(e,t={}){return Lo(`ReadonlyObject`,[e],t)}function y_(e){return cv(Go(e))}function b_(e,t){let n=E_(Vp(e,t));return vs(_o(e,{[t]:n}),t)}function x_(e,t,n){return E_(Bl(e,t,n))}function S_(e){return E_(Hl(e))}function C_(e){return N(Qa(e).reduce((t,n)=>({...t,[n]:hc(e[n])}),{}))}function w_(e){return cv(cl(e))}function T_(e){return F(e.map(e=>E_(e)))}function E_(e){return Ko(e)?y_(e.items):ys(e)?b_(e.$defs,e.$ref):Ts(e)?x_(e.if,e.then,e.else):Ms(e)?S_(e.allOf):ms(e)?C_(e.properties):ll(e)?w_(e.items):Bc(e)?T_(e.anyOf):e}function D_(e,t){return X_([e])?Po(E_(e),{},t):v_(e)}function O_(e,t,n,r){return D_(rv(e,t,n),r)}function k_(e,t,n,r){return t.visited.includes(r)?n:r in e?rv(e,Y_(t.callstack,[...t.visited,r]),e[r]):n}function A_(e,t){let n=F_(Vp(e,t));return vs(_o(e,{[t]:n}),t)}function j_(e,t,n){return F_(Bl(e,t,n))}function M_(e){return F_(Hl(e))}function N_(e){return F(e.map(e=>F_(e)))}function P_(e){return N(Qa(e).reduce((t,n)=>({...t,[n]:vl(e[n])}),{}))}function F_(e){return ys(e)?A_(e.$defs,e.$ref):Ts(e)?j_(e.if,e.then,e.else):Ms(e)?M_(e.allOf):Bc(e)?N_(e.anyOf):ms(e)?P_(e.properties):N({})}function I_(e,t={}){return Lo(`Required`,[e],t)}function L_(e,t){return X_([e])?Po(F_(e),{},t):I_(e,t)}function R_(e,t,n,r){return L_(rv(e,t,n),r)}function z_(e,t={}){return Lo(`ReturnType`,[e],t)}function B_(e){return Qo(e)?e.returnType:ss()}function V_(e,t){return X_([e])?Po(B_(e),{},t):z_(e,t)}function H_(e,t,n,r={}){return V_(rv(e,t,n),r)}function U_(e,t){return Lo(`With`,[e,t],{})}function W_(e,t){return G_(e,t)}function G_(e,t){return X_([e])?Po(e,{},t):U_(e,t)}function K_(e,t,n,r){return G_(rv(e,t,n),r)}function q_(e){return Su(e)?ll(e.items)?J_(e.items.items):Cs(e.items)||ts(e.items)?[e]:[ss()]:[e]}function J_(e){return e.reduce((e,t)=>[...e,...q_(t)],[])}function Y_(e,t){return{callstack:e,visited:t}}function X_(e){return Ja(e,(e,t)=>!ts(e)&&X_(t),()=>!0)}function Z_(e,t,n){return Qa(n).reduce((r,i)=>({...r,[i]:rv(e,t,n[i])}),{})}function Q_(e,t,n){return J_($_(e,t,n))}function $_(e,t,n){return n.map(n=>rv(e,t,n))}function ev(e,t){let n=us(e)?Uo(t,{}):t,r=gc(e)?Bo(n,{}):n;return mc(e)?ov(r,{}):r}function tv(e,t,n,r,i){return A(n,`AddImmutable`)?sv(e,t,r[0],i):A(n,`RemoveImmutable`)?Mm(e,t,r[0],i):A(n,`AddReadonly`)?Vo(e,t,r[0],i):A(n,`RemoveReadonly`)?pl(e,t,r[0],i):A(n,`AddOptional`)?Wo(e,t,r[0],i):A(n,`RemoveOptional`)?_l(e,t,r[0],i):A(n,`Capitalize`)?Xm(e,t,r[0],i):A(n,`Conditional`)?rh(e,t,r[0],r[1],r[2],r[3],i):A(n,`ConstructorParameters`)?sh(e,t,r[0],i):A(n,`Evaluate`)?Xp(e,t,r[0],i):A(n,`Exclude`)?uh(e,t,r[0],r[1],i):A(n,`Extract`)?gh(e,t,r[0],r[1],i):A(n,`Index`)?ug(e,t,r[0],r[1],i):A(n,`InstanceType`)?mg(e,t,r[0],i):A(n,`Interface`)?gp(e,t,r[0],r[1],i):A(n,`KeyOf`)?Tg(e,t,r[0],i):A(n,`Lowercase`)?Zm(e,t,r[0],i):A(n,`Mapped`)?zg(e,t,r[0],r[1],r[2],r[3],i):A(n,`Module`)?Ug(e,t,r[0],i):A(n,`NonNullable`)?qg(e,t,r[0],i):A(n,`Pick`)?__(e,t,r[0],r[1],i):A(n,`Parameters`)?r_(e,t,r[0],i):A(n,`Partial`)?f_(e,t,r[0],i):A(n,`Omit`)?$g(e,t,r[0],r[1],i):A(n,`ReadonlyObject`)?O_(e,t,r[0],i):A(n,`Record`)?lu(e,t,r[0],r[1],i):A(n,`Required`)?R_(e,t,r[0],i):A(n,`ReturnType`)?H_(e,t,r[0],i):A(n,`TemplateLiteral`)?Id(e,t,r[0],i):A(n,`Uncapitalize`)?Qm(e,t,r[0],i):A(n,`Uppercase`)?$m(e,t,r[0],i):A(n,`With`)?K_(e,t,r[0],r[1]):Lo(n,r,i)}function nv(e,t,n){return ev(n,ts(n)?k_(e,t,n,n.$ref):Ko(n)?Go(rv(e,t,n.items),qo(n)):km(n)?Dm(e,t,n.target,n.arguments):Yo(n)?Jo($_(e,t,n.parameters),rv(e,t,n.instanceType),Xo(n)):Qo(n)?Zo($_(e,t,n.parameters),rv(e,t,n.returnType),$o(n)):Ts(n)?ws(rv(e,t,n.if),rv(e,t,n.then),rv(e,t,n.else),Es(n)):Ms(n)?js($_(e,t,n.allOf),Ns(n)):ms(n)?N(Z_(e,t,n.properties),hs(n)):bu(n)?hu(_u(n),rv(e,t,yu(n))):Su(n)?xu(rv(e,t,n.items)):ll(n)?cl(Q_(e,t,n.items),ul(n)):Bc(n)?F($_(e,t,n.anyOf),Vc(n)):n)}function rv(e,t,n){return Ro(n)?tv(e,t,n.action,n.parameters,n.options):nv(e,t,n)}function iv(e,t){return rv(e,Y_([],[]),t)}function av(e){return Po(e,{"~immutable":!0},{})}function ov(e,t){return Po(av(e),{},t)}function sv(e,t,n,r){return ov(rv(e,t,n),r)}function cv(e,t={}){return ov(e,t)}function lv(e,t={}){return Yp(e,t)}function uv(e,t){let n=Wp(e,t);return A(n,3)?1:+!!A(n,1)}function dv(e,t,n=[]){return Ja(t,(r,i)=>A(uv(e,r),1)?dv(e,i,[...n,r]):[...n,e,...t],()=>[...n,e])}function fv(e,t=[]){return Ja(e,(e,n)=>fv(n,dv(e,t)),()=>t)}function pv(e){return fv(e)}function mv(e){return j(e,`~refine`)&&ba(e[`~refine`])&&Ua(e[`~refine`],0,e=>ka(e)&&j(e,`check`)&&j(e,`error`)&&wa(e.check)&&wa(e.error))}function hv(e){return ka(e)&&!ba(e)}function gv(e){return Sa(e)}function _v(e){return hv(e)||gv(e)}function vv(e){return j(e,`additionalItems`)&&_v(e.additionalItems)}function yv(e){return j(e,`additionalProperties`)&&_v(e.additionalProperties)}function bv(e){return j(e,`allOf`)&&ba(e.allOf)&&e.allOf.every(e=>_v(e))}function xv(e){return j(e,`$anchor`)&&Aa(e.$anchor)}function Sv(e){return j(e,`anyOf`)&&ba(e.anyOf)&&e.anyOf.every(e=>_v(e))}function Cv(e){return j(e,`const`)}function wv(e){return j(e,`contains`)&&_v(e.contains)}function Tv(e){return j(e,`default`)}function Ev(e){return j(e,`dependencies`)&&ka(e.dependencies)&&Object.values(e.dependencies).every(e=>_v(e)||ba(e)&&e.every(e=>Aa(e)))}function Dv(e){return j(e,`dependentRequired`)&&ka(e.dependentRequired)&&Object.values(e.dependentRequired).every(e=>ba(e)&&e.every(e=>Aa(e)))}function Ov(e){return j(e,`dependentSchemas`)&&ka(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(e=>_v(e))}function kv(e){return j(e,`$dynamicAnchor`)&&Aa(e.$dynamicAnchor)}function Av(e){return j(e,`$dynamicRef`)&&Aa(e.$dynamicRef)}function jv(e){return j(e,`else`)&&_v(e.else)}function Mv(e){return j(e,`enum`)&&ba(e.enum)}function Nv(e){return j(e,`exclusiveMaximum`)&&(Da(e.exclusiveMaximum)||xa(e.exclusiveMaximum))}function Pv(e){return j(e,`exclusiveMinimum`)&&(Da(e.exclusiveMinimum)||xa(e.exclusiveMinimum))}function Fv(e){return j(e,`format`)&&Aa(e.format)}function Iv(e){return j(e,`$id`)&&Aa(e.$id)}function Lv(e){return j(e,`if`)&&_v(e.if)}function Rv(e){return j(e,`items`)&&(_v(e.items)||ba(e.items)&&e.items.every(e=>_v(e)))}function zv(e){return Rv(e)&&ba(e.items)}function Bv(e){return j(e,`maximum`)&&(Da(e.maximum)||xa(e.maximum))}function Vv(e){return j(e,`maxContains`)&&Da(e.maxContains)}function Hv(e){return j(e,`maxItems`)&&Da(e.maxItems)}function Uv(e){return j(e,`maxLength`)&&Da(e.maxLength)}function Wv(e){return j(e,`maxProperties`)&&Da(e.maxProperties)}function Gv(e){return j(e,`minimum`)&&(Da(e.minimum)||xa(e.minimum))}function Kv(e){return j(e,`minContains`)&&Da(e.minContains)}function qv(e){return j(e,`minItems`)&&Da(e.minItems)}function Jv(e){return j(e,`minLength`)&&Da(e.minLength)}function Yv(e){return j(e,`minProperties`)&&Da(e.minProperties)}function Xv(e){return j(e,`multipleOf`)&&(Da(e.multipleOf)||xa(e.multipleOf))}function Zv(e){return j(e,`not`)&&_v(e.not)}function Qv(e){return j(e,`oneOf`)&&ba(e.oneOf)&&e.oneOf.every(e=>_v(e))}function $v(e){return j(e,`pattern`)&&(Aa(e.pattern)||e.pattern instanceof RegExp)}function ey(e){return j(e,`patternProperties`)&&ka(e.patternProperties)&&Object.values(e.patternProperties).every(e=>_v(e))}function ty(e){return j(e,`prefixItems`)&&ba(e.prefixItems)&&e.prefixItems.every(e=>_v(e))}function ny(e){return j(e,`properties`)&&ka(e.properties)&&Object.values(e.properties).every(e=>_v(e))}function ry(e){return j(e,`propertyNames`)&&(ka(e.propertyNames)||_v(e.propertyNames))}function iy(e){return j(e,`$recursiveAnchor`)&&Sa(e.$recursiveAnchor)}function ay(e){return iy(e)&&A(e.$recursiveAnchor,!0)}function oy(e){return j(e,`$recursiveRef`)&&Aa(e.$recursiveRef)}function sy(e){return j(e,`$ref`)&&Aa(e.$ref)}function cy(e){return j(e,`required`)&&ba(e.required)&&e.required.every(e=>Aa(e))}function ly(e){return j(e,`then`)&&_v(e.then)}function uy(e){return j(e,`type`)&&(Aa(e.type)||ba(e.type)&&e.type.every(e=>Aa(e)))}function dy(e){return j(e,`uniqueItems`)&&Sa(e.uniqueItems)}function fy(e){return j(e,`unevaluatedItems`)&&_v(e.unevaluatedItems)}function py(e){return j(e,`unevaluatedProperties`)&&_v(e.unevaluatedProperties)}var my=class{constructor(){let e=new Set,t=new Set;this.stack=[{indices:e,keys:t}]}Push(){let e=new Set,t=new Set;return this.stack.push({indices:e,keys:t}),!0}Pop(){return this.stack.pop(),!0}AddIndex(e){return this.GetIndices().add(e),!0}AddKey(e){return this.GetKeys().add(e),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(e){for(let t of e)t.GetIndices().forEach(e=>this.GetIndices().add(e)),t.GetKeys().forEach(e=>this.GetKeys().add(e));return!0}},hy=class extends my{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=ho().maxErrors}AddError(e){return this.AtCapacity()||this.errors.push(e),!1}GetErrors(){return this.errors}};function gy(e,t,n,r){return Ua(n[`~refine`],0,(e,t)=>e.check(r))}function _y(e,t,n,r,i,a){return Wa(i[`~refine`],0,(e,i)=>e.check(a)||t.AddError({keyword:`~refine`,schemaPath:n,instancePath:r,params:{index:i,message:e.error(a)}}))}function vy(e){return Rv(e)&&ba(e.items)}function yy(e,t,n,r){return!vy(n)||Ua(r,0,(r,i)=>Pa(i,n.items.length)||sC(e,t,n.additionalItems,r)&&t.AddIndex(i))}function by(e,t,n,r,i,a){return!vy(i)||Ua(a,0,(a,o)=>{let s=`${n}/additionalItems`,c=`${r}/${o}`;return Pa(o,i.items.length)||lC(e,t,s,c,i.additionalItems,a)&&t.AddIndex(o)})}function xy(e){return new RegExp(e,`u`)}function Sy(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}$`}function Cy(e){let t=[];return ey(e)&&t.push(...Qa(e.patternProperties)),ny(e)&&t.push(...Qa(e.properties).map(Sy)),A(t.length,0)?`(?!)`:`(${t.join(`|`)})`}function wy(e,t,n,r){let i=xy(Cy(n));return Ua(Qa(r),0,(a,o)=>i.test(a)||sC(e,t,n.additionalProperties,r[a])&&t.AddKey(a))}function Ty(e,t,n,r,i,a){let o=xy(Cy(i)),s=[];return Wa(Qa(a),0,(c,l)=>{let u=`${n}/additionalProperties`,d=`${r}/${c}`,f=o.test(c)||lC(e,t,u,d,i.additionalProperties,a[c])&&t.AddKey(c);return f||s.push(c),f})||t.AddError({keyword:`additionalProperties`,schemaPath:n,instancePath:r,params:{additionalProperties:s}})}function Ey(e,t,n,r){let i=n.allOf.reduce((t,n)=>{let i=new my;return cC(e,i,n,r)?[...t,i]:t},[]);return A(i.length,n.allOf.length)&&t.Merge(i)}function Dy(e,t,n,r,i,a){let o=[],s=i.allOf.reduce((t,i,s)=>{let c=`${n}/allOf/${s}`,l=new hy,u=uC(e,l,c,r,i,a);return u||o.push(l),u?[...t,l]:t},[]),c=A(s.length,i.allOf.length)&&t.Merge(s);return c||o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),c}function Oy(e,t,n,r){let i=n.anyOf.reduce((t,n)=>{let i=new my;return cC(e,i,n,r)?[...t,i]:t},[]);return Na(i.length,0)&&t.Merge(i)}function ky(e,t,n,r,i,a){let o=[],s=i.anyOf.reduce((t,i,s)=>{let c=new hy,l=uC(e,c,`${n}/anyOf/${s}`,r,i,a);return l||o.push(c),l?[...t,c]:t},[]),c=Na(s.length,0)&&t.Merge(s);return c||o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),c||t.AddError({keyword:`anyOf`,schemaPath:n,instancePath:r,params:{}})}function Ay(e,t,n,r){return n}function jy(e,t,n,r,i,a){return Ay(e,t,i,a)||t.AddError({keyword:`boolean`,schemaPath:n,instancePath:r,params:{}})}function My(e,t,n,r){return za(n.const)?A(r,n.const):ro(r,n.const)}function Ny(e,t,n,r,i,a){return My(e,t,i,a)||t.AddError({keyword:`const`,schemaPath:n,instancePath:r,params:{allowedValue:i.const}})}function Py(e){return!(Kv(e)&&A(e.minContains,0))}function Fy(e,t,n,r){return!Py(n)||!A(r.length,0)&&Ka(r,(r,i)=>cC(e,t,n.contains,r)&&t.AddIndex(i))}function Iy(e,t,n,r,i,a){return Fy(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:1}})}function Ly(e,t,n,r){let i=A(Qa(r).length,0),a=Ua(Za(n.dependencies),0,([n,i])=>!j(r,n)||(ba(i)?i.every(e=>j(r,e)):cC(e,t,i,r)));return i||a}function Ry(e,t,n,r,i,a){let o=A(Qa(a).length,0),s=Wa(Za(i.dependencies),0,([i,o])=>{let s=`${n}/dependencies/${i}`;return!j(a,i)||(ba(o)?o.every(e=>j(a,e)||t.AddError({keyword:`dependencies`,schemaPath:n,instancePath:r,params:{property:i,dependencies:o}})):uC(e,t,s,r,o,a))});return o||s}function zy(e,t,n,r){let i=A(Qa(r).length,0),a=Ua(Za(n.dependentRequired),0,([e,t])=>!j(r,e)||t.every(e=>j(r,e)));return i||a}function By(e,t,n,r,i,a){let o=A(Qa(a).length,0),s=Wa(Za(i.dependentRequired),0,([e,i])=>!j(a,e)||Wa(i,0,o=>j(a,o)||t.AddError({keyword:`dependentRequired`,schemaPath:n,instancePath:r,params:{property:e,dependencies:i}})));return o||s}function Vy(e,t,n,r){let i=A(Qa(r).length,0),a=Ua(Za(n.dependentSchemas),0,([n,i])=>!j(r,n)||cC(e,t,i,r));return i||a}function Hy(e,t,n,r,i,a){let o=A(Qa(a).length,0),s=Wa(Za(i.dependentSchemas),0,([i,o])=>{let s=`${n}/dependentSchemas/${i}`;return!j(a,i)||uC(e,t,s,r,o,a)});return o||s}function Uy(e,t,n,r){let i=e.DynamicRef(n)??!1;return _v(i)&&cC(e,t,i,r)}function Wy(e,t,n,r,i,a){let o=e.DynamicRef(i)??!1;return _v(o)&&uC(e,t,`#`,r,o,a)}function Gy(e,t,n,r){return Ga(n.enum,e=>za(e)?A(r,e):ro(r,e))}function Ky(e,t,n,r,i,a){return Gy(e,t,i,a)||t.AddError({keyword:`enum`,schemaPath:n,instancePath:r,params:{allowedValues:i.enum}})}function qy(e,t,n,r){return Pa(r,n.exclusiveMaximum)}function Jy(e,t,n,r,i,a){return qy(e,t,i,a)||t.AddError({keyword:`exclusiveMaximum`,schemaPath:n,instancePath:r,params:{comparison:`<`,limit:i.exclusiveMaximum}})}function Yy(e,t,n,r){return Na(r,n.exclusiveMinimum)}function Xy(e,t,n,r,i,a){return Yy(e,t,i,a)||t.AddError({keyword:`exclusiveMinimum`,schemaPath:n,instancePath:r,params:{comparison:`>`,limit:i.exclusiveMinimum}})}var Zy=[0,31,28,31,30,31,30,31,31,30,31,30,31],Qy=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function $y(e){return e%4==0&&(e%100!=0||e%400==0)}function eb(e){let t=Qy.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&$y(n)?29:Zy[r])}var tb=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function nb(e,t=!0){let n=tb.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],a=+n[3];if(r>23||i>59||a>60)return!1;if(n[5]){let e=+n[6],t=+n[7];if(e>23||t>59)return!1}if(a<60)return!0;let o=n[5]===`-`?-1:1,s=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(s*60+c))%1440+1440)%1440==1439}function rb(e){let t=e.split(/T/i);return t.length===2&&eb(t[0])&&nb(t[1])}var ib=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function ab(e){return ib.test(e)}var ob=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function sb(e){return ob.test(e)}var cb=/^(?!-).*(?<!-)$/,lb=/^(?!..--)/,ub=/^[a-zA-Z0-9-]*$/,db=/[^\p{ASCII}]/u,fb=/[0-9]/,pb=/[\u{0660}-\u{0669}]/u,mb=/[\u{06f0}-\u{06f9}]/u,hb=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,gb=/[\u{002d}\u{002b}]/u,_b=/\p{Mn}/u,vb=/\p{Mc}/u,yb=/[\p{Mn}\p{Mc}\p{Me}]/u,bb=/\p{L}/u,xb=/\p{Nd}/u,Sb=/\p{Script=Greek}/u,Cb=/\p{Script=Hebrew}/u,wb=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,Tb=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,Eb=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,Db=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,Ob=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,kb=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,Ab=new RegExp([fb,mb].map(e=>e.source).join(`|`),`u`),jb=new RegExp([bb,gb,hb,xb,_b,vb,Ob,kb].map(e=>e.source).join(`|`),`u`);function Mb(e){return cb.test(e)&&lb.test(e)&&ub.test(e)}var Nb=36,Pb=1,Fb=26,Ib=38,Lb=700,Rb=72,zb=128;function Bb(){throw null}function Vb(e){return e.toLowerCase().startsWith(`xn--`)}function Hb(e,t,n){e=n?Math.floor(e/Lb):e>>1,e+=Math.floor(e/t);let r=0;for(;e>455;)e=Math.floor(e/35),r+=Nb;return r+Math.floor(36*e/(e+Ib))}function Ub(e){let t=[],n=zb,r=0,i=Rb,a=e.lastIndexOf(`-`);if(a>0)for(let n=0;n<a;n++){let r=e.charCodeAt(n);r>=128&&Bb(),t.push(r)}let o=a<0?0:a+1;for(;o<e.length;){let a=r,s=1,c=Nb;for(;;){o>=e.length&&Bb();let t=e.charCodeAt(o++),n;t>=97&&t<=122?n=t-97:t>=48&&t<=57?n=t-48+26:Bb(),r+=n*s;let a=c<=i?Pb:c>=i+Fb?Fb:c-i;if(n<a)break;s*=Nb-a,c+=Nb}let l=t.length+1;i=Hb(r-a,l,a===0),n+=Math.floor(r/l),r%=l,t.splice(r,0,n),r++}return String.fromCodePoint(...t)}function Wb(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var Gb=new RegExp(db.source,`gu`);function Kb(e){let t=e.replace(Gb,``),n=t.length,r=n>0?[t,`-`]:[],i=Array.from(e,e=>e.codePointAt(0)),a=zb,o=0,s=Rb,c=n;for(;c<i.length;){let e=1/0;for(let t of i)t>=a&&t<e&&(e=t);o+=(e-a)*(c+1),a=e;for(let e of i)if(e<a&&o++,e===a){let e=o;for(let t=Nb;;t+=Nb){let n=t<=s?Pb:t>=s+Fb?Fb:t-s;if(e<n)break;let i=n+(e-n)%(Nb-n);r.push(Wb(i)),e=Math.floor((e-n)/(Nb-n))}r.push(Wb(e)),s=Hb(o,c+1,c===n),o=0,c++}o++,a++}return r.join(``)}var qb=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,Jb=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,Yb=/^(?:R|AL|AN)$/;function Xb(e){if(Vb(e))try{return Qb(Ub(e.slice(4).toLowerCase()))}catch{return!1}return Qb(e)}function Zb(e){let t=String.fromCodePoint(e);return Ab.test(t)?`EN`:pb.test(t)?`AN`:_b.test(t)?`NSM`:Cb.test(t)?`R`:Tb.test(t)?`AL`:bb.test(t)?`L`:`ON`}function Qb(e){for(let t of e)if(Yb.test(Zb(t.codePointAt(0))))return!0;return!1}function $b(e){let t=!1,n=Jb,r=!1,i=!1,a=!0;for(let o of e){let e=Zb(o.codePointAt(0));if(a){if(e!==`L`&&e!==`R`&&e!==`AL`)return!1;t=e===`R`||e===`AL`,n=t?qb:Jb,a=!1}if(!n.test(e))return!1;e===`EN`?r=!0:e===`AN`&&(i=!0)}return!(t&&r&&i)}function ex(e){return db.test(e)&&Kb(e).length+4>63}function tx(e){return e[0]===`-`||e[e.length-1]===`-`||e.slice(2).join(``).startsWith(`--`)}function nx(e){if(ex(e)||Qb(e)&&!$b(e))return!1;let t=[...e],n=t.map(e=>e.codePointAt(0)),r=n.length;if(tx(t)||yb.test(t[0]))return!1;let i=!1;for(let e=0;e<r;e++){let r=n[e],a=t[e];if(Db.test(a)||!jb.test(a))return!1;wb.test(a)&&(i=!0);let o=n[e-1],s=n[e+1];switch(r){case 183:if(o!==108||s!==108)return!1;break;case 885:if(!s||!Sb.test(t[e+1]))return!1;break;case 1523:case 1524:if(!o||!Cb.test(t[e-1]))return!1;break;case 8204:if(!o||o<128&&!Eb.test(t[e-1]))return!1;break;case 8205:if(!o||!Eb.test(t[e-1]))return!1}}return!(e.includes(`・`)&&!i)}function rx(e){if(!Vb(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf(`-`)===0)return!1;let n=Ub(t);return db.test(n)?nx(n):!1}catch{return!1}}function ix(e){return e.length>0&&e.length<=63}function ax(e){return ix(e)&&(rx(e)||Mb(e))}function ox(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(`.`).every(e=>ax(e))}function sx(e){return e.length>0&&e.length<=63}function cx(e){return sx(e)&&(rx(e)||nx(e))}function lx(e){return e.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize(`NFC`).replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,``).replace(/[\u002E\u3002\uFF0E\uFF61]/g,`.`)}function ux(e){if(e.length===0||e.includes(` `))return!1;let t=lx(e);if(t.length>253)return!1;let n=t.split(`.`),r=n.some(e=>Xb(e));return n.every(e=>cx(e)&&(!r||$b(e)))}function dx(e){return ox(e)}var fx=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function px(e){return fx.test(e.normalize(`NFC`))}function mx(e){return ux(e)}var hx=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function gx(e){return hx.test(e)}var _x=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function vx(e){return _x.test(e)}var yx=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,bx=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function xx(e){return!yx.test(e)&&!bx.test(e)&&URL.canParse(e,`http://example.com`)}var Sx=2048,Cx=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,wx=/[\x00-\x20<>\^`{|}\\]/,Tx=/%(?![0-9a-fA-F]{2})/;function Ex(e){return e.length<Sx?e.replace(Cx,`[::1]`):e}function Dx(e){return wx.test(e)||Tx.test(e)?!1:URL.canParse(Ex(e))}var Ox=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function kx(e){return Ox.test(e)}var Ax=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function jx(e){return Ax.test(e)}function Mx(e){try{return new RegExp(e,`u`),!0}catch{return!1}}var Nx=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Px(e){return Nx.test(e)}var Fx=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Ix(e){return Fx.test(e)}var Lx=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function Rx(e){return Lx.test(e)}var zx=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Bx(e){return zx.test(e)}function Vx(e){return URL.canParse(e)}var Hx=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Ux(e){return Hx.test(e)}var Wx=new Map;function Gx(){Wx.clear()}function Kx(e,t){return Wx.get(e)?.(t)??!0}function qx(){Gx(),Wx.set(`date-time`,rb),Wx.set(`date`,eb),Wx.set(`duration`,ab),Wx.set(`email`,sb),Wx.set(`hostname`,dx),Wx.set(`idn-email`,px),Wx.set(`idn-hostname`,mx),Wx.set(`ipv4`,gx),Wx.set(`ipv6`,vx),Wx.set(`iri-reference`,xx),Wx.set(`iri`,Dx),Wx.set(`json-pointer-uri-fragment`,kx),Wx.set(`json-pointer`,jx),Wx.set(`regex`,Mx),Wx.set(`relative-json-pointer`,Px),Wx.set(`time`,nb),Wx.set(`uri-reference`,Ix),Wx.set(`uri-template`,Rx),Wx.set(`uri`,Bx),Wx.set(`url`,Vx),Wx.set(`uuid`,Ux)}qx();function Jx(e,t,n,r){return Kx(n.format,r)}function Yx(e,t,n,r,i,a){return Jx(e,t,i,a)||t.AddError({keyword:`format`,schemaPath:n,instancePath:r,params:{format:i.format}})}function Xx(e,t,n,r){let i=!ly(n)||n.then,a=!jv(n)||n.else;return cC(e,t,n.if,r)?cC(e,t,i,r):cC(e,t,a,r)}function Zx(e,t,n,r,i,a){let o=!ly(i)||i.then,s=!jv(i)||i.else,c=new hy,l=uC(e,c,`${n}/if`,r,i.if,a)?uC(e,c,`${n}/then`,r,o,a)||t.AddError({keyword:`if`,schemaPath:n,instancePath:r,params:{failingKeyword:`then`}}):uC(e,t,`${n}/else`,r,s,a)||t.AddError({keyword:`if`,schemaPath:n,instancePath:r,params:{failingKeyword:`else`}});return l&&t.Merge([c]),l}function Qx(e,t,n,r){return Ua(n.items,0,(n,i)=>Fa(r.length,i)||sC(e,t,n,r[i])&&t.AddIndex(i))}function $x(e,t,n,r,i,a){return Wa(i.items,0,(i,o)=>{let s=`${n}/items/${o}`,c=`${r}/${o}`;return Fa(a.length,o)||lC(e,t,s,c,i,a[o])&&t.AddIndex(o)})}function eS(e,t,n,r){return Ua(r,ty(n)?n.prefixItems.length:0,(r,i)=>sC(e,t,n.items,r)&&t.AddIndex(i))}function tS(e,t,n,r,i,a){return Wa(a,ty(i)?i.prefixItems.length:0,(a,o)=>lC(e,t,`${n}/items`,`${r}/${o}`,i.items,a)&&t.AddIndex(o))}function nS(e,t,n,r){return zv(n)?Qx(e,t,n,r):eS(e,t,n,r)}function rS(e,t,n,r,i,a){return zv(i)?$x(e,t,n,r,i,a):tS(e,t,n,r,i,a)}function iS(e){return wv(e)}function aS(e,t,n,r){return!iS(n)||Fa(qa(r,r=>cC(e,t,n.contains,r)),n.maxContains)}function oS(e,t,n,r,i,a){let o=Kv(i)?i.minContains:1;return aS(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:o,maxContains:i.maxContains}})}function sS(e,t,n,r){return Fa(r,n.maximum)}function cS(e,t,n,r,i,a){return sS(e,t,i,a)||t.AddError({keyword:`maximum`,schemaPath:n,instancePath:r,params:{comparison:`<=`,limit:i.maximum}})}function lS(e,t,n,r){return Fa(r.length,n.maxItems)}function uS(e,t,n,r,i,a){return lS(e,t,i,a)||t.AddError({keyword:`maxItems`,schemaPath:n,instancePath:r,params:{limit:i.maxItems}})}function dS(e,t,n,r){return Va(r,n.maxLength)}function fS(e,t,n,r,i,a){return dS(e,t,i,a)||t.AddError({keyword:`maxLength`,schemaPath:n,instancePath:r,params:{limit:i.maxLength}})}function pS(e,t,n,r){return Fa(Qa(r).length,n.maxProperties)}function mS(e,t,n,r,i,a){return pS(e,t,i,a)||t.AddError({keyword:`maxProperties`,schemaPath:n,instancePath:r,params:{limit:i.maxProperties}})}function hS(e){return wv(e)}function gS(e,t,n,r){return!hS(n)||Ia(qa(r,(r,i)=>cC(e,t,n.contains,r)&&t.AddIndex(i)),n.minContains)}function _S(e,t,n,r,i,a){return gS(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:i.minContains}})}function vS(e,t,n,r){return Ia(r,n.minimum)}function yS(e,t,n,r,i,a){return vS(e,t,i,a)||t.AddError({keyword:`minimum`,schemaPath:n,instancePath:r,params:{comparison:`>=`,limit:i.minimum}})}function bS(e,t,n,r){return Ia(r.length,n.minItems)}function xS(e,t,n,r,i,a){return bS(e,t,i,a)||t.AddError({keyword:`minItems`,schemaPath:n,instancePath:r,params:{limit:i.minItems}})}function SS(e,t,n,r){return Ha(r,n.minLength)}function CS(e,t,n,r,i,a){return SS(e,t,i,a)||t.AddError({keyword:`minLength`,schemaPath:n,instancePath:r,params:{limit:i.minLength}})}function wS(e,t,n,r){return Ia(Qa(r).length,n.minProperties)}function TS(e,t,n,r,i,a){return wS(e,t,i,a)||t.AddError({keyword:`minProperties`,schemaPath:n,instancePath:r,params:{limit:i.minProperties}})}function ES(e,t,n,r){return La(r,n.multipleOf)}function DS(e,t,n,r,i,a){return ES(e,t,i,a)||t.AddError({keyword:`multipleOf`,schemaPath:n,instancePath:r,params:{multipleOf:i.multipleOf}})}function OS(e,t,n,r){let i=new my;return!cC(e,i,n.not,r)&&t.Merge([i])}function kS(e,t,n,r,i,a){return OS(e,t,i,a)||t.AddError({keyword:`not`,schemaPath:n,instancePath:r,params:{}})}function AS(e,t,n,r){let i=n.oneOf.reduce((t,n)=>{let i=new my;return cC(e,i,n,r)?[...t,i]:t},[]);return A(i.length,1)&&t.Merge(i)}function jS(e,t,n,r,i,a){let o=[],s=[],c=i.oneOf.reduce((t,i,c)=>{let l=new hy,u=uC(e,l,`${n}/oneOf/${c}`,r,i,a);return u&&s.push(c),u||o.push(l),u?[...t,l]:t},[]),l=A(c.length,1)&&t.Merge(c);return!l&&A(s.length,0)&&o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),l||t.AddError({keyword:`oneOf`,schemaPath:n,instancePath:r,params:{passingSchemas:s}})}function MS(e,t,n,r){return(Aa(n.pattern)?xy(n.pattern):n.pattern).test(r)}function NS(e,t,n,r,i,a){return MS(e,t,i,a)||t.AddError({keyword:`pattern`,schemaPath:n,instancePath:r,params:{pattern:i.pattern}})}function PS(e,t,n,r){return Ua(Za(n.patternProperties),0,([n,i])=>{let a=xy(n);return Ua(Za(r),0,([n,r])=>!a.test(n)||sC(e,t,i,r)&&t.AddKey(n))})}function FS(e,t,n,r,i,a){return Wa(Za(i.patternProperties),0,([i,o])=>{let s=`${n}/patternProperties/${i}`,c=xy(i);return Wa(Za(a),0,([n,i])=>{let a=`${r}/${n}`;return!c.test(n)||lC(e,t,s,a,o,i)&&t.AddKey(n)})})}function IS(e,t,n,r){return A(r.length,0)||Ua(n.prefixItems,0,(n,i)=>Fa(r.length,i)||sC(e,t,n,r[i])&&t.AddIndex(i))}function LS(e,t,n,r,i,a){return A(a.length,0)||Wa(i.prefixItems,0,(i,o)=>{let s=`${n}/prefixItems/${o}`,c=`${r}/${o}`;return Fa(a.length,o)||lC(e,t,s,c,i,a[o])&&t.AddIndex(o)})}function RS(e,t){return e.includes(t)||ho().exactOptionalPropertyTypes}function zS(e,t){return Ma(e[t])}function BS(e,t,n,r){let i=cy(n)?n.required:[];return Ua(Za(n.properties),0,([n,a])=>{let o=!j(r,n)||sC(e,t,a,r[n])&&t.AddKey(n);return RS(i,n)?o:zS(r,n)||o})}function VS(e,t,n,r,i,a){let o=cy(i)?i.required:[];return Wa(Za(i.properties),0,([i,s])=>{let c=`${n}/properties/${i}`,l=`${r}/${i}`,u=()=>!j(a,i)||lC(e,t,c,l,s,a[i])&&t.AddKey(i);return RS(o,i)?u():zS(a,i)||u()})}function HS(e,t,n,r){return Ua(Qa(r),0,(r,i)=>cC(e,t,n.propertyNames,r))}function US(e,t,n,r,i,a){let o=[];return Wa(Qa(a),0,(a,s)=>{let c=`${r}/${a}`,l=uC(e,t,`${n}/propertyNames`,c,i.propertyNames,a);return l||o.push(a),l})||t.AddError({keyword:`propertyNames`,schemaPath:n,instancePath:r,params:{propertyNames:o}})}function WS(e,t,n,r){let i=e.RecursiveRef(n)??!1;return _v(i)&&cC(e,t,i,r)}function GS(e,t,n,r,i,a){let o=e.RecursiveRef(i)??!1;return _v(o)&&uC(e,t,`#`,r,o,a)}function KS(e,t,n,r){let i=e.Ref(n)??!1,a=new my,o=_v(i)&&cC(e,a,i,r);return o&&t.Merge([a]),o}function qS(e,t,n,r,i,a){let o=e.Ref(i)??!1,s=new hy,c=_v(o)&&uC(e,s,`#`,r,o,a);return c&&t.Merge([s]),c||s.GetErrors().forEach(e=>t.AddError(e)),c}function JS(e,t,n,r){return Ua(n.required,0,e=>j(r,e))}function YS(e,t,n,r,i,a){let o=[];return Wa(i.required,0,e=>{let t=j(a,e);return t||o.push(e),t})||t.AddError({keyword:`required`,schemaPath:n,instancePath:r,params:{requiredProperties:o}})}function XS(e,t,n,r,i){return A(n,`object`)?Oa(i):A(n,`array`)?ba(i):A(n,`boolean`)?Sa(i):A(n,`integer`)?Ta(i):A(n,`number`)?Da(i):A(n,`null`)?Ea(i):A(n,`string`)?Aa(i):A(n,`bigint`)?xa(i):A(n,`constructor`)?Ca(i):A(n,`function`)?wa(i):A(n,`symbol`)?ja(i):A(n,`undefined`)?Ma(i):!A(n,`void`)||Ma(i)}function ZS(e,t,n,r,i){return Ga(n,n=>XS(e,t,n,r,i))}function QS(e,t,n,r){return ba(n.type)?ZS(e,t,n.type,n,r):XS(e,t,n.type,n,r)}function $S(e,t,n,r,i,a){return(ba(i.type)?ZS(e,t,i.type,i,a):XS(e,t,i.type,i,a))||t.AddError({keyword:`type`,schemaPath:n,instancePath:r,params:{type:i.type}})}function eC(e,t,n,r){let i=t.GetIndices();return Ua(r,0,(r,a)=>(i.has(a)||cC(e,t,n.unevaluatedItems,r))&&t.AddIndex(a))}function tC(e,t,n,r,i,a){let o=t.GetIndices(),s=[];return Wa(a,0,(a,c)=>{let l=new hy,u=(o.has(c)||uC(e,l,n,r,i.unevaluatedItems,a))&&t.AddIndex(c);return u||s.push(c),u})||t.AddError({keyword:`unevaluatedItems`,schemaPath:n,instancePath:r,params:{unevaluatedItems:s}})}function nC(e,t,n,r){let i=t.GetKeys();return Ua(Za(r),0,([r,a])=>i.has(r)||cC(e,t,n.unevaluatedProperties,a)&&t.AddKey(r))}function rC(e,t,n,r,i,a){let o=t.GetKeys(),s=[];return Wa(Za(a),0,([a,c])=>{let l=new hy,u=o.has(a)||uC(e,l,n,r,i.unevaluatedProperties,c)&&t.AddKey(a);return u||s.push(a),u})||t.AddError({keyword:`unevaluatedProperties`,schemaPath:n,instancePath:r,params:{unevaluatedProperties:s}})}function iC(e){return!A(e.uniqueItems,!1)}function aC(e,t,n,r){if(!iC(n))return!0;let i=new Set(r.map(lc)).size,a=r.length;return A(i,a)}function oC(e,t,n,r,i,a){if(!iC(i))return!0;let o=new Set,s=a.reduce((e,t,n)=>{let r=lc(t);return o.has(r)?[...e,n]:(o.add(r),e)},[]);return A(s.length,0)||t.AddError({keyword:`uniqueItems`,schemaPath:n,instancePath:r,params:{duplicateItems:s}})}function sC(e,t,n,r){return t.Push()&&cC(e,t,n,r)&&t.Pop()}function cC(e,t,n,r){e.Push(n);let i=gv(n)?Ay(e,t,n,r):(!uy(n)||QS(e,t,n,r))&&(!(ka(r)&&!ba(r))||(!cy(n)||JS(e,t,n,r))&&(!yv(n)||wy(e,t,n,r))&&(!Ev(n)||Ly(e,t,n,r))&&(!Dv(n)||zy(e,t,n,r))&&(!Ov(n)||Vy(e,t,n,r))&&(!ey(n)||PS(e,t,n,r))&&(!ny(n)||BS(e,t,n,r))&&(!ry(n)||HS(e,t,n,r))&&(!Yv(n)||wS(e,t,n,r))&&(!Wv(n)||pS(e,t,n,r)))&&(!ba(r)||(!vv(n)||yy(e,t,n,r))&&(!wv(n)||Fy(e,t,n,r))&&(!Rv(n)||nS(e,t,n,r))&&(!Vv(n)||aS(e,t,n,r))&&(!Hv(n)||lS(e,t,n,r))&&(!Kv(n)||gS(e,t,n,r))&&(!qv(n)||bS(e,t,n,r))&&(!ty(n)||IS(e,t,n,r))&&(!dy(n)||aC(e,t,n,r)))&&(!Aa(r)||(!Uv(n)||dS(e,t,n,r))&&(!Jv(n)||SS(e,t,n,r))&&(!Fv(n)||Jx(e,t,n,r))&&(!$v(n)||MS(e,t,n,r)))&&(!(Da(r)||xa(r))||(!Nv(n)||qy(e,t,n,r))&&(!Pv(n)||Yy(e,t,n,r))&&(!Bv(n)||sS(e,t,n,r))&&(!Gv(n)||vS(e,t,n,r))&&(!Xv(n)||ES(e,t,n,r)))&&(!sy(n)||KS(e,t,n,r))&&(!oy(n)||WS(e,t,n,r))&&(!Av(n)||Uy(e,t,n,r))&&(!Cv(n)||My(e,t,n,r))&&(!Mv(n)||Gy(e,t,n,r))&&(!Lv(n)||Xx(e,t,n,r))&&(!Zv(n)||OS(e,t,n,r))&&(!bv(n)||Ey(e,t,n,r))&&(!Sv(n)||Oy(e,t,n,r))&&(!Qv(n)||AS(e,t,n,r))&&(!fy(n)||!ba(r)||eC(e,t,n,r))&&(!py(n)||!ka(r)||nC(e,t,n,r))&&(!mv(n)||gy(e,t,n,r));return e.Pop(n),i}function lC(e,t,n,r,i,a){return t.Push()&&uC(e,t,n,r,i,a)&&t.Pop()}function uC(e,t,n,r,i,a){if(t.AtCapacity())return!1;e.Push(i);let o=gv(i)?jy(e,t,n,r,i,a):!!(+(!uy(i)||$S(e,t,n,r,i,a))&(!(ka(a)&&!ba(a))||!!(+(!cy(i)||YS(e,t,n,r,i,a))&(!yv(i)||Ty(e,t,n,r,i,a))&(!Ev(i)||Ry(e,t,n,r,i,a))&(!Dv(i)||By(e,t,n,r,i,a))&(!Ov(i)||Hy(e,t,n,r,i,a))&(!ey(i)||FS(e,t,n,r,i,a))&(!ny(i)||VS(e,t,n,r,i,a))&(!ry(i)||US(e,t,n,r,i,a))&(!Yv(i)||TS(e,t,n,r,i,a))&(!Wv(i)||mS(e,t,n,r,i,a))))&(!ba(a)||!!(+(!vv(i)||by(e,t,n,r,i,a))&(!wv(i)||Iy(e,t,n,r,i,a))&(!Rv(i)||rS(e,t,n,r,i,a))&(!Vv(i)||oS(e,t,n,r,i,a))&(!Hv(i)||uS(e,t,n,r,i,a))&(!Kv(i)||_S(e,t,n,r,i,a))&(!qv(i)||xS(e,t,n,r,i,a))&(!ty(i)||LS(e,t,n,r,i,a))&(!dy(i)||oC(e,t,n,r,i,a))))&(!Aa(a)||!!(+(!Uv(i)||fS(e,t,n,r,i,a))&(!Jv(i)||CS(e,t,n,r,i,a))&(!Fv(i)||Yx(e,t,n,r,i,a))&(!$v(i)||NS(e,t,n,r,i,a))))&(!(Da(a)||xa(a))||!!(+(!Nv(i)||Jy(e,t,n,r,i,a))&(!Pv(i)||Xy(e,t,n,r,i,a))&(!Bv(i)||cS(e,t,n,r,i,a))&(!Gv(i)||yS(e,t,n,r,i,a))&(!Xv(i)||DS(e,t,n,r,i,a))))&(!sy(i)||qS(e,t,n,r,i,a))&(!oy(i)||GS(e,t,n,r,i,a))&(!Av(i)||Wy(e,t,n,r,i,a))&(!Cv(i)||Ny(e,t,n,r,i,a))&(!Mv(i)||Ky(e,t,n,r,i,a))&(!Lv(i)||Zx(e,t,n,r,i,a))&(!Zv(i)||kS(e,t,n,r,i,a))&(!bv(i)||Dy(e,t,n,r,i,a))&(!Sv(i)||ky(e,t,n,r,i,a))&(!Qv(i)||jS(e,t,n,r,i,a))&(!fy(i)||!ba(a)||tC(e,t,n,r,i,a))&(!py(i)||!ka(a)||rC(e,t,n,r,i,a)))&&(!mv(i)||_y(e,t,n,r,i,a));return e.Pop(i),o}function dC(e,t){return ka(t)&&!Ya(e)?t[e]:void 0}function fC(e,t){return e.reduce((e,t)=>dC(t,e),t)}function pC(e){if(A(e.length,0))return[];let t=e.split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`));return t.length>0&&t[0]===``?t.slice(1):t}function mC(e,t){return fC(pC(t),e)}var hC=`https://json-schema.org`;function gC(e,t){if(ka(e)&&kv(e)&&A(e.$dynamicAnchor,t))return e;if(ka(e))for(let n of Qa(e)){let r=gC(e[n],t);if(r)return r}}function _C(e,t,n){if(A(e,n))return t.href;let r=hv(e)&&Iv(e)?new URL(e.$id,t.href):t;if(ba(e))for(let t of e){let e=_C(t,r,n);if(!Ma(e))return e}else if(ka(e))for(let t of Qa(e)){let i=_C(e[t],r,n);if(!Ma(i))return i}}function vC(e,t,n){if(A(e.$id,n.hash))return e;let r=new URL(n.href,t.href);if(A(t.pathname,r.pathname))return n.hash.startsWith(`#`)?xC(e,n):e}function yC(e,t,n){let r=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return A(r.href,i.href)?e:void 0}function bC(e,t,n){let r=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return A(r.href,i.href)?e:void 0}function xC(e,t){if(t.href.endsWith(`#`))return e;if(!t.hash.startsWith(`#`))return;let n=decodeURIComponent(t.hash.slice(1));if(n.startsWith(`/`))return mC(e,n)}function SC(e,t,n){if(Iv(e)){let r=vC(e,t,n);if(!Ma(r))return r}if(xv(e)){let r=yC(e,t,n);if(!Ma(r))return r}if(kv(e)){let r=bC(e,t,n);if(!Ma(r))return r}return xC(e,n)}function CC(e,t,n){return e.reduce((e,r)=>{let i=EC(r,t,n);return Ma(i)?e:i},void 0)}function wC(e){return A(e,`const`)||A(e,`enum`)}function TC(e,t,n){return Qa(e).reduce((r,i)=>{if(wC(i))return r;let a=EC(e[i],t,n);return Ma(a)?r:a},void 0)}function EC(e,t,n){let r=hv(e)&&Iv(e)?new URL(e.$id,t.href):t;if(hv(e)){let t=SC(e,r,n);if(!Ma(t))return t}if(ba(e))return CC(e,r,n);if(ka(e))return TC(e,r,n)}function DC(e,t,n){return _C(e,new URL(t||`.`,hC),n)}function OC(e,t,n,r){let i=LC(e,t,n,r,!1);return hv(i)&&Iv(i)?i:void 0}function kC(e){return e.href.split(`#`)[0]}function AC(e,t){return j(e,t)?e[t]:void 0}function jC(e,t,n){return EC(e,t,n)}function MC(e,t,n){let r=kC(n);if(A(r,kC(t))||!j(e,r))return;let i=e[r],a=hv(i)&&Iv(i)?new URL(i.$id,r):new URL(r);return A(n.hash,``)?i:EC(i,a,n)}function NC(e,t,n,r,i){if(!r.$ref.startsWith(`#`)||j(e,`$schema`))return;let a=DC(t,n,i);if(!(Ma(a)||A(a,n)))return{target:i,base:a,root:t}}function PC(e,t,n){let r=e[t];if(hv(r))return{target:n,base:t,root:r}}function FC(e,t,n,r,i){let a=i?PC(e.context,r,n):void 0;return Ma(a)?NC(e.root,e.lexicalSchema,e.referenceBase,t,n):a}function IC(e,t,n,r,i,a){if(Iv(i))return;let o=OC(e,t,n,r);if(o&&!a.includes(o))return{target:i,resource:o}}function LC(e,t,n,r,i=!0){let a=new URL(n||`.`,hC),o=i&&Iv(t)?new URL(t.$id,a):a,s=new URL(r,o.href);return AC(e,r)??jC(t,o,s)??MC(e,o,s)}function RC(e,t,n,r,i,a){let o=new URL(n||`.`,hC),s=LC(e,i.$dynamicRef.startsWith(`#`)?r:t,n,i.$dynamicRef,!1);if(Ma(s)){let e=new URL(i.$dynamicRef,o).hash;if(!e.startsWith(`#/`)&&e.startsWith(`#`)){let n=decodeURIComponent(e.slice(1));return a.find(e=>A(e.$dynamicAnchor,n))??gC(t,n)}}else return!hv(s)||!kv(s)||new URL(i.$dynamicRef,o).hash.startsWith(`#/`)?s:a.find(e=>A(e.$dynamicAnchor,s.$dynamicAnchor))??s}function zC(e,t){let n=e.inRetrievedFrame?e.lexicalSchema:e.root,r=t.$ref.startsWith(`#`)?e.lexicalSchema:n,i=LC(e.context,r,e.referenceBase,t.$ref,!1);if(!i||!hv(i))return{schema:i};let a=new URL(t.$ref,e.referenceBase).href.split(`#`)[0],o=!A(a,e.resourceBase);return{schema:i,retrievedResource:FC(e,t,i,a,o),resolvedResource:o?IC(e.context,e.root,e.referenceBase,a,i,e.ids):void 0}}function BC(e,t){let n=ay(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return LC(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function VC(e,t){return RC(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var HC=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw=class{constructor(e,t){UC.add(this),this.context=e,this.schema=t,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return HC(this,UC,`m`,KC).call(this,this.ids)}Push(e){if(!hv(e))return;Iv(e)&&HC(this,UC,`m`,ew).call(this,e),xv(e)&&this.anchors.push(e),ay(e)&&this.recursiveAnchors.push(e),kv(e)&&this.dynamicAnchors.push(e);let t=this.retrievedResources.get(e);t&&this.retrievedFrames.push({schema:t.root,base:t.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(e){hv(e)&&(Iv(e)&&HC(this,UC,`m`,tw).call(this,e),xv(e)&&this.anchors.pop(),ay(e)&&this.recursiveAnchors.pop(),kv(e)&&this.dynamicAnchors.pop(),this.retrievedResources.has(e)&&this.retrievedFrames.pop(),HC(this,UC,`m`,rw).call(this,e))}Ref(e){let t=zC(HC(this,UC,`m`,WC).call(this),e);return HC(this,UC,`m`,GC).call(this,t),t.schema}RecursiveRef(e){let t=BC(HC(this,UC,`m`,WC).call(this),e);return t&&(this.pendingResource=!0),t}DynamicRef(e){let t=VC(HC(this,UC,`m`,WC).call(this),e);return t&&(this.pendingResource=!0),t}};UC=new WeakSet,WC=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:HC(this,UC,`m`,YC).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:HC(this,UC,`m`,JC).call(this),resourceBase:HC(this,UC,`m`,qC).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},GC=function(e){Ma(e.schema)||(this.pendingResource=!0),Ma(e.resolvedResource)||HC(this,UC,`m`,nw).call(this,e.resolvedResource.target,e.resolvedResource.resource),Ma(e.retrievedResource)||this.retrievedResources.set(e.retrievedResource.target,{base:e.retrievedResource.base,root:e.retrievedResource.root})},KC=function(e){let t=this.retrievedFrames[this.retrievedFrames.length-1],n=t?new URL(t.base):new URL(hC);return(t?e.slice(t.idDepth):e).reduce((e,t)=>new URL(t.$id,e),n).href},qC=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.resourceIds.slice(e.resourceDepth).reduce((e,t)=>new URL(t.$id,e),new URL(e.base)).href:HC(this,UC,`m`,KC).call(this,this.resourceIds)},JC=function(){if(this.retrievedFrames.length>0)return HC(this,UC,`m`,qC).call(this);let e=this.ids[this.ids.length-1];return e&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)?this.LexicalBaseURL():HC(this,UC,`m`,qC).call(this)},YC=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.ids.length>e.idDepth?this.ids[this.ids.length-1]:e.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},XC=function(e){e.forEach(e=>HC(this,UC,`m`,QC).call(this,e,!1))},ZC=function(e){e.forEach(e=>HC(this,UC,`m`,$C).call(this,e,!1))},QC=function e(t,n=!0){if(gv(t))return;if(ba(t))return HC(this,UC,`m`,XC).call(this,t);if(!hv(t))return;let r=t;if(n||!Iv(r)){!n&&kv(r)&&this.dynamicAnchors.push(r);for(let t of Qa(r))HC(this,UC,`m`,e).call(this,r[t],!1)}},$C=function e(t,n=!0){if(gv(t))return;if(ba(t))return HC(this,UC,`m`,ZC).call(this,t);if(!hv(t))return;let r=t;if(n||!Iv(r)){!n&&kv(r)&&this.dynamicAnchors.pop();for(let t of Qa(r))HC(this,UC,`m`,e).call(this,r[t],!1)}},ew=function(e){this.ids.push(e);let t=this.pendingResource;this.pendingResource=!1,t&&this.resourceIds.push(e),HC(this,UC,`m`,QC).call(this,e,!0)},tw=function(e){this.ids.pop(),this.resourceIds.length>0&&A(this.resourceIds[this.resourceIds.length-1],e)&&this.resourceIds.pop(),HC(this,UC,`m`,$C).call(this,e,!0)},nw=function(e,t){HC(this,UC,`m`,ew).call(this,t),this.resolvedResources.set(e,t)},rw=function(e){if(!this.resolvedResources.has(e))return;let t=this.resolvedResources.get(e);HC(this,UC,`m`,tw).call(this,t),this.resolvedResources.delete(e)};function aw(...e){let[t,n,r]=Ss(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]}),i=new iw(t,n),a=new hy,o=uC(i,a,`#`,``,n,r),s=a.GetErrors(),c=fc();return[o,s.map(e=>({...e,message:c(e)}))]}function ow(...e){let[t,n,r]=Ss(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return cC(new iw(t,n),new my,n,r)}function sw(...e){let[t,n,r]=Ss(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return ow(t,n,r)}function cw(...e){let[t,n,r]=Ss(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]}),[i,a]=aw(t,n,r);return a}function lw(e,t,n){return ba(n)?n.map(n=>bw(e,t.items,n)):n}function uw(e,t,n){return bw({...e,...t.$defs},es(t.$ref),n)}function dw(e,t){let n=j(t,`unevaluatedProperties`)?{additionalProperties:t.unevaluatedProperties}:{},r=lv(iv(e,t));return ms(r)?W_(r,n):r}function fw(e,t,n){return bw(e,dw(e,t),n)}function pw(e){return j(e,`additionalProperties`)?e.additionalProperties:void 0}function mw(e,t,n){if(!ka(n)||ba(n))return n;let r=pw(t);for(let i of Qa(n))j(t.properties,i)?n[i]=bw(e,t.properties[i],n[i]):Sa(r)&&A(r,!0)||Io(r)&&sw(e,r,n[i])?n[i]=bw(e,r,n[i]):delete n[i];return n}function hw(e,t,n){if(!ka(n))return n;let r=pw(t),[i,a]=[new RegExp(_u(t)),yu(t)];for(let t of Qa(n))i.test(t)?n[t]=bw(e,a,n[t]):Sa(r)&&A(r,!0)||Io(r)&&sw(e,r,n[t])?n[t]=bw(e,r,n[t]):delete n[t];return n}function gw(e,t,n){return j(e,t.$ref)?bw(e,e[t.$ref],n):n}function _w(e,t,n){if(!ba(n))return n;let r=Math.min(n.length,t.items.length);for(let i=0;i<r;i++)n[i]=bw(e,t.items[i],n[i]);return Na(n.length,r)?n.slice(0,r):n}function vw(e){return ko(e)}function yw(e,t,n){for(let r of t.anyOf){let t=bw(e,r,vw(n));if(sw(e,r,t))return t}return n}function bw(e,t,n){return Ko(t)?lw(e,t,n):ys(t)?uw(e,t,n):Ms(t)?fw(e,t,n):ms(t)?mw(e,t,n):bu(t)?hw(e,t,n):ts(t)?gw(e,t,n):ll(t)?_w(e,t,n):Bc(t)?yw(e,t,n):n}function xw(e,t){for(let n of po.Keys(e))po.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function Sw(e){let t={};for(let n of po.Keys(e))t[n]=Tw(e[n]);return t}function Cw(e){return ww(pv(e))}function ww(e){return e.map(e=>Tw(e))}function Tw(e){return xw(e,Ko(e)?Go(Tw(e.items),qo(e)):Ms(e)?js(ww(e.allOf)):Bc(e)?F(Cw(e.anyOf)):ms(e)?N(Sw(e.properties)):bu(e)?mu(vu(e),Tw(yu(e))):ll(e)?cl(ww(e.items)):e)}function Ew(e){return Tw(e)}function Dw(...e){let[t,n,r]=Ss(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return bw(t,ho().unionPrioritySort?Ew(n):n,r)}BigInt(2**53-1),BigInt(-(2**53-1));function Ow(e,t,n){if(!ba(n))return n;for(let r=0;r<n.length;r++)n[r]=Lw(e,t.items,n[r]);return n}function kw(e,t,n){return Lw({...e,...t.$defs},es(t.$ref),n)}function Aw(e,t){return Ma(t)?wa(e.default)?e.default():vw(e.default):t}function jw(e,t,n){return Lw(e,lv(iv(e,t)),n)}function Mw(e,t,n){if(!ka(n))return n;let r=Qa(t.properties);for(let i of r){let r=Lw(e,t.properties[i],n[i]);(!Ma(r)||!us(t.properties[i])&&j(t.properties[i],`default`))&&(n[i]=r)}if(!yv(t)||Sa(t.additionalProperties))return n;for(let i of Qa(n))r.includes(i)||(n[i]=Lw(e,t.additionalProperties,n[i]));return n}function Nw(e,t,n){if(!ka(n))return n;let[r,i]=[new RegExp(_u(t)),yu(t)];for(let t of Qa(n))r.test(t)&&Tv(i)&&(n[t]=Lw(e,i,n[t]));if(!yv(t))return n;for(let i of Qa(n))r.test(i)||(n[i]=Lw(e,t.additionalProperties,n[i]));return n}function Pw(e,t,n){return j(e,t.$ref)?Lw(e,e[t.$ref],n):n}function Fw(e,t,n){if(!ba(n))return n;let[r,i]=[t.items,Math.max(t.items.length,n.length)];for(let t=0;t<i;t++)t<r.length&&(n[t]=Lw(e,r[t],n[t]));return n}function Iw(e,t,n){for(let r of t.anyOf){let t=Lw(e,r,vw(n));if(sw(e,r,t))return t}return n}function Lw(e,t,n){let r=Tv(t)?Aw(t,n):n;return Ko(t)?Ow(e,t,r):ys(t)?kw(e,t,r):Ms(t)?jw(e,t,r):ms(t)?Mw(e,t,r):bu(t)?Nw(e,t,r):ts(t)?Pw(e,t,r):ll(t)?Fw(e,t,r):Bc(t)?Iw(e,t,r):r}function Rw(...e){let[t,n,r]=Ss(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return Lw(t,n,r)}F([N({type:P(`insert`),path:Rc(),value:gs()}),Object({type:P(`update`),path:Rc(),value:gs()}),N({type:P(`delete`),path:Rc()})]);var zw=[`aborted`,`contract_mismatch`,`forbidden`,`gone`,`invalid`,`not_in_variant`,`not_ready`,`released`,`superseded`,`unavailable`,`upgrade_conflict`,`upgrade_required`],Bw=new Set([`superseded`,`upgrade_conflict`]),I=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=Bw.has(e),this.details=n?.details}},Vw=(e,t)=>e instanceof I&&(t===void 0||e.code===t),Hw=(e,t,n)=>new I(`invalid`,t,{reason:e,details:n}),Uw=(e,t)=>e instanceof I?e:new I(`unavailable`,`${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e});async function Ww(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 Gw=e=>typeof e==`object`&&e?e:e===!1?{not:{}}:{};function Kw(e){return typeof e!=`object`||!e?JSON.stringify(e)??`null`:Array.isArray(e)?`[${e.map(e=>Kw(e)).join(`,`)}]`:`{${Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${Kw(e[t])}`).join(`,`)}}`}function qw(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 Jw(e,t){return e===t||Kw(e)===Kw(t)}function Yw(e,t,n,r){if(sw(n,r))return;let i=[...cw(n,r)].slice(0,3);throw Hw(e,`${t}: ${i.map(e=>`${e.instancePath||`/`} ${e.message}`).join(`; `)}`,i)}function Xw(e,t,n){let r=Dw(e,Rw(e,vw(t??{})));return Yw(`input`,n,e,r),r}function Zw(e,t){return Kw(Qw(Gw(e),t))}function Qw(e,t){if(Array.isArray(t)){let n=e.items;return Array.isArray(n)?t.map((e,t)=>Qw(Gw(n[t]),e)):t.map(e=>Qw(Gw(n),e))}if(typeof t!=`object`||!t)return t;let n=Gw(e.properties),r={};for(let[e,i]of Object.entries(t)){let t=Gw(n[e]);`default`in t&&Jw(t.default,i)||(r[e]=Qw(t,i))}return r}var $w=[`minLength`,`maxLength`,`pattern`,`format`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`minItems`,`maxItems`,`uniqueItems`,`minProperties`,`maxProperties`],eT=e=>typeof e.type==`string`?[e.type]:Array.isArray(e.type)?e.type:void 0,tT=new Set([...$w,`type`,`properties`,`required`,`additionalProperties`,`patternProperties`,`items`,`additionalItems`,`const`,`enum`,`anyOf`,`parameters`,`returnType`]),nT=new Set([`title`,`description`,`default`,`examples`,`$id`,`$schema`,`$comment`,`readOnly`,`writeOnly`,`deprecated`]),rT=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!nT.has(e)));function iT(e,t){let n=rT(Gw(e)),r=rT(Gw(t));if(Object.keys(r).length===0||Jw(n,r))return!0;if(Object.keys(r).some(e=>!tT.has(e))||r.additionalProperties!==void 0&&typeof r.additionalProperties!=`boolean`)return!1;if(Array.isArray(n.anyOf))return n.anyOf.every(e=>iT(e,r));if(Array.isArray(r.anyOf))return r.anyOf.some(e=>iT(n,e));if(`const`in r)return`const`in n&&Jw(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=>Jw(t,e)))??!1;for(let e of $w)if(e in r&&!Jw(n[e],r[e]))return!1;let i=eT(r),a=eT(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`)&&!aT(n,r)||a.includes(`array`)&&!oT(n,r)?!1:!a.includes(`function`)||sT(n,r)}function aT(e,t){let n=Gw(e.properties),r=Gw(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(!iT(n[t],i))return!1}else if(typeof e.additionalProperties==`object`&&!iT(e.additionalProperties,i))return!1;if(t.additionalProperties===!1&&(e.additionalProperties!==!1||Object.keys(n).some(e=>!(e in r))))return!1;let a=Gw(t.patternProperties);if(Object.keys(a).length>0){let t=Gw(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)&&!iT(t,i))return!1;if(Object.keys(t).length>0&&(!(e in t)||!iT(t[e],i)))return!1}for(let e of Object.keys(t))if(!(e in a))return!1}return!0}function oT(e,t){return Array.isArray(t.items)?!Array.isArray(e.items)||e.items.length!==t.items.length?!1:e.items.every((e,n)=>iT(e,t.items[n])):Array.isArray(e.items)?e.items.every(e=>iT(e,t.items)):iT(e.items,t.items)}function sT(e,t){let n=e.parameters??[],r=t.parameters??[];return n.length>r.length||!n.every((e,t)=>iT(r[t],e))?!1:iT(e.returnType,t.returnType)}var cT=Symbol(`chord.member`);function lT(e,t){return{[cT]:`method`,args:e,result:t}}function uT(e){if(typeof e!=`string`||e===``)throw TypeError(`hostNamed needs a host name`);return{name:e}}function dT(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 Hw(`placement`,`${e}: input field ${t.key} names no host`);return t.prefix+r}var fT=(e,t)=>`name`in e?e.name===t:t.startsWith(e.prefix)&&t.length>e.prefix.length,pT=e=>`name`in e?e.name:`${e.prefix}<${e.key}>`,mT=bs(N({})),hT=F([N({kind:P(`method`),args:M(mT),result:M(mT)}),N({kind:P(`state`),schema:mT}),N({kind:P(`opaque`),id:Rc()})]),gT=F([N({name:Rc({minLength:1})},{additionalProperties:!1}),N({prefix:Rc({minLength:1}),key:Rc({minLength:1})},{additionalProperties:!1})]),_T=N({name:Rc({minLength:1}),scope:F([P(`remote`),P(`local`)]),version:Cc(),input:mT,host:M(gT),variants:mu(Rc(),mu(Rc(),hT))}),vT=new Set([`variant`,`status`,`ready`,`shape`,`error`,`onShape`,`onStatus`,`release`,`then`,`contract`]);function yT(e,t,n){if(vT.has(e))throw TypeError(`member name is reserved: ${e}`);let r=t[cT];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 bT(e){return{...e,fingerprint:qw(Kw(e.description))}}function xT(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 ST(e,t){xT(e,t.version);let n=t.host;if(n===void 0||!sw(gT,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]=yT(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]=yT(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 bT({scope:`remote`,name:e,version:t.version,input:t.input,def:t,description:a})}function CT(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 I(`invalid`,`malformed contract token`,{reason:`token`});let o={name:t,version:r,input:i,description:e,fingerprint:qw(Kw(e))};return n===`remote`?{...o,scope:n,def:{version:r,input:i,host:a,variants:{}}}:{...o,scope:n,def:{version:r,input:i}}}function wT(e,t){if(e.name!==t.name||e.scope!==t.scope)return`different type`;if(!TT(e,t))return`host`;if(!iT(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&&!iT(i.args,r.args))return`${n}.${e} arguments`;if(i.result!==void 0&&(r.result===void 0||!iT(r.result,i.result)))return`${n}.${e} result`}else if(r.kind===`state`&&i.kind===`state`){if(!iT(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 TT=(e,t)=>Kw(e.host??null)===Kw(t.host??null),ET=e=>e.host===void 0?`(local)`:pT(e.host);function DT(e,t,n){if(e.fingerprint===n.fingerprint)return;if(!TT(e.description,n.description))throw new I(`contract_mismatch`,`${e.name} lives on ${ET(e.description)}, the consumer expects ${ET(n.description)}`);if(e.version===n.version){let t=wT(e.description,n.description);if(t===void 0)return;throw new I(`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 I(`contract_mismatch`,`${e.name}: provider version ${e.version}, consumer version ${n.version}, no accepts adapter`);return r}function OT(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 kT=65536,AT=4096,jT=new WeakSet,MT=(e,t)=>{jT.has(e)||(e.length>=AT?jT.add(e):e.push(t))},NT=e=>typeof e==`object`&&!!e,PT=(e,t,n)=>{e.length===0?MT(n,[`r`,t]):MT(n,[`s`,e,t])},FT=(e,t)=>{if(e===t)return!0;if(!NT(e)||!NT(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(!FT(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)||!FT(e[t],n[t]))return!1;return!0},IT=(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},LT=(e,t,n,r)=>{if(e===t)return;if(t.length>e.length&&t.slice(0,e.length)===e){MT(r,[`a`,n,t.slice(e.length)]);return}let i=PO(e,t,kT);i===0?MT(r,[`s`,n,t]):(MT(r,[`t`,n,e.length-i]),t.length>i&&MT(r,[`a`,n,t.slice(i)]))},RT=2e5,zT=65536,BT=(e,t)=>e===t||FT(e,t),VT=(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},HT=(e,t)=>{if(BT(e,t))return!0;if(!NT(e)||!NT(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)=>NT(e)&&e===t[n]);let n=e,r=t;for(let e of Object.keys(n)){let t=n[e];if(NT(t)&&Object.hasOwn(r,e)&&t===r[e])return!0}return!1},UT=(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},WT=(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}},GT=(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[UT(n,a+1)];r!==void 0&&(i.push([r,o]),a=r)}return i},KT=(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>RT)return GT(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=UT(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},qT=(e,t,n,r,i,a,o,s,c,l)=>{let u=i,d=o,f=c;for(let[i,a]of l){if(jT.has(r))return;JT(e,t,n,r,u,i,d,a,f),f+=a-d,BT(e[i],t[a])||ZT(e[i],t[a],[...n,f],r),f+=1,u=i+1,d=a+1}jT.has(r)||JT(e,t,n,r,u,a,d,s,f)};function JT(e,t,n,r,i,a,o,s,c){if(jT.has(r))return;for(;i<a&&o<s&&BT(e[i],t[o]);)i+=1,o+=1,c+=1;for(;i<a&&o<s&&BT(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){MT(r,[`p`,n,c,l,t.slice(o,s)]);return}if(l===u){let u=[];for(let n=0;n<l;n++)BT(e[i+n],t[o+n])&&u.push([i+n,o+n]);if(u.length>0){qT(e,t,n,r,i,a,o,s,c,u);return}}let d=WT(e,i,a,t,o,s);if(d!==void 0&&d.length>0){qT(e,t,n,r,i,a,o,s,c,d);return}let f=KT(e,i,a,t,o,s);if(f.length>0){qT(e,t,n,r,i,a,o,s,c,f);return}let p=VT(e.slice(i,a),t.slice(o,s),HT,zT);if(p!==void 0&&p.length>0){let l=p.map(([e,t])=>[i+e,o+t]);qT(e,t,n,r,i,a,o,s,c,l)}else l===1&&u===1?ZT(e[i],t[o],[...n,c],r):MT(r,[`p`,n,c,l,t.slice(o,s)])}var YT=(e,t,n,r)=>{if(!(e===t||FT(e,t))){if(e.length===t.length&&e.length>1&&!BT(e[0],t[0])&&!BT(e[e.length-1],t[t.length-1])){let i=IT(e,t);if(i!==void 0){MT(r,[`m`,n,i]);return}}JT(e,t,n,r,0,e.length,0,t.length,0)}},XT=(e,t,n,r)=>{let i=Object.keys(e),a=Object.keys(t);if([...i,...a].some(e=>FO.has(e)))FT(e,t)||PT(n,t,r);else{for(let i of a){if(jT.has(r))return;Object.hasOwn(e,i)?ZT(e[i],t[i],[...n,i],r):PT([...n,i],t[i],r)}for(let e of i){if(jT.has(r))return;Object.hasOwn(t,e)||MT(r,[`d`,[...n,e]])}}},ZT=(e,t,n,r)=>{e===t||jT.has(r)||(typeof e==`string`&&typeof t==`string`&&n.length>0?LT(e,t,n,r):Array.isArray(e)&&Array.isArray(t)?YT(e,t,n,r):NT(e)&&NT(t)&&!Array.isArray(e)&&!Array.isArray(t)?XT(e,t,n,r):PT(n,t,r))},QT=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+=QT(e[n])+(n===0?0:1);return t}let t=2,n=0;for(let r of Object.keys(e))t+=r.length+3+QT(e[r])+(n++===0?0:1);return t},$T=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},eE=e=>{switch(e[0]){case`r`:return 6+QT(e[1]);case`s`:return 7+$T(e[1])+QT(e[2]);case`d`:return 6+$T(e[1]);case`a`:return 7+$T(e[1])+e[2].length+2;case`t`:return 7+$T(e[1])+String(e[2]).length;case`p`:return 10+$T(e[1])+String(e[2]).length+String(e[3]).length+QT(e[4]);case`m`:return 7+$T(e[1])+QT(e[2])}};function tE(e,t){let n=[];if(ZT(e,t,[],n),jT.has(n))return[[`r`,t]];if(n.length===0||n[0]?.[0]===`r`)return n;let r=2;for(let e of n)r+=eE(e)+1;if(r<65536)return n;let i=QT(t)+6;return r>=i?[[`r`,t]]:n}var nE={value:void 0,writable:!0,enumerable:!0,configurable:!0};function rE(e,t){return iE(e,void 0,t?.omitUndefinedProperties===!0)}function iE(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`);aE(t,String(i),iE(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||aE(i,t,iE(a.value,r,n))}return i}finally{r.delete(e)}}function aE(e,t,n){nE.value=n,Object.defineProperty(e,t,nE),nE.value=void 0}var oE={value:void 0,writable:!0,enumerable:!0,configurable:!0};function sE(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=cE(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`?fE(t.target,e[2],e[3],e[4]):pE(t.target,e[2]);continue}let t=e[1],i=cE(n,t,t.length-1,r);n=i.root;let a=t[t.length-1];switch(e[0]){case`s`:dE(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`);fE(i.target,a,1,[])}else Reflect.deleteProperty(i.target,a);break;case`a`:{let t=uE(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted append target is not a string`);dE(i.target,a,`${t}${e[2]}`);break}case`t`:{let t=uE(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted truncate target is not a string`);dE(i.target,a,t.slice(e[2]));break}}}return n}function cE(e,t,n,r){if(!mE(e))throw TypeError(`Trusted operation root is not a container`);let i=e;r.has(e)||(i=lE(e),r.add(i));let a=i;for(let e=0;e<n;e++){let n=t[e],i=uE(a,n);if(!mE(i))throw TypeError(`Trusted operation path is not a container`);if(r.has(i)){a=i;continue}let o=lE(i);dE(a,n,o),r.add(o),a=o}return{root:i,target:a}}function lE(e){if(Array.isArray(e))return Array.from(e);let t=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let n of Object.keys(e))dE(t,n,e[n]);return t}function uE(e,t){return e[t]}function dE(e,t,n){oE.value=n,Object.defineProperty(e,t,oE),oE.value=void 0}function fE(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++)dE(e,t+n,r[n])}function pE(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 mE(e){return typeof e==`object`&&!!e}var hE=Symbol(`chord.delta.overlay.node`),gE=new WeakMap,_E={},vE=new Set([`push`,`pop`,`shift`,`unshift`,`splice`,`reverse`,`sort`,`fill`,`copyWithin`]),yE=4096,bE=128,xE={value:void 0,writable:!0,enumerable:!0,configurable:!0},SE=class{#e;value;base;ops;constructor(e,t,n){this.#e=e,this.value=t,this.base=e.baseValue,this.ops=n,gE.set(this,e)}get baseRevision(){return this.#e.baseRevision}abort(){kO(this.#e)}},CE=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;VE(e),e.status.value=`prepared`;try{e.replacement||(e.ops=e.dirty.length===0?[]:eO(e));let t=EE(e);return this.#t=e.status,this.#n=!0,t}catch(t){throw e.status.value=`aborted`,jO(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,kO(this.#e),this.#e=void 0)}},wE=class{#e={};#t=new Set;#n;#r;#i=0;#a=256;constructor(e){this.#r=e,this.#n=new WeakRef(this)}get value(){return this.#r}get revision(){return this.#i}beginChange(){let e=OE(this.#n,this.#e,this.#i,this.#r,!1,this.#r);return this.#o(e),new CE(e)}prepareReplace(e){let t=OE(this.#n,this.#e,this.#i,e,!0,this.#r);t.status.value=`prepared`,this.#o(t);try{return EE(t)}catch(e){throw t.status.value=`aborted`,jO(t),e}}adopt(e){let t=gE.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.#i)throw t.status.value=`stale`,jO(t),Error(`Prepared change is stale`);if(this.#r!==e.base)throw t.status.value=`stale`,Error(`Prepared change is stale`);this.#r=e.value,t.status.value=`consumed`,this.#i+=1,this.#c(t)}releaseContext(e){e.registryRef!==void 0&&this.#t.delete(e.registryRef),e.registryRef=void 0}#o(e){let t=new WeakRef(e);e.registryRef=t,this.#t.add(t),--this.#a,this.#a===0&&(this.#s(),this.#a=Math.max(256,this.#t.size))}#s(){for(let e of this.#t)e.deref()===void 0&&this.#t.delete(e)}#c(e){for(let t of this.#t){let n=t.deref();n!==void 0&&n!==e&&((n.status.value===`open`||n.status.value===`prepared`)&&(n.status.value=`stale`),AO(n))}this.#t.clear(),this.#a=256}replacementBase(e){return e.baseRevision===this.#i?this.#r:void 0}};function TE(e){return new wE(e)}function EE(e){let t=DO(e),n=e.baseValue,r=new SE(e,t.length===0?n:e.simpleObjectMaterialization?YD(e.root):DE(n,t),t);return e.nodes.length>4096?AO(e):jO(e),r}function DE(e,t){for(let n of t)if(n[0]===`p`||n[0]===`m`)return GO(e,t);return sE(e,t)}function OE(e,t,n,r,i,a){let o={owner:t,tracker:e,baseRevision:n,status:{value:`open`},root:void 0,bases:[],stored:[],dirty:[],nodes:[],rawNodes:new WeakMap,ops:void 0,replacement:i,replacementNoop:!1,baseValue:a,overlayReleased:!1,simpleObjectMaterialization:!1,registryRef:void 0};return o.root=jE(o,r,void 0),o}var kE={deleteProperty(e,t){return GE(RE(e),t)},defineProperty(e){throw VE(RE(e).context),TypeError(`Defining overlay properties is not supported`)},get(e,t){if(t===`then`){let t=e[hE];if(t===void 0||zE(t.context))return}let n=RE(e);return t===hE?n:HE(n,t)},getOwnPropertyDescriptor(e,t){return JE(RE(e),t)},getPrototypeOf(e){let t=RE(e);return BE(t.context),Object.getPrototypeOf(ME(t))},has(e,t){return KE(RE(e),t)},isExtensible(e){return BE(RE(e).context),!0},ownKeys(e){return qE(RE(e))},preventExtensions(e){throw VE(RE(e).context),TypeError(`Overlays cannot be made non-extensible`)},set(e,t,n){return WE(RE(e),t,n)},setPrototypeOf(e){throw VE(RE(e).context),TypeError(`Changing an overlay prototype is not supported`)}},AE=kE;function jE(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[hE]=d,d.proxy=new Proxy(c,Array.isArray(t)?AE:kE),e.rawNodes.set(t,d),e.nodes.push(d),d}function ME(e){return e.context.bases[e.baseIndex]}function NE(e){return e.parentIndex<0?void 0:e.context.nodes[e.parentIndex]}function PE(e,t){if(!MO(t))return t;let n=e.stored.length;return e.stored.push(t),{index:n}}function FE(e,t){return typeof t==`object`&&t?e.stored[t.index]:t}function IE(e,t,n){return MO(n)?typeof t==`object`&&t?(e.stored[t.index]=n,t):PE(e,n):(typeof t==`object`&&t&&(e.stored[t.index]=_E),n)}function LE(e,t){typeof t==`object`&&t&&(e.stored[t.index]=_E)}function RE(e){let t=e[hE];if(t===void 0)throw TypeError(`Cannot use a settled overlay`);return t}function zE(e){return e.overlayReleased||e.status.value===`consumed`||e.status.value===`aborted`||e.status.value===`stale`}function BE(e){if(zE(e))throw TypeError(`Cannot use a settled overlay`)}function VE(e){if(BE(e),e.status.value!==`open`)throw TypeError(`Prepared overlays are read-only`)}function HE(e,t){if(BE(e.context),Array.isArray(ME(e))){let n=iD(e);if(t===`length`)return xD(n);if(vE.has(t))return RD[t];let r=CD(t);return r===void 0?Reflect.get(Array.prototype,t,e.proxy):UE(e,r)}if(typeof t==`symbol`)return Reflect.get(ME(e),t,e.proxy);let n=String(t);if(!tD(e,n))return QE(e,n)||Object.hasOwn(ME(e),n)?void 0:Reflect.get(ME(e),t,e.proxy);let r=nD(e,n);return MO(r)?jE(e.context,r,e,0,n,void 0,YE(e,n)).proxy:r}function UE(e,t){let n=iD(e);if(t>=xD(n))return;let r=SD(n,t),i=r.start+r.step*n.locatedOffset,a=wD(e,r,i);return MO(a)?jE(e.context,a,e,r.kind===`base`?1:2,i,r.kind===`insert`?r.source:void 0,r.kind===`insert`||TD(n,r,i)).proxy:a}function WE(e,t,n){if(VE(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(ME(e))){if(t===`length`)return ND(e,PD(n)),!0;let r=CD(t);if(r===void 0)throw TypeError(`Only array indices and length can be written`);if(r>xD(iD(e)))throw TypeError(`Overlay arrays cannot contain holes`);return MD(e,r,JD(n)),!0}let r=String(t);if(n===void 0)return GE(e,r);let i=JD(n),a=nD(e,r),o=QE(e,r);return!o&&!MO(i)&&a===i||(XE(e,r,i),o&&Object.hasOwn(ME(e),r)&&(e.readded===void 0&&(e.readded=new Set),e.readded.add(r)),eD(e,r),rD(e)),!0}function GE(e,t){if(VE(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(ME(e)))throw TypeError(`Overlay arrays cannot contain holes`);let n=String(t);return tD(e,n)&&(ZE(e,n),e.readded?.delete(n),$E(e,n),rD(e)),!0}function KE(e,t){if(BE(e.context),Array.isArray(ME(e))){if(t===`length`)return!0;let n=CD(t);return n===void 0?t in Array.prototype:n<xD(iD(e))}return typeof t==`symbol`?t in ME(e):tD(e,String(t))}function qE(e){if(BE(e.context),Array.isArray(ME(e))){let t=xD(iD(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(ME(e),e.writeKey));if(t&&e.writes!==void 0){for(let n of e.writes.keys())if(!Object.hasOwn(ME(e),n)){t=!1;break}}if(t)return Object.keys(ME(e));let n=Object.keys(ME(e)).filter(t=>!QE(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=CD(e);t===void 0?a.push(e):i.push(t)}return i.sort((e,t)=>e-t),[...i.map(String),...a]}function JE(e,t){if(BE(e.context),Array.isArray(ME(e))){if(t===`length`){let t=xD(iD(e));return e.target.length=t,Reflect.getOwnPropertyDescriptor(e.target,`length`)}let n=CD(t);if(n===void 0||n>=xD(iD(e)))return}else if(typeof t==`symbol`||!tD(e,String(t)))return;return{configurable:!0,enumerable:!0,writable:e.context.status.value===`open`,value:HE(e,t)}}function YE(e,t){return e.writeKey===t||(e.writes?.has(t)??!1)}function XE(e,t,n){if(e.writes!==void 0){let r=e.writes.get(t);e.writes.set(t,r===void 0?PE(e.context,n):IE(e.context,r,n))}else e.writeKey===void 0||e.writeKey===t?(e.writeKey=t,e.writeValue=e.writeValue===void 0?PE(e.context,n):IE(e.context,e.writeValue,n)):(e.writes=new Map,e.writes.set(e.writeKey,e.writeValue),e.writes.set(t,PE(e.context,n)),e.writeKey=void 0,e.writeValue=void 0)}function ZE(e,t){if(e.writeKey===t)e.writeKey=void 0,LE(e.context,e.writeValue),e.writeValue=void 0;else{let n=e.writes?.get(t);n!==void 0&&LE(e.context,n),e.writes?.delete(t)}}function QE(e,t){return e.deleteKey===t||(e.deletes?.has(t)??!1)}function $E(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 eD(e,t){e.deleteKey===t?e.deleteKey=void 0:e.deletes?.delete(t)}function tD(e,t){return QE(e,t)?!1:YE(e,t)||Object.hasOwn(ME(e),t)}function nD(e,t){if(e.writeKey===t)return FE(e.context,e.writeValue);let n=e.writes?.get(t);return n===void 0?ME(e)[t]:FE(e.context,n)}function rD(e){if(!e.dirty){e.dirty=!0,e.context.dirty.push(e);for(let t=NE(e);t!==void 0;t=NE(t))t.subtreeDirty=!0}}function iD(e){if(e.array!==void 0)return e.array;let t=ME(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=uD(n,{kind:`base`,start:0,length:t.length,step:1})),e.array=n,n}function aD(e){return e.baseOverrides===void 0&&(e.baseOverrides=new Map),e.baseOverrides}function oD(e){return e.insertOverrides===void 0&&(e.insertOverrides=new Map),e.insertOverrides}function sD(e){let t=e.seed;return t^=t<<13,t^=t>>>17,t^=t<<5,e.seed=t>>>0,e.seed}function cD(e){return e?.elements??0}function lD(e){e.elements=cD(e.left)+e.piece.length+cD(e.right)}function uD(e,t){return{piece:t,left:void 0,right:void 0,priority:sD(e),elements:t.length}}function dD(e,t){return e===void 0?t:t===void 0?e:e.priority>=t.priority?(e.right=dD(e.right,t),lD(e),e):(t.left=dD(e,t.left),lD(t),t)}function fD(e,t,n){if(t===void 0)return[void 0,void 0];let r=cD(t.left);if(n<r){let[r,i]=fD(e,t.left,n);return t.left=i,lD(t),[r,t]}let i=r+t.piece.length;if(n>i){let[r,a]=fD(e,t.right,n-i);return t.right=r,lD(t),[t,a]}if(n===r){let e=t.left;return t.left=void 0,lD(t),[e,t]}if(n===i){let e=t.right;return t.right=void 0,lD(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[dD(t.left,uD(e,o)),dD(uD(e,s),t.right)]}function pD(e){for(;e.left!==void 0;)e=e.left;return e}function mD(e){for(;e.right!==void 0;)e=e.right;return e}function hD(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 gD(e,t,n){if(t===void 0)return n;if(n===void 0)return t;let r=mD(t).piece,i=pD(n).piece;if(!hD(r,i))return dD(t,n);let[a]=fD(e,t,cD(t)-r.length),[,o]=fD(e,n,i.length),s=r.length===1?i.start-r.start:r.step;return gD(e,gD(e,a,uD(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 _D(e,t){e!==void 0&&(_D(e.left,t),t.push(e.piece),_D(e.right,t))}function vD(e){return e.pieces===void 0&&(e.pieces=[],_D(e.root,e.pieces)),e.pieces}function yD(e,t){kD(t);let n;for(let r of t)n=dD(n,uD(e,r));return n}function bD(e,t){e.root=yD(e,t),e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0}function xD(e){return cD(e.root)}function SD(e,t){let n=e.root;for(;n!==void 0;){let r=cD(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 CD(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 wD(e,t,n){let r=iD(e);if(t.kind===`base`){let t=r.baseOverrides?.get(n);return t===void 0?ME(e)[n]:FE(e.context,t)}let i=r.insertOverrides?.get(t.source),a=i?.has(n)?i.get(n):t.source.refs[n];return FE(e.context,a)}function TD(e,t,n){return t.kind===`base`?e.baseOverrides?.has(n)??!1:e.insertOverrides?.get(t.source)?.has(n)??!1}function ED(e,t){e.right===void 0?e.piece.length+=t:ED(e.right,t),lD(e)}function DD(e){e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0,e.plan=void 0}function OD(e,t,n,r){if(n===0&&r.length===0)return;let i=iD(e);if(n===0&&t===xD(i)&&r.length===1&&i.root!==void 0){let t=r[0],n=mD(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]);ED(i.root,t.length),DD(i),i.structural=!0,i.generation+=1,rD(e);return}}let[a,o]=fD(i,i.root,t),[,s]=fD(i,o,n);i.root=gD(i,gD(i,a,yD(i,r)),s),DD(i),i.structural=!0,i.generation+=1,rD(e)}function kD(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 AD(e,t,n=0){if(t.length===n)return[];let r=[];for(let i=n;i<t.length;i++)r.push(PE(e.context,t[i]));return[{kind:`insert`,source:{refs:r},start:0,length:r.length,step:1}]}function jD(e,t,n=0){if(t.length===n)return[];let r=e.context.stored.length;try{for(let r=n;r<t.length;r++)t[r]=PE(e.context,JD(t[r]))}catch(t){throw e.context.stored.length=r,t}return[{kind:`insert`,source:{refs:t},start:n,length:t.length-n,step:1}]}function MD(e,t,n){let r=iD(e),i=xD(r);if(t===i){OD(e,i,0,AD(e,[n]));return}let a=SD(r,t),o=a.start+a.step*r.locatedOffset,s=wD(e,a,o);if(MO(n)||s!==n){if(a.kind===`base`){let t=r.baseOverrides?.get(o);!MO(n)&&n===ME(e)[o]?(t!==void 0&&LE(e.context,t),r.baseOverrides?.delete(o)):t===void 0?aD(r).set(o,PE(e.context,n)):r.baseOverrides.set(o,IE(e.context,t,n))}else{let t=r.insertOverrides?.get(a.source),i=t?.get(o);!MO(n)&&n===FE(e.context,a.source.refs[o])?(i!==void 0&&LE(e.context,i),t?.delete(o),t?.size===0&&r.insertOverrides?.delete(a.source)):(t===void 0&&(t=new Map,oD(r).set(a.source,t)),i===void 0?t.set(o,PE(e.context,n)):t.set(o,IE(e.context,i,n)))}rD(e)}}function ND(e,t){let n=xD(iD(e));t!==n&&(t<n?OD(e,t,n-t,[]):OD(e,n,0,AD(e,Array.from({length:t-n},()=>null))))}function PD(e){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=4294967296)throw RangeError(`Invalid array length`);return t}function FD(e){let t=Number(e);return Number.isNaN(t)||t===0?0:Number.isFinite(t)?Math.trunc(t):t}function ID(e,t){return e===-1/0?0:e<0?Math.max(t+e,0):Math.min(e,t)}function LD(e){if(!MO(e))return;let t=Reflect.get(e,hE);if(t!==void 0){if(!Array.isArray(ME(t)))throw TypeError(`Array mutator called on incompatible receiver`);return VE(t.context),t}}var RD={push(...e){let t=LD(this);if(t===void 0)return Reflect.apply(Array.prototype.push,this,e);let n=xD(iD(t));return OD(t,n,0,jD(t,e)),n+e.length},pop(){let e=LD(this);if(e===void 0)return Reflect.apply(Array.prototype.pop,this,[]);let t=xD(iD(e));if(t===0)return;let n=UE(e,t-1);return OD(e,t-1,1,[]),n},shift(){let e=LD(this);if(e===void 0)return Reflect.apply(Array.prototype.shift,this,[]);if(xD(iD(e))===0)return;let t=UE(e,0);return OD(e,0,1,[]),t},unshift(...e){let t=LD(this);return t===void 0?Reflect.apply(Array.prototype.unshift,this,e):(OD(t,0,0,jD(t,e)),xD(iD(t)))},splice(...e){let t=LD(this);if(t===void 0)return Reflect.apply(Array.prototype.splice,this,e);let n=xD(iD(t)),r=e.length===0?0:ID(FD(e[0]),n),i=e.length===0?0:e.length===1?n-r:Math.min(Math.max(FD(e[1]),0),n-r),a=Array.from({length:i},(e,n)=>UE(t,r+n)),o=Math.min(2,e.length),s=Math.max(e.length-2,0);return OD(t,r,i,jD(t,e,o)),ND(t,n-i+s),a},reverse(){let e=LD(this);if(e===void 0)return Reflect.apply(Array.prototype.reverse,this,[]);let t=iD(e);if(xD(t)<2)return e.proxy;let n=[...vD(t)].reverse();for(let e of n)e.start+=e.step*(e.length-1),e.step=e.step===1?-1:1;return bD(t,n),t.structural=!0,t.generation+=1,t.plan=void 0,rD(e),e.proxy},sort(e){let t=LD(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=iD(t),r=[],i=[],a=[],o=Array(ME(t).length),s=[];for(let e of vD(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]=VD(t,c,r,i);else{r.push(e.source),i.push(c);let n=-r.length;s.push(n),a.push(VD(t,n,r,i))}}let c=new Map;for(let[e,r]of n.baseOverrides??[])c.set(e,FE(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,FE(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)HD(t,e,r,i,c,l);let d=n.generation!==u,f=xD(n);return f>=s.length&&s.every((e,t)=>UD(n,t,e,r,i))||OD(t,0,Math.min(s.length,f),GD(s,r,i)),d&&WD(t),t.proxy},fill(e,t,n){let r=LD(this);if(r===void 0)return Reflect.apply(Array.prototype.fill,this,[e,t,n]);let i=xD(iD(r)),a=t===void 0?0:ID(FD(t),i),o=n===void 0?i:ID(FD(n),i);if(o<=a)return r.proxy;let s=Array.from({length:o-a},()=>JD(e));return OD(r,a,o-a,AD(r,s)),r.proxy},copyWithin(e,t,n){let r=LD(this);if(r===void 0)return Reflect.apply(Array.prototype.copyWithin,this,[e,t,n]);let i=xD(iD(r)),a=ID(FD(e),i),o=ID(FD(t),i),s=n===void 0?i:ID(FD(n),i),c=Math.min(Math.max(s-o,0),i-a);return OD(r,a,c,AD(r,Array.from({length:c},(e,t)=>JD(UE(r,o+t))))),r.proxy}};function zD(e,t){return e<0?t[-e-1]:void 0}function BD(e,t){return e<0?t[-e-1]:e}function VD(e,t,n,r){let i=iD(e),a=zD(t,n),o=BD(t,r),s=a===void 0?i.baseOverrides?.get(o):i.insertOverrides?.get(a)?.get(o),c=s===void 0?a===void 0?ME(e)[o]:FE(e.context,a.refs[o]):FE(e.context,s);return MO(c)?jE(e.context,c,e,a===void 0?1:2,o,a,a!==void 0||(i.baseOverrides?.has(o)??!1)).proxy:c}function HD(e,t,n,r,i,a){let o=iD(e),s=zD(t,n),c=BD(t,r);if(s===void 0){let t=o.baseOverrides?.get(c),n=i.get(c);n===void 0?(t!==void 0&&LE(e.context,t),o.baseOverrides?.delete(c)):t===void 0?aD(o).set(c,PE(e.context,n)):o.baseOverrides.set(c,IE(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&&LE(e.context,u),l?.delete(c),l?.size===0&&o.insertOverrides?.delete(s)):(l===void 0&&(l=new Map,oD(o).set(s,l)),u===void 0?l.set(c,PE(e.context,d)):l.set(c,IE(e.context,u,d)))}function UD(e,t,n,r,i){let a=SD(e,t),o=a.start+a.step*e.locatedOffset,s=zD(n,r);return o===BD(n,i)&&(a.kind===`base`&&s===void 0||a.kind===`insert`&&a.source===s)}function WD(e){let t=iD(e),n=new Set,r=new Map,i=[],a=!1;for(let o of vD(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,KD(i,AD(e,[QD(wD(e,o,s),e.context)])[0])):KD(i,qD(o,s))}a&&(bD(t,i),t.structural=!0,t.generation+=1,t.plan=void 0,rD(e))}function GD(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 KD(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 qD(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 JD(e){let t=MO(e)?Reflect.get(e,hE):void 0;return t===void 0?rE(e):ZD(t)}function YD(e){if(BE(e.context),Array.isArray(ME(e))){let t=iD(e),n=[];for(let r of vD(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(XD(wD(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(ME(e)));for(let n of qE(e))$D(t,n,XD(nD(e,n),e.context));return t}function XD(e,t){if(!MO(e))return e;let n=t.rawNodes.get(e);return n===void 0||!n.dirty&&!n.subtreeDirty?e:YD(n)}function ZD(e){if(BE(e.context),Array.isArray(ME(e))){let t=iD(e),n=[];for(let r of vD(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(QD(wD(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(ME(e)));for(let n of qE(e))$D(t,n,QD(nD(e,n),e.context));return t}function QD(e,t){if(!MO(e))return rE(e);let n=t.rawNodes.get(e);return n===void 0?rE(e):ZD(n)}function $D(e,t,n){xE.value=n,Object.defineProperty(e,t,xE),xE.value=void 0}function eO(e){let t=tO(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(sO(t,a),Array.isArray(ME(t))){let e=iD(t);if(!e.structural&&(e.baseOverrides?.size??0)>0){let n=a.get(t);n===void 0&&(n={indices:[],bits:void 0,length:ME(t).length},a.set(t,n));for(let t of e.baseOverrides.keys())oO(n,t)}}let o=new Map;for(let[e,t]of a){let n=wO(e);if(n===void 0||n.some(e=>typeof e==`string`&&FO.has(e)))continue;let r=cO(t);r.length>0&&o.set(e,r)}for(let t of e.dirty){let e=wO(t);if(e===void 0||aO(t,e,o))continue;i.set(t,e),!Array.isArray(ME(t))&&uO(t)&&r.set(t,e);let n=e.findIndex(e=>typeof e==`string`&&FO.has(e));if(n>=0){let i=t;for(let t=e.length;t>n;t--)i=NE(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=wO(e);t!==void 0&&!aO(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(!(fO(a)||dO(a,l))){if(r.has(a))CO(n,t,YD(a)),l.add(a);else if(Array.isArray(ME(a))?bO(a,t,n,o.get(a)):mO(a,t,n),n.length>yE)return nO=void 0,[[`r`,YD(e.root)]]}}return nO=void 0,n}function tO(e){let t=[];for(let n of e.dirty){if(Array.isArray(ME(n))||uO(n)||fO(n))return;for(let e=NE(n);e!==void 0;e=NE(e))if(Array.isArray(ME(e)))return;let e=wO(n);if(e!==void 0){for(let t of e)if(typeof t==`string`&&FO.has(t))return;if(t.push(n),t.length>bE)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(mO(i,i.preparedPath,n)&&(r=!1),n.length>yE)return[[`r`,YD(e.root)]];return e.simpleObjectMaterialization=r,n}var nO,rO=0;function iO(e){let t=e;for(let e=NE(t);e!==void 0;e=NE(t)){if(Array.isArray(ME(e))){let n=iD(e);if(t.parentKind!==1||n.structural)return!1;let r=t.parentKey,i=n.baseOverrides?.get(r);return(i===void 0?ME(e)[r]:FE(e.context,i))===ME(t)&&(nO=e,rO=r,!0)}t=e}return!1}function aO(e,t,n){for(let r=NE(e);r!==void 0;r=NE(r)){let e=n.get(r);if(e===void 0)continue;let i=wO(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`&&lO(e,o))return!0}return!1}function oO(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 sO(e,t){if(!iO(e))return;let n=t.get(nO);n===void 0&&(n={indices:[],bits:void 0,length:ME(nO).length},t.set(nO,n)),oO(n,rO)}function cO(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 lO(e,t){for(let n of e)if(t>=n.start&&t<n.start+n.length)return!0;return!1}function uO(e){if(e.writeKey!==void 0&&FO.has(e.writeKey)||e.deleteKey!==void 0&&FO.has(e.deleteKey))return!0;if(e.writes!==void 0){for(let t of e.writes.keys())if(FO.has(t))return!0}if(e.deletes!==void 0){for(let t of e.deletes)if(FO.has(t))return!0}return!1}function dO(e,t){for(let n=NE(e);n!==void 0;n=NE(n))if(t.has(n))return!0;return!1}function fO(e){for(let t=e;t!==void 0;t=NE(t))if(NE(t)!==void 0&&t.parentPlacement)return!0;return!1}function pO(e,t,n,r,i){let a=[...t,r],o=e.readded?.has(r)||!Object.hasOwn(ME(e),r)?void 0:ME(e)[r],s=XD(i,e.context),c=SO(n,a,o,s);return MO(o)&&MO(s)&&!c}function mO(e,t,n){if(e.readded!==void 0)for(let r of e.readded)Object.hasOwn(ME(e),r)&&n.push([`d`,[...t,r]]);let r=!1;if(e.writeKey!==void 0&&(r=pO(e,t,n,e.writeKey,nD(e,e.writeKey))),e.writes!==void 0)for(let[i,a]of e.writes){if(n.length>yE)return r;pO(e,t,n,i,FE(e.context,a))&&(r=!0)}if(e.deleteKey!==void 0&&Object.hasOwn(ME(e),e.deleteKey)&&n.push([`d`,[...t,e.deleteKey]]),e.deletes!==void 0)for(let i of e.deletes){if(n.length>yE)return r;Object.hasOwn(ME(e),i)&&n.push([`d`,[...t,i]])}return r}function hO(e){let t=iD(e);if(t.plan!==void 0)return t.plan;let n=ME(e),r=vD(t);return t.plan=gO(n.length,r)??_O(n.length,r),t.plan}function gO(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:vO(t)}}function _O(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:vO(t)}}function vO(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-yO(e,a,r),a,r)}return t}function yO(e,t,n){let r=0;for(let i=t;i<n;i++)r+=e[i].length;return r}function bO(e,t,n,r){let i=iD(e),a=ME(e);if(r!==void 0)for(let i of r){if(n.length>yE)return;n.push([`p`,t,i.start,i.length,xO(e,i)])}if(i.structural){let r=hO(e);for(let e=0;e<r.removeRuns.length;e+=2){if(n.length>yE)return;n.push([`p`,t,r.removeRuns[e],r.removeRuns[e+1],[]])}r.permutation!==void 0&&n.push([`m`,t,r.permutation]);let a=vD(i);for(let i=0;i<r.insertRuns.length;i+=3){if(n.length>yE)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(XD(wD(e,n,r),e.context))}}n.push([`p`,t,o,0,s])}}for(let[o,s]of i.baseOverrides??[]){if(n.length>yE)return;let c=EO(i,1,o,void 0);c===void 0||r!==void 0&&lO(r,c)||SO(n,[...t,c],a[o],XD(FE(e.context,s),e.context))}}function xO(e,t){let n=iD(e),r=[];for(let i=t.start;i<t.start+t.length;i++){let t=SD(n,i),a=t.start+t.step*n.locatedOffset;r.push(XD(wD(e,t,a),e.context))}return r}function SO(e,t,n,r){if(!MO(r)&&n===r||MO(n)&&MO(r)&&OO(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,r.slice(n.length)]),!0;let i=PO(n,r,65536);if(i>0)return e.push([`t`,t,n.length-i]),r.length>i&&e.push([`a`,t,r.slice(i)]),!0}return e.push([`s`,t,r]),!0}function CO(e,t,n){t.length===0?e.push([`r`,n]):e.push([`s`,t,n])}function wO(e){if(e.preparedPath!==void 0)return e.preparedPath;let t=NE(e);if(t===void 0)return e.preparedPath=[],e.preparedPath;let n=wO(t);if(n===void 0)return;if(e.parentKind===0){let r=e.parentKey;return!tD(t,r)||nD(t,r)!==ME(e)?void 0:(e.preparedPath=[...n,r],e.preparedPath)}let r=iD(t),i=EO(r,e.parentKind,e.parentKey,e.parentSource);if(i!==void 0&&wD(t,SD(r,i),e.parentKey)===ME(e))return e.preparedPath=[...n,i],e.preparedPath}function TO(e){if(e.baseLocations!==void 0)return;e.baseLocations=[],e.insertLocations=new Map;let t=0;for(let n of vD(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 EO(e,t,n,r){if(t===1&&!e.structural)return n;TO(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 DO(e){if(e.ops!==void 0)return e.ops;if(BE(e),e.replacement){let t=e.tracker.deref()?.replacementBase(e);e.replacementNoop=t!==void 0&&OO(t,ME(e.root)),e.ops=e.replacementNoop?[]:[[`r`,ME(e.root)]]}else e.ops=eO(e);return e.ops}function OO(e,t){if(e===t)return!0;if(!MO(e)||!MO(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(!OO(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)||!OO(e[t],n[t]))return!1;return!0}function kO(e){e.status.value!==`aborted`&&e.status.value!==`consumed`&&e.status.value!==`stale`&&(e.status.value=`aborted`,jO(e))}function AO(e){e.tracker.deref()?.releaseContext(e),nO?.context===e&&(nO=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 jO(e){e.tracker.deref()?.releaseContext(e),nO?.context===e&&(nO=void 0);for(let t of e.nodes)Array.isArray(t.target)&&(t.target.length=0),Reflect.deleteProperty(t.target,hE),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=_E,t.proxy=_E,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 MO(e){return typeof e==`object`&&!!e}var NO=e=>typeof e==`object`&&!!e;function PO(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}var FO=new Set([`__proto__`,`constructor`,`prototype`]),IO=class extends Error{segment;constructor(e){super(`unsafe path segment: ${String(e)}`),this.segment=e,this.name=`UnsafePathError`}};function LO(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`);RO(e[1],!0);return;case`d`:if(e.length!==2)throw TypeError(`d arity`);RO(e[1],!0);return;case`a`:if(e.length!==3||typeof e[2]!=`string`)throw TypeError(`a shape`);RO(e[1],!0);return;case`t`:if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t shape`);RO(e[1],!0);return;case`p`:if(e.length!==5)throw TypeError(`p arity`);if(RO(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`);RO(e[1]),zO(e[2]);return;default:throw TypeError(`unknown op verb: ${String(e[0])}`)}}function RO(e,t=!1){if(!Array.isArray(e))throw TypeError(`path is not an array`);if(t&&e.length===0)throw TypeError(`path is empty`);VO(e)}function zO(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 BO(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`);VO(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`);zO(e[e.length-1]);return;case`#`:if(e.length!==3||!Number.isInteger(e[1])||e[1]<0||!Array.isArray(e[2]))throw TypeError(`# shape`);VO(e[2]);return;default:throw TypeError(`unknown op verb: ${String(t)}`)}}function VO(e){for(let t of e)if(typeof t==`string`){if(FO.has(t))throw new IO(t)}else if(!Number.isInteger(t)||t<0)throw new IO(t)}function HO(e,t){if(t>e.length)throw new IO(t)}var UO=class extends Error{path;constructor(e){super(`unresolvable path: ${JSON.stringify(e)}`),this.path=e,this.name=`PathError`}};function WO(e,t){let n=e;for(let e of t){if(LO(e),e[0]===`r`){n=e[1];continue}let t=e[1];if(VO(t),e[0]===`p`){let r=t.length===0?n:XO(n,t);if(!Array.isArray(r))throw new UO(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:XO(n,t);if(!Array.isArray(r)||r.length!==e[2].length)throw new UO(t);let i=r.slice();for(let t=0;t<e[2].length;t++)r[t]=i[e[2][t]];continue}let r=XO(n,t.slice(0,-1)),i=t[t.length-1];if(Array.isArray(r)){if(typeof i!=`number`)throw new IO(i);HO(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 UO(t);r.splice(i,1)}else delete r[i];break;case`a`:{let n=o();if(typeof n!=`string`)throw new UO(t);a(`${n}${e[2]}`);break}case`t`:{let n=o();if(typeof n!=`string`)throw new UO(t);a(n.slice(e[2]));break}}}return n}function GO(e,t){return KO(e,[t])}function KO(e,t){let n=e,r=new WeakSet;for(let e of t)for(let t of e)if(LO(t),t[0]===`r`)n=t[1];else{if(t[0]===`p`){let e=qO(n,t,r);if(e!==void 0){n=e;continue}}n=JO(n,t[0]===`p`||t[0]===`m`?t[1]:t[1].slice(0,-1),r),n=WO(n,[t])}return n}function qO(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`?!FO.has(e)&&NO(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=JO(e,l,n);return Object.defineProperty(XO(u,l),r[r.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),u}function JO(e,t,n){let r=e=>{if(Array.isArray(e))return e.slice();if(!NO(e))throw new UO(t);let n=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0});return n};if(!NO(e))throw new UO(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 UO(t);if(Array.isArray(a)&&typeof e!=`number`)throw new IO(e);let i=a[e];if(!NO(i))throw new UO(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 YO(e,t){let n=e;for(let e of t){if(!NO(n))throw new UO(t);if(Array.isArray(n)&&typeof e!=`number`)throw new IO(e);if(!Object.hasOwn(n,e))throw new UO(t);n=n[e]}return n}function XO(e,t){let n=YO(e,t);if(!NO(n))throw new UO(t);return n}var ZO=e=>JSON.stringify(e);function QO(){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=ZO(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 $O(){let e=new Map;return{decode(t){let n,r=[];for(let i of t){if(BO(i),i[0]===`#`){VO(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 UO([]);a=n}else{let t=i[1];if(typeof t==`number`){let n=e.get(t);if(n===void 0)throw new UO(t);a=n}else a=t;n=a}if(i[0]!==`p`&&i[0]!==`m`&&a.length===0)throw new UO(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 ek=[],tk=0,nk=!1;function rk(e){ek.push(e),ak()}function ik(e){tk++;try{return e()}finally{tk--,ak()}}function ak(){if(!(nk||tk>0)){nk=!0;try{for(let e=ek.shift();e!==void 0;e=ek.shift())e()}finally{nk=!1}}}var ok=0,sk=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];rk(()=>{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)}}},ck=Symbol(`chord.hydration`);function lk(e){if(typeof e==`object`&&e)return e[ck]}var uk=e=>[...e].map(lk).filter(e=>e?.hydrated===!1),dk=class{key;seq=++ok;dependents=new Set;schemas=[];options;fanout;constructor(e,t){this.key=e,this.options=t,this.fanout=new sk(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())Yw(`state`,`state ${this.key}`,t,e);for(let t of this.schemas)Yw(`state`,`state ${this.key}`,t,e)}}ownSchemas(){return[]}};function fk(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 pk=class extends dk{schema;#e;#t;#n;constructor(e,t,n,r,i){super(e,i),n!==void 0&&Yw(`state`,`initial value of state ${e}`,t,n.value),this.schema=t,this.#e=TE({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`);Yw(`state`,`initial value of state ${this.key}`,this.schema,e),this.#e=TE({v:e}),this.#n=!0}ownSchemas(){return[this.schema]}get value(){if(!this.#n)throw yk(`state ${this.key} (its init has not run)`);return this.#e.value.v}change(e,t){if(this.#t(e),!this.#n)throw yk(`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&&Yw(`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 yk(`state ${this.key} (its init has not run)`);let r=this.value,i=n.diff??mk(r,t)?tE(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=hk(this,i,n)}catch(t){throw e.abort(),t}ik(()=>{this.#e.adopt(e);let n=r!==void 0&&r.length>0?r:fk(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 mk(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 hk(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 gk=e=>typeof e==`object`&&!!e&&typeof e.subscribe==`function`&&`value`in e,_k=class extends dk{sources;#e;#t;#n=[];constructor(e,t,n,r){super(e,r),this.sources=t.map(t=>{if(!gk(t))throw TypeError(`derive ${e}: sources must be readables`);return t}),this.#e=n,this.#t=void 0}get value(){return this.#t}get[ck](){let e=uk(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 dk?e.dependents.add(this):this.#n.push(e.subscribe(()=>this.refresh()))}detach(){for(let e of this.sources)e instanceof dk&&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=hk(this,e);ik(()=>{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]]:tE(t,e);n.length>0&&this.fanout.emit({type:`ops`,ops:n,value:e})}},vk=e=>e instanceof dk,yk=e=>new I(`not_ready`,`${e} is not ready`),bk=()=>{},xk=(e,t,n,r)=>(Ck(e,n),{contract:e,factory:t,options:n,facet:r}),Sk=e=>e.options.lifetime===`host`;function Ck(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{Xw(e.input,{},`${e.name} input`)}catch{throw TypeError(`${e.name}: lifetime "host" needs an input that accepts {} (the object's one address)`)}}}var wk=class{resource;constructor(e){this.resource=e}},Tk=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 I(`unavailable`,`resource ${this.key} could not be restored`);if(this.state!==`open`)throw yk(`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 I(`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}},Ek=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,Dk.set(this,e)}get key(){return this.#e.key}get value(){if(this.#t.inFactory>0)throw yk(`resource ${this.key} (inside a factory)`);return this.#e.value}},Dk=new WeakMap,Ok=e=>e instanceof Tk?e:typeof e==`object`&&e?Dk.get(e):void 0,kk=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},Ak=e=>typeof e==`object`&&!!e&&typeof e.init==`function`,jk=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 Hw(`foreign_ctx`,`ctx belongs to another host`);if(this.#r)throw new I(`aborted`,`ctx expired: its call already settled`,{reason:`expired`});if(this.signal.aborted){let e=this.signal.reason;throw e instanceof I&&e.code===`superseded`?new I(`superseded`,e.message,{cause:e}):new I(`aborted`,`ctx aborted`,{cause:e})}}constructor(e,t){this.host=e;let n=Mk(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 Nk(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 I(`aborted`,`ctx expired: its call already settled`,{reason:`expired`})),this.#t();for(let e of this.#e.splice(0))e.release()}};function Mk(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 Nk(e,t,n){let r=new AbortController,i=Number.isFinite(n)?setTimeout(()=>r.abort(new I(`unavailable`,`${e.address} was not ready after ${n} ms`,{reason:`ready_timeout`})),n):void 0;i?.unref?.();let a=Mk([...t,r.signal]);try{await Pk(e.ready,a.signal)}catch(t){e.release();let n=a.signal.reason;throw n instanceof I&&n.reason===`ready_timeout`?n:t}finally{clearTimeout(i),a.release()}}async function Pk(e,t){if(t.aborted)throw new I(`aborted`,`call aborted`,{cause:t.reason});let n=bk,r=new Promise((e,r)=>{n=()=>r(new I(`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 Fk=new Set([`contract`,`status`,`ready`,`variant`,`shape`,`error`,`onShape`,`onStatus`,`release`]);function Ik(e,t,n,r){if(e.size===0)return;let i=[...e];rk(()=>{for(let e of i)try{e(t,n)}catch(e){r(e)}})}var Lk=new WeakMap,Rk=e=>typeof e==`object`&&e?Lk.get(e):void 0,zk=class{#e;#t;#n=new Set;#r=new Set;#i=new Set;#a;#o=bk;#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 yk(`${e.address}.${this.#t}`);let t=e.currentView();if(t===void 0)throw yk(`${e.address}.${this.#t}`);let n=this.#c();if(n===void 0)throw new I(`not_in_variant`,`${e.address}: ${this.#t} is not a state member of variant ${Vk(t)??`(local)`}`);return n.value}get[ck](){let e=this.#e;return e.status===`live`?lk(this.#c()):{hydrated:!1,whenHydrated:async()=>{await e.ready,await lk(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=bk,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(),rk(()=>{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 vk(t)||Wk(t)?t:void 0}#l(){let e=this.#c();return e===void 0||lk(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)}}},Bk=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 I(`released`,`reference ${this.address} released`)}),this.ready.catch(bk),this.proxy=new Proxy(this,{get:(e,t)=>{if(Fk.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)=>Fk.has(t)||e.member(String(t))!==void 0}),Lk.set(this.proxy,this)}get variant(){let e=this.currentView();return e===void 0?void 0:Vk(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:Vk(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(){Ik(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];rk(()=>{for(let n of t)try{n(e)}catch(e){this.object.host.report(e)}})}terminalError(){return this.status===`gone`?this.error:new I(`released`,`reference ${this.address} released`)}viewOf(e){let t=this.bindings.get(e.service);if(this.bindings.has(e.service)||(t=DT(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(Vk(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&&(vk(r)||Wk(r))){let t=this.readables.get(e);return t===void 0&&(t=new zk(this,e),this.readables.set(e,t)),t}if(n!==void 0&&this.inVariant(n,e))return r instanceof wk?r.resource.value:r}caller(e){let t=this.callers.get(e);if(t===void 0){let n=OT(this.contract,e);t=(...t)=>{let[r,i]=n?[void 0,t[0]]:t;if(this.object.host.inFactory>0)throw new I(`not_ready`,`${this.address}.${e} called inside a factory`);if(i!==void 0&&!(i instanceof jk))return Promise.reject(Hw(`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()}},Vk=e=>typeof e.variant==`string`?e.variant:void 0,Hk=(e,t)=>e===t||e!==void 0&&t!==void 0&&String(e)===String(t),Uk=class{host;address;typeName;input;principal;hostLifetime;status=`activating`;ready=Promise.resolve();service;minCodeVersion=0;decls=new kk;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=Uw(e,`activating ${this.address}`);for(let e of this.refs)e.gone(t);throw t}),this.ready.catch(bk)}async#s(e){await e?.catch(bk);let t=this.activationAbort.signal,n=()=>new I(`aborted`,`${this.address} abandoned`);if(t.aborted)throw n();let r=this.host.service(this.typeName);if(r===void 0)throw new I(`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 I(`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 kk,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 qk(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 Hw(`implementation`,`${this.typeName}: factories must be synchronous`);Kk(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 Tk?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=uk([...e.created.derives,...t.map(([,e])=>e)]);n.length!==0&&await this.withinReadyTimeout(Promise.all(n.map(e=>e.whenHydrated())),()=>[...t.filter(([,e])=>lk(e)?.hydrated===!1).map(([e])=>`${this.address}.${e}`),...e.created.derives.filter(e=>lk(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 I(`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(bk);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 Ww([...[...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 Gk(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 Ok(e.source)??e.source}#l(e,t){let n=Ok(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 Hw(`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&&Hk(a.select,i.select)){n.add(r);continue}let o=this.#l(r,i),s={origin:e,select:i.select,unsubscribe:bk,buffer:[]};t.set(r,s),vk(o)||Wk(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 I(`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 jk(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 I(`aborted`,`task stopped`));let t=e.done;this.#r.add(t),t.finally(()=>this.#r.delete(t))}this.#n.clear()}#d(e,t){rk(()=>{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 I(`unavailable`,`${this.host.name} failed and admits no work`,{reason:`host_failed`});if(!this.host.hasCodeVersion(e.codeVersion))throw new I(`superseded`,`code version ${e.codeVersion} is retired`);if(e.codeVersion<this.minCodeVersion)throw new I(`upgrade_conflict`,`${this.address} was upgraded in code version ${this.minCodeVersion}`);if(this.gate!==void 0&&!this.gate.grandfathered.has(e.rootId))throw new I(`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 Hw(`read_only`,`cells cannot be written while a factory runs`);if(e instanceof jk&&e.check(this.host),e.signal.aborted)throw new I(`aborted`,`write with an aborted ctx`);if(this.status===`disposed`)throw new I(`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 Pk(e.ready,r.signal),e.status!==`live`||this.status!==`live`)throw e.status===`live`?new I(`gone`,`${this.address} is ${this.status}`):e.terminalError();this.admit(r);let i=this.implementations.get(r.codeVersion);if(i===void 0)throw new I(`superseded`,`${this.address} has no implementation for code version ${r.codeVersion}`);let a=e.viewOf(i),o=Vk(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 I(`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:Dw(r,vw(n));m=d?.args?Dw(d.args,vw(i)):i,d?.args&&Yw(`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&&Yw(`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 I(`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(bk);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 kk,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 Ww([()=>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)}}},Wk=e=>typeof e==`object`&&!!e&&typeof e.events==`function`&&typeof e.subscribe==`function`;function Gk(e,t){let n=new Map,r=e.contract;if(r.scope!==`remote`)return n;let i=r.description.variants[Vk(t)??``]??{};for(let[e,r]of Object.entries(i)){let i=t[e];r.kind===`state`&&vk(i)&&n.set(i,[...n.get(i)??[],r.schema])}return n}function Kk(e,t){let n=e.contract,r=e=>{throw Hw(`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`&&!vk(i)&&!Wk(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 qk=class{#e;#t;#n=new kk;#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 Hw(`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=Ak(n)?n.init:void 0,s=this.#t?.cells.get(e);return s===void 0&&(s=new pk(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 Hw(`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=Rk(t)??Ok(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 Tk(e,t,n);return i?this.#n.adopted.set(r,t):this.#r.resources.push(a),this.#n.resources.set(e,a),new Ek(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 _k(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=Ok(e);if(t===void 0||![...this.#n.resources.values()].includes(t))throw TypeError(`expose takes a resource declared by this object`);return new wk(t)}register(e,t){if(!this.#e.hostLifetime)throw Hw(`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 Jk(e){let{run:t,migrated:n,service:r,object:i}=e,a=Gk(r,t.implementation);for(let[e,t]of n)for(let n of a.get(e)??[])Yw(`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):Yk(e));for(let r of a.get(t)??[])Yw(`state`,`${i.address}: derivation ${e}`,r,n);o.set(t,n)}e.derived=o}function Yk(e){try{return e.value}catch(e){if(Vw(e,`not_ready`)||Vw(e,`not_in_variant`))return;throw e}}function Xk(e){let t=Uw(e,`reload`);return/^reload aborted/.test(t.message.replace(/^[^:]*: /,``))?t:new I(t.code,`reload aborted: ${t.message}`,{cause:t,reason:t.reason,details:t.details})}async function Zk(e,t,n){let r=await Qk(e,t,n);try{return await r.prepare(),r.commit()}finally{$k(e)}}async function Qk(e,t,n,r){if(e.reloading)throw new I(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.reloading=!0;try{return new nA(e,await e.resolve(t),n,r)}catch(t){throw e.reloadEnded(),Xk(t)}}function $k(e){e.reloadEnded()}var eA=1e3;function tA(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 nA=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(),Xk(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 I(`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 tA(e,()=>r()||e.retirable(),n)&&!r()&&(t.abort.abort(new I(`superseded`,`code version ${t.id} was retired`)),await tA(e,()=>r()||t.roots.size===0,Math.min(n,eA))),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,xk(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 I(`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=wT(t.description,n.description);if(r!==void 0)throw new I(`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)&&DT(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 Hw(`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(!Jw(i.schema,n.decls.cellSchemas.get(t)))throw Hw(`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),Jk(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`&&DT(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 I(`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(!Jw(i.schema,a))c=i.value;else continue;Yw(`state`,`${t.address}: migrated state ${r}`,a,c),e.migrated.set(i,c)}Jk(e)}async rollback(){if(this.rolledBack)return;this.rolledBack=!0,this.abort.abort(new I(`aborted`,`reload aborted`));for(let e of this.facetRuns.values())e.abort(new I(`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 I(`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 I(`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 ik(()=>{let t=this.#r();e?.();for(let e of this.#n.splice(0))e();return t})}catch(e){throw this.host.fail(e),Xk(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 I(`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){Sk(n)&&this.changed.has(t)&&e.hostObjects.get(t)?.object?.status!==`live`&&this.#n.push(()=>e.startHostObject(n));let r=e.hostObjects.get(t);!Sk(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 Bk(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{DT(i.contract,i.options.accepts,e.contract)}catch(t){e.gone(new I(`upgrade_required`,`${n.typeName} changed; reload the web facets`,{cause:t})),n.release(e);continue}e.shapeChanged()}}},rA=Cc({minimum:1}),iA=Rc({minLength:1}),aA=Cc({minimum:1}),oA=e=>pc(Go(e)),sA=N({rootId:iA,codeVersion:Cc({minimum:1})}),cA=N({code:ks(zw),message:Rc(),reason:M(Rc())}),lA=N({remove:M(oA(Rc())),gateDeadline:M(Pc()),retireDeadline:M(Pc())}),uA=N({codeVersion:Cc(),previous:Cc(),changed:oA(Rc()),removed:oA(Rc()),prepared:oA(Rc()),gated:oA(Rc())}),dA=F([N({t:P(`hello`),protocol:M(Cc({minimum:1})),name:iA,kind:F([P(`host`),P(`client`)]),codeVersion:Cc({minimum:0}),acks:M(bc())}),N({t:P(`ack`),n:Cc({minimum:1})}),N({t:P(`hold`),id:rA,at:iA,token:_T,input:gs(),principal:M(gs()),origin:M(iA),state:M(P(!1)),again:M(P(!0))}),N({t:P(`release`),id:rA}),N({t:P(`shape`),id:rA,variant:M(Rc()),members:oA(Rc()),contract:Rc(),state:oA(iA)}),N({t:P(`gone`),id:rA,error:cA}),N({t:P(`call`),id:rA,hold:rA,member:iA,args:M(gs()),root:M(sA)}),N({t:P(`result`),id:rA,value:M(gs()),error:M(cA)}),N({t:P(`cancel`),id:rA}),N({t:P(`sub`),hold:rA}),N({t:P(`unsub`),hold:rA}),N({t:P(`resync`),hold:rA,m:iA}),N({t:P(`state`),hold:rA,m:iA,as:F([P(`snap`),P(`reset`),P(`ops`),P(`error`)]),value:M(gs()),ops:M(oA(oA(gs()))),error:M(cA)}),N({t:P(`ping`),n:Cc()}),N({t:P(`pong`),n:Cc()}),N({t:P(`bye`),reason:M(Rc())}),N({t:P(`root_end`),rootId:iA}),N({t:P(`invalidate`),pattern:mu(Rc(),gs())}),N({t:P(`prepare`),reload:aA,codeVersion:Cc({minimum:1}),plugins:oA(Rc()),options:lA}),N({t:P(`vote`),reload:aA,error:M(cA),report:M(uA)}),N({t:P(`commit`),reload:aA}),N({t:P(`retire`),codeVersion:Cc({minimum:1})}),N({t:P(`abort`),reload:aA})]),fA=e=>sw(dA,e);function pA(e){return e instanceof I?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 mA=e=>new I(e.code,e.message.replace(/^[a-z_]+(\/[a-z_]+)?: /,``),{reason:e.reason}),hA=0,gA=(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 _A(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 I(`aborted`,`votes missing after ${n} ms`,{reason:`vote_deadline`}))},n)}).finally(()=>clearTimeout(r))}async function vA(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 Qk(e,t,n,i);try{await a.waitForRetirement();let t=r.filter(e=>e.open),o=++hA,s=n.voteDeadline??(n.gateDeadline??5e3)+(n.retireDeadline??5e3)+5e3,c=t.map(e=>{let t=e.name??`child`,r=_A(e,o,s);return e.send({t:`prepare`,reload:o,codeVersion:i,plugins:gA(n.remote,t),options:{remove:gA(n.remoteRemove,t),gateDeadline:n.gateDeadline,retireDeadline:n.retireDeadline}}),r.then(e=>[t,e],e=>{let n=Xk(e);throw new I(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{$k(e)}}async function yA(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=++hA,i=_A(t,r,3e4);t.send({t:`prepare`,reload:r,codeVersion:n,plugins:gA(e.remoteModules,t.name),options:{remove:gA(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 bA=class{#e;#t;constructor(e){this.#e=e}handle(e,t){if(t.t===`prepare`){if(this.#t!==void 0){let n=new I(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.send({t:`vote`,reload:t.reload,error:pA(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{$k(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(()=>$k(this.#e))):e.reload?.rollback().catch(e=>this.#e.report(e))}async#r(e,t,n){let r=()=>new I(`aborted`,`reload aborted by the server`,{reason:`aborted`});try{if(e.reload=await Qk(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)),$k(this.#e)),this.#t===e&&(this.#t=void 0),e.cancelled||t.send({t:`vote`,reload:n.reload,error:pA(r)})}}},xA=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()}}}},SA=globalThis.process?.getBuiltinModule?.(`node:zlib`),CA=class{bytes;constructor(e){this.bytes=e}};function wA(e){if(!(e instanceof CA))return e;if(SA===void 0)throw TypeError(`packed payload without zlib`);return JSON.parse(SA.inflateRawSync(e.bytes).toString(`utf8`))}var TA=new Set([`args`,`value`]);function EA(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 DA(e,t){let n={...e};return delete n[t],n}function OA(e,t,n){if(e instanceof CA)return e.bytes;if(!(!t||SA===void 0||n===void 0||n.length<=65536))return SA.deflateRawSync(n,{level:1})}function kA(e){if(typeof e!=`object`||!e||!(`z`in e))return e;let{z:t,...n}=e;if(!Array.isArray(t)||!TA.has(t[0])||typeof t[1]!=`string`)throw TypeError(`bad packed payload`);return{...n,[t[0]]:new CA(Buffer.from(t[1],`base64`))}}var AA=new TextEncoder,jA=new TextDecoder;function MA(e,t){let n=EA(e);if(n===void 0)return JSON.stringify(e);let r=e[n],i=r instanceof CA?void 0:JSON.stringify(r),a=OA(r,t,i),o=DA(e,n);if(a===void 0)return`${JSON.stringify(o).slice(0,-1)},${JSON.stringify(n)}:${i}}`;let s=AA.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 NA(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0),n=JSON.parse(jA.decode(e.subarray(4,4+t)));if(typeof n!=`object`||!n)throw TypeError(`bad envelope`);let{z:r,...i}=n;if(typeof r!=`string`||!TA.has(r))throw TypeError(`bad packed payload`);return{envelope:i,field:r,bytes:e.slice(4+t)}}async function PA(e){let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate-raw`));return JSON.parse(await new Response(t).text())}function FA(e){let t=kA(JSON.parse(e));if(typeof t!=`object`||!t||typeof t.t!=`string`)throw TypeError(`not a frame`);return t}var IA=1,LA=class extends xA{#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(FA(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}=NA(r);SA===void 0?this.deliverLater(PA(o).then(e=>({...i,[a]:e}))):this.deliver({...i,[a]:new CA(o)})}catch{this.close(`protocol error`)}}),e.addEventListener(`close`,()=>this.ended(`socket closed`))}transmit(e){let t=MA(e,this.#t);return this.#e.readyState===IA?this.#e.send(t):this.#n.push(t),typeof t==`string`?t.length:t.byteLength}shutdown(){this.#n=[],this.#e.readyState<=IA&&this.#e.close(1e3)}},RA=(e,t)=>new LA(e,t),zA=262144,BA=4,VA=e=>new I(`unavailable`,e),HA=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 I(`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:pA(e)})}}},UA=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))}},WA=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??zA,this.#c=n.pendingCap??this.#s*BA,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=GA(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(GA(e.hold,e.m)),e.overflow.resync())}#S(e,t,n){let r=GA(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=KA(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(GA(e,t));n?.kind===`state`&&(this.#h-=n.size,this.#m.delete(GA(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(VA(`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 I(`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 I(`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 I(`aborted`,`call aborted`));return}let c=()=>{this.calls.delete(a),this.send({t:`cancel`,id:a}),s(new I(`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(),!fA(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 I(`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(mA(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:pA(VA(`${this.host.name} does not relay`))});return}let r=new HA(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=CT(e.token);if(n.scope!==`remote`)throw Hw(`token`,`${n.name} is local; only remote types cross links`);if(dT(n.name,n.description.host,e.input)!==this.host.name)throw Hw(`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 Bk))throw VA(`not a local reference`);i=a}catch(t){this.send({t:`gone`,id:e.id,error:pA(r?YA(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:pA(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(KA(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:QO(),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{JA(e.ref,t,r)}catch(n){return{t:`state`,hold:e.id,m:t,as:`error`,error:pA(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=QO(),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 I(`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 I(`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:pA(t)});return}let t=this.served.get(e.hold);if(t===void 0){this.send({t:`result`,id:e.id,error:pA(new I(`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,wA(e.args),n):n=>qA(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:pA(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(mA(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(mA(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:mA(e.error),e.value);return}let n=this.calls.get(e.id);if(this.calls.delete(e.id),e.error!==void 0){n?.reject(mA(e.error));return}let r;try{r=wA(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 CA)){n.state(e.m,e);return}let r;try{r=wA(e.value)}catch(t){n.state(e.m,{as:`error`,error:pA(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=VA(`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)}},GA=(e,t)=>`s${e}\u0000${t}`,KA=e=>`u${e}`;async function qA(e,t,n,r,i){let a=()=>new I(`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 I(`gone`,`relayed hold closed`);return await new Promise((c,l)=>{let u=new UA(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 JA(e,t,n){if(n===void 0)return;let r=e.object.currentInstalled();if(r===void 0)return;let i=e.currentView(),a=Vk(i===void 0?r.implementation:i),o=i!==void 0&&i!==r.implementation?e.contract.description.variants[a??``]?.[t]:r.service.contract.description.variants[Vk(r.implementation)??``]?.[t];o?.kind===`state`&&Yw(`state`,`${e.address}.${t}`,o.schema,n)}function YA(e){return e instanceof I&&e.code===`contract_mismatch`?new I(`upgrade_required`,e.message,{cause:e}):e}var XA=()=>{};function ZA(){let e=XA,t=XA,n=new Promise((n,r)=>{e=n,t=r});return n.catch(XA),{promise:n,resolve:e,reject:t}}var QA=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=ZA();#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 I(`not_ready`,`${this.key}.${e} is not hydrated yet`);if(!this.inVariant(e))throw new I(`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 I(`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=mA(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=GO(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:$O()};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=ZA());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 I(`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 Pk(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 I(`not_in_variant`,`${this.key}: ${e} is not a method of variant ${i}`);let o=a.args===void 0?void 0:Dw(a.args,vw(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)}},$A=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[ck](){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)}}},ej=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=ZA();this.ready=r.promise,this.#r=r,this.proxy=new Proxy(this,{get:(e,t)=>{if(Fk.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)}}),Lk.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 I(`released`,`reference ${this.address} released`)}release(){if(!this.ended){this.status=`released`,this.#i(),this.#r?.reject(new I(`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 I&&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(){Ik(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 $A(this,e),this.#t.set(e,t)),t}}#a(e){let t=this.#n.get(e);if(t===void 0){let n=OT(this.contract,e);t=(...t)=>{let[r,i]=n?[void 0,t[0]]:t,a=this.binding.host;if(a.inFactory>0)throw new I(`not_ready`,`${this.address}.${e} called inside a factory`);if(i!==void 0&&!(i instanceof jk))return Promise.reject(Hw(`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)}},tj=e=>typeof e==`object`&&!(e instanceof URL),nj=new Map;function rj(e){return new ij(e)}var ij=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 bA(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??Kw,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,xk(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=xk(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(Sk).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=>!tj(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=>tj(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 I(`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&&!fT(n,this.name))throw TypeError(`${t.contract.name} is declared for ${pT(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 cj(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=Xw(e.input,t,`${e.name} input`),i=dT(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=Xw(i,t,`${r} input`),o=Zw(i,a);if(Sk(e)){if(o!==Zw(i,Xw(i,{},`${r} input`)))throw Hw(`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=Zw(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 cj(e.name,this.name);DT(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&&dT(e.name,d,l)!==this.name)throw Hw(`placement`,`${e.name} with this input lives on ${dT(e.name,d,l)}, not ${this.name}`);let f=this.objects.get(c);if(i!==void 0&&f!==void 0&&(f===i||lj(f,i)))throw Hw(`cycle`,`${i.address} -> ${c} would create a ref cycle`);if(f===void 0){if(this.gating?.has(e.name))throw new I(`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 Uk(this,{address:c,typeName:e.name,input:l,principal:u,hostLifetime:Sk(s)}),this.objects.set(c,f),f.start(t?.status===`disposing`?t.dispose(!1):void 0)}let p=new Bk(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 I(`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 jk(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(),Ww([...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 I(`superseded`,`code version ${t?.codeVersion} is retired`);return n.tables.get(e.name)??nj};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 Hw(`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)??nj;if(!n&&oj(r.get(i)??nj,o))continue;let s=[...a];rk(()=>{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 Nk(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=>sj(e,t),n=new I(`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 aj([...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 WA(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 I(`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),yA(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 QA(this,{key:o,contract:e,at:t,input:n,principal:a}),this.bindings.set(o,s));let l=new ej(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 I(`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 I(`forbidden`,`${t} refused for this principal`),a=()=>new I(`gone`,`principal invalidated while resolving`);if(!await e.authorize(n,t))throw i();if(!r())throw a();let o=await e.resolve(t);if(!r())throw a();if(!await e.authorize(n,t))throw i();if(!r())throw a();let s=[...this.connections].find(e=>e.link===o);if(s??=this.#M(o,{role:`downstream`,principal:e.principal(t),peer:{kind:`host`,name:t}}),await s.whenSynced(),!r())throw a();return s}async relay(e){let t=e.frame.at,n=CT(e.frame.token).description.host;if(n===void 0||dT(e.frame.token.name,n,e.frame.input)!==t)throw Hw(`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 I(`unavailable`,`no route to ${t}`):new I(`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 I(`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?vA(this,e,t):Zk(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 I(`gone`,`host ${this.name} closed`);try{await aj([...this.objects.values()],e,`host close: disposal failed`)}finally{for(let e of[...this.connections])e.link.close(`host closed`)}}};async function aj(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 oj(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 sj=(e,t)=>typeof t==`object`&&!!t&&Object.entries(e).every(([e,n])=>Jw(t[e],n)),cj=(e,t)=>new I(`unavailable`,`${e} is not served by ${t}`,{reason:`unknown_type`});function lj(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 uj=[`off`,`on`,`only`],dj={maxItems:100,idChars:64,textChars:256,itemsBytes:65536},fj={questionChars:2e3,maxOptions:12,optionIdChars:64,labelChars:200,descriptionChars:500,textChars:4e3,questionBytes:16384,responseBytes:16384,maxPending:8,previewChars:256,recordBytes:65536},pj={titleChars:120,maxSteps:30,stepChars:500,noteChars:4e3,feedbackChars:2e3},mj=class extends Error{name=`InteractionInputError`},hj=new TextEncoder,gj=e=>hj.encode(JSON.stringify(e)).length,_j=e=>e.trim()===``,vj=e=>typeof e==`object`&&!!e&&!Array.isArray(e),yj=e=>{throw new mj(e)};function bj(e,t,n){for(let r of Object.keys(e))t.includes(r)||yj(`${n} has an unknown field "${r}".`)}function xj(e,t){if(!vj(t))return yj(`Response must be an object.`);if(gj(t)>fj.responseBytes&&yj(`Response is too large (limit ${fj.responseBytes} bytes).`),t.kind===`skip`)return bj(t,[`kind`],`Response`),{kind:`skip`};if(t.kind!==`answer`)return yj(`Response kind must be "answer" or "skip".`);bj(t,[`kind`,`optionIds`,`text`],`Response`);let n=t.optionIds===void 0?[]:t.optionIds;if(!Array.isArray(n))return yj(`optionIds must be an array.`);n.length>fj.maxOptions&&yj(`Too many selected options (limit ${fj.maxOptions}).`);let r=new Set;for(let t of n)(typeof t!=`string`||t===``)&&yj(`optionIds must contain non-empty strings.`),r.has(t)&&yj(`Option "${t}" was selected twice.`),e.options.some(e=>e.id===t)||yj(`Unknown option "${t}".`),r.add(t);!e.options.length&&r.size&&yj(`This question has no options.`),!e.multiple&&r.size>1&&yj(`This question accepts only one option.`);let i=null;if(t.text!==void 0){typeof t.text!=`string`&&yj(`text must be a string.`);let e=t.text;e.length>fj.textChars&&yj(`text is too long (limit ${fj.textChars} characters).`),_j(e)||(i=e)}return!r.size&&i===null&&yj(`Choose an option or enter text.`),{kind:`answer`,optionIds:e.options.filter(e=>r.has(e.id)).map(e=>e.id),text:i}}function Sj(e,t){return t.optionIds.map(t=>e.options.find(e=>e.id===t)?.label??t)}var Cj=e=>({completed:e.filter(e=>e.status===`completed`).length,total:e.length}),wj=()=>({optionIds:[],text:``});function Tj(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 Ej(e){let t=_j(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 Dj(e,t){let n=Ej(t);if(!n)return`Choose an option or enter text.`;try{return xj(e,n),null}catch(e){return e instanceof Error?e.message:`Invalid answer.`}}function Oj(e){if(e.status===`answered`&&e.answer){let t=Sj(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 kj=`neko`,Aj=(e,t)=>[e,t];function jj(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,lT(t,n)]))}]));return ST(e,{...t,host:uT(kj),variants:n})}var L=Rc(),Mj=Pc(),Nj=bc(),Pj=jc(),R=Cc({minimum:0,maximum:2**53-1}),Fj=F([L,Pj]),Ij=ks([`pending`,`running`,`done`]),Lj=ks([`project`,`user`,`builtin`]),Rj=ks([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]),zj=N({provider:L,modelId:L}),Bj=N({model:M(zj),thinkingLevel:M(Rj)},{additionalProperties:!1}),Vj=N({input:Mj,output:Mj,cacheRead:Mj,cacheWrite:Mj,cost:Mj}),Hj=N({name:L,mimeType:L,width:R,height:R,bytes:R,entryId:R,contentIndex:R}),Uj=N({name:L,location:L,body:L,args:L}),Wj=N({calls:Go(N({id:R,name:L,args:L,status:ks([`running`,`ok`,`error`,`cancelled`]),durationMs:F([Mj,Pj]),error:Fj})),omitted:R,fullOutputPath:Fj}),Gj=N({callId:L,name:L,summary:L,detail:Fj,phase:Ij,output:Fj,diff:Fj,diffAdded:F([Mj,Pj]),diffRemoved:F([Mj,Pj]),diffTruncated:M(Nj),codemode:M(Wj)}),Kj=N({parentId:R,agentId:M(L),round:M(R),runnerId:M(R),inputEntryId:M(R),answerEntryId:M(R),roundUsage:M(F([Vj,Pj])),taskId:R,callId:L,childId:R,role:ks([`explore`,`plan`,`coder`]),title:L,createdAt:Mj,startedAt:F([Mj,Pj]),endedAt:F([Mj,Pj]),status:ks([`queued`,`running`,`completed`,`failed`,`cancelled`]),report:Fj,approvalCount:M(R),historyThrough:M(R),historyUsage:M(Vj)}),qj=N({agentId:L,parentId:R,childId:R,role:ks([`explore`,`plan`,`coder`]),title:L,status:ks([`idle`,`queued`,`running`]),activeRoundId:F([R,Pj]),lastRoundId:R,lastReport:M(Fj),roundCount:R,taskTitle:L,approvalCount:R,createdAt:Mj,historyThrough:M(R),historyUsage:M(Vj)}),Jj=N({jobId:L,title:L,command:L,cwd:L,status:ks([`running`,`exited`,`failed`,`stopped`,`lost`]),startedAt:Mj,endedAt:F([Mj,Pj]),exitCode:F([Mj,Pj]),reason:M(ks([`timeout`,`spawn-error`,`restart`,`aborted`])),timeoutSeconds:M(Mj),outputBytes:R}),Yj=N({job:Jj,text:L,offset:R,truncated:Nj,dropped:R}),Xj=N({id:R,mode:ks([`steer`,`followUp`]),preview:L,images:R,skill:M(N({name:L,args:L}))}),Zj=N({result:ks([`withdrawn`,`placed`,`settled`,`unknown`]),text:M(L),images:M(R)}),Qj=N({result:ks([`steered`,`withdrawn`,`placed`,`settled`,`unknown`]),id:M(R),text:M(L),images:M(R)}),$j=N({revision:R,items:Go(N({id:Rc({minLength:1,maxLength:dj.idChars}),text:Rc({minLength:1,maxLength:dj.textChars}),status:ks([`pending`,`in_progress`,`completed`])},{additionalProperties:!1}),{maxItems:dj.maxItems})}),eM=N({id:Rc({minLength:1,maxLength:fj.optionIdChars}),label:Rc({minLength:1,maxLength:fj.labelChars}),description:M(Rc({maxLength:fj.descriptionChars})),recommended:M(Nj)},{additionalProperties:!1}),tM=ks([`pending`,`answered`,`skipped`,`cancelled`]),nM=N({id:R,version:L,preview:Rc({maxLength:fj.previewChars}),multiple:Nj,optionCount:R,createdAt:Mj}),rM=N({path:L,entries:Go(N({name:L,path:L,kind:ks([`file`,`directory`,`symlink`]),protected:M(P(!0))},{additionalProperties:!1}),{maxItems:1e3}),limited:Nj,incomplete:Nj}),iM=N({path:L,size:Mj,mtimeMs:Mj,kind:ks([`text`,`binary`,`protected`]),content:M(L),truncated:Nj}),aM=N({revision:R,files:R,added:R,removed:R}),oM=N({revision:R,files:Go(N({path:L,outside:M(P(!0)),ops:R,added:R,removed:R,agents:Go(L,{maxItems:64}),lastSeq:R},{additionalProperties:!1}),{maxItems:500}),truncated:Nj}),sM=N({seq:R,agent:L,tool:ks([`edit`,`write`]),diff:L,added:R,removed:R,truncated:Nj},{additionalProperties:!1}),cM=N({path:L,outside:M(P(!0)),ops:Go(sM,{maxItems:50}),truncated:Nj}),lM=N({revision:R,pending:Go(nM,{maxItems:fj.maxPending})}),uM=N({id:R,callId:L,version:L,question:Rc({maxLength:fj.questionChars}),multiple:Nj,options:Go(eM,{maxItems:fj.maxOptions}),status:tM,answer:F([N({optionIds:Go(Rc(),{maxItems:fj.maxOptions}),text:F([Rc({maxLength:fj.textChars}),Pj])}),Pj]),createdAt:Mj,settledAt:F([Mj,Pj])}),dM=F([N({kind:P(`answer`),optionIds:M(Go(Rc(),{maxItems:fj.maxOptions})),text:M(Rc({maxLength:fj.textChars}))},{additionalProperties:!1}),N({kind:P(`skip`)},{additionalProperties:!1})]),fM=N({version:L,title:Rc({maxLength:pj.titleChars}),steps:Go(Rc({maxLength:pj.stepChars}),{maxItems:pj.maxSteps}),note:Rc({maxLength:pj.noteChars}),status:ks([`awaiting_approval`,`approved`,`revision_requested`,`superseded`,`cancelled`]),feedback:F([Rc({maxLength:pj.feedbackChars}),Pj]),createdAt:Mj,settledAt:F([Mj,Pj])}),pM=N({mode:ks([`normal`,`plan`]),revision:R,current:F([fM,Pj])}),mM=F([N({kind:P(`approve`)},{additionalProperties:!1}),N({kind:P(`revise`),feedback:Rc({minLength:1,maxLength:pj.feedbackChars})},{additionalProperties:!1})]),hM=F([N({kind:P(`ask_user`),id:R,question:L,multiple:Nj,options:Go(N({id:L,label:L,recommended:M(Nj)})),status:tM,optionIds:M(Go(L)),labels:M(Go(L)),text:M(F([L,Pj]))}),N({kind:P(`todo`),action:ks([`list`,`replace`]),revision:R,completed:R,total:R}),N({kind:P(`submit_plan`),version:L,title:L,steps:Go(L),note:L})]),gM=N({historyBefore:M(F([R,Pj])),agents:M(Go(qj)),jobs:M(Go(Jj)),queued:M(Go(Xj)),todos:M($j),questions:M(lM),plan:M(pM),changes:M(aM),rounds:M(Go(Kj)),subagents:M(Go(Kj)),taskUsage:M(Vj),model:L,agent:N({model:F([zj,Pj]),thinkingLevel:F([Rj,Pj])}),cwd:L,busy:Nj,status:Fj,usage:Vj,contextUsage:M(N({tokens:F([Mj,Pj]),window:Mj,percent:F([Mj,Pj])})),compaction:M(N({failure:M(N({taskId:R,reason:ks([`manual`,`threshold`,`overflow`]),error:L})),active:Go(N({taskId:R,reason:ks([`manual`,`threshold`,`overflow`]),blocking:Nj,attempt:R,retry:M(N({at:Mj,error:L}))})),latest:F([Pj,N({taskId:R,phase:ks([`summarizing`,`waiting-to-apply`,`applied`,`nothing`,`skipped`,`cancelled`,`failed`]),at:Mj})])})),items:Go(F([N({type:P(`user`),order:M(Mj),key:L,id:R,text:L,images:M(Go(Hj)),skill:M(Uj),defaultImagePrompt:M(N({version:Cc({minimum:1}),text:L}))}),N({type:P(`assistant`),order:M(Mj),key:L,id:R,thinking:L,text:L,stopReason:Fj,errorMessage:Fj,note:Fj}),N({type:P(`tool`),order:M(Mj),key:L,images:M(Go(Hj)),callId:L,name:L,summary:L,detail:Fj,phase:Ij,isError:Nj,output:Fj,result:Fj,durationMs:F([Mj,Pj]),note:Fj,diff:Fj,diffAdded:F([Mj,Pj]),diffRemoved:F([Mj,Pj]),diffTruncated:M(Nj),interaction:M(hM),codemode:M(Wj)}),N({type:P(`system`),order:M(Mj),key:L,id:R,text:L,jobId:M(L),planDecision:M(N({version:L,kind:ks([`approve`,`revise`])},{additionalProperties:!1}))})])),streaming:F([Pj,N({thinking:L,text:L,toolCalls:Go(Gj)})])}),_M=N({workspaceRoot:L,lastUsedAt:Mj,title:L,firstPromptPreview:L,createdAt:Mj,lastMessageAt:F([Mj,Pj]),model:F([zj,Pj]),status:ks([`idle`,`running`,`error`]),awaitingAnswer:M(Nj),awaitingPlan:M(Nj),id:L}),vM=N({revision:R,sessions:Go(_M)}),yM=N({path:L,createdAt:Mj}),bM=N({revision:R,workspaces:Go(yM)}),xM=N({revision:R,statuses:mu(L,N({savedConfigured:Nj,environmentConfigured:Nj,source:ks([`saved`,`environment`,`runtime`,`keyless`,`none`]),enabled:M(Nj)}))}),SM=N({sessionId:L,attachmentId:L}),CM=N({sessionId:L,attachmentId:L},{additionalProperties:!1}),wM=jj(`neko.session-directory`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:vM}}}}),TM=jj(`neko.session-management`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{methods:{create:Aj(N({...Bj.properties,cwd:M(L)},{additionalProperties:!1}),_M),archive:Aj(L,Pj),attach:Aj(L,SM),detach:Aj(Pj,Pj),fork:Aj(L,_M)}}}}),EM=N({maxWidth:M(R),maxHeight:M(R),maxBytes:M(R),jpegQuality:M(R)}),DM=N({maxRequestBytes:M(R),images:M(N({resize:M(EM),maxPerMessage:M(R),maxPerRequest:M(R)}))}),OM=N({provider:L,modelId:L,name:L,available:Nj,contextWindow:Mj,input:Go(L),inputLimits:M(DM),reasoning:Nj,supportedThinkingLevels:Go(Rj),thinkingLevelAdjustments:N({off:Rj,minimal:Rj,low:Rj,medium:Rj,high:Rj,xhigh:Rj,max:Rj})}),kM=jj(`neko.models`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{methods:{list:Aj(Pj,Go(OM))}}}}),AM=N({data:L,total:R,mimeType:L}),jM=jj(`neko.subagent`,{version:1,input:N({sessionId:L,attachmentId:L,taskId:M(R),agentId:M(L)}),variants:{ready:{state:{revision:R},methods:{chunk:Aj(N({kind:ks([`view`,`history`]),before:M(R),token:M(R),offset:R}),N({token:R,data:L,next:F([R,Pj])})),getImage:Aj(N({entryId:R,contentIndex:R,offset:R}),AM),decideApproval:Aj(N({id:R,version:L,decision:ks([`allowed`,`denied`])}),ks([`pending`,`allowed`,`denied`,`cancelled`])),stop:Aj(F([Pj,N({taskId:R})]),Pj)}}}}),MM=jj(`neko.chat`,{version:1,input:CM,variants:{ready:{state:{view:gM},methods:{submit:Aj(N({content:L,images:M(Go(L,{maxItems:4})),requestId:M(L),whenBusy:M(ks([`steer`,`followUp`]))},{additionalProperties:!1}),Pj),abort:Aj(Pj,Pj),withdraw:Aj(N({id:R},{additionalProperties:!1}),Zj),steer:Aj(N({id:R},{additionalProperties:!1}),Qj),questionGet:Aj(N({id:R},{additionalProperties:!1}),F([uM,Pj])),questionRespond:Aj(N({id:R,version:L,response:dM},{additionalProperties:!1}),uM),planGet:Aj(N({version:L},{additionalProperties:!1}),F([fM,Pj])),planRespond:Aj(N({version:L,decision:mM},{additionalProperties:!1}),fM),planMode:Aj(N({mode:ks([`normal`,`plan`])},{additionalProperties:!1}),pM),usage:Aj(Pj,Vj),workspaceDir:Aj(N({path:L},{additionalProperties:!1}),rM),workspaceFile:Aj(N({path:L},{additionalProperties:!1}),iM),changesList:Aj(Pj,oM),changeGet:Aj(N({path:L},{additionalProperties:!1}),F([cM,Pj])),skills:Aj(Pj,Go(N({name:L,description:L,location:L,level:Lj}))),jobOutput:Aj(N({jobId:L,since:M(R)},{additionalProperties:!1}),Yj),jobStop:Aj(N({jobId:L},{additionalProperties:!1}),Jj),configure:Aj(Bj,Pj),compact:Aj(N({instructions:M(L)},{additionalProperties:!1}),Pj),importImage:Aj(L,N({id:L,name:L})),draftImage:Aj(N({id:L,offset:R},{additionalProperties:!1}),AM),beginImage:Aj(N({name:L,mimeType:L,size:Cc({minimum:1,maximum:20971520})},{additionalProperties:!1}),L),appendImage:Aj(N({id:L,offset:R,data:Rc({maxLength:35e4})},{additionalProperties:!1}),Pj),finishImage:Aj(L,Pj),releaseImage:Aj(L,Pj),getImage:Aj(N({entryId:R,contentIndex:R,offset:R},{additionalProperties:!1}),AM)}}}}),NM=N({path:L,query:M(L),showHidden:M(Nj),cursor:M(L)},{additionalProperties:!1}),PM=N({path:L,parent:Fj,entries:Go(N({name:L,path:L,error:M(L)})),next:Fj}),FM=jj(`neko.workspaces`,{version:2,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:bM},methods:{add:Aj(N({path:L},{additionalProperties:!1}),yM),remove:Aj(N({path:L},{additionalProperties:!1}),jc()),browse:Aj(NM,PM)}}}}),IM=Rc({minLength:1,maxLength:64}),LM=jj(`neko.credentials`,{version:2,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:xM},methods:{save:Aj(N({provider:IM,key:Rc({minLength:1,maxLength:8192})},{additionalProperties:!1}),Pj),remove:Aj(N({provider:IM},{additionalProperties:!1}),Pj),setEnabled:Aj(N({provider:IM,enabled:Nj},{additionalProperties:!1}),Pj)}}}}),RM=N({revision:R,selected:ks([`tavily`,`deepseek`])}),zM=jj(`neko.search-settings`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:RM},methods:{set:Aj(N({provider:ks([`tavily`,`deepseek`])},{additionalProperties:!1}),Pj)}}}}),BM=ks([`default`,`config`,`saved`]),VM=N({revision:R,effective:N({compaction:N({enabled:Nj,triggerPercent:F([R,Pj]),keepRecentTokens:R}),pruning:N({enabled:Nj,triggerPercent:R,keepRecent:R,minChars:R,minSavePercent:R})}),sources:N({compaction:N({enabled:BM,triggerPercent:BM,keepRecentTokens:BM}),pruning:N({enabled:BM,triggerPercent:BM,keepRecent:BM,minChars:BM,minSavePercent:BM})})}),HM=e=>F([e,Pj]),UM=N({compaction:M(N({enabled:M(HM(Nj)),triggerPercent:M(HM(R)),keepRecentTokens:M(HM(R))},{additionalProperties:!1})),pruning:M(N({enabled:M(HM(Nj)),triggerPercent:M(HM(R)),keepRecent:M(HM(R)),minChars:M(HM(R)),minSavePercent:M(HM(R))},{additionalProperties:!1}))},{additionalProperties:!1}),WM=jj(`neko.context-settings`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:VM},methods:{set:Aj(UM,Pj),reset:Aj(N({},{additionalProperties:!1}),Pj)}}}}),GM=N({revision:R,effective:N({mode:ks([...uj])}),source:ks([`default`,`config`,`saved`])}),KM=jj(`neko.codemode-settings`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:GM},methods:{set:Aj(N({mode:ks([...uj])},{additionalProperties:!1}),Pj),reset:Aj(N({},{additionalProperties:!1}),Pj)}}}}),qM=N({effective:zj,source:ks([`cli`,`saved`,`config`,`default`])}),JM=jj(`neko.default-model`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{state:{state:qM},methods:{set:Aj(zj,Pj),clear:Aj(Pj,Pj)}}}}),YM=N({entries:Go(N({name:L,path:L,kind:ks([`file`,`directory`])}),{maxItems:100}),limited:Nj,incomplete:Nj}),XM=jj(`neko.workspace-files`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{methods:{search:Aj(N({workspaceRoot:L,query:L},{additionalProperties:!1}),YM)}}}}),ZM=N({name:L,description:L,category:L,source:L,license:L,version:L,sha256:L,sizeBytes:R,uploadedAt:L,installed:N({project:Nj,user:Nj,builtin:Nj}),activeLevel:F([Lj,Pj])}),QM=N({body:L,files:Go(L)}),$M=ks([`user`,`project`]),eN=N({name:L,scope:$M,path:L,shadowedBy:M($M)}),tN=jj(`neko.skill-market`,{version:1,input:N({},{additionalProperties:!1}),variants:{ready:{methods:{list:Aj(N({query:M(L),workspaceRoot:M(L)},{additionalProperties:!1}),Go(ZM)),detail:Aj(N({name:L,workspaceRoot:M(L)},{additionalProperties:!1}),ZM),preview:Aj(N({name:L},{additionalProperties:!1}),QM),install:Aj(N({name:L,scope:$M,workspaceRoot:M(L),overwrite:M(Nj)},{additionalProperties:!1}),eN),uninstall:Aj(N({name:L,scope:$M,workspaceRoot:M(L)},{additionalProperties:!1}),Pj)}}}}),nN=F([N({status:P(`ready`),path:L,source:ks([`config`,`auto`])}),N({status:P(`missing`),reason:ks([`not_found`,`invalid_config`]),detail:M(L)})]),rN=N({runningVersion:L,installedVersion:Fj,protocolVersion:Cc({minimum:1}),latestVersion:Fj,checkedAt:F([R,Pj]),checkState:ks([`unknown`,`checking`,`ok`,`failed`,`development`]),serverId:L,shell:M(nN)}),iN=jj(`neko.application-info`,{version:1,input:N({}),variants:{ready:{state:{info:rN},methods:{check:Aj(Pj,rN)}}}}),aN=16777216,oN=e=>e instanceof Uint8Array?e:new Uint8Array(e),sN=e=>typeof e==`string`?new TextEncoder().encode(e).byteLength:e.byteLength;function cN(e,t=aN,n){let r=0,i=0,a=!1,o;return o=RA({get readyState(){return e.readyState},send(n){if(sN(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=sN(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?oN(e):new TextDecoder().decode(oN(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=sN(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 lN(e,t={}){return rj({kind:`client`,self:{kind:`client`},upstream:{link:e,principal:{kind:`server`},...t.onProtocolMismatch?{onProtocolMismatch:t.onProtocolMismatch}:{}},onError:()=>{}})}function uN(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 dN=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()}},fN=class extends Error{constructor(){super(`Gateway identity mismatch`),this.name=`GatewayIdentityError`}},pN=`This gateway does not support background jobs. Restart the gateway to enable them.`;function mN(e){let t=()=>e.view.value?.jobs!==void 0,n=()=>{if(!t())throw Error(pN)};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 hN=`This gateway does not support queued message controls. Restart the gateway to enable them.`;function gN(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(hN);return e.steer({id:n})},async withdraw(n){if(!t())throw Error(hN);return e.withdraw({id:n})}}}var _N=`This gateway does not support questions. Restart the gateway to enable them.`,vN={revision:0,pending:[]};function yN(e){let t=()=>e.view.value?.questions??vN,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(_N);return e.questionGet({id:t})},async respond(t){if(!n())throw Error(_N);return e.questionRespond(t)}}}var bN=`This gateway does not support plan mode. Restart the gateway to enable it.`;function xN(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(bN);return e.planGet({version:n})},async respond(n){if(!t())throw Error(bN);return e.planRespond(n)},async setMode(n){if(!t())throw Error(bN);return e.planMode({mode:n})}}}var SN=`This gateway does not support the workspace browser. Restart the gateway to enable it.`;function CN(e,t){let n=()=>e.view.value?.changes!==void 0,r=()=>{if(!n())throw Error(SN)},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 wN(e,t,n={}){let r=n.readyTimeoutMs??TN,i=!1,a=new AbortController,o=``;e.onClose(e=>{o=e,a.abort(Error(`Gateway connection closed: ${e}`))});let s=lN(e,{onProtocolMismatch:()=>{i=!0}}),c=e=>s.hold(e,{}),l=c(iN),u=[l.info.subscribe(()=>{})],d,f=!1;function p(){let e=c(wM),t=c(TM),n=c(kM),r=c(FM),i=c(XM),a=c(LM),o=c(zM),s=c(WM),l=c(KM),d=c(JM),f=c(tN);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 EN(l.ready,e,r);let n=l.info.value;if(n.serverId!==t)throw new fN;if(n.protocolVersion!==10)throw new Gi;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 EN(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 uN(()=>s.hold(jM,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 Gi: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(MM,n);g=i,v=i.view.subscribe(()=>{});try{if(await EN(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 TN=5e3;function EN(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 DN=`neko.language`,ON=[`zh`,`en`],kN={zh:`zh-CN`,en:`en`};function AN(e){return e===`zh`||e===`en`?e:`zh`}function jN(e=PN()){try{return AN(e?.getItem(DN))}catch{return`zh`}}function MN(e,t=PN()){try{e===`zh`?t?.removeItem(DN):t?.setItem(DN,e)}catch{}}function NN(e,t=FN()){t?.documentElement.setAttribute(`lang`,kN[e])}function PN(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function FN(){return typeof document>`u`?void 0:document}function IN(e={}){let t=e.storage??PN(),n=e.doc??FN(),r=e.target??(typeof window>`u`?void 0:window),i=jN(t),a=new Set;function o(e){if(e!==i){i=e,NN(i,n);for(let e of a)e()}}let s=e=>{let n=e.key;(n===null||n===`neko.language`)&&o(jN(t))};return{get:()=>i,set(e){let n=AN(e);MN(n,t),o(n)},reset(){MN(`zh`,t),o(`zh`)},start(){i=jN(t),NN(i,n),r?.addEventListener(`storage`,s)},stop(){r?.removeEventListener(`storage`,s)},subscribe(e){return a.add(e),()=>a.delete(e)}}}var LN;function RN(){return LN??=IN(),LN}function zN(){return RN().get()}function BN(e=RN()){return(0,f.useSyncExternalStore)(e.subscribe,e.get,()=>`zh`)}var VN={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.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.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`"}},HN=/\{(\w+)\}/g;function UN(e,t,n=``){return e.replace(HN,(e,r)=>{let i=t?.[r];if(i===void 0)throw Error(`i18n: missing param "${r}" for "${n}"`);return String(i)})}function WN(e){let t=VN[e];return((e,n)=>UN(t[e],n,e))}function z(){return WN(zN())}function B(){let e=BN();return(0,f.useMemo)(()=>WN(e),[e])}function GN(e,t){return e.filter(e=>e.workspaceRoot===t).sort($i)}var KN=class{subagent(e){if(!this.ready||!this.#t)throw Error(z()(`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(z()(`gw.notConnected`));await this.#o.save({provider:e,key:t})}async removeCredential(e){if(!this.#C||!this.#o)throw Error(z()(`gw.notConnected`));await this.#o.remove({provider:e})}async setProviderEnabled(e,t){if(!this.#C||!this.#o)throw Error(z()(`gw.notConnected`));await this.#o.setEnabled({provider:e,enabled:t})}async setSearchProvider(e){if(!this.#C||!this.#s)throw Error(z()(`gw.notConnected`));await this.#s.set({provider:e})}async setContextSettings(e){if(!this.#C||!this.#c)throw Error(z()(`gw.notConnected`));await this.#c.set(e)}async setCodemodeMode(e){if(!this.#C||!this.#l)throw Error(z()(`gw.notConnected`));await this.#l.set({mode:e})}async resetCodemodeMode(){if(!this.#C||!this.#l)throw Error(z()(`gw.notConnected`));await this.#l.reset({})}async resetContextSettings(){if(!this.#C||!this.#c)throw Error(z()(`gw.notConnected`));await this.#c.reset({})}async setDefaultModel(e){if(!this.#C||!this.#u)throw Error(z()(`gw.notConnected`));await this.#u.set(e)}async clearDefaultModel(){if(!this.#C||!this.#u)throw Error(z()(`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 Gi?(this.#w=!0,this.#e.events.onPhase(`error`),await this.#H()):this.#B()}}#k(e){this.#e.events.onError(e instanceof Gi?z()(`gw.incompatible`):e instanceof Error?e.message:String(e))}#A(e){if(this.#S||e!==this.#b)throw Error(z()(`gw.connectionChanged`))}async#j(e){if(!this.managementReady)throw Error(z()(`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(z()(`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(z()(`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(z()(`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=GN(this.#p,e).sort(ea),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(z()(`gw.sessionNotReady`));await this.#f.configure(e)}async submit(e,t=[],n=crypto.randomUUID(),r){if(r!==void 0&&r!==this.#h)throw Error(z()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(z()(`gw.sessionNotReady`));let i=this.#f,a=[];try{for(let e of t)a.push(await Ji(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(z()(`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(z()(`gw.sessionChangedDraft`));let r=this.#f;return this.#t.host.root(async t=>{let n=await r.importImage(e,t);try{return{...await Yi(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(z()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(z()(`gw.sessionNotReady`));await this.#f.compact({instructions:e})}#I(e){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChanged`));return mN(this.#f)}async steer(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChanged`));return gN(this.#f).steer(t)}async withdraw(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChanged`));return gN(this.#f).withdraw(t)}async questionGet(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChangedOrNotReady`));return yN(this.#f).get(t)}async questionRespond(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChangedAnswerDraft`));return yN(this.#f).respond(t)}async planMode(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChangedOrNotReady`));return xN(this.#f).setMode(t)}async planGet(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChangedOrNotReady`));return xN(this.#f).get(t)}async planRespond(e,t){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChangedFeedbackDraft`));return xN(this.#f).respond(t)}workspace(e){if(!this.ready||e!==this.#h)throw Error(z()(`gw.sessionChangedOrNotReady`));return CN(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(z()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(z()(`gw.sessionNotReady`));let r=this.#f;return Yi(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(z()(`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(z()(`gw.notConnected`)))}marketDetail(e){return this.#d?this.#d.detail({name:e,workspaceRoot:this.#m}):Promise.reject(Error(z()(`gw.notConnected`)))}marketPreview(e){return this.#d?this.#d.preview({name:e}):Promise.reject(Error(z()(`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(z()(`gw.notConnected`)))}async marketUninstall(e,t){if(!this.#d)return Promise.reject(Error(z()(`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=wN(cN(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 Gi&&(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(z()(`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 Gi?(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()}},qN=[{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 JN(e,t=z()){for(let n of qN){let r=n.pattern.exec(e);if(r)return n.render(t,r)}return e}var YN={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`)},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`)}},XN=/^([A-Z][A-Z_]+): ([\s\S]*)$/;function ZN(e,t=z()){let n=XN.exec(e),r=n?.[1]===void 0?void 0:YN[n[1]];if(!n||!r)return e;let i=r.pattern.exec(n[2]??``);return i?r.render(t,i):e}var QN={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},$N=new Set;function eP(e){QN=e;for(let e of $N)e()}function tP(e){return $N.add(e),()=>{$N.delete(e)}}function nP(){return(0,f.useSyncExternalStore)(tP,()=>QN)}function rP(){return QN}var iP={setUpdates(e){eP({...QN,updates:e})},setShell(e){eP({...QN,shell:e})},setWebInfo(e){eP({...QN,webInfo:e})},setCredentials(e){e&&QN.credentials&&e.revision<QN.credentials.revision||eP({...QN,credentials:e})},setSearchSettings(e){e&&QN.searchSettings&&e.revision<QN.searchSettings.revision||eP({...QN,searchSettings:e})},setCodemodeSettings(e){e&&QN.codemodeSettings&&e.revision<QN.codemodeSettings.revision||eP({...QN,codemodeSettings:e})},setContextSettings(e){e&&QN.contextSettings&&e.revision<QN.contextSettings.revision||eP({...QN,contextSettings:e})},setDefaultModel(e){eP({...QN,defaultModel:e})},setWorkspace(e){eP({...QN,workspaceRoot:e})},setWorkspaces(e){eP({...QN,workspaces:e})},setOperation(e){eP({...QN,operating:e})},setPhase(e){eP({...QN,phase:e})},setDirectory(e){eP({...QN,sessions:e})},setModels(e){eP({...QN,models:e})},setSession(e){eP({...QN,currentSessionId:e})},setView(e){let t=QN.currentSessionId,n=e!==null&&t!==null?{sessionId:t,todos:e.todos,questions:e.questions}:QN.retained;eP({...QN,view:e,retained:n})},notice(e){eP({...QN,notice:{...e,text:ZN(e.text)}})},clearNotice(){QN.notice!==null&&eP({...QN,notice:null})}},aP=`neko.upgrade-draft.v1`;function oP(e=sessionStorage){try{let t=JSON.parse(e.getItem(aP)??`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 sP(e,t=sessionStorage){if(t.setItem(aP,JSON.stringify(e)),t.getItem(aP)!==JSON.stringify(e))throw Error(`Draft not saved`)}function cP(){sessionStorage.removeItem(aP)}var lP=0;async function uP(){let e=++lP,t=await fetch(`/api/info`,{cache:`no-store`,signal:AbortSignal.timeout(5e3)});if(!t.ok)throw Error(z()(`gw.infoFailed`,{status:t.status}));let n=await t.json();if(n.protocolCompatible===!1)throw new Gi;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(z()(`gw.invalidInfo`));return e===lP&&iP.setWebInfo({serverId:n.serverId,webVersion:n.webVersion,installedVersion:n.installedVersion,gatewaySpawned:n.gatewaySpawned===!0,launchRoot:n.workspaceRoot}),n}var dP;function fP(){(async()=>{let e;try{e=await uP()}catch(e){iP.setPhase(`error`),iP.notice({level:`error`,text:e instanceof Gi?z()(`gw.incompatible`):z()(`gw.infoLoadFailed`,{error:e instanceof Error?e.message:String(e)})});return}let t=oP(),n=t?.serverId===e.serverId?t:null;dP=new KN({url:e.gatewayWs,serverId:e.serverId,workspaceRoot:n?.workspace??e.workspaceRoot,preferredSession:n?.session??void 0,discover:uP,events:{onPhase:iP.setPhase,onUpdates:iP.setUpdates,onShell:iP.setShell,onCredentials:iP.setCredentials,onSearchSettings:iP.setSearchSettings,onContextSettings:iP.setContextSettings,onCodemodeSettings:iP.setCodemodeSettings,onDefaultModel:iP.setDefaultModel,onWorkspaces:e=>iP.setWorkspaces(e.workspaces),onWorkspace:iP.setWorkspace,onOperation:iP.setOperation,onError:e=>iP.notice({level:`error`,text:e}),onDirectory:e=>iP.setDirectory(e.sessions),onModels:iP.setModels,onSessionChange:iP.setSession,onView:iP.setView}}),await dP.start();let r=()=>{document.visibilityState===`visible`&&uP().catch(()=>{})},i=setInterval(r,3e4);document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)},{once:!0}),n?.text&&dP.currentSessionId!==n.session&&iP.notice({level:`info`,text:z()(`gw.sessionGone`)})})()}function pP(){iP.notice({level:`error`,text:z()(`gw.notReady`)})}var mP={subagent(e){return hP().subagent(e)},jobOutput(e,t,n){return hP().jobOutput(e,t,n)},jobStop(e,t){return hP().jobStop(e,t)},workspace(e){return hP().workspace(e)},checkUpdates(){return hP().checkUpdates()},saveCredential(e,t){return hP().saveCredential(e,t)},removeCredential(e){return hP().removeCredential(e)},setProviderEnabled(e,t){return hP().setProviderEnabled(e,t)},setContextSettings(e){return hP().setContextSettings(e)},setCodemodeMode(e){return hP().setCodemodeMode(e)},resetCodemodeMode(){return hP().resetCodemodeMode()},resetContextSettings(){return hP().resetContextSettings()},setDefaultModel(e){return hP().setDefaultModel(e)},clearDefaultModel(){return hP().clearDefaultModel()},setSearchProvider(e){return hP().setSearchProvider(e)},configure(e,t){let n=hP();return n.currentSessionId!==t||!n.ready?Promise.reject(Error(z()(`gw.sessionChangedRetry`))):n.configure(e)},submit(e,t=[],n,r){return hP().submit(e,t,n,r)},steer(e,t){return hP().steer(e,t)},withdraw(e,t){return hP().withdraw(e,t)},questionGet(e,t){return hP().questionGet(e,t)},questionRespond(e,t){return hP().questionRespond(e,t)},planMode(e,t){return hP().planMode(e,t)},planGet(e,t){return hP().planGet(e,t)},planRespond(e,t){return hP().planRespond(e,t)},searchFiles(e,t,n){return hP().searchFiles(e,t,n)},workspaceImage(e,t,n){return hP().workspaceImage(e,t,n)},compact(e,t){return hP().compact(e,t)},listSkills(e,t){return hP().listSkills(e,t)},marketList(e){return hP().marketList(e)},marketDetail(e){return hP().marketDetail(e)},marketPreview(e){return hP().marketPreview(e)},marketInstall(e,t,n){return hP().marketInstall(e,t,n)},marketUninstall(e,t){return hP().marketUninstall(e,t)},image(e,t,n){return hP().image(e,t,n)},abort(){dP?.ready===!0?dP.abort():pP()},selectSession(e){return hP().attachTo(e)},selectWorkspace(e){return hP().selectWorkspace(e)},addWorkspace(e){return hP().addWorkspace(e)},removeWorkspace(e){return hP().removeWorkspace(e)},browse(e){return hP().browse(e)},createSession(){return hP().createSession()},configureModel(e){dP===void 0?pP():dP.configure({model:e}).catch(e=>{iP.notice({level:`error`,text:e instanceof Error?e.message:String(e)})})},archiveSession(e){return hP().archiveSession(e)}};function hP(){if(!dP)throw Error(z()(`gw.notStarted`));return dP}function gP(e){iP.notice({level:`error`,text:e instanceof Error?e.message:String(e)})}function _P(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 vP(e,t=!1){let n=t&&!e.endsWith(`/`)?`${e}/`:e;return`@${/\s/.test(n)?`"${n}"`:n}`}function yP(e,t,n,r){let i=vP(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 bP(e){return e.skill===void 0?e.text:e.skill.args===``?`/skill:${e.skill.name}`:`/skill:${e.skill.name} ${e.skill.args}`}function xP(e){return e.phase===`done`?e.isError?`error`:`ok`:e.phase}function SP(e){return(e.phase===`done`?e.result:e.output)??``}function CP(e){let t=e.width>0&&e.height>0?` · ${e.width}×${e.height}`:``;return`${e.name} · ${e.mimeType}${t}`}function wP(e){return[`${e.name}${e.args===``?``:` ${DP(e.args)}`}`,e.status,e.durationMs===null?``:EP(e.durationMs),e.error===null?``:DP(e.error)].filter(Boolean).join(` · `)}var TP=e=>`… ${e} more calls not listed`;function EP(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function DP(e){return e.replace(/\s+/g,` `).trim()}function OP(e){let t=[];for(let n of e){if(n.type!==`user`||n.subagentRoundId!==void 0)continue;let e=bP(n).trim();e!==``&&t.at(-1)!==e&&t.push(e)}return t.reverse().slice(0,100)}var kP=e=>/^\/[^\s]*$/.test(e);function AP(e,t,n={}){let r=kP(e)?e:`/`,i=z();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 jP(e,t=160){e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`}function MP(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 NP(e){return e.retained!==null&&e.retained.sessionId===e.currentSessionId?e.retained:null}function PP(e){let t=e.view===null?NP(e)?.todos:e.view.todos;return t===void 0?null:{items:t.items,revision:t.revision,...Cj(t.items),offline:e.view===null||e.phase!==`ready`}}function FP(e){let t=e.view===null?NP(e)?.questions:e.view.questions;return t===void 0?null:{pending:t.pending,online:e.phase===`ready`&&!e.operating&&e.view!==null}}var IP={pending:`todo.status.pending`,in_progress:`todo.status.in_progress`,completed:`todo.status.completed`},LP={pending:`question.status.pending`,answered:`question.status.answered`,skipped:`question.status.skipped`,cancelled:`question.status.cancelled`},RP=e=>z()(IP[e]),zP=e=>z()(LP[e]);function BP(e){let t=z();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 VP(e,t){return t>0?`${z()(`title.answerPrefix`,{count:t})}${e}`:e}function HP(e){return[...e.replace(/\r\n?/g,`
|
|
13
|
+
`)].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 UP(e){let t=z();if(e.status===`answered`){let n=Oj(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`):zP(`pending`)}function WP(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 GP(e){let t=[...e.labels??e.optionIds??[]];return e.text&&t.push(e.text),t.join(`, `)}var KP={awaiting_approval:`plan.status.awaiting_approval`,approved:`plan.status.approved`,revision_requested:`plan.status.revision_requested`,superseded:`plan.status.superseded`,cancelled:`plan.status.cancelled`},qP=e=>z()(KP[e]),JP=()=>z()(`plan.modeLabel`),YP=()=>z()(`plan.unsupported`);function XP(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 ZP(e){let t=/^\/plan(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}function QP(e,t){let n=z();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:qP(e.status)})}function $P(e){return e===`approve`?`approved`:`revision_requested`}function eF(e){return(e instanceof Error?e.message:String(e)).includes(`PLAN_BUSY`)}function tF(e){let t=e instanceof Error?e.message:String(e);return eF(e)?z()(`plan.busy`):t}function nF(e,t,n){if(!n)return VP(e,t);let r=z();return`${t>0?r(`title.answerPrefix`,{count:t}):``}${r(`title.planPrefix`)}${e}`}var rF=(e,t,n,r)=>({id:e,kind:`model`,name:t,envVar:n,signupUrl:r,keyless:!1}),iF=[rF(`deepseek`,`DeepSeek`,`DEEPSEEK_API_KEY`,`https://platform.deepseek.com/api_keys`),rF(`openrouter`,`OpenRouter`,`OPENROUTER_API_KEY`,`https://openrouter.ai/keys`),rF(`opencode-go`,`OpenCode Go`,`OPENCODE_API_KEY`,`https://opencode.ai/auth`),rF(`opencode`,`OpenCode Zen`,`OPENCODE_API_KEY`,`https://opencode.ai/auth`),rF(`openai`,`OpenAI`,`OPENAI_API_KEY`,`https://platform.openai.com/api-keys`),rF(`google`,`Google`,`GEMINI_API_KEY`,`https://aistudio.google.com/apikey`),rF(`groq`,`Groq`,`GROQ_API_KEY`,`https://console.groq.com/keys`),rF(`mistral`,`Mistral`,`MISTRAL_API_KEY`,`https://console.mistral.ai/api-keys`),rF(`xai`,`xAI`,`XAI_API_KEY`,`https://console.x.ai`),rF(`together`,`Together`,`TOGETHER_API_KEY`,`https://api.together.ai/settings/api-keys`),rF(`fireworks`,`Fireworks`,`FIREWORKS_API_KEY`,`https://fireworks.ai/account/api-keys`),rF(`cerebras`,`Cerebras`,`CEREBRAS_API_KEY`,`https://cloud.cerebras.ai`),rF(`nvidia`,`NVIDIA`,`NVIDIA_API_KEY`,`https://build.nvidia.com/settings/api-keys`),rF(`huggingface`,`Hugging Face`,`HF_TOKEN`,`https://huggingface.co/settings/tokens`),rF(`vercel-ai-gateway`,`Vercel AI Gateway`,`AI_GATEWAY_API_KEY`,`https://vercel.com/ai-gateway`),rF(`moonshotai`,`Moonshot AI`,`MOONSHOT_API_KEY`,`https://platform.moonshot.ai/console/api-keys`),rF(`moonshotai-cn`,`Moonshot AI CN`,`MOONSHOT_API_KEY`,`https://platform.moonshot.cn/console/api-keys`),rF(`minimax`,`MiniMax`,`MINIMAX_API_KEY`,`https://platform.minimax.io`),rF(`minimax-cn`,`MiniMax CN`,`MINIMAX_CN_API_KEY`,`https://platform.minimaxi.com`),rF(`zai`,`Z.AI`,`ZAI_API_KEY`,`https://z.ai/manage-apikey/apikey-list`),rF(`zai-coding-cn`,`Z.AI Coding CN`,`ZAI_CODING_CN_API_KEY`,`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`),rF(`qwen-token-plan`,`Qwen Token Plan`,`QWEN_TOKEN_PLAN_API_KEY`,`https://modelstudio.console.alibabacloud.com`),rF(`qwen-token-plan-cn`,`Qwen Token Plan CN`,`QWEN_TOKEN_PLAN_CN_API_KEY`,`https://bailian.console.aliyun.com`),rF(`qwen-token-plan-individual`,`Qwen Token Plan Individual`,`QWEN_TOKEN_PLAN_API_KEY`,`https://modelstudio.console.alibabacloud.com`),rF(`xiaomi`,`Xiaomi MiMo`,`XIAOMI_API_KEY`,`https://platform.xiaomimimo.com`),rF(`xiaomi-token-plan-cn`,`Xiaomi Token Plan CN`,`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`https://platform.xiaomimimo.com`),rF(`xiaomi-token-plan-ams`,`Xiaomi Token Plan AMS`,`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`https://platform.xiaomimimo.com`),rF(`xiaomi-token-plan-sgp`,`Xiaomi Token Plan SGP`,`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`https://platform.xiaomimimo.com`),rF(`baseten`,`Baseten`,`BASETEN_API_KEY`,`https://app.baseten.co/settings/api_keys`),rF(`ant-ling`,`Ant Ling`,`ANT_LING_API_KEY`,`https://ling.tbox.cn`),rF(`kimi-coding`,`Kimi For Coding`,`KIMI_API_KEY`,`https://www.kimi.com/code/console`),rF(`meta`,`Meta`,`META_API_KEY`,`https://llama.developer.meta.com`)],aF=[{id:`tavily`,kind:`search`,name:`Tavily`,envVar:`TAVILY_API_KEY`,signupUrl:`https://app.tavily.com`,keyless:!0}];[...iF,...aF];function oF(e){return iF.some(t=>t.id===e)}var sF=new Map(iF.map(e=>[e.id,e.name]));function cF(e){return sF.get(e)??e}function lF(e,t){if(!e||!t||!oF(t))return null;let n=e.statuses[t];return n?n.enabled===!1?`disabled`:n.source===`none`?`missing-key`:null:null}var uF=new Map(iF.map((e,t)=>[e.id,t]));function dF(e,t){return e!==null&&t!=null&&e.effective.provider===t.provider&&e.effective.modelId===t.modelId}function fF(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} ${cF(t.provider)}`.toLowerCase();if(!n.every(t=>e.includes(t)))continue;let i=r.get(t.provider);i||(i={provider:t.provider,name:cF(t.provider),available:t.available,models:[]},r.set(t.provider,i)),i.models.push(t)}return[...r.values()].sort((e,t)=>(uF.get(e.provider)??uF.size)-(uF.get(t.provider)??uF.size))}function pF(e,t){return t&&e.some(e=>e.provider===t)?t:(e.find(e=>e.available)??e[0])?.provider??null}function mF(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 hF(e){return e>=1e6?`${Number((e/1e6).toFixed(1))}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function gF(e){let t=z();return[t(`model.context`,{size:hF(e.contextWindow)}),e.input.includes(`image`)?t(`model.images`):t(`model.textOnly`),e.reasoning?t(`model.reasoning`):t(`model.noReasoning`)].join(` · `)}var _F=wj(),vF={drafts:{},fold:{},active:{},focus:null},yF=0,bF=new Set;function xF(e){vF=e;for(let e of bF)e()}var SF=(e,t,n)=>JSON.stringify([e,t,n]);function CF(){return(0,f.useSyncExternalStore)(e=>(bF.add(e),()=>{bF.delete(e)}),()=>vF)}var wF={get state(){return vF},draft(e){return vF.drafts[e]??_F},setDraft(e,t){xF({...vF,drafts:{...vF.drafts,[e]:t}})},clearDraft(e){if(!(e in vF.drafts))return;let{[e]:t,...n}=vF.drafts;xF({...vF,drafts:n})},setFold(e,t){vF.fold[e]!==t&&xF({...vF,fold:{...vF.fold,[e]:t}})},setActive(e,t){vF.active[e]!==t&&xF({...vF,active:{...vF.active,[e]:t}})},open(e,t){let n=SF(e,t.id,t.version);xF({...vF,fold:{...vF.fold,[n]:`open`},active:{...vF.active,[e]:t.id},focus:{key:n,nonce:++yF}})},consumeFocus(e){vF.focus?.nonce===e&&xF({...vF,focus:null})},reset(){xF({drafts:{},fold:{},active:{},focus:null})}};function TF(){return typeof window<`u`}function EF(e){return kF(e)?(e.nodeName||``).toLowerCase():`#document`}function DF(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function OF(e){return((kF(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function kF(e){return TF()?e instanceof Node||e instanceof DF(e).Node:!1}function AF(e){return TF()?e instanceof Element||e instanceof DF(e).Element:!1}function jF(e){return TF()?e instanceof HTMLElement||e instanceof DF(e).HTMLElement:!1}function MF(e){return!TF()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof DF(e).ShadowRoot}function NF(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=WF(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function PF(e){return/^(table|td|th)$/.test(EF(e))}function FF(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var IF=/transform|translate|scale|rotate|perspective|filter/,LF=/paint|layout|strict|content/,RF=e=>!!e&&e!==`none`,zF;function BF(e){let t=AF(e)?WF(e):e;return RF(t.transform)||RF(t.translate)||RF(t.scale)||RF(t.rotate)||RF(t.perspective)||!HF()&&(RF(t.backdropFilter)||RF(t.filter))||IF.test(t.willChange||``)||LF.test(t.contain||``)}function VF(e){let t=KF(e);for(;jF(t)&&!UF(t);){if(BF(t))return t;if(FF(t))return null;t=KF(t)}return null}function HF(){return zF??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zF}function UF(e){return/^(html|body|#document)$/.test(EF(e))}function WF(e){return DF(e).getComputedStyle(e)}function GF(e){return AF(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function KF(e){if(EF(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||MF(e)&&e.host||OF(e);return MF(t)?t.host:t}function qF(e){let t=KF(e);return UF(t)?(e.ownerDocument||e).body:jF(t)&&NF(t)?t:qF(t)}function JF(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qF(e),i=r===e.ownerDocument?.body,a=DF(r);if(i){let e=YF(a);return t.concat(a,a.visualViewport||[],NF(r)?r:[],e&&n?JF(e):[])}return t.concat(r,JF(r,[],n))}function YF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var XF=Math.min,ZF=Math.max,QF=Math.round,$F=Math.floor,eI=e=>({x:e,y:e}),tI={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nI(e,t,n){return ZF(e,XF(t,n))}function rI(e,t){return typeof e==`function`?e(t):e}function iI(e){return e.split(`-`)[0]}function aI(e){return e.split(`-`)[1]}function oI(e){return e===`x`?`y`:`x`}function sI(e){return e===`y`?`height`:`width`}function cI(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function lI(e){return oI(cI(e))}function uI(e,t,n){n===void 0&&(n=!1);let r=aI(e),i=lI(e),a=sI(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yI(o)),[o,yI(o)]}function dI(e){let t=yI(e);return[fI(e),t,fI(t)]}function fI(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pI=[`left`,`right`],mI=[`right`,`left`],hI=[`top`,`bottom`],gI=[`bottom`,`top`];function _I(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mI:pI:t?pI:mI;case`left`:case`right`:return t?hI:gI;default:return[]}}function vI(e,t,n,r){let i=aI(e),a=_I(iI(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fI)))),a}function yI(e){let t=iI(e);return tI[t]+e.slice(t.length)}function bI(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xI(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bI(e)}function SI(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 CI=[`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(`,`),wI=typeof Element>`u`,TI=wI?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,EI=!wI&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},DI=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]`):DI(e.parentNode))},OI=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},kI=function(e,t,n){if(DI(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(CI));return t&&TI.call(e,CI)&&r.unshift(e),r=r.filter(n),r},AI=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!DI(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=AI(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{TI.call(a,CI)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!DI(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=AI(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},jI=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},MI=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||OI(e))&&!jI(e)?0:e.tabIndex},NI=function(e,t){var n=MI(e);return n<0&&t&&!jI(e)?0:n},PI=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},FI=function(e){return e.tagName===`INPUT`},II=function(e){return FI(e)&&e.type===`hidden`},LI=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},RI=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},zI=function(e){if(!e.name)return!0;var t=e.form||EI(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=RI(r,e.form);return!i||i===e},BI=function(e){return FI(e)&&e.type===`radio`},VI=function(e){return BI(e)&&!zI(e)},HI=function(e){var t=e&&EI(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=EI(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},UI=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},WI=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=TI.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(TI.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=EI(e);if(s&&!s.shadowRoot&&r(s)===!0)return UI(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(HI(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return UI(e);return!1},GI=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 TI.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},KI=function(e,t){return!(t.disabled||II(t)||WI(t,e)||LI(t)||GI(t))},qI=function(e,t){return!(VI(t)||MI(t)<0||!KI(e,t))},JI=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},YI=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=NI(a,i),s=i?YI(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(PI).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},XI=function(e,t){return t||={},YI(t.getShadowRoot?AI([e],t.includeContainer,{filter:qI.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:JI}):kI(e,t.includeContainer,qI.bind(null,t)))};function ZI(){return/apple/i.test(navigator.vendor)}function QI(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 $I(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&MF(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function eL(e){return e?.ownerDocument||document}var tL=typeof document<`u`?f.useLayoutEffect:function(){},nL={...f}.useInsertionEffect||(e=>e());function rL(e){let t=f.useRef(()=>{});return nL(()=>{t.current=e}),f.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var iL=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function aL(e,t){let n=XI(e,iL()),r=n.length;if(r===0)return;let i=QI(eL(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function oL(e){return aL(eL(e).body,1)||e}function sL(e){return aL(eL(e).body,-1)||e}function cL(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$I(n,r)}function lL(e){XI(e,iL()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function uL(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 dL=l(_i(),1);function fL(e,t,n){let{reference:r,floating:i}=e,a=cI(t),o=lI(t),s=sI(o),c=iI(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=aI(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function pL(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}=rI(t,e),p=xI(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=SI(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=SI(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 mL=50,hL=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:pL},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fL(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<mL&&(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}=fL(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},gL=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}=rI(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=iI(r),_=cI(o),v=iI(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yI(o)]:dI(o)),x=p!==`none`;!d&&x&&b.push(...vI(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=uI(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`||_===cI(t)||T.every(e=>cI(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=cI(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{}}}},_L=new Set([`left`,`top`]);async function vL(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=iI(n),s=aI(n),c=cI(n)===`y`,l=_L.has(o)?-1:1,u=a&&c?-1:1,d=rI(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 yL=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 vL(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}}}}},bL=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}=rI(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cI(i),p=oI(f),m=u[p],h=u[f],g=(e,t)=>nI(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}}}}}},xL=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}=rI(e,t),c=await i.detectOverflow(t,s),l=iI(n),u=aI(n),d=cI(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=XF(p-c[m],g),y=XF(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*ZF(c.left,c.right):S=p-2*ZF(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 SL(e){let t=WF(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=jF(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=QF(n)!==a||QF(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function CL(e){return AF(e)?e:e.contextElement}function wL(e){let t=CL(e);if(!jF(t))return eI(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=SL(t),o=(a?QF(n.width):n.width)/r,s=(a?QF(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var TL=eI(0);function EL(e){let t=DF(e);return!HF()||!t.visualViewport?TL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DL(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===DF(e)}function OL(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=CL(e),o=eI(1);t&&(r?AF(r)&&(o=wL(r)):o=wL(e));let s=DL(a,n,r)?EL(a):eI(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=DF(a),t=AF(r)?DF(r):r,n=e,i=YF(n);for(;i&&t!==n;){let e=wL(i),t=i.getBoundingClientRect(),r=WF(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=DF(i),i=YF(n)}}return SI({width:u,height:d,x:c,y:l})}function kL(e,t){let n=GF(e).scrollLeft;return t?t.left+n:OL(OF(e)).left+n}function AL(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-kL(e,n),y:n.top+t.scrollTop}}function jL(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=OF(r),s=t?FF(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eI(1),u=eI(0),d=jF(r);if((d||!a)&&((EF(r)!==`body`||NF(o))&&(c=GF(r)),d)){let e=OL(r);l=wL(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?AL(o,c):eI(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 ML(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function NL(e){let t=GF(e),n=e.ownerDocument.body,r=ZF(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ZF(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+kL(e),o=-t.scrollTop;return WF(n).direction===`rtl`&&(a+=ZF(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var PL=25;function FL(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=DF(e),a=OF(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!HF()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(kL(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<=PL&&(s-=o)}return{width:s,height:c,x:l,y:u}}function IL(e,t){let n=OL(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=wL(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function LL(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=FL(e,n,t);else if(t===`document`)r=NL(OF(e));else if(AF(t))r=IL(t,n);else{let n=EL(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return SI(r)}function RL(e,t){let n=t.get(e);if(n)return n;let r=JF(e,[],!1).filter(e=>AF(e)&&EF(e)!==`body`),i=null,a=WF(e).position===`fixed`,o=a?KF(e):e;for(;AF(o)&&!UF(o);){let e=WF(o),t=BF(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=KF(o)}return t.set(e,r),r}function zL(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?FF(t)?[]:RL(t,this._c):[].concat(n),r],o=LL(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=LL(t,a[e],i);s=ZF(n.top,s),c=XF(n.right,c),l=XF(n.bottom,l),u=ZF(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function BL(e){let{width:t,height:n}=SL(e);return{width:t,height:n}}function VL(e,t,n){let r=jF(t),i=OF(t),a=n===`fixed`,o=OL(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eI(0);if((r||!a)&&((EF(t)!==`body`||NF(i))&&(s=GF(t)),r)){let e=OL(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=kL(i));let l=i&&!r&&!a?AL(i,s):eI(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 HL(e){return WF(e).position===`static`}function UL(e,t){if(!jF(e)||WF(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return OF(e)===n&&(n=n.ownerDocument.body),n}function WL(e,t){let n=DF(e);if(FF(e))return n;if(!jF(e)){let t=KF(e);for(;t&&!UF(t);){if(AF(t)&&!HL(t))return t;t=KF(t)}return n}let r=UL(e,t);for(;r&&PF(r)&&HL(r);)r=UL(r,t);return r&&UF(r)&&HL(r)&&!BF(r)?n:r||VF(e)||n}var GL=async function(e){let t=this.getOffsetParent||WL,n=this.getDimensions,r=await n(e.floating);return{reference:VL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KL(e){return WF(e).direction===`rtl`}var qL={convertOffsetParentRelativeRectToViewportRelativeRect:jL,getDocumentElement:OF,getClippingRect:zL,getOffsetParent:WL,getElementRects:GL,getClientRects:ML,getDimensions:BL,getScale:wL,isElement:AF,isRTL:KL};function JL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YL(e,t,n){let r=null,i,a=OF(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=$F(d),h=$F(a.clientWidth-(u+f)),g=$F(a.clientHeight-(d+p)),_=$F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ZF(0,XF(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!JL(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=DF(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function XL(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=CL(e),u=i||a?[...l?JF(l):[],...t?JF(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?YL(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?OL(e):null;c&&g();function g(){let t=OL(e);h&&!JL(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 ZL=yL,QL=bL,$L=gL,eR=xL,tR=(e,t,n)=>{let r=new Map,i=n??{},a={...qL,...i.platform,_c:r};return hL(e,t,{...i,platform:a})},nR=typeof document<`u`?f.useLayoutEffect:function(){};function rR(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(!rR(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)&&!rR(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function iR(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function aR(e,t){let n=iR(e);return Math.round(t*n)/n}function oR(e){let t=f.useRef(e);return nR(()=>{t.current=e}),t}function sR(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);rR(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),E=c!=null,ee=oR(c),te=oR(i),ne=oR(l),D=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};te.current&&(e.platform=te.current),tR(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};re.current&&!rR(T.current,t)&&(T.current=t,dL.flushSync(()=>{d(t)}))})},[p,t,n,te,ne]);nR(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=f.useRef(!1);nR(()=>(re.current=!0,()=>{re.current=!1}),[]),nR(()=>{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=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ae=f.useMemo(()=>({reference:x,floating:S}),[x,S]),oe=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!ae.floating)return e;let t=aR(ae.floating,u.x),r=aR(ae.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...iR(ae.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ae.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:D,refs:ie,elements:ae,floatingStyles:oe}),[u,D,ie,ae,oe])}var cR=(e,t)=>{let n=ZL(e);return{name:n.name,fn:n.fn,options:[e,t]}},lR=(e,t)=>{let n=QL(e);return{name:n.name,fn:n.fn,options:[e,t]}},uR=(e,t)=>{let n=$L(e);return{name:n.name,fn:n.fn,options:[e,t]}},dR=(e,t)=>{let n=eR(e);return{name:n.name,fn:n.fn,options:[e,t]}},fR=`ArrowLeft`,pR=`ArrowRight`,mR=`ArrowUp`,hR=`ArrowDown`,gR=[fR,pR],_R=[mR,hR];[...gR,..._R];var vR={...f},yR=!1,bR=0,xR=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+bR++;function SR(){let[e,t]=f.useState(()=>yR?xR():void 0);return tL(()=>{e??t(xR())},[]),f.useEffect(()=>{yR=!0},[]),e}var CR=vR.useId||SR;function wR(){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 TR=f.createContext(null),ER=f.createContext(null),DR=()=>f.useContext(TR)?.id||null,OR=()=>f.useContext(ER);function kR(e){return`data-floating-ui-`+e}var AR={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},jR=f.forwardRef(function(e,t){let[n,r]=f.useState();tL(()=>{ZI()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[kR(`focus-guard`)]:``,style:AR};return(0,k.jsx)(`span`,{...e,...i})}),MR={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},NR=f.createContext(null),PR=kR(`portal`);function FR(e){e===void 0&&(e={});let{id:t,root:n}=e,r=CR(),i=LR(),[a,o]=f.useState(null),s=f.useRef(null);return tL(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),tL(()=>{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(PR,``),e.appendChild(n),s.current=n,o(n)},[t,r]),tL(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!kF(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(PR,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function IR(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=FR({id:n,root:r}),[o,s]=f.useState(null),c=f.useRef(null),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),p=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return f.useEffect(()=>{if(!a||!i||p)return;function e(e){a&&cL(e)&&(e.type===`focusin`?uL:lL)(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]),f.useEffect(()=>{a&&(m||uL(a))},[m,a]),(0,k.jsxs)(NR.Provider,{value:f.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&(0,k.jsx)(jR,{"data-type":`outside`,ref:c,onFocus:e=>{if(cL(e,a)){var t;(t=u.current)==null||t.focus()}else sL(o?o.domReference:null)?.focus()}}),h&&a&&(0,k.jsx)(`span`,{"aria-owns":a.id,style:MR}),a&&dL.createPortal(t,a),h&&a&&(0,k.jsx)(jR,{"data-type":`outside`,ref:l,onFocus:e=>{if(cL(e,a)){var t;(t=d.current)==null||t.focus()}else oL(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var LR=()=>f.useContext(NR);function RR(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=CR(),a=f.useRef({}),[o]=f.useState(()=>wR()),s=DR()!=null,[c,l]=f.useState(r.reference),u=rL((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)}),d=f.useMemo(()=>({setPositionReference:l}),[]),p=f.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return f.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:p,events:o,floatingId:i,refs:d}),[t,u,p,o,i,d])}function zR(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=RR({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=f.useState(null),[l,u]=f.useState(null),d=o?.domReference||s,p=f.useRef(null),m=OR();tL(()=>{d&&(p.current=d)},[d]);let h=sR({...n,elements:{...o,...l&&{reference:l}}}),g=f.useCallback(e=>{let t=AF(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=f.useCallback(e=>{(AF(e)||e===null)&&(p.current=e,c(e)),(AF(h.refs.reference.current)||h.refs.reference.current===null||e!==null&&!AF(e))&&h.refs.setReference(e)},[h.refs]),v=f.useMemo(()=>({...h.refs,setReference:_,setPositionReference:g,domReference:p}),[h.refs,_,g]),y=f.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=f.useMemo(()=>({...h,...a,refs:v,elements:y,nodeId:r}),[h,v,y,r,a]);return tL(()=>{a.dataRef.current.floatingContext=b;let e=m?.nodesRef.current.find(e=>e.id===r);e&&(e.context=b)}),f.useMemo(()=>({...h,context:b,refs:v,elements:y}),[h,v,y,b])}function BR({anchor:e,id:t,title:n,items:r,selected:i,onSelect:a,onAccept:o,message:s,onRetry:c}){let l=B(),{refs:u,floatingStyles:d,isPositioned:p}=zR({elements:{reference:e.current},placement:`top-start`,whileElementsMounted:XL,middleware:[cR(8),uR(),lR({padding:12}),dR({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,f.useEffect)(()=>{document.getElementById(`${t}-${i}`)?.scrollIntoView({block:`nearest`})},[t,i]),(0,k.jsx)(IR,{children:(0,k.jsxs)(`div`,{ref:u.setFloating,style:{...d,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,k.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,k.jsx)(`span`,{children:n}),(0,k.jsx)(`span`,{children:l(`suggest.hint`)})]}),(0,k.jsx)(`div`,{id:t,role:`listbox`,tabIndex:-1,"aria-label":n,children:r.map((e,n)=>(0,k.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,k.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,k.jsx)(`span`,{className:`truncate text-sm text-ink-900`,children:e.label}),e.badge&&(0,k.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,k.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:e.description})]},e.key))}),s&&(0,k.jsx)(`output`,{className:`block break-words px-3 py-2 text-sm text-ink-500`,children:s}),c&&(0,k.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 VR(e,t,n,r,i){let[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)({entries:[],limited:!1,incomplete:!1}),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(0),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(0),_=(0,f.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=_P(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(z()(`mention.searching`)),h(!1),o(n),p(0))};(0,f.useEffect)(()=>{if(!a||!r){o(null);return}let e=new AbortController,t=++g.current,i=setTimeout(()=>{mP.searchFiles(a.query,n,e.signal).then(n=>{if(e.signal.aborted||t!==g.current)return;c(n);let r=z();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=z();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[d];return t&&b(t),!0}return!1},panel:a&&r?(0,k.jsx)(BR,{anchor:t,id:_,title:z()(`mention.title`),selected:d,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(z()(`mention.searching`)),o(e=>e?{...e}:null)}:void 0}):null,open:!!a,controls:a?_:void 0,active:a&&s.entries[d]?`${_}-${d}`:void 0}}var HR=`(max-width: 768px)`,UR={min:320,max:960,initial:560,step:24},WR=.6,GR=e=>Math.min(UR.max,Math.max(UR.min,Math.round(e)));function KR({name:e,size:t=18,className:n}){return(0,k.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,k.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 qR(){let[e,t]=(0,f.useState)(()=>window.matchMedia(HR).matches);return(0,f.useEffect)(()=>{let e=window.matchMedia(HR),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var JR=0,YR=``;function XR(e){let t=(0,f.useRef)(null),n=(0,f.useId)(),r=B();return(0,f.useEffect)(()=>{let e=document.activeElement,n=t.current;return JR===0&&(YR=document.body.style.overflow),JR+=1,document.body.style.overflow=`hidden`,n.showModal(),()=>{n.close(),--JR,JR===0&&(document.body.style.overflow=YR),e?.isConnected&&e.focus()}},[]),(0,dL.createPortal)((0,k.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,k.jsxs)(`div`,{className:`dialog-heading`,children:[(0,k.jsx)(`h2`,{id:n,children:e.title}),(0,k.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":r(`common.close`),title:r(`common.close`),disabled:e.locked,onClick:e.onClose,children:(0,k.jsx)(KR,{name:`close`})})]}),e.children]}),document.body)}function ZR(e){let t=(0,f.useRef)(null),n=(0,f.useRef)(e.onClose);n.current=e.onClose;let[r,i]=(0,f.useState)({left:8,top:8});return(0,f.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,dL.createPortal)((0,k.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 QR=e=>e.split(/[\\/]/).filter(Boolean).at(-1)??e;function $R(e){return(0,k.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,k.jsx)(KR,{name:`close`,size:14})})}var ez={on:`text-tianyi-800`,warn:`text-sakura-800`,off:`text-ink-400`};function tz(e){let{options:t,value:n}=e,r=B(),i=(0,f.useId)(),[a,o]=(0,f.useState)(!1),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(0),d=t.find(e=>e.id===n),p=a?mF(t,s??``):[],m=a&&p[l]?`${i}-${l}`:void 0,h=`${i}-list`;(0,f.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,k.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.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??d?.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,k.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,k.jsx)(KR,{name:`chevron`,size:16})})]}),(0,k.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,k.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,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.detail&&(0,k.jsx)(`span`,{className:`shrink-0 text-xs ${ez[e.tone??`off`]}`,children:e.detail})]},e.id)),a&&p.length===0&&(0,k.jsx)(`p`,{className:`px-2.5 py-2 text-xs text-ink-500`,children:r(`providerCombo.empty`)})]})]})}function nz(e){let t=B(),{models:n,currentSessionId:r,view:i,phase:a,operating:o,defaultModel:s}=nP(),[c,l]=(0,f.useState)(null),u=n.find(t=>t.provider===e.current?.provider&&t.modelId===e.current?.modelId);c&&c.id!==r&&l(null);let d=u?.name??e.fallbackLabel,p=dF(s,e.current);return(0,k.jsxs)(k.Fragment,{children:[(0,k.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:d,level:i?.agent.thinkingLevel??``}),children:[p?`★ `:``,d,` · `,i?.agent.thinkingLevel??`off`,` ▾`]}),c&&c.id===r&&e.current&&(0,k.jsx)(iz,{session:c.id,currentRef:e.current,current:u??null,level:i?.agent.thinkingLevel??`off`,onClose:()=>l(e=>e===c?null:e)},c.id)]})}function rz(e,t){return[hF(e.contextWindow),e.input.includes(`image`)?t(`picker.badgeImage`):``,e.reasoning?t(`picker.badgeReasoning`):``].filter(Boolean).join(` · `)}function iz(e){let t=B(),{models:n,credentials:r,defaultModel:i}=nP(),[a,o]=(0,f.useState)(e.current),[s,c]=(0,f.useState)(e.level),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(e.currentRef.provider),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(!1),[_,v]=(0,f.useState)(``),y=fF(n,``),b=pF(y,d??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?fF(n,l):y.filter(e=>e.provider===b),w=lF(r,e.currentRef.provider);async function T(){if(!g.current&&a){g.current=!0,h(!0),v(``);try{await mP.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{dF(i,e)?await mP.clearDefaultModel():await mP.setDefaultModel({provider:e.provider,modelId:e.modelId})}catch{v(t(`picker.defaultFailed`))}finally{g.current=!1,h(!1)}}}return(0,k.jsx)(XR,{title:t(`picker.title`),onClose:e.onClose,children:(0,k.jsxs)(`div`,{className:`space-y-5 p-5`,children:[w&&(0,k.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:cF(e.currentRef.provider)}),` `,(0,k.jsx)(Ur,{to:`/settings`,hash:`credential-${e.currentRef.provider}`,className:`focus-neko rounded underline`,children:t(`picker.goSettings`)})]}),(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,k.jsx)(`div`,{className:`min-w-0 sm:w-64 sm:shrink-0`,children:(0,k.jsx)(tz,{label:t(`picker.providerLabel`),options:x,value:b,onChange:e=>{p(e),u(``)}})}),(0,k.jsx)(`label`,{className:`sr-only`,htmlFor:`model-search`,children:t(`picker.searchLabel`)}),(0,k.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,k.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,k.jsxs)(`section`,{id:`models-${e.provider}`,children:[(S||!e.available)&&(0,k.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pt-1 pb-0.5 text-xs`,children:[S&&(0,k.jsx)(`span`,{className:`truncate font-semibold text-ink-700`,children:e.name}),!e.available&&(0,k.jsxs)(`span`,{className:`ml-auto shrink-0 text-sakura-800`,children:[t(`picker.keyMissingDot`),` `,(0,k.jsx)(Ur,{to:`/settings`,hash:`credential-${e.provider}`,className:`focus-neko rounded underline`,children:t(`picker.configure`)})]})]}),(0,k.jsx)(`ul`,{className:`space-y-1`,children:e.models.map(n=>{let r=a?.provider===n.provider&&a.modelId===n.modelId,l=dF(i,n);return(0,k.jsxs)(`li`,{className:`flex items-stretch gap-1`,children:[(0,k.jsxs)(`button`,{type:`button`,disabled:m||!e.available,"aria-pressed":r,title:`${n.modelId} · ${gF(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,k.jsxs)(`span`,{className:`min-w-0 truncate`,children:[l?`★ `:``,n.name,r?` ✓`:``]}),(0,k.jsx)(`span`,{className:`hidden min-w-0 flex-1 truncate text-xs text-ink-400 sm:inline`,children:n.modelId}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-ink-500`,children:rz(n,t)})]}),e.available&&(0,k.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,k.jsx)(`span`,{"aria-hidden":`true`,children:l?`★`:`☆`})})]},`${n.provider}/${n.modelId}`)})})]},e.provider)),C.length===0&&(0,k.jsx)(`p`,{className:`px-1 py-3 text-sm text-ink-500`,children:t(S?`picker.noMatch`:`picker.noModels`)})]})]}),a&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{className:`mb-2 text-sm text-ink-600`,children:t(`picker.thinking`)}),(0,k.jsx)(`fieldset`,{className:`flex flex-wrap gap-2`,"aria-label":t(`picker.thinking`),children:a.supportedThinkingLevels.map(e=>(0,k.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,k.jsx)(`p`,{className:`text-xs text-tianyi-800`,children:t(`picker.cliNote`)}),(0,k.jsx)(`p`,{className:`text-xs text-ink-500`,children:t(`picker.scopeNote`)}),_&&(0,k.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:_}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:e.onClose,className:`btn-outline rounded-full px-4 py-2 text-sm`,children:t(`common.cancel`)}),(0,k.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 az({queued:e,busy:t,onSteer:n,onWithdraw:r}){let i=B();if(!e.length)return null;let a=e=>i(`queue.mode.${e}`);return(0,k.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,k.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,k.jsxs)(`li`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[(0,k.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,k.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,k.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:i(`queue.images`,{count:e.images})}),e.mode===`followUp`&&(0,k.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,k.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 oz=new Map,sz=new Set,cz=new Set;function lz(e){let t=oz.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 uz(){let e=z(),t=rP(),n=t.currentSessionId,r=n??`none:${t.workspaceRoot}`,i=oz.get(r);if(cz.size||t.operating)iP.notice({level:`info`,text:e(`composer.upgrade.sending`)});else if([...oz.values()].some(e=>e.files.length))iP.notice({level:`info`,text:e(`composer.upgrade.attachments`)});else if(!t.webInfo)iP.notice({level:`error`,text:e(`composer.upgrade.notReady`)});else if([...oz.entries()].some(([e,t])=>e!==r&&t.text.trim()))iP.notice({level:`info`,text:e(`composer.upgrade.otherDrafts`)});else{try{sP({version:1,serverId:t.webInfo.serverId,workspace:t.workspaceRoot,session:n,text:i?.text??``,requestId:i?.requestId??crypto.randomUUID()})}catch{iP.notice({level:`error`,text:e(`composer.upgrade.saveFailed`)});return}window.location.reload()}}var dz=e=>(sz.add(e),()=>{sz.delete(e)});function fz(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function pz(e){return`$${e.toFixed(e>=1?2:4)}`}function mz(e){let{currentSessionId:t,workspaceRoot:n}=nP();return(0,k.jsx)(gz,{sessionId:t??`none:${n}`,...e},t??`none:${n}`)}function hz({file:e}){let[t,n]=(0,f.useState)(``);return(0,f.useEffect)(()=>{let t=URL.createObjectURL(e);return n(t),()=>URL.revokeObjectURL(t)},[e]),(0,k.jsx)(`img`,{src:t||void 0,alt:e.name,className:`h-16 w-20 rounded-lg object-cover`})}function gz(e){let{credentials:t,view:n,models:r,workspaceRoot:i,phase:a,operating:o}=nP(),s=B(),c=n?.compaction?.active??[];oz.has(e.sessionId)||oz.set(e.sessionId,{text:``,files:[],requestId:crypto.randomUUID()}),(0,f.useEffect)(()=>{let t=oP(),n=rP();if(t&&t.serverId===n.webInfo?.serverId&&t.workspace===i&&(t.session??`none:${i}`)===e.sessionId){oz.set(e.sessionId,{text:t.text,files:[],requestId:t.requestId}),cP();for(let e of sz)e()}},[e.sessionId,i]);let l=(0,f.useSyncExternalStore)(dz,()=>oz.get(e.sessionId)),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(null),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)([]),[C,w]=(0,f.useState)(0),[T,E]=(0,f.useState)(``),ee=(0,f.useId)(),[te,ne]=(0,f.useState)(!1),D=(0,f.useRef)(null),re=(0,f.useRef)(null),ie=(0,f.useRef)(null),ae=(0,f.useRef)(l);ae.current=l;let oe=(0,f.useRef)(!1),se=(0,f.useMemo)(()=>OP(n?.items??[]),[n?.items]),ce=(0,f.useRef)(null),le=(0,f.useRef)(null);(0,f.useLayoutEffect)(()=>{let e=D.current;if(!le.current||!e)return;let t=le.current===`start`?0:e.value.length;le.current=null,e.setSelectionRange(t,t)}),(0,f.useLayoutEffect)(()=>{let e=D.current;e&&jP(e)},[l.text,e.sessionId]),(0,f.useEffect)(()=>{let e=D.current;if(!e||typeof ResizeObserver>`u`)return;let t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,jP(e))});return n.observe(e),()=>n.disconnect()},[]);let ue=e=>{let t=e.currentTarget,n=MP(ce.current,se,e,t.value,{start:t.selectionStart,end:t.selectionEnd});return n?(ce.current=n.browse,le.current=n.caret,b(!1),fe({text:n.text}),!0):!1},de=t=>{ae.current=t,oz.set(e.sessionId,t);for(let e of sz)e()},fe=e=>de({...ae.current,...e,requestId:crypto.randomUUID()}),pe=lF(t,n?.agent.model?.provider),me=pe!==null,he=r.find(e=>e.provider===n?.agent.model?.provider&&e.modelId===n?.agent.model?.modelId),ge=l.files.length>0&&he!==void 0&&!he.input.includes(`image`),_e=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`}));fe({files:[...ae.current.files,...t]});for(let e of t)ve(e)},ve=async t=>{let n=t.error;if(!n)try{(await createImageBitmap(t.file)).close()}catch{n=`composer.attach.decode`}let r=oz.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)};de(i)},ye=(0,f.useRef)(null),be=(0,f.useRef)(!1);(0,f.useEffect)(()=>()=>{be.current||ye.current?.abort()},[]),(0,f.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`),mP.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 O=VR(D,re,i,a===`ready`&&!o,(t,n)=>{let r=ae.current;if(t.kind===`file`&&/\.(png|jpe?g|webp)$/i.test(t.path)){if(ye.current)return;let a=new AbortController;ye.current=a,m(s(`composer.image.reading`)),(async()=>{let o=e.sessionId;if(o.startsWith(`none:`)){be.current=!0,await mP.createSession();let e=rP();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(s(`composer.workspaceChanged`));o=e.currentSessionId,oz.set(o,r);for(let e of sz)e()}let c=await mP.workspaceImage(t.path,o,a.signal);if(a.signal.aborted||rP().currentSessionId!==o||rP().workspaceRoot!==i)return;let l=oz.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;oz.set(o,{...l,text:d,files:[...l.files,u],requestId:crypto.randomUUID()});for(let e of sz)e();m(``)})().catch(e=>{if(!a.signal.aborted){let t=e instanceof Error?e.message:s(`composer.image.readFailed`);m(t),be.current&&iP.notice({level:`error`,text:t})}}).finally(()=>{ye.current===a&&(ye.current=null)});return}let a=yP(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)?fe({text:o.value}):fe({text:a.text}),requestAnimationFrame(()=>{o.setSelectionRange(a.cursor,a.cursor),t.kind===`directory`&&O.refresh()})}}),xe=n?.contextUsage,Se=n?.compaction?.latest,Ce=Se&&![`summarizing`,`waiting-to-apply`].includes(Se.phase)?Se.at+(Se.phase===`failed`?1e4:5e3):null,[we,Te]=(0,f.useState)(Ce!==null&&Ce<=Date.now());(0,f.useEffect)(()=>{if(Te(Ce!==null&&Ce<=Date.now()),Ce===null||Ce<=Date.now())return;let e=setTimeout(()=>Te(!0),Ce-Date.now());return()=>clearTimeout(e)},[Ce]);let Ee=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}):Se&&!we?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`}[Se.phase]):null,De=!c.length&&(!!n?.compaction?.failure||Se?.phase===`failed`),Oe=n?.taskUsage??n?.usage??null,ke=async t=>{if(oe.current||e.disabled)return;oe.current=!0,d(!0),cz.add(e.sessionId),m(``);let n=ae.current;oz.set(e.sessionId,n);try{await mP.compact(t,e.sessionId),ae.current===n&&oz.get(e.sessionId)===n&&Xi(n.text)!==null&&de({...n,text:``,requestId:crypto.randomUUID()}),b(!1)}catch(e){m(e instanceof Error?ZN(e.message):s(`composer.compactFailed`))}finally{oe.current=!1,d(!1),cz.delete(e.sessionId)}},Ae=XP({view:n,phase:a,operating:o}),je=async t=>{if(oe.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(Ae===null){g(YP());return}if(e.busy){g(s(`composer.plan.busy`));return}oe.current=!0,d(!0);let n=ae.current;try{await mP.planMode(e.sessionId,Ae.mode===`plan`?`normal`:`plan`),ae.current===n&&oz.get(e.sessionId)===n&&ZP(n.text)!==null&&de({...n,text:``,requestId:crypto.randomUUID()}),b(!1)}catch(e){let t=tF(e);(eF(e)?g:m)(t)}finally{oe.current=!1,d(!1)}},Me=async()=>{let t=Xi(ae.current.text);if(t!==null){await ke(t);return}let n=ZP(ae.current.text);if(n!==null){await je(n);return}let r=ae.current;if(oz.set(e.sessionId,r),!(oe.current||e.disabled||me||ge||!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{oe.current=!0,d(!0),cz.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 mP.createSession();let e=rP();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(s(`composer.workspaceChangedDraft`));n=e.currentSessionId,oz.set(n,r);for(let e of sz)e()}if(await mP.submit(r.text.trim(),t,r.requestId,n),n!==e.sessionId){oz.set(n,{text:``,files:[],requestId:crypto.randomUUID()});for(let e of sz)e()}let a=oz.get(e.sessionId);a&&de({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?ZN(t.message):s(`composer.sendFailed`);m(n),rP().currentSessionId!==e.sessionId&&iP.notice({level:`error`,text:n})}finally{oe.current=!1,d(!1),cz.delete(e.sessionId)}}}}},Ne=AP(l.text,x,{plan:Ae!==null}),Pe=Math.min(C,Math.max(0,Ne.length-1)),Fe=(e=Pe)=>{let t=Ne[e];t&&(fe({text:`${t.label} `}),b(!1),D.current?.focus())},Ie=n?.queued??[],Le=n?.questions?.pending??[],Re=()=>{let t=wF.state.active[e.sessionId],n=Le.find(e=>e.id===t)??Le[0];n&&wF.open(e.sessionId,n)},ze=async t=>{if(_===null){v(t.id),m(``),g(``);try{let n=await mP.steer(e.sessionId,t.id);if(n.result===`withdrawn`){let e=ae.current.text,r=n.text??t.preview;fe({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?ZN(e.message):s(`composer.queue.steerFailed`))}finally{v(null)}}},Be=async t=>{if(_===null){v(t.id),m(``),g(``);try{let n=await mP.withdraw(e.sessionId,t.id);if(n.result===`withdrawn`){let e=ae.current.text,r=n.text??t.preview;fe({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?ZN(e.message):s(`composer.queue.withdrawFailed`))}finally{v(null)}}},Ve=e.busy||c.some(e=>e.reason===`manual`||e.blocking);return(0,k.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),_e(Array.from(e.dataTransfer.files))},children:(0,k.jsxs)(`div`,{className:`chat-column`,children:[(0,k.jsx)(az,{queued:Ie,busy:_!==null,onSteer:e=>void ze(e),onWithdraw:e=>void Be(e)}),(0,k.jsxs)(`div`,{ref:re,className:`composer-card ${Ve?`is-busy`:``} ${te?`ring-2 ring-sakura-300`:``}`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pt-2.5 empty:pt-0`,children:[Le.length>0&&(0,k.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,k.jsx)(`span`,{className:`min-w-0 break-words`,children:s(`composer.questionHint`)}),(0,k.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:Re,children:s(`composer.openQuestion`)})]}),te&&(0,k.jsx)(`p`,{className:`text-sm text-sakura-700`,children:s(`composer.dropHint`)}),pe&&(0,k.jsxs)(`p`,{className:`text-sm text-sakura-700`,children:[s(pe===`disabled`?`composer.provider.disabled`:`composer.provider.keyMissing`,{provider:cF(n?.agent.model?.provider??``)}),(0,k.jsx)(Ur,{to:`/settings`,hash:`credential-${n?.agent.model?.provider??``}`,className:`focus-neko ml-1 underline`,children:s(`composer.provider.goSettings`)})]}),ge&&(0,k.jsx)(`p`,{className:`text-sm text-sakura-700`,children:s(`composer.noVision`)}),!he?.input.includes(`image`)&&n?.items.some(e=>e.type===`user`&&e.images?.length)&&(0,k.jsx)(`p`,{className:`text-xs text-ink-500`,children:s(`composer.noHistoryImages`)}),h&&(0,k.jsx)(`output`,{className:`block break-words text-sm text-ink-600`,children:h}),p&&(0,k.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-sakura-700`,children:p})]}),!!l.files.length&&(0,k.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,k.jsxs)(`li`,{className:`relative w-28 rounded-xl border border-sakura-200 bg-base p-2`,children:[(0,k.jsx)(hz,{file:e.file}),(0,k.jsx)(`span`,{className:`block truncate text-xs`,title:e.file.name,children:e.file.name}),e.processing&&(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:s(`composer.attach.checking`)}),e.error&&(0,k.jsx)(`span`,{className:`text-xs text-sakura-700`,children:s(e.error)}),(0,k.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:()=>fe({files:ae.current.files.filter(t=>t.id!==e.id)}),children:`×`})]},e.id))}),(0,k.jsx)(`textarea`,{ref:D,disabled:e.disabled,value:l.text,rows:1,placeholder:Le.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":O.controls??(y?ee:void 0),"aria-activedescendant":O.active??(y&&Ne.length?`${ee}-${Pe}`:void 0),onClick:e=>{O.refresh(),b(kP(e.currentTarget.value))},onBlur:()=>{O.close(),b(!1)},onCompositionStart:()=>{O.close(),b(!1)},onCompositionEnd:e=>{O.refresh(),b(kP(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=>{ce.current=null,fe({text:e.target.value}),w(0),b(!e.nativeEvent.isComposing&&kP(e.target.value)),e.nativeEvent.isComposing||O.refresh()},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),_e(t))},onKeyDown:e=>{e.nativeEvent.isComposing||O.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(Ne.length-1,Pe+(e.key===`ArrowDown`?1:-1))))):y&&e.key===`Tab`?!e.shiftKey&&Ne.length?(e.preventDefault(),Fe()):b(!1):(e.key===`ArrowUp`||e.key===`ArrowDown`)&&!y&&ue(e)?e.preventDefault():e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y&&Ne.length?Fe():(b(!1),Me())))}}),(0,k.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,k.jsx)(`input`,{ref:ie,type:`file`,accept:`image/png,image/jpeg,image/webp`,multiple:!0,hidden:!0,onChange:e=>{_e(Array.from(e.target.files??[])),e.target.value=``}}),(0,k.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,k.jsx)(KR,{name:`plus`})}),(0,k.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:()=>{O.close(),b(!y),D.current?.focus()},children:(0,k.jsx)(KR,{name:`more`})}),(0,k.jsx)(`div`,{className:`min-w-0 max-w-64 [&>button]:max-w-full`,children:(0,k.jsx)(nz,{current:n?.agent.model??null,fallbackLabel:n?.model??`…`})}),xe&&xe.window>0&&(0,k.jsxs)(`span`,{className:`shrink-0 rounded-full bg-tianyi-50 px-2 py-1 font-mono text-xs ${xe.percent!==null&&xe.percent>90?`text-sakura-700 font-semibold`:`text-ink-600`}`,title:xe.tokens===null?s(`composer.ctx.none`):s(`composer.ctx.usage`,{tokens:xe.tokens,window:xe.window}),children:[`Ctx `,xe.percent===null?`?`:`${xe.percent.toFixed(1)}%`,`/`,fz(xe.window)]}),(0,k.jsxs)(`output`,{"aria-live":`polite`,"aria-atomic":`true`,className:`contents`,children:[Ee&&(0,k.jsx)(`span`,{className:`max-w-full whitespace-nowrap rounded-full border px-2 py-1 text-xs ${De?`border-sakura-300 bg-sakura-50 text-sakura-700`:`border-tianyi-200 bg-tianyi-50 text-ink-600`}`,title:Se?.phase===`nothing`&&!c.length?s(`composer.compaction.nothingTitle`):void 0,children:Ee}),Ae?.mode===`plan`&&(0,k.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:JP()})]}),(0,k.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[e.busy&&e.status!==null&&(0,k.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-64 items-center gap-1.5 text-xs font-medium text-sakura-700`,title:JN(e.status,s),children:[(0,k.jsxs)(`span`,{className:`dots shrink-0`,"aria-hidden":!0,children:[(0,k.jsx)(`span`,{}),(0,k.jsx)(`span`,{}),(0,k.jsx)(`span`,{})]}),(0,k.jsx)(`span`,{className:`truncate`,children:JN(e.status,s).replace(/(\.\.\.|…)$/,``)})]}),Oe!==null&&(0,k.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:Oe.input,output:Oe.output,cacheRead:Oe.cacheRead,cost:pz(Oe.cost)}),children:[`↑`,fz(Oe.input),` ↓`,fz(Oe.output),(0,k.jsx)(`span`,{className:`telemetry-detail`,"aria-hidden":!0,children:s(`composer.usage.detail`,{input:Oe.input,output:Oe.output,cacheRead:Oe.cacheRead,cost:pz(Oe.cost)})})]}),(0,k.jsx)(`button`,{type:`button`,disabled:u||e.disabled||!l.text.trim()&&!l.files.length||Xi(l.text)===null&&ZP(l.text)===null&&(me||ge||l.files.some(e=>!!e.error||e.processing)),onClick:()=>void Me(),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`)}),Ve&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>mP.abort(),className:`btn-stop focus-neko h-10 rounded-full px-2 text-sm`,title:s(`composer.stopTitle`),children:s(`composer.stop`)})]})]})]}),O.panel,y&&!O.open&&(0,k.jsx)(BR,{anchor:re,id:ee,title:s(`composer.commandTitle`),items:Ne,selected:Pe,onSelect:w,message:T?s(T):Ne.length?void 0:s(`composer.noCommands`),onAccept:Fe})]})})}var _z=[{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 vz({active:e,children:t}){let n=B();return(0,k.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base sm:flex-row`,children:[(0,k.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,k.jsx)(Ur,{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,k.jsx)(`span`,{className:`hidden px-2 pb-1 text-xs font-medium text-ink-400 sm:block`,children:n(`settings.title`)}),_z.map(t=>(0,k.jsxs)(Ur,{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,k.jsx)(KR,{name:t.icon,size:15}),n(t.label)]},t.key))]}),(0,k.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}async function yz(){let e=z(),t;try{await navigator.clipboard.writeText(`neko update`),t=e(`update.copied`)}catch{t=e(`update.copyManually`)}return iP.notice({level:`info`,text:t}),t}function bz(){let{updates:e,webInfo:t}=nP();return Wi({gateway:e,frontend:Vi,installed:t?.installedVersion??null,web:t?{runningVersion:t.webVersion,installedVersion:t.installedVersion}:void 0})}function xz(){let e=bz(),t=B(),[n,r]=(0,f.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,k.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,k.jsx)(`span`,{children:i}),e===`install`?(0,k.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:()=>void yz(),children:t(`update.copyCommand`)}):e===`refresh-page`?(0,k.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:uz,children:t(`update.refresh`)}):(0,k.jsx)(Ur,{to:`/about`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,children:t(`update.viewSteps`)}),(0,k.jsx)($R,{label:t(`update.dismiss`),onClick:()=>r(e)})]})}function Sz(e){if(e?.status!==`missing`)return;let t=z();return e.reason===`invalid_config`?t(`shell.invalid`,{detail:e.detail??t(`shell.invalidDefault`)}):t(`shell.missing`)}function Cz(e){if(e===null)return null;let t=z();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:Sz(e)??``}}function wz(){let{updates:e,webInfo:t,phase:n,shell:r}=nP(),i=B(),a=Cz(r),o=bz(),[s,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(``),d=oP();async function p(){if(!s){c(!0),u(``);try{let e=await mP.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,k.jsxs)(vz,{active:`about`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:i(`settings.menu.about`)}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:i(n===`ready`?`common.connected`:`common.connecting`)})]}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:i(`about.intro`)})]}),(0,k.jsxs)(`main`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-5 px-5 pb-8`,children:[(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsx)(`h2`,{className:`mb-4 text-base font-bold text-ink-900`,children:i(`about.versionStatus`)}),(0,k.jsxs)(`div`,{className:`flex flex-col divide-y divide-sakura-100`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-sm font-medium text-ink-800`,children:i(`about.currentVersion`)}),(0,k.jsx)(`span`,{className:`ml-3 font-mono text-sm text-ink-600`,children:Vi})]}),(0,k.jsx)(`div`,{children:s?(0,k.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,k.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,k.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,k.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,k.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,k.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,k.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,k.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,k.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-sakura-50/60 px-3 py-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-sm font-semibold text-sakura-800`,children:i(`about.latestStable`)}),(0,k.jsx)(`span`,{className:`ml-3 font-mono text-sm text-sakura-900`,children:e.latestVersion})]}),(0,k.jsx)(`span`,{className:`text-xs text-sakura-700`,children:i(`about.runUpdate`)})]}),o===`restart-service`&&(0,k.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:i(`about.installedNew`)}),(0,k.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:e?.installedVersion??t?.installedVersion??i(`about.newVersion`)})]}),(0,k.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:i(`about.afterRestart`)})]}),o===`refresh-page`&&(0,k.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:i(`about.staticUpdated`)}),(0,k.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:t?.webVersion??i(`about.newVersion`)})]}),(0,k.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:i(`about.afterRefresh`)})]})]}),(0,k.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,k.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,k.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 yz().then(u),children:i(`about.copyUpdate`)}):(0,k.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 yz().then(u),children:i(`about.copyUpdate`)}),o===`refresh-page`&&(0,k.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:uz,children:i(`about.refreshPage`)})]}),l&&(0,k.jsx)(`output`,{className:`mt-3 block text-xs text-tianyi-800`,children:l})]}),a&&(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"data-shell-status":!0,children:[(0,k.jsx)(`h2`,{className:`mb-3 text-base font-bold text-ink-900`,children:i(`about.commandShell`)}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.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,k.jsx)(`span`,{className:`min-w-0 break-all text-sm text-ink-600`,children:a.detail})]})]}),(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsx)(`h2`,{className:`mb-2 text-base font-bold text-ink-900`,children:i(`about.upgradeTitle`)}),(0,k.jsxs)(`p`,{className:`text-sm text-ink-600`,children:[i(`about.upgradeBefore`),` `,(0,k.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`)]}),d?.text&&(0,k.jsxs)(`details`,{className:`mt-4 border-t border-sakura-100 pt-3 text-sm`,children:[(0,k.jsx)(`summary`,{className:`focus-neko cursor-pointer font-medium text-ink-700`,children:i(`about.draftKept`)}),(0,k.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:d.text})]})]})]})]})}var Tz=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 Ez({item:e,title:t,decide:n}){let r=B(),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(``),c=(0,f.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,k.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,k.jsxs)(`output`,{className:`block font-medium text-sakura-800`,children:[t,` · Bash · `,r(`approval.status.${e.status}`)]}),(0,k.jsxs)(`p`,{className:`break-all text-xs text-ink-500`,children:[Tz(e.cwd),` · `,r(`approval.timeout`,{value:e.timeout??r(`approval.timeoutDefault`)})]}),(0,k.jsx)(`textarea`,{readOnly:!0,rows:Math.min(6,Math.max(1,e.command.split(`
|
|
14
|
+
`).length)),"aria-label":r(`approval.command`),value:Tz(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,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.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,k.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,k.jsx)(`p`,{role:`alert`,className:`break-all text-xs text-sakura-800`,children:o})]})}function Dz(){let e=B(),{phase:t,operating:n,currentSessionId:r,view:i}=nP(),[,a]=(0,f.useState)(0),o=(0,f.useRef)(null),[s,c]=(0,f.useState)(null),l=t===`ready`&&!n&&i!==null;if((0,f.useEffect)(()=>{if(!l||!r)return;let e=!0,t=new dN(e=>mP.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,f.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,k.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,k.jsx)(Ez,{item:e,title:t,decide:t=>n.decideApproval({id:e.id,version:e.version,decision:t})},`${e.id}:${e.version}`)),s.error&&(0,k.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:s.error})]})}function Oz(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 kz=e=>e.split(`
|
|
15
|
+
`).map(e=>e.trim()).find(Boolean)??``;function Az(e){return e.title.trim()||kz(e.command)||`(empty command)`}function jz(e,t){return e.status===`running`?Oz(t-e.startedAt):e.reason===`timeout`?`timeout`:e.exitCode===null?e.reason===`restart`?`restart`:Oz((e.endedAt??t)-e.startedAt):`exit ${e.exitCode}`}var Mz=e=>Number.parseInt(e.replace(/^\D+/,``),10)||0;function Nz(e,t){let n=[...e].sort((e,t)=>t.startedAt-e.startedAt||Mz(t.jobId)-Mz(e.jobId)).map(e=>{let n=e.status===`running`;return{job:e,label:Az(e),running:n,statusText:e.status,meta:jz(e,t),durationMs:Math.max(0,(e.endedAt??t)-e.startedAt)}});return{rows:n,running:n.filter(e=>e.running).length}}function Pz(e){let t=e.split(`
|
|
16
|
+
`),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(`
|
|
17
|
+
`);return{head:n,command:r,output:a===``?void 0:a}}var Fz=262144,Iz=class{#e=``;#t=0;#n;#r;constructor(e=Fz){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}}},Lz={running:`job.status.running`,exited:`job.status.exited`,failed:`job.status.failed`,stopped:`job.status.stopped`,lost:`job.status.lost`};function Rz(e,t){let n=z(),r=n(Lz[e.status]);return e.status===`running`?`${r} · ${Oz(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} · ${Oz((e.endedAt??t)-e.startedAt)}`:`${r} · ${n(`job.reason.exitCode`,{code:e.exitCode})}`}var zz=/\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\)|[@-Z\\-_])/g,Bz=/[\u0000-\u0008\u000b-\u001f\u007f]/g;function Vz(e){return e.replace(zz,``).replace(/\r\n?/g,`
|
|
18
|
+
`).replace(Bz,``)}function Hz(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}var Uz=`neko.panelWidth`;function Wz(e){if(e==null||e.trim()===``)return UR.initial;let t=Number(e);return Number.isFinite(t)?GR(t):UR.initial}function Gz(){try{return localStorage}catch{return}}function Kz(e={}){let t=e.storage??Gz(),n=()=>{try{return Wz(t?.getItem(Uz))}catch{return UR.initial}},r=n(),i=new Set,a=e=>{if(e!==r){r=e;for(let e of i)e()}},o=()=>{try{r===UR.initial?t?.removeItem(Uz):t?.setItem(Uz,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(GR(e))},commit(){o()},reset(){a(UR.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 qz;function Jz(){return qz??=Kz(),qz}function Yz(e=Jz()){return{width:(0,f.useSyncExternalStore)(e.subscribe,e.get,()=>UR.initial),set:e.set,commit:e.commit,reset:e.reset}}var Xz=`is-resizing-panel`;function Zz({width:e,onChange:t,onCommit:n,onReset:r}){let i=B(),a=(0,f.useRef)(null),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(n);c.current=n;let l=()=>{a.current!==null&&(a.current=null,document.body.classList.remove(Xz),s(!1),c.current())},u=(0,f.useRef)(l);return u.current=l,(0,f.useEffect)(()=>()=>u.current(),[]),(0,k.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":i(`panel.resize`),"aria-valuemin":UR.min,"aria-valuemax":UR.max,"aria-valuenow":e,tabIndex:0,"data-dragging":o,className:`resize-handle hidden lg:block`,onKeyDown:r=>{let i=r.key===`ArrowLeft`?e+UR.step:r.key===`ArrowRight`?e-UR.step:r.key===`Home`?UR.min:r.key===`End`?UR.max:null;i!==null&&(r.preventDefault(),r.stopPropagation(),t(GR(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(Xz),s(!0))},onPointerMove:e=>{if(a.current!==e.pointerId)return;let n=window.innerWidth*WR;t(GR(Math.min(window.innerWidth-e.clientX,n)))},onPointerUp:l,onPointerCancel:l,onLostPointerCapture:l})}var Qz=1e3,$z=e=>e instanceof Error?e.message:String(e);function eB({sessionId:e,job:t}){let n=B(),r=t.jobId,i=(0,f.useRef)(new Iz),[,a]=(0,f.useState)(0),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(!0),[u,d]=(0,f.useState)(!1),p=(0,f.useRef)(!0),m=(0,f.useRef)(null),h=t.status===`running`,g=(0,f.useRef)(h);g.current=h;let[_,v]=(0,f.useState)(Date.now);(0,f.useEffect)(()=>{if(!h)return;let e=setInterval(()=>v(Date.now()),Qz);return()=>clearInterval(e)},[h]),(0,f.useEffect)(()=>{let t=!1,n,o=async()=>{let c=g.current;try{let l=await mP.jobOutput(e,r,i.current.offset);if(t)return;i.current.apply(l,Vz),s(``),a(e=>e+1),c&&(n=setTimeout(()=>void o(),Qz))}catch(e){t||s($z(e))}};return o(),()=>{t=!0,clearTimeout(n)}},[e,r]),(0,f.useLayoutEffect)(()=>{let e=m.current;e&&p.current&&(e.scrollTop=e.scrollHeight)});let y=(0,f.useCallback)(()=>{let e=m.current;e&&(p.current=!0,l(!0),e.scrollTop=e.scrollHeight)},[]),b=()=>{u||(d(!0),mP.jobStop(e,r).catch(e=>s($z(e))).finally(()=>d(!1)))},x=i.current.text;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,k.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 p-3 text-xs`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`font-medium text-ink-800`,children:Rz(t,_)}),h&&(0,k.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,k.jsx)(`code`,{className:`max-h-20 overflow-auto whitespace-pre-wrap break-all text-ink-700`,children:t.command}),(0,k.jsx)(`span`,{className:`break-all text-ink-500`,children:t.cwd})]}),o&&(0,k.jsx)(`p`,{role:`alert`,className:`shrink-0 p-3 text-sm text-sakura-800`,children:o}),(0,k.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,k.jsxs)(`div`,{ref:m,"data-testid":`job-output`,className:`h-full overflow-y-auto overflow-x-hidden p-3`,onScroll:e=>{let t=Hz(e.currentTarget);p.current=t,l(t)},children:[i.current.dropped>0&&(0,k.jsx)(`p`,{className:`mb-2 text-xs text-sakura-800`,children:n(`job.dropped`,{count:i.current.dropped})}),x===``?(0,k.jsx)(`p`,{className:`text-xs text-ink-500`,children:i.current.offset===void 0?n(`job.reading`):n(`job.noOutput`)}):(0,k.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-ink-800`,children:x})]}),!c&&(0,k.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 tB({sessionId:e,jobs:t,open:n,onClose:r}){let i=B(),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(Date.now),l=Yz(),u=(0,f.useRef)(null),d=(0,f.useRef)(null),[p,m]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>m(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let h=Nz(t,s);(0,f.useEffect)(()=>{if(!n||h.running===0)return;let e=setInterval(()=>c(Date.now()),Qz);return()=>clearInterval(e)},[n,h.running]),(0,f.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=p&&d.current?.parentElement?[...d.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==d.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,k.jsxs)(`aside`,{ref:d,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,k.jsx)(Zz,{width:l.width,onChange:l.set,onCommit:l.commit,onReset:l.reset}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,k.jsx)(`strong`,{className:`text-sm text-ink-800`,children:i(`job.panel`)}),(0,k.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,k.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:i(`job.panelEmpty`)}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:h.rows.map(e=>(0,k.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,k.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,k.jsx)(`span`,{className:`text-tianyi-700`,children:e.job.jobId}),` · `,e.label]}),(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:Rz(e.job,s)})]},e.job.jobId))}),n&&g&&(0,k.jsx)(eB,{sessionId:e,job:g.job},`${e}:${g.job.jobId}`)]})]})}function nB(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rB=nB();function iB(e){rB=e}var aB={exec:()=>null};function oB(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 sB(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(lB.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var cB=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),lB={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:oB(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:oB(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:oB(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:oB(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:oB(e=>RegExp(`^ {0,${e}}(?:</?(?:${wB})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:oB(e=>RegExp(`^ {0,${e}}>`))},uB=/^(?:[ \t]*(?:\n|$))+/,dB=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fB=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pB=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,mB=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hB=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gB=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_B=sB(gB).replace(/bull/g,hB).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(),vB=sB(gB).replace(/bull/g,hB).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(),yB=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,bB=/^[^\n]+/,xB=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,SB=sB(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,xB).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),CB=sB(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,hB).getRegex(),wB=`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`,TB=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,EB=sB(`^ {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`,TB).replace(`tag`,wB).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),DB=e=>sB(yB).replace(`hr`,pB).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`,wB).getRegex(),OB=DB(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),kB=DB(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),AB={blockquote:sB(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,kB).getRegex(),code:dB,def:SB,fences:fB,heading:mB,hr:pB,html:EB,lheading:_B,list:CB,newline:uB,paragraph:OB,table:aB,text:bB},jB=sB(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,pB).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`,wB).getRegex(),MB={...AB,lheading:vB,table:jB,paragraph:sB(yB).replace(`hr`,pB).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,jB).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`,wB).getRegex()},NB={...AB,html:sB(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,TB).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:aB,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:sB(yB).replace(`hr`,pB).replace(`heading`,` *#{1,6} *[^
|
|
19
|
+
]`).replace(`lheading`,_B).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},PB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,FB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,IB=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,LB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,RB=/[\p{P}\p{S}]/u,zB=/[\s\p{P}\p{S}]/u,BB=/[^\s\p{P}\p{S}]/u,VB=sB(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,zB).getRegex(),HB=/[\p{Pi}\p{Ps}"']/u,UB=/(?!~)[\p{P}\p{S}]/u,WB=/(?!~)[\s\p{P}\p{S}]/u,GB=/(?:[^\s\p{P}\p{S}]|~)/u,KB=sB(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,cB?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),qB=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,JB=sB(qB,`u`).replace(/punct/g,RB).getRegex(),YB=sB(qB,`u`).replace(/punct/g,UB).getRegex(),XB=sB(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,HB).replace(/punct/g,RB).getRegex(),ZB=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,QB=sB(ZB,`gu`).replace(/notPunctSpace/g,BB).replace(/punctSpace/g,zB).replace(/punct/g,RB).getRegex(),$B=sB(ZB,`gu`).replace(/notPunctSpace/g,GB).replace(/punctSpace/g,WB).replace(/punct/g,UB).getRegex(),eV=sB(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,BB).replace(/punctSpace/g,zB).replace(/punct/g,RB).getRegex(),tV=sB(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,BB).replace(/punctSpace/g,zB).replace(/punct/g,RB).getRegex(),nV=sB(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,BB).replace(/punctSpace/g,zB).replace(/punct/g,RB).getRegex(),rV=sB(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,RB).getRegex(),iV=sB(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,BB).replace(/punctSpace/g,zB).replace(/punct/g,RB).getRegex(),aV=sB(/\\(punct)/,`gu`).replace(/punct/g,RB).getRegex(),oV=sB(/^<(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(),sV=sB(TB).replace(`(?:-->|$)`,`-->`).getRegex(),cV=sB(`^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`,sV).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lV=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,uV=sB(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,lV).getRegex(),dV=sB(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,uV).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fV=sB(/^!?\[(label)\]\[(ref)\]/).replace(`label`,uV).replace(`ref`,xB).getRegex(),pV=sB(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,xB).getRegex(),mV=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,hV=sB(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,lV).getRegex(),gV=sB(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,sB(/^!?\[(label)\]\[(ref)\]/).replace(`label`,hV).replace(`ref`,mV).getRegex()).replace(`nolink`,sB(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,mV).getRegex()).getRegex(),_V=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vV=sB(/(?: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(),yV={_backpedal:aB,anyPunctuation:aV,autolink:oV,blockSkip:KB,br:IB,code:FB,del:aB,delLDelim:aB,delRDelim:aB,emStrongLDelim:JB,emStrongRDelimAst:QB,emStrongRDelimUnd:tV,escape:PB,link:dV,nolink:pV,punctuation:VB,reflink:fV,reflinkSearch:gV,tag:cV,text:LB,url:aB},bV={...yV,emStrongLDelim:XB,emStrongRDelimAst:eV,emStrongRDelimUnd:nV,link:sB(/^!?\[(label)\]\((.*?)\)/).replace(`label`,uV).getRegex(),reflink:sB(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,uV).getRegex()},xV={...yV,emStrongRDelimAst:$B,emStrongLDelim:YB,delLDelim:rV,delRDelim:iV,url:sB(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,vV).replace(`protocol`,_V).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:sB(/^(?:[^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`,_V).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},SV={...xV,br:sB(IB).replace(`{2,}`,`*`).getRegex(),text:sB(xV.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},CV={normal:AB,gfm:MB,pedantic:NB},wV={normal:yV,gfm:xV,breaks:SV,pedantic:bV},TV={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},EV=e=>TV[e];function DV(e,t){if(t){if(lB.escapeTest.test(e))return e.replace(lB.escapeReplace,EV)}else if(lB.escapeTestNoEncode.test(e))return e.replace(lB.escapeReplaceNoEncode,EV);return e}function OV(e){return e.replace(lB.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 kV(e){try{e=encodeURI(e).replace(lB.percentDecode,`%`)}catch{return null}return e}function AV(e,t){let n=e.replace(lB.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(lB.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(lB.slashPipe,`|`);return n}function jV(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 MV(e){let t=e.split(`
|
|
20
|
+
`),n=t.length-1;for(;n>=0&&lB.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
21
|
+
`)}function NV(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function PV(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 FV(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 IV(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 LV(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
22
|
+
`).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(`
|
|
23
|
+
`)}function RV(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 zV=class{options;rules;lexer;constructor(e){this.options=e||rB}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]:MV(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=LV(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=jV(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:jV(t[0],`
|
|
24
|
+
`),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:jV(t[0],`
|
|
25
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=jV(t[0],`
|
|
26
|
+
`).split(`
|
|
27
|
+
`),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(`
|
|
28
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
29
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
30
|
+
${s}`:s,r=r?`${r}
|
|
31
|
+
${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(`
|
|
32
|
+
`),o=t.raw+`
|
|
33
|
+
`+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(`
|
|
34
|
+
`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
|
|
35
|
+
${d.join(`
|
|
36
|
+
`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
37
|
+
`+e.join(`
|
|
38
|
+
`),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(`
|
|
39
|
+
`)}}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(`
|
|
40
|
+
`,1)[0],l=t[1].length,u=this.options.pedantic?FV(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>FV(e,l)),d=e.split(`
|
|
41
|
+
`,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+`
|
|
42
|
+
`,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(`
|
|
43
|
+
`,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+=`
|
|
44
|
+
`+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+=`
|
|
45
|
+
`+d}f=!d.trim(),r+=l+`
|
|
46
|
+
`,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=MV(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])&&PV(t[2],`()`)!==-1)return;let e=NV(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:jV(t[0],`
|
|
47
|
+
`),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=AV(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
48
|
+
`):[],a={type:`table`,raw:jV(t[0],`
|
|
49
|
+
`),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(AV(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:jV(t[0],`
|
|
50
|
+
`),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)===`
|
|
51
|
+
`?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&&RV(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=jV(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=PV(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)),IV(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&&RV(e,n[1],r,this.rules))return;let i=t[NV((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 IV(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]:OV(t[0]),escaped:e}}}},BV=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||rB,this.options.tokenizer=this.options.tokenizer||new zV,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:lB,block:CV.normal,inline:wV.normal};this.options.pedantic?(t.block=CV.pedantic,t.inline=wV.pedantic):this.options.gfm&&(t.block=CV.gfm,t.inline=this.options.breaks?wV.breaks:wV.gfm),this.tokenizer.rules=t}static get rules(){return{block:CV,inline:wV}}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(lB.carriageReturn,`
|
|
52
|
+
`),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(lB.tabCharGlobal,` `).replace(lB.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+=`
|
|
53
|
+
`: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(`
|
|
54
|
+
`)?``:`
|
|
55
|
+
`)+i.raw,n.text+=`
|
|
56
|
+
`+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(`
|
|
57
|
+
`)?``:`
|
|
58
|
+
`)+i.raw,n.text+=`
|
|
59
|
+
`+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(`
|
|
60
|
+
`)?``:`
|
|
61
|
+
`)+i.raw,r.text+=`
|
|
62
|
+
`+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(`
|
|
63
|
+
`)?``:`
|
|
64
|
+
`)+i.raw,n.text+=`
|
|
65
|
+
`+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,NV(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,NV(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)}},VV=class{options;parser;constructor(e){this.options=e||rB}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(lB.notSpaceStart)?.[0],i=e?e.replace(lB.endingNewline,``)+`
|
|
66
|
+
`:``;return r?`<pre><code class="language-`+DV(r)+`">`+(n?i:DV(i,!0))+`</code></pre>
|
|
67
|
+
`:`<pre><code>`+(n?i:DV(i,!0))+`</code></pre>
|
|
68
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
69
|
+
${this.parser.parse(e)}</blockquote>
|
|
70
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
71
|
+
`}hr(e){return`<hr>
|
|
72
|
+
`}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+`>
|
|
73
|
+
`+r+`</`+i+`>
|
|
74
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
75
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
76
|
+
`}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>
|
|
77
|
+
<thead>
|
|
78
|
+
`+t+`</thead>
|
|
79
|
+
`+r+`</table>
|
|
80
|
+
`}tablerow({text:e}){return`<tr>
|
|
81
|
+
${e}</tr>
|
|
82
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
83
|
+
`}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>${DV(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?DV(n,!0):this.parser.parseInline(r),o=kV(e);if(o===null)return a;e=DV(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+DV(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=kV(e);if(i===null)return DV(n);e=i;let a=`<img src="${DV(e)}" alt="${DV(n)}"`;return t&&(a+=` title="${DV(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:DV(e.text)}},HV=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}},UV=class e{options;renderer;textRenderer;constructor(e){this.options=e||rB,this.options.renderer=this.options.renderer||new VV,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new HV}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}},WV=class{options;block;constructor(e){this.options=e||rB}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?BV.lex:BV.lexInline}provideParser(e=this.block){return e?UV.parse:UV.parseInline}},GV=class{defaults=nB();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=UV;Renderer=VV;TextRenderer=HV;Lexer=BV;Tokenizer=zV;Hooks=WV;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 VV(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 zV(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 WV;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]=WV.passThroughHooks.has(n)?e=>{if(this.defaults.async&&WV.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 BV.lex(e,t??this.defaults)}parser(e,t){return UV.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?BV.lex:BV.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?UV.parse:UV.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?BV.lex:BV.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?UV.parse:UV.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+=`
|
|
84
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+DV(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},KV=new GV;function qV(e,t){return KV.parse(e,t)}qV.options=qV.setOptions=function(e){return KV.setOptions(e),qV.defaults=KV.defaults,iB(qV.defaults),qV},qV.getDefaults=nB,qV.defaults=rB;function JV(...e){return KV.use(...e),qV.defaults=KV.defaults,iB(qV.defaults),qV}qV.use=JV,qV.walkTokens=function(e,t){return KV.walkTokens(e,t)},qV.parseInline=KV.parseInline,qV.Parser=UV,qV.parser=UV.parse,qV.Renderer=VV,qV.TextRenderer=HV,qV.Lexer=BV,qV.lexer=BV.lex,qV.Tokenizer=zV,qV.Hooks=WV,qV.parse=qV,qV.options,qV.setOptions,qV.walkTokens,qV.parseInline,UV.parse,BV.lex;var YV=/^image\/(png|jpeg|webp|gif)$/i,XV=/^(https?:|mailto:)/i,ZV=49152,QV=`default-src 'none'; img-src data:; style-src 'unsafe-inline'`,$V=`
|
|
85
|
+
:root{color-scheme:light dark;--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--user:#eef4ff;--code:#f6f8fa}
|
|
86
|
+
@media(prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8b949e;--border:#30363d;--user:#16243a;--code:#161b22}}
|
|
87
|
+
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
|
|
88
|
+
main{max-width:860px;margin:0 auto;padding:24px 16px 64px}
|
|
89
|
+
h1{font-size:1.5rem;margin:0 0 4px}
|
|
90
|
+
.meta{color:var(--muted);font-size:.85rem;margin:0 0 24px}
|
|
91
|
+
.msg{margin:16px 0;padding:12px 16px;border:1px solid var(--border);border-radius:12px}
|
|
92
|
+
.msg.user{background:var(--user)}
|
|
93
|
+
.role{font-size:.75rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
|
|
94
|
+
.text{white-space:pre-wrap;overflow-wrap:anywhere}
|
|
95
|
+
.system{text-align:center;color:var(--muted);font-size:.85rem;margin:16px 0}
|
|
96
|
+
.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}
|
|
97
|
+
.md pre,pre{background:var(--code);border-radius:8px;padding:10px 12px;overflow:auto;font-size:.85rem;white-space:pre-wrap;overflow-wrap:anywhere}
|
|
98
|
+
.md code{background:var(--code);border-radius:4px;padding:1px 4px}.md pre code{background:none;padding:0}
|
|
99
|
+
.md table{border-collapse:collapse}.md th,.md td{border:1px solid var(--border);padding:4px 8px}
|
|
100
|
+
.md blockquote{margin:0;padding-left:12px;border-left:3px solid var(--border);color:var(--muted)}
|
|
101
|
+
details{margin:8px 0}summary{cursor:pointer;color:var(--muted)}
|
|
102
|
+
details.tool{border:1px solid var(--border);border-radius:8px;padding:6px 12px;margin:12px 0}
|
|
103
|
+
details.tool.error>summary .status{color:#cf222e}
|
|
104
|
+
.label{font-size:.75rem;color:var(--muted);margin-top:8px}
|
|
105
|
+
.note{color:var(--muted);font-style:italic;margin-top:6px}
|
|
106
|
+
figure{margin:8px 0}img{max-width:100%;height:auto;border-radius:8px}figcaption,.placeholder{color:var(--muted);font-size:.8rem}
|
|
107
|
+
`,eH=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`).replaceAll(`'`,`'`),tH=new GV({gfm:!0,breaks:!0,renderer:{html:({text:e})=>eH(e),link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n);if(!XV.test(e.trim()))return r;let i=t?` title="${eH(t)}"`:``;return`<a href="${eH(e)}"${i} rel="noopener noreferrer" target="_blank">${r}</a>`},image({href:e,text:t}){let n=`[image: ${eH(t||e)}]`;return XV.test(e.trim())?`<a href="${eH(e)}" rel="noopener noreferrer" target="_blank">${n}</a>`:n}}});async function nH(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(!YV.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+=ZV)t.push(Ki(i.bytes.subarray(e,e+ZV)));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 rH(e,t){return(e??[]).map(e=>{let n=t.get(`${e.entryId}:${e.contentIndex}`),r=eH(CP(e));return n!==void 0&&`src`in n?`<figure><img src="${n.src}" alt="${eH(e.name)}"><figcaption>${r}</figcaption></figure>`:`<p class="placeholder">[image: ${r}${n!==void 0&&`reason`in n?` — ${n.reason}`:``}]</p>`}).join(``)}async function iH(e,t){let{embedded:n,skipped:r}=await nH(e.items,t.loadImage),i=eH(DP(e.title)||`neko-session`),a=[];for(let r of e.items)if(r.type===`system`)a.push(`<div class="system">${eH(DP(r.text))}</div>`);else if(r.type===`user`){let e=bP(r);a.push(`<section class="msg user"><div class="role">User</div>${e===``?``:`<div class="text">${eH(e)}</div>`}${rH(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">${eH(r.thinking.trim())}</div></details>`:``,n=r.text.trim()===``?``:`<div class="md">${tH.parse(r.text.trim(),{async:!1})}</div>`,i=r.note===null?``:`<div class="note">${eH(DP(r.note))}</div>`;a.push(`<section class="msg assistant"><div class="role">Assistant</div>${e}${n}${i}</section>`)}else{let e=xP(r),t=SP(r),i=[`<b>Tool</b> ${eH(r.name)}`,r.summary===``?``:`<span class="args">${eH(DP(r.summary))}</span>`,e===`ok`?``:`<span class="status">[${e}]</span>`,r.durationMs===null?``:`<span class="duration">(${EP(r.durationMs)})</span>`].filter(Boolean).join(` `),o=r.codemode===void 0||r.codemode.calls.length===0?``:`<div class="label">Calls</div><pre>${eH([...r.codemode.calls.map(wP),...r.codemode.omitted>0?[TP(r.codemode.omitted)]:[]].join(`
|
|
108
|
+
`))}</pre>`;a.push(`<details class="tool ${e}"><summary>${i}</summary>${r.detail===null||r.detail===``?``:`<pre${r.codemode===void 0?``:` class="language-javascript"`}>${eH(r.detail)}</pre>`}${o}${t===``?``:`<div class="label">${e===`running`?`Output so far`:`Result`}</div><pre>${eH(t)}</pre>`}${r.note===null?``:`<div class="note">${eH(DP(r.note))}</div>`}${rH(r.images,n)}</details>`)}return{content:`<!doctype html>
|
|
109
|
+
<html lang="en">
|
|
110
|
+
<head>
|
|
111
|
+
<meta charset="utf-8">
|
|
112
|
+
<meta http-equiv="Content-Security-Policy" content="${QV}">
|
|
113
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
114
|
+
<title>${i}</title>
|
|
115
|
+
<style>${$V}</style>
|
|
116
|
+
</head>
|
|
117
|
+
<body>
|
|
118
|
+
<main>
|
|
119
|
+
<h1>${i}</h1>
|
|
120
|
+
<p class="meta">${eH(DP(e.model))} · ${eH(DP(e.cwd))} · ${eH(e.exportedAt.toISOString())}</p>
|
|
121
|
+
${a.join(`
|
|
122
|
+
`)}
|
|
123
|
+
</main>
|
|
124
|
+
</body>
|
|
125
|
+
</html>
|
|
126
|
+
`,skippedImages:r}}var aH={markdown:`md`,html:`html`,json:`json`},oH={markdown:`text/markdown;charset=utf-8`,html:`text/html;charset=utf-8`,json:`application/json;charset=utf-8`},sH=60;function cH(e){return e.type===`user`?bP(e):e.type===`assistant`?e.text.trim():``}function lH(e,t,n){let r=e.replace(/[\\/:*?"<>|\u0000-\u001f\u007f]/g,`-`).replace(/\s+/g,` `).replace(/-{2,}/g,`-`),i=Array.from(r).slice(0,sH).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())}`}.${aH[t]}`}async function uH(e,t,n){if(t.items.length===0)throw Error(`Nothing to export yet - start a conversation first`);let r=aH[e],i=oH[e];if(e===`html`){let{content:e,skippedImages:a}=await iH(t,n);return{content:e,mimeType:i,extension:r,skippedImages:a}}return{content:e===`markdown`?pH(t,n):hH(t,n),mimeType:i,extension:r,skippedImages:0}}function dH(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 fH=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`);function pH(e,t){let n=[`# ${DP(e.title)||`neko-session`}`,``,`- **Model:** ${DP(e.model)}`,`- **Workspace:** ${DP(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(`---`,``,`*${fH(DP(a.text))}*`,``);else if(a.type===`user`){i(`user`);let e=bP(a);e!==``&&n.push(e,``);for(let e of a.images??[])n.push(`> [image] ${fH(CP(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(`> ${fH(DP(a.note))}`,``)):(i(`assistant`),n.push(...mH(a)));return`${n.join(`
|
|
127
|
+
`).trimEnd()}\n`}function mH(e){let t=xP(e),n=[`<details>`,`<summary>${fH([`Tool: ${e.name}`,e.summary===``?``:`· ${DP(e.summary)}`,t===`ok`?``:`[${t}]`,e.durationMs===null?``:`(${EP(e.durationMs)})`].filter(Boolean).join(` `))}</summary>`,``];if(e.detail!==null&&e.detail!==``&&n.push(dH(e.detail,e.codemode===void 0?``:`javascript`),``),e.codemode!==void 0&&e.codemode.calls.length>0){let t=e.codemode.calls.map(wP);e.codemode.omitted>0&&t.push(TP(e.codemode.omitted)),n.push(`Calls:`,``,dH(t.join(`
|
|
128
|
+
`)),``)}let r=SP(e);r!==``&&n.push(t===`running`?`Output so far:`:`Result:`,``,dH(r),``),e.note!==null&&n.push(`> ${fH(DP(e.note))}`,``);for(let t of e.images??[])n.push(`> [image] ${fH(CP(t))}`,``);return n.push(`</details>`,``),n}function hH(e,t){let n=e.items.map(e=>{switch(e.type){case`user`:return{type:`user`,text:bP(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:SP(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 gH={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 _H(e,t){return e.status===`answered`?t(`askUser.answer`,{answer:HP(GP(e))}):e.status===`skipped`?t(`askUser.skipped`):e.status===`cancelled`?t(`askUser.cancelled`):null}function vH({interaction:e,onLocate:t}){let n=B(),r=_H(e,n);return(0,k.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,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.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,k.jsx)(KR,{name:`sparkles`,size:12}),n(`askUser.badge`)]}),(0,k.jsx)(`span`,{className:`shrink-0 rounded-full border px-2 py-0.5 text-xs font-medium ${gH[e.status]}`,children:zP(e.status)}),t&&(0,k.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,k.jsx)(`p`,{className:`mt-1.5 max-h-40 overflow-y-auto whitespace-pre-wrap break-words text-ink-900`,children:HP(e.question)}),r!==null&&(0,k.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-xs text-ink-700`,children:r})]})}function yH(e,t){this.v=e,this.k=t}function bH(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 xH(e){if(Array.isArray(e))return e}function SH(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 CH(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wH(e,t){return xH(e)||SH(e,t)||TH(e,t)||CH()}function TH(e,t){if(e){if(typeof e==`string`)return bH(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)?bH(e,t):void 0}}function EH(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof yH;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)}EH.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},EH.prototype.next=function(e){return this._invoke(`next`,e)},EH.prototype.throw=function(e){return this._invoke(`throw`,e)},EH.prototype.return=function(e){return this._invoke(`return`,e)};var DH=Object.entries,OH=Object.setPrototypeOf,kH=Object.isFrozen,AH=Object.getPrototypeOf,jH=Object.getOwnPropertyDescriptor,MH=Object.freeze,NH=Object.seal,PH=Object.create,FH=typeof Reflect<`u`&&Reflect,IH=FH.apply,LH=FH.construct;MH||=function(e){return e},NH||=function(e){return e},IH||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},LH||=function(e){return new e(...[...arguments].slice(1))};var RH=iU(Array.prototype.forEach);Array.prototype.indexOf;var zH=iU(Array.prototype.lastIndexOf),BH=iU(Array.prototype.pop),VH=iU(Array.prototype.push);Array.prototype.slice;var HH=iU(Array.prototype.splice),UH=Array.isArray,WH=iU(String.prototype.toLowerCase),GH=iU(String.prototype.toString),KH=iU(String.prototype.match),qH=iU(String.prototype.replace),JH=iU(String.prototype.indexOf),YH=iU(String.prototype.trim),XH=iU(Number.prototype.toString),ZH=iU(Boolean.prototype.toString),QH=typeof BigInt>`u`?null:iU(BigInt.prototype.toString),$H=typeof Symbol>`u`?null:iU(Symbol.prototype.toString),eU=iU(Object.prototype.hasOwnProperty),tU=iU(Object.prototype.toString),nU=iU(RegExp.prototype.test),rU=aU(TypeError);function iU(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return IH(e,t,n)}}function aU(e){return function(){return LH(e,[...arguments])}}function oU(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:WH;if(OH&&OH(e,null),!UH(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(kH(t)||(t[r]=e),i=e)}e[i]=!0}return e}function sU(e){for(let t=0;t<e.length;t++)eU(e,t)||(e[t]=null);return e}function cU(e){let t=PH(null);for(let r of DH(e)){var n=wH(r,2);let i=n[0],a=n[1];eU(e,i)&&(t[i]=UH(a)?sU(a):a&&typeof a==`object`&&a.constructor===Object?cU(a):a)}return t}function lU(e){switch(typeof e){case`string`:return e;case`number`:return XH(e);case`boolean`:return ZH(e);case`bigint`:return QH?QH(e):`0`;case`symbol`:return $H?$H(e):`Symbol()`;case`undefined`:return tU(e);case`function`:case`object`:{if(e===null)return tU(e);let t=e,n=uU(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:tU(e)}return tU(e)}default:return tU(e)}}function uU(e,t){for(;e!==null;){let n=jH(e,t);if(n){if(n.get)return iU(n.get);if(typeof n.value==`function`)return iU(n.value)}e=AH(e)}function n(){return null}return n}function dU(e){try{return nU(e,``),!0}catch{return!1}}var fU=MH(`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(`.`)),pU=MH(`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(`.`)),mU=MH([`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`]),hU=MH([`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`]),gU=MH(`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(`.`)),_U=MH([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),vU=MH([`#text`]),yU=MH(`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(`.`)),bU=MH(`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(`.`)),xU=MH(`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(`.`)),SU=MH([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),CU=NH(/{{[\w\W]*|^[\w\W]*}}/g),wU=NH(/<%[\w\W]*|^[\w\W]*%>/g),TU=NH(/\${[\w\W]*/g),EU=NH(/^data-[\-\w.\u00B7-\uFFFF]+$/),DU=NH(/^aria-[\-\w]+$/),OU=NH(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kU=NH(/^(?:\w+script|data):/i),AU=NH(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jU=NH(/^html$/i),MU=NH(/^[a-z][.\w]*(-[.\w]+)+$/i),NU=NH(/<[/\w!]/g),PU=NH(/<[/\w]/g),FU=NH(/<\/no(script|embed|frames)/i),IU=NH(/\/>/i),LU={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},RU=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],zU=MH(oU({},RU)),BU=function(){let e={};return RH(RU,t=>{e[t]=NH(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),MH(e)}(),VU=function(){return typeof window>`u`?null:window},HU=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}},UU=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},WU=function(e,t,n,r){return eU(e,t)&&UH(e[t])?oU(r.base?cU(r.base):{},e[t],r.transform):n},GU=function(e,t,n){let r=eU(e,t)?e[t]:void 0;return r&&typeof r==`object`?cU(r):n()};function KU(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VU(),t=e=>KU(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==LU.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=uU(d,`cloneNode`),p=uU(d,`remove`),m=uU(d,`removeAttributeNode`),h=uU(d,`nextSibling`),g=uU(d,`childNodes`),_=uU(d,`parentNode`),v=uU(d,`shadowRoot`),y=uU(d,`attributes`),b=o&&o.prototype?uU(o.prototype,`nodeType`):null,x=o&&o.prototype?uU(o.prototype,`nodeName`):null,S=o&&o.prototype?uU(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 rU(`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--}},ae=function(){return te||=(ee=HU(u,i),!0),ee},oe=n,se=oe.implementation,ce=oe.createNodeIterator,le=oe.createDocumentFragment,ue=oe.getElementsByTagName,de=r.importNode,fe=UU();t.isSupported=typeof DH==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let pe=CU,me=wU,he=TU,ge=EU,_e=DU,ve=kU,ye=AU,be=MU,O=OU,xe=null,Se=oU({},[...fU,...pU,...mU,...gU,...vU]),Ce=null,we=oU({},[...yU,...bU,...xU,...SU]),Te=Object.seal(PH(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}})),Ee=null,De=null,Oe=Object.seal(PH(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ke=!0,Ae=!0,je=!1,Me=!0,Ne=!1,Pe=!0,Fe=!1,Ie=!1,Le=null,Re=null,ze=!1,Be=!1,Ve=!1,He=!1,Ue=!0,We=!1,Ge=`user-content-`,Ke=!0,qe=!1,Je={},Ye=null,Xe=oU({},`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(`.`)),Ze=null,Qe=oU({},[`audio`,`video`,`img`,`source`,`image`,`track`]),$e=null,et=oU({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),tt=`http://www.w3.org/1998/Math/MathML`,nt=`http://www.w3.org/2000/svg`,rt=`http://www.w3.org/1999/xhtml`,it=rt,at=!1,ot=null,st=oU({},[tt,nt,rt],GH),ct=MH([`mi`,`mo`,`mn`,`ms`,`mtext`]),lt=oU({},ct),ut=MH([`annotation-xml`]),dt=oU({},ut),ft=oU({},[`title`,`style`,`font`,`a`,`script`]),pt=null,mt=[`application/xhtml+xml`,`text/html`],ht=null,gt=null,_t=n.createElement(`form`),vt=function(e){return e instanceof RegExp||e instanceof Function},yt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gt&>===e)return;(!e||typeof e!=`object`)&&(e={}),e=cU(e),pt=mt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ht=pt===`application/xhtml+xml`?GH:WH,xe=WU(e,`ALLOWED_TAGS`,Se,{transform:ht}),Ce=WU(e,`ALLOWED_ATTR`,we,{transform:ht}),ot=WU(e,`ALLOWED_NAMESPACES`,st,{transform:GH}),$e=WU(e,`ADD_URI_SAFE_ATTR`,et,{transform:ht,base:et}),Ze=WU(e,`ADD_DATA_URI_TAGS`,Qe,{transform:ht,base:Qe}),Ye=WU(e,`FORBID_CONTENTS`,Xe,{transform:ht}),Ee=WU(e,`FORBID_TAGS`,cU({}),{transform:ht}),De=WU(e,`FORBID_ATTR`,cU({}),{transform:ht}),Je=eU(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?cU(e.USE_PROFILES):e.USE_PROFILES:!1,ke=e.ALLOW_ARIA_ATTR!==!1,Ae=e.ALLOW_DATA_ATTR!==!1,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=e.SAFE_FOR_TEMPLATES||!1,Pe=e.SAFE_FOR_XML!==!1,Fe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ve=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,ze=e.FORCE_BODY||!1,Ue=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ke=e.KEEP_CONTENT!==!1,qe=e.IN_PLACE||!1,O=dU(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:OU,it=typeof e.NAMESPACE==`string`?e.NAMESPACE:rt,lt=GU(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>oU({},ct)),dt=GU(e,`HTML_INTEGRATION_POINTS`,()=>oU({},ut));let t=GU(e,`CUSTOM_ELEMENT_HANDLING`,()=>PH(null));if(Te=PH(null),eU(t,`tagNameCheck`)&&vt(t.tagNameCheck)&&(Te.tagNameCheck=t.tagNameCheck),eU(t,`attributeNameCheck`)&&vt(t.attributeNameCheck)&&(Te.attributeNameCheck=t.attributeNameCheck),eU(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),NH(Te),Ne&&(Ae=!1),Ve&&(Be=!0),Je&&(xe=oU({},vU),Ce=PH(null),Je.html===!0&&(oU(xe,fU),oU(Ce,yU)),Je.svg===!0&&(oU(xe,pU),oU(Ce,bU),oU(Ce,SU)),Je.svgFilters===!0&&(oU(xe,mU),oU(Ce,bU),oU(Ce,SU)),Je.mathMl===!0&&(oU(xe,gU),oU(Ce,xU),oU(Ce,SU))),Oe.tagCheck=null,Oe.attributeCheck=null,eU(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Oe.tagCheck=e.ADD_TAGS:UH(e.ADD_TAGS)&&(xe===Se&&(xe=cU(xe)),oU(xe,e.ADD_TAGS,ht))),eU(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Oe.attributeCheck=e.ADD_ATTR:UH(e.ADD_ATTR)&&(Ce===we&&(Ce=cU(Ce)),oU(Ce,e.ADD_ATTR,ht))),eU(e,`ADD_FORBID_CONTENTS`)&&UH(e.ADD_FORBID_CONTENTS)&&(Ye===Xe&&(Ye=cU(Ye)),oU(Ye,e.ADD_FORBID_CONTENTS,ht)),Ke&&(xe[`#text`]=!0),Fe&&oU(xe,[`html`,`head`,`body`]),xe.table&&(oU(xe,[`tbody`]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw rU(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw rU(`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=ae()),T&&typeof E==`string`&&(E=re(``)));MH&&MH(e),gt=e},bt=oU({},[...pU,...mU,...hU]),xt=oU({},[...gU,..._U]),St=function(e,t,n){return t.namespaceURI===rt?e===`svg`:t.namespaceURI===tt?e===`svg`&&(n===`annotation-xml`||lt[n]):!!bt[e]},Ct=function(e,t,n){return t.namespaceURI===rt?e===`math`:t.namespaceURI===nt?e===`math`&&dt[n]:!!xt[e]},wt=function(e,t,n){return t.namespaceURI===nt&&!dt[n]||t.namespaceURI===tt&&!lt[n]?!1:!xt[e]&&(ft[e]||!bt[e])},Tt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:it,tagName:`template`});let n=WH(e.tagName),r=WH(t.tagName);return ot[e.namespaceURI]?e.namespaceURI===nt?St(n,t,r):e.namespaceURI===tt?Ct(n,t,r):e.namespaceURI===rt?wt(n,t,r):!!(pt===`application/xhtml+xml`&&ot[e.namespaceURI]):!1},Et=function(e){VH(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw rU(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Dt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Ot=function(e){jt(e);let t=g(e);if(t){let e=[];RH(t,t=>{VH(e,t)}),RH(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`&&Dt(e,r,i)}},kt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}VH(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(Be||Ve)try{Et(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},At=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`||Ce[ht(i)]||Dt(e,r,i)}},jt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===LU.element&&At(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Mt=function(e,t){return Pe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Nt=function(e){if(!Pe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===LU.processingInstruction||n===LU.comment&&nU(PU,e.data)){try{p(e)}catch{}continue}if(n===LU.element){let t=e,n=ht(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Mt(`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])}},Pt=function(e){let t=null,r=null;if(ze)e=`<remove></remove>`+e;else{let t=KH(e,/^[\r\n\t ]+/);r=t&&t[0]}pt===`application/xhtml+xml`&&it===rt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?re(e):e;if(it===rt)try{t=new l().parseFromString(i,pt)}catch{}if(!t||!t.documentElement){t=se.createDocument(it,`template`,null);try{t.documentElement.innerHTML=at?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),it===rt?ue.call(t,Fe?`html`:`body`)[0]:Fe?t.documentElement:a},Ft=function(e){let t=S?S(e):e.ownerDocument;return ce.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},It=function(e){return e=qH(e,pe,` `),e=qH(e,me,` `),e=qH(e,he,` `),e},Lt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ce.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=It(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&RH(i,e=>{zt(e.content)&&Lt(e.content)})},Rt=function(e){let t=x?x(e):null;return typeof t!=`string`||ht(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)},zt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===LU.documentFragment}catch{return!1}},Bt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Vt(e,n,r){e.length!==0&&RH(e,e=>{e.call(t,n,r,gt)})}let Ht=function(e,t){return!!(Pe&&e.hasChildNodes()&&!Bt(e.firstElementChild)&&nU(NU,e.textContent)&&nU(NU,e.innerHTML)||Pe&&e.namespaceURI===rt&&zU[t]&&(Bt(e.firstElementChild)||typeof e.textContent==`string`&&nU(BU[t],e.textContent))||e.nodeType===LU.processingInstruction||Pe&&e.nodeType===LU.comment&&nU(PU,e.data))},Ut=function(e,t){return e instanceof RegExp?nU(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Wt=function(e,t,n){if(!Ee[t]&&Xt(t)&&Ut(Te.tagNameCheck,t))return!1;if(Ke&&!Ye[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 Et(e),!0},Gt=function(e,t,n,r){return e.length===0?t:t===n||t===r?cU(t):t},Kt=function(e,t){return e===t||_(e)!==null?!1:(qe&&jt(e),!0)},qt=function(e,n){if(Vt(fe.beforeSanitizeElements,e,null),Kt(e,n))return!0;if(Rt(e))return Et(e),!0;let r=ht(w(e));if(xe=Gt(fe.uponSanitizeElement,xe,Se,Le),Vt(fe.uponSanitizeElement,e,{tagName:r,allowedTags:xe}),Kt(e,n))return!0;if(Ht(e,r))return Et(e),!0;if(Ee[r]||!(Oe.tagCheck instanceof Function&&Oe.tagCheck(r))&&!xe[r]){let t=Wt(e,r,n);return t===!1&&(Vt(fe.afterSanitizeElements,e,null),Kt(e,n))?!0:t}if(C(e)===LU.element&&!Tt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&nU(FU,e.innerHTML))return Et(e),!0;if(Ne&&e.nodeType===LU.text){let n=It(e.textContent);e.textContent!==n&&(VH(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Vt(fe.afterSanitizeElements,e,null),Kt(e,n)},Jt=function(e,t,r){if(De[t]||Mt(t,e)||Ue&&(t===`id`||t===`name`)&&(r in n||r in _t))return!1;let i=Ce[t]||Oe.attributeCheck instanceof Function&&Oe.attributeCheck(t,e);return Ae&&nU(ge,t)||ke&&nU(_e,t)?!0:i?$e[t]||nU(O,qH(r,ye,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&JH(r,`data:`)===0&&Ze[e]||je&&!nU(ve,qH(r,ye,``))?!0:!r:Xt(e)&&Ut(Te.tagNameCheck,e)&&Ut(Te.attributeNameCheck,t,e)||t===`is`&&Te.allowCustomizedBuiltInElements&&Ut(Te.tagNameCheck,r)},Yt=oU({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Xt=function(e){return!Yt[WH(e)]&&nU(be,e)},Zt=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},Qt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Rt(e)||(Et(e),!1)}catch{return kt(t,e),!1}},$t=function(e,n){if(Vt(fe.beforeSanitizeAttributes,e,null),Kt(e,n))return;let r=e.attributes;if(!r||Rt(e))return;Ce=Gt(fe.uponSanitizeAttribute,Ce,we,Re);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0},a=r.length,o=ht(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=ht(s),d=l,f=s===`value`?d:YH(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Vt(fe.uponSanitizeAttribute,e,i),f=i.attrValue,We&&(u===`id`||u===`name`)&&JH(f,Ge)!==0&&(kt(s,e,n),f=Ge+f,p=!0),Pe&&nU(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&KH(f,`href`)?kt(s,e,n):i.forceKeepAttr||(i.keepAttr?!Me&&nU(IU,f)?kt(s,e,n):(Ne&&(f=It(f)),Jt(o,u,f)?(f=Zt(o,u,c,f),f!==d&&Qt(e,s,c,f)&&p&&BH(t.removed)):kt(s,e,n)):kt(s,e,n))}Vt(fe.afterSanitizeAttributes,e,null),Kt(e,n)},en=function(e){let t=null,n=Ft(e);for(Vt(fe.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Vt(fe.uponSanitizeShadowNode,t,null),qt(t,e),$t(t,e),zt(t.content)&&en(t.content),C(t)===LU.element){let e=v(t);zt(e)&&(tn(e),en(e))}Vt(fe.afterSanitizeShadowDOM,e,null)},tn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){en(e.shadow);continue}let n=e.node,r=C(n)===LU.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`&&ht(e)===`template`){let e=n.content;zt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);zt(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(at=!e,at&&(e=`<!-->`),typeof e!=`string`&&!Bt(e)&&(e=lU(e),typeof e!=`string`))throw rU(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ie?(xe=Le,Ce=Re):yt(n),(fe.uponSanitizeElement.length>0||fe.uponSanitizeAttribute.length>0)&&(xe=cU(xe)),fe.uponSanitizeAttribute.length>0&&(Ce=cU(Ce)),t.removed=[];let c=qe&&typeof e!=`string`&&Bt(e);if(c){Nt(e);let t=w(e);if(typeof t==`string`){let n=ht(t);if(!xe[n]||Ee[n])throw Ot(e),rU(`root node is forbidden and cannot be sanitized in-place`)}if(Rt(e))throw Ot(e),rU(`root node is clobbered and cannot be sanitized in-place`);try{tn(e)}catch(t){throw Ot(e),t}}else if(Bt(e))i=Pt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===LU.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),tn(i);else{if(!Be&&!Ne&&!Fe&&e.indexOf(`<`)===-1)return T&&He?re(e):e;if(i=Pt(e),!i)return Be?null:He?E:``}i&&ze&&Et(i.firstChild);let l=c?e:i;try{let e=Ft(l);for(;o=e.nextNode();)qt(o,l),$t(o,l),zt(o.content)&&en(o.content)}catch(n){throw c&&(Ot(e),RH(t.removed,e=>{e.element&&jt(e.element)})),n}if(c){let n=!1;if(RH(t.removed,t=>{t.element&&(t.element===e&&(n=!0),jt(t.element))}),n)throw rU(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ne&&Lt(e),e}if(Be){if(Ne&&Lt(i),Ve)for(s=le.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(Ce.shadowroot||Ce.shadowrootmode)&&(s=de.call(r,s,!0)),s}let u=Fe?i.outerHTML:i.innerHTML;return Fe&&xe[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&nU(jU,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
130
|
+
`+u),Ne&&(u=It(u)),T&&He?re(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yt(e),Ie=!0,Le=xe,Re=Ce},t.clearConfig=function(){gt=null,Ie=!1,Le=null,Re=null,T=ee,E=``},t.isValidAttribute=function(e,t,n){gt||yt({});let r=ht(e),i=ht(t);return Jt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&eU(fe,e)&&VH(fe[e],t)},t.removeHook=function(e,t){if(eU(fe,e)){if(t!==void 0){let n=zH(fe[e],t);return n===-1?void 0:HH(fe[e],n,1)[0]}return BH(fe[e])}},t.removeHooks=function(e){eU(fe,e)&&(fe[e]=[])},t.removeAllHooks=function(){fe=UU()},t}var qU=KU(),JU=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=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},ae={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[ie]},oe={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[ie]},se={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/},ce=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},le=ce(`//`,`$`),ue=ce(`/\\*`,`\\*/`),de=ce(`#`,`$`),fe=Object.freeze({__proto__:null,APOS_STRING_MODE:ae,BACKSLASH_ESCAPE:ie,BINARY_NUMBER_MODE:{scope:`number`,begin:ne,relevance:0},BINARY_NUMBER_RE:ne,COMMENT:ce,C_BLOCK_COMMENT_MODE:ue,C_LINE_COMMENT_MODE:le,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:de,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:se,QUOTE_STRING_MODE:oe,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 pe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function me(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function he(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=pe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ge(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function _e(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 ve(e,t){e.relevance===void 0&&(e.relevance=1)}var ye=(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},be=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],O=`keyword`;function xe(e,t,n=O){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,xe(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,Se(n[0],n[1])]})}}function Se(e,t){return t?Number(t):+!Ce(e)}function Ce(e){return be.includes(e.toLowerCase())}var we={},Te=e=>{console.error(e)},Ee=(e,...t)=>{console.log(`WARN: ${e}`,...t)},De=(e,t)=>{we[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),we[`${e}/${t}`]=!0)},Oe=Error();function ke(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 Ae(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Te(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Oe;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Te(`beginScope must be object`),Oe;ke(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function je(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Te(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Oe;if(typeof e.endScope!=`object`||e.endScope===null)throw Te(`endScope must be object`),Oe;ke(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Me(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ne(e){Me(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Ae(e),je(e)}function Pe(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;[me,_e,Ne,ye].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[he,ge,ve].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&&=xe(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 Ie(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 Fe(e){return e?e.endsWithParent||Fe(e.starts):!1}function Ie(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Fe(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Le=`11.12.0`,Re=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ze=i,Be=a,Ve=Symbol(`nomatch`),He=7,Ue=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=ae(n[1]);return t||(Ee(s.replace(`{}`,n[1])),Ee(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||ae(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(De(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),De(`10.7.0`,`Please use highlight(code, options) instead.
|
|
131
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};de(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,de(`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(oe);return}let e=0;D.keywordPatternRe.lastIndex=0;let t=D.keywordPatternRe.exec(oe),n=``;for(;t;){n+=oe.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]<=He&&(se+=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(oe)}n+=oe.substring(e),ie.addText(n)}function f(){if(oe===``)return;let e=null;if(typeof D.subLanguage==`string`){if(!t[D.subLanguage]){ie.addText(oe);return}e=v(D.subLanguage,oe,!0,re[D.subLanguage]),re[D.subLanguage]=e._top}else e=S(oe,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(se+=e.relevance),ie.__addSublanguage(e._emitter,e.language)}function p(){D.subLanguage==null?d():f(),oe=``}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):(oe=i,d(),oe=``),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(oe,ee.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),oe=``):e.beginScope._multi&&(h(e.beginScope,t),oe=``)),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?(oe+=e[0],1):(ue=!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?oe+=t:(n.excludeBegin&&(oe+=t),p(),!n.returnBegin&&!n.excludeBegin&&(oe=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 Ve;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?oe+=t:(a.returnEnd||a.excludeEnd||(oe+=t),p(),a.excludeEnd&&(oe=t));do D.scope&&ie.closeNode(),!D.skip&&!D.subLanguage&&(se+=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(oe+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(oe+=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!==Ve)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(oe+=`
|
|
132
|
+
`),1;if(le>1e5&&le>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return oe+=a,a.length}let ee=ae(e);if(!ee)throw Te(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let te=Pe(ee),ne=``,D=a||te,re={},ie=new l.__emitter(l);w();let oe=``,se=0,ce=0,le=0,ue=!1;try{if(ee.__emitTokens)ee.__emitTokens(n,ie);else{for(D.matcher.considerAll();;){le++,ue?ue=!1:D.matcher.considerAll(),D.matcher.lastIndex=ce;let e=D.matcher.exec(n);if(!e)break;let t=E(n.substring(ce,e.index),e);ce=e.index+t}E(n.substring(ce))}return ie.finalize(),ne=ie.toHTML(),{language:e,value:ne,relevance:se,illegal:!1,_emitter:ie,_top:D}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ze(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:ce,context:n.slice(ce-100,ce+100),mode:t.mode,resultSoFar:ne},_emitter:ie};if(o)return{language:e,value:ze(n),illegal:!1,relevance:0,errorRaised:t,_emitter:ie,_top:D};throw t}}function b(e){let t={value:ze(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(ae).filter(se).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(ae(e.language).supersetOf===t.language)return 1;if(ae(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(de(`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 Re(`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}),de(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Be(l,e)}let E=()=>{ne(),De(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function ee(){ne(),De(`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(Te(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Te(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&oe(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 ae(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function oe(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function se(e){let t=ae(e);return t&&!t.disableAutodetect}function ce(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 le(e){ce(e),a.push(e)}function ue(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function de(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function pe(e){return De(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),De(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:ne,highlightElement:w,highlightBlock:pe,configure:T,initHighlighting:E,initHighlightingOnLoad:ee,registerLanguage:D,unregisterLanguage:re,listLanguages:ie,getLanguage:ae,registerAliases:oe,autoDetection:se,inherit:Be,addPlugin:le,removePlugin:ue}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Le,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in fe)typeof fe[e]==`object`&&n(fe[e]);return Object.assign(e,fe),e},We=Ue({});We.newInstance=()=>Ue({}),t.exports=We,We.HighlightJS=We,We.default=We}))()).default;function YU(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 XU(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 ZU(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 QU=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_-]*/}}),$U=`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(`.`),eW=`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(`.`),tW=[...$U,...eW],nW=`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(),rW=`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(),iW=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),aW=`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 oW(e){let t=e.regex,n=QU(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:`:(`+rW.join(`|`)+`)`},{begin:`:(:)?(`+iW.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+aW.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:nW.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+tW.join(`|`)+`)\\b`}]}}function sW(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 cW(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 lW(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 uW=`[0-9](_*[0-9])*`,dW=`\\.(${uW})`,fW=`[0-9a-fA-F](_*[0-9a-fA-F])*`,pW={className:`number`,variants:[{begin:`(\\b(${uW})((${dW})|\\.)?|(${dW}))[eE][+-]?(${uW})[fFdD]?\\b`},{begin:`\\b(${uW})((${dW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${dW})[fFdD]?\\b`},{begin:`\\b(${uW})[fFdD]\\b`},{begin:`\\b0[xX]((${fW})\\.?|(${fW})?\\.(${fW}))[pP][+-]?(${uW})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${fW})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function mW(e,t,n){return n===-1?``:e.replace(t,r=>mW(e,t,n-1))}function hW(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=mW(`(?:\\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,pW,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},pW,s]}}var gW=`[A-Za-z$_][0-9A-Za-z$_]*`,_W=`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(`.`),vW=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],yW=`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(`.`),bW=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],xW=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],SW=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],CW=[].concat(xW,yW,bW);function wW(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=gW,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:gW,keyword:_W,literal:vW,built_in:CW,"variable.language":SW},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:{_:[...yW,...bW]}},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([...xW,`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 TW={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function EW(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,TW,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function DW(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 OW(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 kW(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 AW(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 jW=`[A-Za-z$_][0-9A-Za-z$_]*`,MW=`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(`.`),NW=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],PW=`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(`.`),FW=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],IW=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],LW=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],RW=[].concat(IW,PW,FW);function zW(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=jW,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:jW,keyword:MW,literal:NW,built_in:RW,"variable.language":LW},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:{_:[...PW,...FW]}},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([...IW,`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 BW(e){let t=e.regex,n=zW(e),r=jW,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:jW,keyword:MW.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:NW,built_in:RW.concat(i),"variable.language":LW},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 VW(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 HW(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}}JU.registerLanguage(`bash`,YU),JU.registerLanguage(`c`,XU),JU.registerLanguage(`cpp`,ZU),JU.registerLanguage(`css`,oW),JU.registerLanguage(`diff`,sW),JU.registerLanguage(`go`,cW),JU.registerLanguage(`ini`,lW),JU.registerLanguage(`java`,hW),JU.registerLanguage(`javascript`,wW),JU.registerLanguage(`json`,EW),JU.registerLanguage(`markdown`,DW),JU.registerLanguage(`python`,OW),JU.registerLanguage(`rust`,kW),JU.registerLanguage(`sql`,AW),JU.registerLanguage(`typescript`,BW),JU.registerLanguage(`xml`,VW),JU.registerLanguage(`yaml`,HW);var UW={shell:`bash`};function WW(e){if(e===void 0)return!1;let t=UW[e.trim().toLowerCase()]??e.trim().toLowerCase();return t!==``&&JU.getLanguage(t)!==void 0}function GW(e,t){let n=t===void 0?``:UW[t.trim().toLowerCase()]??t.trim().toLowerCase();if(n!==``&&JU.getLanguage(n)!==void 0)try{return JU.highlight(e,{language:n}).value}catch{}return KW(e)}function KW(e){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`)}function qW(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 JW(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 YW(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 WW(r)?r:void 0}function XW(e,t,n=`edit`){let r=e.split(`
|
|
133
|
+
`),i=r.map(e=>qW(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&&WW(t)?t:void 0;if(l!==void 0)try{return{kind:`highlighted`,rows:ZW(r,i,s,c,QW(JU.highlight(a.join(`
|
|
134
|
+
`),{language:l}).value),QW(JU.highlight(o.join(`
|
|
135
|
+
`),{language:l}).value))}}catch{}return{kind:`plain`,rows:ZW(r,i,s,c,a.map(KW),o.map(KW))}}function ZW(e,t,n,r,i,a){return t.map((t,o)=>{if(t===null)return{kind:`context`,gutter:``,html:KW(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 QW(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]===`
|
|
136
|
+
`?(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 $W(e){let t=(0,f.useMemo)(()=>XW(e.diff,YW(e.path),e.format).rows.map(e=>({...e,html:qU.sanitize(e.html,{USE_PROFILES:{html:!0}})})),[e.diff,e.path,e.format]);return(0,k.jsx)(`div`,{className:e.className,children:t.map((e,t)=>(0,k.jsxs)(`div`,{className:`whitespace-pre ${e.kind===`added`?`diff-line-add`:e.kind===`removed`?`diff-line-del`:``}`,children:[(0,k.jsx)(`span`,{className:`diff-gutter`,children:e.gutter}),(0,k.jsx)(`span`,{dangerouslySetInnerHTML:{__html:e.html}})]},t))})}var eG={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 tG(e,t){return e===`done`?t?eG.doneError:eG.doneOk:eG[e]}function nG(e){let t=B(),[n,r]=(0,f.useState)(!1),i=tG(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),d=u||e.output!=null||e.result!=null||e.note!=null||e.diff!=null;return(0,k.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,children:[(0,k.jsxs)(`button`,{type:`button`,"aria-expanded":d?n:void 0,onClick:()=>{d&&r(!n)},className:`focus-neko flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,k.jsx)(`span`,{className:`text-tianyi-500`,children:(0,k.jsx)(KR,{name:`bolt`,size:14})}),(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold text-tianyi-800`,children:e.name}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:[e.summary,l!==null&&(0,k.jsxs)(`span`,{className:`text-ink-400`,children:[` `,l]})]}),(0,k.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,k.jsx)(KR,{name:i.icon,size:12,className:i.spin?`animate-spin`:void 0}),t(i.label),a]}),d&&(0,k.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:n?`▾`:`▸`})]}),n&&(0,k.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[o&&e.diff!=null&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.diff`)}),e.diffTruncated&&(0,k.jsx)(`div`,{className:`mb-1 text-xs text-ink-600`,children:t(`tool.diffTruncated`)}),(0,k.jsx)($W,{diff:e.diff,path:JW(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,k.jsxs)(`div`,{children:[e.name===`write`&&e.diffTruncated&&(0,k.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.fullWrite`)}),(0,k.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,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.output`)}),(0,k.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,k.jsxs)(`div`,{children:[(0,k.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,k.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,k.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:JN(e.note,t)})]})]})}var rG={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 iG({code:e}){let t=(0,f.useMemo)(()=>qU.sanitize(GW(e,`javascript`),{USE_PROFILES:{html:!0}}),[e]);return(0,k.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:(0,k.jsx)(`code`,{dangerouslySetInnerHTML:{__html:t}})})}function aG({call:e}){let t=B(),n=rG[e.status];return(0,k.jsxs)(`li`,{className:`flex flex-col gap-0.5 py-0.5`,"data-call-status":e.status,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`inline-flex shrink-0 items-center ${n.className}`,role:`img`,"aria-label":t(n.label),children:(0,k.jsx)(KR,{name:n.icon,size:12,className:e.status===`running`?`animate-spin`:void 0})}),(0,k.jsx)(`span`,{className:`shrink-0 font-semibold text-tianyi-800`,children:e.name}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-600`,children:e.args}),e.durationMs!==null&&(0,k.jsxs)(`span`,{className:`shrink-0 text-ink-400`,children:[(e.durationMs/1e3).toFixed(1),`s`]})]}),e.error!==null&&(0,k.jsx)(`div`,{className:`pl-5 text-sakura-800`,children:e.error})]})}function oG(e){let t=B(),[n,r]=(0,f.useState)(!1),i=tG(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,d=e.phase===`done`?e.result:e.output;return(0,k.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,"data-codemode-card":!0,children:[(0,k.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,k.jsx)(`span`,{className:`text-tianyi-500`,children:(0,k.jsx)(KR,{name:`code`,size:14})}),(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold text-tianyi-800`,children:e.name}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:[e.summary,c>0&&(0,k.jsxs)(`span`,{className:`text-ink-400`,children:[` · `,t(`codemode.card.callCount`,{count:c})]})]}),(0,k.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,k.jsx)(KR,{name:i.icon,size:12,className:i.spin?`animate-spin`:void 0}),t(i.label),l]}),u&&(0,k.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:n?`▾`:`▸`})]}),n&&(0,k.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[e.detail!==null&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`codemode.card.script`)}),(0,k.jsx)(iG,{code:e.detail})]}),c>0&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`codemode.card.calls`,{count:c})}),(0,k.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,k.jsx)(aG,{call:e},e.id)),o>0&&(0,k.jsx)(`li`,{className:`py-0.5 text-ink-500`,children:t(`codemode.card.omitted`,{count:o})})]})]}),d!=null&&d!==``&&(0,k.jsxs)(`div`,{children:[(0,k.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,k.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:d})]}),s!==null&&(0,k.jsx)(`div`,{className:`break-all text-xs text-ink-500`,children:t(`codemode.card.fullOutput`,{path:s})}),e.note!=null&&(0,k.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:JN(e.note,t)})]})]})}function sG(e){let{codemode:t,...n}=e;return t?(0,k.jsx)(oG,{...n,codemode:t}):(0,k.jsx)(nG,{...n})}async function cG(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 lG=1500;function uG({text:e,label:t}){let n=B(),r=t??n(`copy.label`),[i,a]=(0,f.useState)(`idle`),o=(0,f.useRef)(void 0);if((0,f.useEffect)(()=>()=>clearTimeout(o.current),[]),e===``)return null;let s=e=>{a(e),clearTimeout(o.current),o.current=setTimeout(()=>a(`idle`),lG)};return(0,k.jsxs)(`span`,{className:`copy-row`,"data-state":i,children:[(0,k.jsx)(`button`,{type:`button`,className:`copy-btn focus-neko`,"aria-label":r,title:r,onClick:()=>{cG(e).then(()=>s(`copied`),()=>s(`failed`))},children:(0,k.jsx)(KR,{name:i===`copied`?`check`:`copy`,size:15})}),(0,k.jsx)(`output`,{className:`copy-status`,"aria-live":`polite`,children:i===`copied`?n(`copy.copied`):i===`failed`?n(`copy.failed`):``})]})}var dG=(0,f.createContext)(null);function fG({image:e}){let t=B(),{currentSessionId:n,phase:r}=nP(),i=(0,f.useContext)(dG),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(0),m=(0,f.useRef)(null);return(0,f.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):mP.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(z()(`image.loadFailed`))}))});return m.current&&l.observe(m.current),()=>{t=!0,l.disconnect(),a&&URL.revokeObjectURL(a)}},[n,r,e.entryId,e.contentIndex,d,i]),(0,k.jsxs)(`div`,{ref:m,className:`max-w-full`,children:[(0,k.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(d+1)):a&&u(!0)},children:a?(0,k.jsx)(`img`,{src:a,alt:e.name,className:`max-h-40 max-w-full rounded-lg object-contain`}):(0,k.jsx)(`span`,{className:`text-sm`,children:s||t(`image.loading`)})}),l&&a&&(0,k.jsxs)(XR,{title:e.name,onClose:()=>u(!1),children:[(0,k.jsx)(`div`,{className:`min-h-0 overflow-auto bg-surface p-3 sm:p-4`,children:(0,k.jsx)(`img`,{src:a,alt:e.name,className:`max-h-[65dvh] w-full rounded-lg object-contain`})}),(0,k.jsx)(`div`,{className:`flex shrink-0 justify-end border-t border-sakura-200 bg-surface px-4 py-3`,children:(0,k.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,k.jsx)(`svg`,{"aria-hidden":`true`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,k.jsx)(`path`,{d:`M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4`})}),t(`image.save`)]})})]})]})}function pG({images:e}){return(0,k.jsx)(`div`,{className:`my-2 flex flex-wrap gap-2`,children:e.map(e=>(0,k.jsx)(fG,{image:e},`${e.entryId}:${e.contentIndex}`))})}function mG({text:e,jobId:t,job:n}){let r=B(),{head:i,command:a,output:o}=Pz(e),s=o===void 0?void 0:Vz(o),c=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`font-medium text-tianyi-700`,children:r(`job.reportTitle`,{id:t})}),(0,k.jsx)(`span`,{className:`min-w-0 break-words text-ink-700`,children:i.replace(/^\[|\]$/g,``)}),n&&(0,k.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 text-ink-600`,children:r(`job.reportCurrent`,{status:Rz(n,Date.now())})})]});return(0,k.jsx)(`div`,{className:`chat-row anim-other`,"data-job-report":t,children:(0,k.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,k.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:c}):(0,k.jsxs)(`details`,{children:[(0,k.jsx)(`summary`,{className:`focus-neko flex cursor-pointer flex-wrap items-center gap-x-2 gap-y-1`,children:c}),a!==void 0&&(0,k.jsxs)(`code`,{className:`mt-2 block whitespace-pre-wrap break-all text-ink-600`,children:[`$ `,a]}),(0,k.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-ink-800`,children:s})]})})})}var V=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},hG=/([A-Z])/g,gG=e=>e.replace(hG,`-$1`).toLowerCase(),_G={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},vG=/[&><"']/g,yG=e=>String(e).replace(vG,e=>_G[e]),bG=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?bG(e.body[0]):e:e.type===`font`?bG(e.body):e,xG=new Set([`mathord`,`textord`,`atom`]),SG=e=>xG.has(bG(e).type),CG=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},wG={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 TG(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 EG(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:TG(Array.isArray(e.type)?e.type[0]:e.type)}function DG(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?EG(r):a?a(i):i}var OG=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(wG)){var n=wG[t];n&&DG(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=CG(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},kG=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 RG[zG[this.id]]}sub(){return RG[BG[this.id]]}fracNum(){return RG[VG[this.id]]}fracDen(){return RG[HG[this.id]]}cramp(){return RG[UG[this.id]]}text(){return RG[WG[this.id]]}isTight(){return this.size>=2}},AG=0,jG=1,MG=2,NG=3,PG=4,FG=5,IG=6,LG=7,RG=[new kG(AG,0,!1),new kG(jG,0,!0),new kG(MG,1,!1),new kG(NG,1,!0),new kG(PG,2,!1),new kG(FG,2,!0),new kG(IG,3,!1),new kG(LG,3,!0)],zG=[PG,FG,PG,FG,IG,LG,IG,LG],BG=[FG,FG,FG,FG,LG,LG,LG,LG],VG=[MG,NG,PG,FG,IG,LG,IG,LG],HG=[NG,NG,FG,FG,LG,LG,LG,LG],UG=[jG,jG,NG,NG,FG,FG,LG,LG],WG=[AG,jG,MG,NG,MG,NG,MG,NG],GG={DISPLAY:RG[AG],TEXT:RG[MG],SCRIPT:RG[PG],SCRIPTSCRIPT:RG[IG]},KG=[{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 qG(e){for(var t=0;t<KG.length;t++)for(var n=KG[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 JG=[];KG.forEach(e=>e.blocks.forEach(e=>JG.push(...e)));function YG(e){for(var t=0;t<JG.length;t+=2)if(e>=JG[t]&&e<=JG[t+1])return!0;return!1}var XG=e=>e+` `+e,ZG=80,QG=function(e,t){return`M95,`+(622+e+t)+`
|
|
137
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
138
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
139
|
+
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
|
|
140
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
141
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
142
|
+
l`+e/2.075+` -`+e+`
|
|
143
|
+
c5.3,-9.3,12,-14,20,-14
|
|
144
|
+
H400000v`+(40+e)+`H845.2724
|
|
145
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
146
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
147
|
+
M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},$G=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
148
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
149
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
150
|
+
l`+e/2.084+` -`+e+`
|
|
151
|
+
c4.7,-7.3,11,-11,19,-11
|
|
152
|
+
H40000v`+(40+e)+`H1012.3
|
|
153
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
154
|
+
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
|
|
155
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
156
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
157
|
+
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},eK=function(e,t){return`M983 `+(10+e+t)+`
|
|
158
|
+
l`+e/3.13+` -`+e+`
|
|
159
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
160
|
+
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
|
|
161
|
+
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
|
|
162
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
163
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
164
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
165
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
166
|
+
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},tK=function(e,t){return`M424,`+(2398+e+t)+`
|
|
167
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
168
|
+
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
|
|
169
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
170
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
171
|
+
l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
172
|
+
v`+(40+e)+`H1014.6
|
|
173
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
174
|
+
c-2,6,-10,9,-24,9
|
|
175
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
|
|
176
|
+
h400000v`+(40+e)+`h-400000z`},nK=function(e,t){return`M473,`+(2713+e+t)+`
|
|
177
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
|
|
178
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
179
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
180
|
+
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
|
|
181
|
+
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
|
|
182
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
183
|
+
606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},rK=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},iK=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
|
|
184
|
+
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
|
|
185
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
186
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
187
|
+
219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},aK=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=QG(t,ZG);break;case`sqrtSize1`:r=$G(t,ZG);break;case`sqrtSize2`:r=eK(t,ZG);break;case`sqrtSize3`:r=tK(t,ZG);break;case`sqrtSize4`:r=nK(t,ZG);break;case`sqrtTall`:r=iK(t,ZG,n)}return r},oK=function(e,t){switch(e){case`⎜`:return XG(`M291 0 H417 V`+t+` H291z`);case`∣`:return XG(`M145 0 H188 V`+t+` H145z`);case`∥`:return XG(`M145 0 H188 V`+t+` H145z`)+XG(`M367 0 H410 V`+t+` H367z`);case`⎟`:return XG(`M457 0 H583 V`+t+` H457z`);case`⎢`:return XG(`M319 0 H403 V`+t+` H319z`);case`⎥`:return XG(`M263 0 H347 V`+t+` H263z`);case`⎪`:return XG(`M384 0 H504 V`+t+` H384z`);case`⏐`:return XG(`M312 0 H355 V`+t+` H312z`);case`‖`:return XG(`M257 0 H300 V`+t+` H257z`)+XG(`M478 0 H521 V`+t+` H478z`);default:return``}},sK={doubleleftarrow:`M262 157
|
|
188
|
+
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
|
|
189
|
+
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
|
|
190
|
+
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
|
|
191
|
+
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
|
|
192
|
+
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
|
|
193
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
194
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
195
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
196
|
+
-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
|
|
197
|
+
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
|
|
198
|
+
-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
|
|
199
|
+
-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
|
|
200
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
201
|
+
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
|
|
202
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
203
|
+
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
|
|
204
|
+
-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
|
|
205
|
+
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
|
|
206
|
+
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
|
|
207
|
+
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
|
|
208
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
209
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
210
|
+
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
|
|
211
|
+
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
|
|
212
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
213
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
214
|
+
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
|
|
215
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
216
|
+
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
|
|
217
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
218
|
+
-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
|
|
219
|
+
-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
|
|
220
|
+
-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
|
|
221
|
+
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
|
|
222
|
+
-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
|
|
223
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
224
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
225
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
226
|
+
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
|
|
227
|
+
-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
|
|
228
|
+
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
|
|
229
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
230
|
+
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
|
|
231
|
+
-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
|
|
232
|
+
-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
|
|
233
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:XG(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:XG(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:XG(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:XG(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
234
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
235
|
+
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
|
|
236
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:XG(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
|
|
237
|
+
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
|
|
238
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
239
|
+
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
|
|
240
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
241
|
+
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
|
|
242
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
243
|
+
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
|
|
244
|
+
-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
|
|
245
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
246
|
+
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
|
|
247
|
+
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
|
|
248
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
249
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
250
|
+
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
|
|
251
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
252
|
+
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
|
|
253
|
+
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
|
|
254
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
255
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
256
|
+
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
|
|
257
|
+
-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
|
|
258
|
+
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
|
|
259
|
+
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
|
|
260
|
+
-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
|
|
261
|
+
-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
|
|
262
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
263
|
+
-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
|
|
264
|
+
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
|
|
265
|
+
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
|
|
266
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
267
|
+
-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
|
|
268
|
+
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
|
|
269
|
+
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
|
|
270
|
+
-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
|
|
271
|
+
-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
|
|
272
|
+
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
|
|
273
|
+
-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
|
|
274
|
+
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
|
|
275
|
+
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
|
|
276
|
+
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
|
|
277
|
+
-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
|
|
278
|
+
-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
|
|
279
|
+
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
|
|
280
|
+
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
|
|
281
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
282
|
+
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
|
|
283
|
+
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
|
|
284
|
+
-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
|
|
285
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:XG(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:XG(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:XG(`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
|
|
286
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
287
|
+
-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
|
|
288
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
289
|
+
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
|
|
290
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
291
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
292
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
293
|
+
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
|
|
294
|
+
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
|
|
295
|
+
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
|
|
296
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
297
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
298
|
+
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
|
|
299
|
+
-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
|
|
300
|
+
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
|
|
301
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
302
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
303
|
+
-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
|
|
304
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
305
|
+
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
|
|
306
|
+
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
|
|
307
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
308
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
309
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
310
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
311
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
312
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
313
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
314
|
+
-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
|
|
315
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
316
|
+
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
|
|
317
|
+
-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
|
|
318
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
319
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
320
|
+
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
|
|
321
|
+
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
|
|
322
|
+
-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
|
|
323
|
+
-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
|
|
324
|
+
-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,
|
|
325
|
+
-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,
|
|
326
|
+
-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,
|
|
327
|
+
-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,
|
|
328
|
+
-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
|
|
329
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
330
|
+
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
|
|
331
|
+
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
|
|
332
|
+
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
|
|
333
|
+
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
|
|
334
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
335
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
336
|
+
-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
|
|
337
|
+
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
|
|
338
|
+
-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
|
|
339
|
+
-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
|
|
340
|
+
-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
|
|
341
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
342
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
343
|
+
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
|
|
344
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
345
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
346
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
347
|
+
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,
|
|
348
|
+
-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
|
|
349
|
+
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
|
|
350
|
+
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
|
|
351
|
+
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,
|
|
352
|
+
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,
|
|
353
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
354
|
+
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
|
|
355
|
+
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,
|
|
356
|
+
-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
|
|
357
|
+
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
|
|
358
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},cK=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
|
|
359
|
+
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
|
|
360
|
+
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
|
|
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`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
363
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
364
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
|
365
|
+
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
366
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
367
|
+
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
|
|
368
|
+
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
|
|
369
|
+
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
|
|
370
|
+
M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
|
|
371
|
+
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
|
|
372
|
+
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,
|
|
373
|
+
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
374
|
+
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
|
|
375
|
+
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,
|
|
376
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
377
|
+
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
378
|
+
-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,
|
|
379
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
380
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
|
381
|
+
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
|
|
382
|
+
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
|
|
383
|
+
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
|
|
384
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
385
|
+
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
386
|
+
-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 lK(e){return`toText`in e}var uK=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(lK(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},dK={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},fK={ex:!0,em:!0,mu:!0},pK=function(e){return typeof e!=`string`&&(e=e.unit),e in dK||e in fK||e===`ex`},mK=function(e,t){var n;if(e.unit in dK)n=dK[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new V(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},H=function(e){return+e.toFixed(4)+`em`},hK=function(e){return e.filter(e=>e).join(` `)},gK=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=gG(n)+`:`+r+`;`)}return t},_K=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)}},vK=function(e){var t=document.createElement(e);t.className=hK(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},yK=/[\s"'>/=\x00-\x1f]/,bK=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+yG(hK(this.classes))+`"`);var n=gK(this.style);n&&(t+=` style="`+yG(n)+`"`);for(var r of Object.keys(this.attributes)){if(yK.test(r))throw new V(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+yG(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},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.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,_K.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return vK.call(this,`span`)}toMarkup(){return bK.call(this,`span`)}},SK=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,_K.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 vK.call(this,`a`)}toMarkup(){return bK.call(this,`a`)}},CK=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="`+yG(this.src)+`"`+(` alt="`+yG(this.alt)+`"`),t=gK(this.style);return t&&(e+=` style="`+yG(t)+`"`),e+=`'/>`,e}},wK={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},TK=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=qG(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=wK[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=H(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=hK(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+=yG(hK(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+H(this.italic)+`;`),n+=gK(this.style),n&&(e=!0,t+=` style="`+yG(n)+`"`);var r=yG(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},EK=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+`="`+yG(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},DK=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`,sK[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+yG(this.alternate)+`"/>`:`<path d="`+yG(sK[this.pathName])+`"/>`}},OK=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+`="`+yG(this.attributes[t])+`"`;return e+=`/>`,e}};function kK(e){if(e instanceof TK)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function AK(e){if(e instanceof xK)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var jK=e=>e instanceof xK||e instanceof SK||e instanceof uK,MK={"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]}},NK={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]},PK={Å:`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 FK(e,t){MK[e]=t}function IK(e,t,n){if(!MK[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=MK[t][r];if(!i&&e[0]in PK&&(r=PK[e[0]].charCodeAt(0),i=MK[t][r]),!i&&n===`text`&&YG(r)&&(i=MK[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var LK={};function RK(e){var t=e>=5?0:e>=3?1:2;if(!LK[t]){var n=LK[t]={cssEmPerMu:NK.quad[t]/18};for(var r of Object.keys(NK))n[r]=NK[r][t]}return LK[t]}var zK={math:{},text:{}};function U(e,t,n,r,i,a){zK[e][i]={font:t,group:n,replace:r},a&&r&&(zK[e][r]=zK[e][i])}var W=`math`,G=`text`,K=`main`,q=`ams`,BK=`accent-token`,VK=`bin`,HK=`close`,UK=`inner`,WK=`mathord`,GK=`op-token`,KK=`open`,qK=`punct`,J=`rel`,JK=`spacing`,Y=`textord`;U(W,K,J,`≡`,`\\equiv`,!0),U(W,K,J,`≺`,`\\prec`,!0),U(W,K,J,`≻`,`\\succ`,!0),U(W,K,J,`∼`,`\\sim`,!0),U(W,K,J,`⊥`,`\\perp`),U(W,K,J,`⪯`,`\\preceq`,!0),U(W,K,J,`⪰`,`\\succeq`,!0),U(W,K,J,`≃`,`\\simeq`,!0),U(W,K,J,`∣`,`\\mid`,!0),U(W,K,J,`≪`,`\\ll`,!0),U(W,K,J,`≫`,`\\gg`,!0),U(W,K,J,`≍`,`\\asymp`,!0),U(W,K,J,`∥`,`\\parallel`),U(W,K,J,`⋈`,`\\bowtie`,!0),U(W,K,J,`⌣`,`\\smile`,!0),U(W,K,J,`⊑`,`\\sqsubseteq`,!0),U(W,K,J,`⊒`,`\\sqsupseteq`,!0),U(W,K,J,`≐`,`\\doteq`,!0),U(W,K,J,`⌢`,`\\frown`,!0),U(W,K,J,`∋`,`\\ni`,!0),U(W,K,J,`∝`,`\\propto`,!0),U(W,K,J,`⊢`,`\\vdash`,!0),U(W,K,J,`⊣`,`\\dashv`,!0),U(W,K,J,`∋`,`\\owns`),U(W,K,qK,`.`,`\\ldotp`),U(W,K,qK,`⋅`,`\\cdotp`),U(W,K,qK,`⋅`,`·`),U(G,K,Y,`⋅`,`·`),U(W,K,Y,`#`,`\\#`),U(G,K,Y,`#`,`\\#`),U(W,K,Y,`&`,`\\&`),U(G,K,Y,`&`,`\\&`),U(W,K,Y,`ℵ`,`\\aleph`,!0),U(W,K,Y,`∀`,`\\forall`,!0),U(W,K,Y,`ℏ`,`\\hbar`,!0),U(W,K,Y,`∃`,`\\exists`,!0),U(W,K,Y,`∇`,`\\nabla`,!0),U(W,K,Y,`♭`,`\\flat`,!0),U(W,K,Y,`ℓ`,`\\ell`,!0),U(W,K,Y,`♮`,`\\natural`,!0),U(W,K,Y,`♣`,`\\clubsuit`,!0),U(W,K,Y,`℘`,`\\wp`,!0),U(W,K,Y,`♯`,`\\sharp`,!0),U(W,K,Y,`♢`,`\\diamondsuit`,!0),U(W,K,Y,`ℜ`,`\\Re`,!0),U(W,K,Y,`♡`,`\\heartsuit`,!0),U(W,K,Y,`ℑ`,`\\Im`,!0),U(W,K,Y,`♠`,`\\spadesuit`,!0),U(W,K,Y,`§`,`\\S`,!0),U(G,K,Y,`§`,`\\S`),U(W,K,Y,`¶`,`\\P`,!0),U(G,K,Y,`¶`,`\\P`),U(W,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\textdagger`),U(W,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\textdaggerdbl`),U(W,K,HK,`⎱`,`\\rmoustache`,!0),U(W,K,KK,`⎰`,`\\lmoustache`,!0),U(W,K,HK,`⟯`,`\\rgroup`,!0),U(W,K,KK,`⟮`,`\\lgroup`,!0),U(W,K,VK,`∓`,`\\mp`,!0),U(W,K,VK,`⊖`,`\\ominus`,!0),U(W,K,VK,`⊎`,`\\uplus`,!0),U(W,K,VK,`⊓`,`\\sqcap`,!0),U(W,K,VK,`∗`,`\\ast`),U(W,K,VK,`⊔`,`\\sqcup`,!0),U(W,K,VK,`◯`,`\\bigcirc`,!0),U(W,K,VK,`∙`,`\\bullet`,!0),U(W,K,VK,`‡`,`\\ddagger`),U(W,K,VK,`≀`,`\\wr`,!0),U(W,K,VK,`⨿`,`\\amalg`),U(W,K,VK,`&`,`\\And`),U(W,K,J,`⟵`,`\\longleftarrow`,!0),U(W,K,J,`⇐`,`\\Leftarrow`,!0),U(W,K,J,`⟸`,`\\Longleftarrow`,!0),U(W,K,J,`⟶`,`\\longrightarrow`,!0),U(W,K,J,`⇒`,`\\Rightarrow`,!0),U(W,K,J,`⟹`,`\\Longrightarrow`,!0),U(W,K,J,`↔`,`\\leftrightarrow`,!0),U(W,K,J,`⟷`,`\\longleftrightarrow`,!0),U(W,K,J,`⇔`,`\\Leftrightarrow`,!0),U(W,K,J,`⟺`,`\\Longleftrightarrow`,!0),U(W,K,J,`↦`,`\\mapsto`,!0),U(W,K,J,`⟼`,`\\longmapsto`,!0),U(W,K,J,`↗`,`\\nearrow`,!0),U(W,K,J,`↩`,`\\hookleftarrow`,!0),U(W,K,J,`↪`,`\\hookrightarrow`,!0),U(W,K,J,`↘`,`\\searrow`,!0),U(W,K,J,`↼`,`\\leftharpoonup`,!0),U(W,K,J,`⇀`,`\\rightharpoonup`,!0),U(W,K,J,`↙`,`\\swarrow`,!0),U(W,K,J,`↽`,`\\leftharpoondown`,!0),U(W,K,J,`⇁`,`\\rightharpoondown`,!0),U(W,K,J,`↖`,`\\nwarrow`,!0),U(W,K,J,`⇌`,`\\rightleftharpoons`,!0),U(W,q,J,`≮`,`\\nless`,!0),U(W,q,J,``,`\\@nleqslant`),U(W,q,J,``,`\\@nleqq`),U(W,q,J,`⪇`,`\\lneq`,!0),U(W,q,J,`≨`,`\\lneqq`,!0),U(W,q,J,``,`\\@lvertneqq`),U(W,q,J,`⋦`,`\\lnsim`,!0),U(W,q,J,`⪉`,`\\lnapprox`,!0),U(W,q,J,`⊀`,`\\nprec`,!0),U(W,q,J,`⋠`,`\\npreceq`,!0),U(W,q,J,`⋨`,`\\precnsim`,!0),U(W,q,J,`⪹`,`\\precnapprox`,!0),U(W,q,J,`≁`,`\\nsim`,!0),U(W,q,J,``,`\\@nshortmid`),U(W,q,J,`∤`,`\\nmid`,!0),U(W,q,J,`⊬`,`\\nvdash`,!0),U(W,q,J,`⊭`,`\\nvDash`,!0),U(W,q,J,`⋪`,`\\ntriangleleft`),U(W,q,J,`⋬`,`\\ntrianglelefteq`,!0),U(W,q,J,`⊊`,`\\subsetneq`,!0),U(W,q,J,``,`\\@varsubsetneq`),U(W,q,J,`⫋`,`\\subsetneqq`,!0),U(W,q,J,``,`\\@varsubsetneqq`),U(W,q,J,`≯`,`\\ngtr`,!0),U(W,q,J,``,`\\@ngeqslant`),U(W,q,J,``,`\\@ngeqq`),U(W,q,J,`⪈`,`\\gneq`,!0),U(W,q,J,`≩`,`\\gneqq`,!0),U(W,q,J,``,`\\@gvertneqq`),U(W,q,J,`⋧`,`\\gnsim`,!0),U(W,q,J,`⪊`,`\\gnapprox`,!0),U(W,q,J,`⊁`,`\\nsucc`,!0),U(W,q,J,`⋡`,`\\nsucceq`,!0),U(W,q,J,`⋩`,`\\succnsim`,!0),U(W,q,J,`⪺`,`\\succnapprox`,!0),U(W,q,J,`≆`,`\\ncong`,!0),U(W,q,J,``,`\\@nshortparallel`),U(W,q,J,`∦`,`\\nparallel`,!0),U(W,q,J,`⊯`,`\\nVDash`,!0),U(W,q,J,`⋫`,`\\ntriangleright`),U(W,q,J,`⋭`,`\\ntrianglerighteq`,!0),U(W,q,J,``,`\\@nsupseteqq`),U(W,q,J,`⊋`,`\\supsetneq`,!0),U(W,q,J,``,`\\@varsupsetneq`),U(W,q,J,`⫌`,`\\supsetneqq`,!0),U(W,q,J,``,`\\@varsupsetneqq`),U(W,q,J,`⊮`,`\\nVdash`,!0),U(W,q,J,`⪵`,`\\precneqq`,!0),U(W,q,J,`⪶`,`\\succneqq`,!0),U(W,q,J,``,`\\@nsubseteqq`),U(W,q,VK,`⊴`,`\\unlhd`),U(W,q,VK,`⊵`,`\\unrhd`),U(W,q,J,`↚`,`\\nleftarrow`,!0),U(W,q,J,`↛`,`\\nrightarrow`,!0),U(W,q,J,`⇍`,`\\nLeftarrow`,!0),U(W,q,J,`⇏`,`\\nRightarrow`,!0),U(W,q,J,`↮`,`\\nleftrightarrow`,!0),U(W,q,J,`⇎`,`\\nLeftrightarrow`,!0),U(W,q,J,`△`,`\\vartriangle`),U(W,q,Y,`ℏ`,`\\hslash`),U(W,q,Y,`▽`,`\\triangledown`),U(W,q,Y,`◊`,`\\lozenge`),U(W,q,Y,`Ⓢ`,`\\circledS`),U(W,q,Y,`®`,`\\circledR`),U(G,q,Y,`®`,`\\circledR`),U(W,q,Y,`∡`,`\\measuredangle`,!0),U(W,q,Y,`∄`,`\\nexists`),U(W,q,Y,`℧`,`\\mho`),U(W,q,Y,`Ⅎ`,`\\Finv`,!0),U(W,q,Y,`⅁`,`\\Game`,!0),U(W,q,Y,`‵`,`\\backprime`),U(W,q,Y,`▲`,`\\blacktriangle`),U(W,q,Y,`▼`,`\\blacktriangledown`),U(W,q,Y,`■`,`\\blacksquare`),U(W,q,Y,`⧫`,`\\blacklozenge`),U(W,q,Y,`★`,`\\bigstar`),U(W,q,Y,`∢`,`\\sphericalangle`,!0),U(W,q,Y,`∁`,`\\complement`,!0),U(W,q,Y,`ð`,`\\eth`,!0),U(G,K,Y,`ð`,`ð`),U(W,q,Y,`╱`,`\\diagup`),U(W,q,Y,`╲`,`\\diagdown`),U(W,q,Y,`□`,`\\square`),U(W,q,Y,`□`,`\\Box`),U(W,q,Y,`◊`,`\\Diamond`),U(W,q,Y,`¥`,`\\yen`,!0),U(G,q,Y,`¥`,`\\yen`,!0),U(W,q,Y,`✓`,`\\checkmark`,!0),U(G,q,Y,`✓`,`\\checkmark`),U(W,q,Y,`ℶ`,`\\beth`,!0),U(W,q,Y,`ℸ`,`\\daleth`,!0),U(W,q,Y,`ℷ`,`\\gimel`,!0),U(W,q,Y,`ϝ`,`\\digamma`,!0),U(W,q,Y,`ϰ`,`\\varkappa`),U(W,q,KK,`┌`,`\\@ulcorner`,!0),U(W,q,HK,`┐`,`\\@urcorner`,!0),U(W,q,KK,`└`,`\\@llcorner`,!0),U(W,q,HK,`┘`,`\\@lrcorner`,!0),U(W,q,J,`≦`,`\\leqq`,!0),U(W,q,J,`⩽`,`\\leqslant`,!0),U(W,q,J,`⪕`,`\\eqslantless`,!0),U(W,q,J,`≲`,`\\lesssim`,!0),U(W,q,J,`⪅`,`\\lessapprox`,!0),U(W,q,J,`≊`,`\\approxeq`,!0),U(W,q,VK,`⋖`,`\\lessdot`),U(W,q,J,`⋘`,`\\lll`,!0),U(W,q,J,`≶`,`\\lessgtr`,!0),U(W,q,J,`⋚`,`\\lesseqgtr`,!0),U(W,q,J,`⪋`,`\\lesseqqgtr`,!0),U(W,q,J,`≑`,`\\doteqdot`),U(W,q,J,`≓`,`\\risingdotseq`,!0),U(W,q,J,`≒`,`\\fallingdotseq`,!0),U(W,q,J,`∽`,`\\backsim`,!0),U(W,q,J,`⋍`,`\\backsimeq`,!0),U(W,q,J,`⫅`,`\\subseteqq`,!0),U(W,q,J,`⋐`,`\\Subset`,!0),U(W,q,J,`⊏`,`\\sqsubset`,!0),U(W,q,J,`≼`,`\\preccurlyeq`,!0),U(W,q,J,`⋞`,`\\curlyeqprec`,!0),U(W,q,J,`≾`,`\\precsim`,!0),U(W,q,J,`⪷`,`\\precapprox`,!0),U(W,q,J,`⊲`,`\\vartriangleleft`),U(W,q,J,`⊴`,`\\trianglelefteq`),U(W,q,J,`⊨`,`\\vDash`,!0),U(W,q,J,`⊪`,`\\Vvdash`,!0),U(W,q,J,`⌣`,`\\smallsmile`),U(W,q,J,`⌢`,`\\smallfrown`),U(W,q,J,`≏`,`\\bumpeq`,!0),U(W,q,J,`≎`,`\\Bumpeq`,!0),U(W,q,J,`≧`,`\\geqq`,!0),U(W,q,J,`⩾`,`\\geqslant`,!0),U(W,q,J,`⪖`,`\\eqslantgtr`,!0),U(W,q,J,`≳`,`\\gtrsim`,!0),U(W,q,J,`⪆`,`\\gtrapprox`,!0),U(W,q,VK,`⋗`,`\\gtrdot`),U(W,q,J,`⋙`,`\\ggg`,!0),U(W,q,J,`≷`,`\\gtrless`,!0),U(W,q,J,`⋛`,`\\gtreqless`,!0),U(W,q,J,`⪌`,`\\gtreqqless`,!0),U(W,q,J,`≖`,`\\eqcirc`,!0),U(W,q,J,`≗`,`\\circeq`,!0),U(W,q,J,`≜`,`\\triangleq`,!0),U(W,q,J,`∼`,`\\thicksim`),U(W,q,J,`≈`,`\\thickapprox`),U(W,q,J,`⫆`,`\\supseteqq`,!0),U(W,q,J,`⋑`,`\\Supset`,!0),U(W,q,J,`⊐`,`\\sqsupset`,!0),U(W,q,J,`≽`,`\\succcurlyeq`,!0),U(W,q,J,`⋟`,`\\curlyeqsucc`,!0),U(W,q,J,`≿`,`\\succsim`,!0),U(W,q,J,`⪸`,`\\succapprox`,!0),U(W,q,J,`⊳`,`\\vartriangleright`),U(W,q,J,`⊵`,`\\trianglerighteq`),U(W,q,J,`⊩`,`\\Vdash`,!0),U(W,q,J,`∣`,`\\shortmid`),U(W,q,J,`∥`,`\\shortparallel`),U(W,q,J,`≬`,`\\between`,!0),U(W,q,J,`⋔`,`\\pitchfork`,!0),U(W,q,J,`∝`,`\\varpropto`),U(W,q,J,`◀`,`\\blacktriangleleft`),U(W,q,J,`∴`,`\\therefore`,!0),U(W,q,J,`∍`,`\\backepsilon`),U(W,q,J,`▶`,`\\blacktriangleright`),U(W,q,J,`∵`,`\\because`,!0),U(W,q,J,`⋘`,`\\llless`),U(W,q,J,`⋙`,`\\gggtr`),U(W,q,VK,`⊲`,`\\lhd`),U(W,q,VK,`⊳`,`\\rhd`),U(W,q,J,`≂`,`\\eqsim`,!0),U(W,K,J,`⋈`,`\\Join`),U(W,q,J,`≑`,`\\Doteq`,!0),U(W,q,VK,`∔`,`\\dotplus`,!0),U(W,q,VK,`∖`,`\\smallsetminus`),U(W,q,VK,`⋒`,`\\Cap`,!0),U(W,q,VK,`⋓`,`\\Cup`,!0),U(W,q,VK,`⩞`,`\\doublebarwedge`,!0),U(W,q,VK,`⊟`,`\\boxminus`,!0),U(W,q,VK,`⊞`,`\\boxplus`,!0),U(W,q,VK,`⋇`,`\\divideontimes`,!0),U(W,q,VK,`⋉`,`\\ltimes`,!0),U(W,q,VK,`⋊`,`\\rtimes`,!0),U(W,q,VK,`⋋`,`\\leftthreetimes`,!0),U(W,q,VK,`⋌`,`\\rightthreetimes`,!0),U(W,q,VK,`⋏`,`\\curlywedge`,!0),U(W,q,VK,`⋎`,`\\curlyvee`,!0),U(W,q,VK,`⊝`,`\\circleddash`,!0),U(W,q,VK,`⊛`,`\\circledast`,!0),U(W,q,VK,`⋅`,`\\centerdot`),U(W,q,VK,`⊺`,`\\intercal`,!0),U(W,q,VK,`⋒`,`\\doublecap`),U(W,q,VK,`⋓`,`\\doublecup`),U(W,q,VK,`⊠`,`\\boxtimes`,!0),U(W,q,J,`⇢`,`\\dashrightarrow`,!0),U(W,q,J,`⇠`,`\\dashleftarrow`,!0),U(W,q,J,`⇇`,`\\leftleftarrows`,!0),U(W,q,J,`⇆`,`\\leftrightarrows`,!0),U(W,q,J,`⇚`,`\\Lleftarrow`,!0),U(W,q,J,`↞`,`\\twoheadleftarrow`,!0),U(W,q,J,`↢`,`\\leftarrowtail`,!0),U(W,q,J,`↫`,`\\looparrowleft`,!0),U(W,q,J,`⇋`,`\\leftrightharpoons`,!0),U(W,q,J,`↶`,`\\curvearrowleft`,!0),U(W,q,J,`↺`,`\\circlearrowleft`,!0),U(W,q,J,`↰`,`\\Lsh`,!0),U(W,q,J,`⇈`,`\\upuparrows`,!0),U(W,q,J,`↿`,`\\upharpoonleft`,!0),U(W,q,J,`⇃`,`\\downharpoonleft`,!0),U(W,K,J,`⊶`,`\\origof`,!0),U(W,K,J,`⊷`,`\\imageof`,!0),U(W,q,J,`⊸`,`\\multimap`,!0),U(W,q,J,`↭`,`\\leftrightsquigarrow`,!0),U(W,q,J,`⇉`,`\\rightrightarrows`,!0),U(W,q,J,`⇄`,`\\rightleftarrows`,!0),U(W,q,J,`↠`,`\\twoheadrightarrow`,!0),U(W,q,J,`↣`,`\\rightarrowtail`,!0),U(W,q,J,`↬`,`\\looparrowright`,!0),U(W,q,J,`↷`,`\\curvearrowright`,!0),U(W,q,J,`↻`,`\\circlearrowright`,!0),U(W,q,J,`↱`,`\\Rsh`,!0),U(W,q,J,`⇊`,`\\downdownarrows`,!0),U(W,q,J,`↾`,`\\upharpoonright`,!0),U(W,q,J,`⇂`,`\\downharpoonright`,!0),U(W,q,J,`⇝`,`\\rightsquigarrow`,!0),U(W,q,J,`⇝`,`\\leadsto`),U(W,q,J,`⇛`,`\\Rrightarrow`,!0),U(W,q,J,`↾`,`\\restriction`),U(W,K,Y,`‘`,"`"),U(W,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\textdollar`),U(W,K,Y,`%`,`\\%`),U(G,K,Y,`%`,`\\%`),U(W,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\textunderscore`),U(W,K,Y,`∠`,`\\angle`,!0),U(W,K,Y,`∞`,`\\infty`,!0),U(W,K,Y,`′`,`\\prime`),U(W,K,Y,`△`,`\\triangle`),U(W,K,Y,`Γ`,`\\Gamma`,!0),U(W,K,Y,`Δ`,`\\Delta`,!0),U(W,K,Y,`Θ`,`\\Theta`,!0),U(W,K,Y,`Λ`,`\\Lambda`,!0),U(W,K,Y,`Ξ`,`\\Xi`,!0),U(W,K,Y,`Π`,`\\Pi`,!0),U(W,K,Y,`Σ`,`\\Sigma`,!0),U(W,K,Y,`Υ`,`\\Upsilon`,!0),U(W,K,Y,`Φ`,`\\Phi`,!0),U(W,K,Y,`Ψ`,`\\Psi`,!0),U(W,K,Y,`Ω`,`\\Omega`,!0),U(W,K,Y,`A`,`Α`),U(W,K,Y,`B`,`Β`),U(W,K,Y,`E`,`Ε`),U(W,K,Y,`Z`,`Ζ`),U(W,K,Y,`H`,`Η`),U(W,K,Y,`I`,`Ι`),U(W,K,Y,`K`,`Κ`),U(W,K,Y,`M`,`Μ`),U(W,K,Y,`N`,`Ν`),U(W,K,Y,`O`,`Ο`),U(W,K,Y,`P`,`Ρ`),U(W,K,Y,`T`,`Τ`),U(W,K,Y,`X`,`Χ`),U(W,K,Y,`¬`,`\\neg`,!0),U(W,K,Y,`¬`,`\\lnot`),U(W,K,Y,`⊤`,`\\top`),U(W,K,Y,`⊥`,`\\bot`),U(W,K,Y,`∅`,`\\emptyset`),U(W,q,Y,`∅`,`\\varnothing`),U(W,K,WK,`α`,`\\alpha`,!0),U(W,K,WK,`β`,`\\beta`,!0),U(W,K,WK,`γ`,`\\gamma`,!0),U(W,K,WK,`δ`,`\\delta`,!0),U(W,K,WK,`ϵ`,`\\epsilon`,!0),U(W,K,WK,`ζ`,`\\zeta`,!0),U(W,K,WK,`η`,`\\eta`,!0),U(W,K,WK,`θ`,`\\theta`,!0),U(W,K,WK,`ι`,`\\iota`,!0),U(W,K,WK,`κ`,`\\kappa`,!0),U(W,K,WK,`λ`,`\\lambda`,!0),U(W,K,WK,`μ`,`\\mu`,!0),U(W,K,WK,`ν`,`\\nu`,!0),U(W,K,WK,`ξ`,`\\xi`,!0),U(W,K,WK,`ο`,`\\omicron`,!0),U(W,K,WK,`π`,`\\pi`,!0),U(W,K,WK,`ρ`,`\\rho`,!0),U(W,K,WK,`σ`,`\\sigma`,!0),U(W,K,WK,`τ`,`\\tau`,!0),U(W,K,WK,`υ`,`\\upsilon`,!0),U(W,K,WK,`ϕ`,`\\phi`,!0),U(W,K,WK,`χ`,`\\chi`,!0),U(W,K,WK,`ψ`,`\\psi`,!0),U(W,K,WK,`ω`,`\\omega`,!0),U(W,K,WK,`ε`,`\\varepsilon`,!0),U(W,K,WK,`ϑ`,`\\vartheta`,!0),U(W,K,WK,`ϖ`,`\\varpi`,!0),U(W,K,WK,`ϱ`,`\\varrho`,!0),U(W,K,WK,`ς`,`\\varsigma`,!0),U(W,K,WK,`φ`,`\\varphi`,!0),U(W,K,VK,`∗`,`*`,!0),U(W,K,VK,`+`,`+`),U(W,K,VK,`−`,`-`,!0),U(W,K,VK,`⋅`,`\\cdot`,!0),U(W,K,VK,`∘`,`\\circ`,!0),U(W,K,VK,`÷`,`\\div`,!0),U(W,K,VK,`±`,`\\pm`,!0),U(W,K,VK,`×`,`\\times`,!0),U(W,K,VK,`∩`,`\\cap`,!0),U(W,K,VK,`∪`,`\\cup`,!0),U(W,K,VK,`∖`,`\\setminus`,!0),U(W,K,VK,`∧`,`\\land`),U(W,K,VK,`∨`,`\\lor`),U(W,K,VK,`∧`,`\\wedge`,!0),U(W,K,VK,`∨`,`\\vee`,!0),U(W,K,Y,`√`,`\\surd`),U(W,K,KK,`⟨`,`\\langle`,!0),U(W,K,KK,`∣`,`\\lvert`),U(W,K,KK,`∥`,`\\lVert`),U(W,K,HK,`?`,`?`),U(W,K,HK,`!`,`!`),U(W,K,HK,`⟩`,`\\rangle`,!0),U(W,K,HK,`∣`,`\\rvert`),U(W,K,HK,`∥`,`\\rVert`),U(W,K,J,`=`,`=`),U(W,K,J,`:`,`:`),U(W,K,J,`≈`,`\\approx`,!0),U(W,K,J,`≅`,`\\cong`,!0),U(W,K,J,`≥`,`\\ge`),U(W,K,J,`≥`,`\\geq`,!0),U(W,K,J,`←`,`\\gets`),U(W,K,J,`>`,`\\gt`,!0),U(W,K,J,`∈`,`\\in`,!0),U(W,K,J,``,`\\@not`),U(W,K,J,`⊂`,`\\subset`,!0),U(W,K,J,`⊃`,`\\supset`,!0),U(W,K,J,`⊆`,`\\subseteq`,!0),U(W,K,J,`⊇`,`\\supseteq`,!0),U(W,q,J,`⊈`,`\\nsubseteq`,!0),U(W,q,J,`⊉`,`\\nsupseteq`,!0),U(W,K,J,`⊨`,`\\models`),U(W,K,J,`←`,`\\leftarrow`,!0),U(W,K,J,`≤`,`\\le`),U(W,K,J,`≤`,`\\leq`,!0),U(W,K,J,`<`,`\\lt`,!0),U(W,K,J,`→`,`\\rightarrow`,!0),U(W,K,J,`→`,`\\to`),U(W,q,J,`≱`,`\\ngeq`,!0),U(W,q,J,`≰`,`\\nleq`,!0),U(W,K,JK,`\xA0`,`\\ `),U(W,K,JK,`\xA0`,`\\space`),U(W,K,JK,`\xA0`,`\\nobreakspace`),U(G,K,JK,`\xA0`,`\\ `),U(G,K,JK,`\xA0`,` `),U(G,K,JK,`\xA0`,`\\space`),U(G,K,JK,`\xA0`,`\\nobreakspace`),U(W,K,JK,``,`\\nobreak`),U(W,K,JK,``,`\\allowbreak`),U(W,K,qK,`,`,`,`),U(W,K,qK,`;`,`;`),U(W,q,VK,`⊼`,`\\barwedge`,!0),U(W,q,VK,`⊻`,`\\veebar`,!0),U(W,K,VK,`⊙`,`\\odot`,!0),U(W,K,VK,`⊕`,`\\oplus`,!0),U(W,K,VK,`⊗`,`\\otimes`,!0),U(W,K,Y,`∂`,`\\partial`,!0),U(W,K,VK,`⊘`,`\\oslash`,!0),U(W,q,VK,`⊚`,`\\circledcirc`,!0),U(W,q,VK,`⊡`,`\\boxdot`,!0),U(W,K,VK,`△`,`\\bigtriangleup`),U(W,K,VK,`▽`,`\\bigtriangledown`),U(W,K,VK,`†`,`\\dagger`),U(W,K,VK,`⋄`,`\\diamond`),U(W,K,VK,`⋆`,`\\star`),U(W,K,VK,`◃`,`\\triangleleft`),U(W,K,VK,`▹`,`\\triangleright`),U(W,K,KK,`{`,`\\{`),U(G,K,Y,`{`,`\\{`),U(G,K,Y,`{`,`\\textbraceleft`),U(W,K,HK,`}`,`\\}`),U(G,K,Y,`}`,`\\}`),U(G,K,Y,`}`,`\\textbraceright`),U(W,K,KK,`{`,`\\lbrace`),U(W,K,HK,`}`,`\\rbrace`),U(W,K,KK,`[`,`\\lbrack`,!0),U(G,K,Y,`[`,`\\lbrack`,!0),U(W,K,HK,`]`,`\\rbrack`,!0),U(G,K,Y,`]`,`\\rbrack`,!0),U(W,K,KK,`(`,`\\lparen`,!0),U(W,K,HK,`)`,`\\rparen`,!0),U(G,K,Y,`<`,`\\textless`,!0),U(G,K,Y,`>`,`\\textgreater`,!0),U(W,K,KK,`⌊`,`\\lfloor`,!0),U(W,K,HK,`⌋`,`\\rfloor`,!0),U(W,K,KK,`⌈`,`\\lceil`,!0),U(W,K,HK,`⌉`,`\\rceil`,!0),U(W,K,Y,`\\`,`\\backslash`),U(W,K,Y,`∣`,`|`),U(W,K,Y,`∣`,`\\vert`),U(G,K,Y,`|`,`\\textbar`,!0),U(W,K,Y,`∥`,`\\|`),U(W,K,Y,`∥`,`\\Vert`),U(G,K,Y,`∥`,`\\textbardbl`),U(G,K,Y,`~`,`\\textasciitilde`),U(G,K,Y,`\\`,`\\textbackslash`),U(G,K,Y,`^`,`\\textasciicircum`),U(W,K,J,`↑`,`\\uparrow`,!0),U(W,K,J,`⇑`,`\\Uparrow`,!0),U(W,K,J,`↓`,`\\downarrow`,!0),U(W,K,J,`⇓`,`\\Downarrow`,!0),U(W,K,J,`↕`,`\\updownarrow`,!0),U(W,K,J,`⇕`,`\\Updownarrow`,!0),U(W,K,GK,`∐`,`\\coprod`),U(W,K,GK,`⋁`,`\\bigvee`),U(W,K,GK,`⋀`,`\\bigwedge`),U(W,K,GK,`⨄`,`\\biguplus`),U(W,K,GK,`⋂`,`\\bigcap`),U(W,K,GK,`⋃`,`\\bigcup`),U(W,K,GK,`∫`,`\\int`),U(W,K,GK,`∫`,`\\intop`),U(W,K,GK,`∬`,`\\iint`),U(W,K,GK,`∭`,`\\iiint`),U(W,K,GK,`∏`,`\\prod`),U(W,K,GK,`∑`,`\\sum`),U(W,K,GK,`⨂`,`\\bigotimes`),U(W,K,GK,`⨁`,`\\bigoplus`),U(W,K,GK,`⨀`,`\\bigodot`),U(W,K,GK,`∮`,`\\oint`),U(W,K,GK,`∯`,`\\oiint`),U(W,K,GK,`∰`,`\\oiiint`),U(W,K,GK,`⨆`,`\\bigsqcup`),U(W,K,GK,`∫`,`\\smallint`),U(G,K,UK,`…`,`\\textellipsis`),U(W,K,UK,`…`,`\\mathellipsis`),U(G,K,UK,`…`,`\\ldots`,!0),U(W,K,UK,`…`,`\\ldots`,!0),U(W,K,UK,`⋯`,`\\@cdots`,!0),U(W,K,UK,`⋱`,`\\ddots`,!0),U(W,K,Y,`⋮`,`\\varvdots`),U(G,K,Y,`⋮`,`\\varvdots`),U(W,K,BK,`ˊ`,`\\acute`),U(W,K,BK,`ˋ`,`\\grave`),U(W,K,BK,`¨`,`\\ddot`),U(W,K,BK,`~`,`\\tilde`),U(W,K,BK,`ˉ`,`\\bar`),U(W,K,BK,`˘`,`\\breve`),U(W,K,BK,`ˇ`,`\\check`),U(W,K,BK,`^`,`\\hat`),U(W,K,BK,`⃗`,`\\vec`),U(W,K,BK,`˙`,`\\dot`),U(W,K,BK,`˚`,`\\mathring`),U(W,K,WK,``,`\\@imath`),U(W,K,WK,``,`\\@jmath`),U(W,K,Y,`ı`,`ı`),U(W,K,Y,`ȷ`,`ȷ`),U(G,K,Y,`ı`,`\\i`,!0),U(G,K,Y,`ȷ`,`\\j`,!0),U(G,K,Y,`ß`,`\\ss`,!0),U(G,K,Y,`æ`,`\\ae`,!0),U(G,K,Y,`œ`,`\\oe`,!0),U(G,K,Y,`ø`,`\\o`,!0),U(G,K,Y,`Æ`,`\\AE`,!0),U(G,K,Y,`Œ`,`\\OE`,!0),U(G,K,Y,`Ø`,`\\O`,!0),U(G,K,BK,`ˊ`,`\\'`),U(G,K,BK,`ˋ`,"\\`"),U(G,K,BK,`ˆ`,`\\^`),U(G,K,BK,`˜`,`\\~`),U(G,K,BK,`ˉ`,`\\=`),U(G,K,BK,`˘`,`\\u`),U(G,K,BK,`˙`,`\\.`),U(G,K,BK,`¸`,`\\c`),U(G,K,BK,`˚`,`\\r`),U(G,K,BK,`ˇ`,`\\v`),U(G,K,BK,`¨`,`\\"`),U(G,K,BK,`˝`,`\\H`),U(G,K,BK,`◯`,`\\textcircled`);var YK={"--":!0,"---":!0,"``":!0,"''":!0};U(G,K,Y,`–`,`--`,!0),U(G,K,Y,`–`,`\\textendash`),U(G,K,Y,`—`,`---`,!0),U(G,K,Y,`—`,`\\textemdash`),U(G,K,Y,`‘`,"`",!0),U(G,K,Y,`‘`,`\\textquoteleft`),U(G,K,Y,`’`,`'`,!0),U(G,K,Y,`’`,`\\textquoteright`),U(G,K,Y,`“`,"``",!0),U(G,K,Y,`“`,`\\textquotedblleft`),U(G,K,Y,`”`,`''`,!0),U(G,K,Y,`”`,`\\textquotedblright`),U(W,K,Y,`°`,`\\degree`,!0),U(G,K,Y,`°`,`\\degree`),U(G,K,Y,`°`,`\\textdegree`,!0),U(W,K,Y,`£`,`\\pounds`),U(W,K,Y,`£`,`\\mathsterling`,!0),U(G,K,Y,`£`,`\\pounds`),U(G,K,Y,`£`,`\\textsterling`,!0),U(W,q,Y,`✠`,`\\maltese`),U(G,q,Y,`✠`,`\\maltese`);for(var XK=`0123456789/@."`,ZK=0;ZK<XK.length;ZK++){var QK=XK.charAt(ZK);U(W,K,Y,QK,QK)}for(var $K=`0123456789!@*()-=+";:?/.,`,eq=0;eq<$K.length;eq++){var tq=$K.charAt(eq);U(G,K,Y,tq,tq)}for(var nq=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,rq=0;rq<nq.length;rq++){var iq=nq.charAt(rq);U(W,K,WK,iq,iq),U(G,K,Y,iq,iq)}U(W,q,Y,`C`,`ℂ`),U(G,q,Y,`C`,`ℂ`),U(W,q,Y,`H`,`ℍ`),U(G,q,Y,`H`,`ℍ`),U(W,q,Y,`N`,`ℕ`),U(G,q,Y,`N`,`ℕ`),U(W,q,Y,`P`,`ℙ`),U(G,q,Y,`P`,`ℙ`),U(W,q,Y,`Q`,`ℚ`),U(G,q,Y,`Q`,`ℚ`),U(W,q,Y,`R`,`ℝ`),U(G,q,Y,`R`,`ℝ`),U(W,q,Y,`Z`,`ℤ`),U(G,q,Y,`Z`,`ℤ`),U(W,K,WK,`h`,`ℎ`),U(G,K,WK,`h`,`ℎ`);for(var aq,oq=0;oq<nq.length;oq++){var sq=nq.charAt(oq);aq=String.fromCharCode(55349,56320+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56372+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56424+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56580+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56684+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56736+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56788+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56840+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56944+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),oq<26&&(aq=String.fromCharCode(55349,56632+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq),aq=String.fromCharCode(55349,56476+oq),U(W,K,WK,sq,aq),U(G,K,Y,sq,aq))}aq=String.fromCharCode(55349,56668),U(W,K,WK,`k`,aq),U(G,K,Y,`k`,aq);for(var cq=0;cq<10;cq++){var lq=cq.toString();aq=String.fromCharCode(55349,57294+cq),U(W,K,WK,lq,aq),U(G,K,Y,lq,aq),aq=String.fromCharCode(55349,57314+cq),U(W,K,WK,lq,aq),U(G,K,Y,lq,aq),aq=String.fromCharCode(55349,57324+cq),U(W,K,WK,lq,aq),U(G,K,Y,lq,aq),aq=String.fromCharCode(55349,57334+cq),U(W,K,WK,lq,aq),U(G,K,Y,lq,aq)}for(var uq=`ÐÞþ`,dq=0;dq<uq.length;dq++){var fq=uq.charAt(dq);U(W,K,WK,fq,fq),U(G,K,Y,fq,fq)}var pq={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},mq={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},hq={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},gq={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},_q={mathClass:``,textClass:``,font:``},vq={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},yq={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},bq={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},xq={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},Sq={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},Cq={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},wq={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},Tq=[pq,pq,mq,mq,hq,hq,gq,_q,_q,_q,vq,vq,yq,yq,bq,bq,xq,xq,Sq,Sq,Cq,Cq,_q,_q,wq,wq],Eq=[pq,_q,xq,Sq,wq],Dq=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return Tq[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return Eq[Math.floor((r-120782)/10)];if(r===120485||r===120486)return Tq[0];if(120486<r&&r<120782)return _q;throw new V(`Unsupported character: `+e)};function Oq(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 V(`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 kq=function(e,t,n){if(zK[n][e]){var r=zK[n][e].replace;r&&(e=r)}return{value:e,metrics:IK(e,t,n)}},Aq=function(e,t,n,r,i){var a=kq(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 TK(e,o.height,o.depth,c,o.skew,o.width,i)}else Oq({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new TK(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},jq=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&kq(e,`Main-Bold`,t).metrics?Aq(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||zK[t][e].font===`main`?Aq(e,`Main-Regular`,t,n,r):Aq(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},Mq=function(e,t,n){return n!==`textord`&&kq(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},Nq=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=Dq(i);f=m.font,p=m[r+`Class`]}if(f)return Aq(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=Mq(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=Kq[o].fontName,g=[o]):(h=Gq(s,c,l),g=[s,c,l]);if(kq(i,h,r).metrics)return Aq(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(YK,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(Aq(i[y],h,r,t,a.concat(g)));return Bq(v)}}if(n===`mathord`)return Aq(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=zK[r][i]&&zK[r][i].font;if(b===`ams`)return Aq(i,Gq(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return Aq(i,Gq(`textrm`,c,l),r,t,a.concat(c,l));var x=Gq(b,c,l);return Aq(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},Pq=(e,t)=>{if(hK(e.classes)!==hK(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},Fq=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof TK&&r instanceof TK&&Pq(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},Iq=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 xK(e,t,n,r);return Iq(i),i},Lq=(e,t,n,r)=>new xK(e,t,n,r),Rq=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=H(r.height),r.maxFontSize=1,r},zq=function(e,t,n,r){var i=new SK(e,t,n,r);return Iq(i),i},Bq=function(e){var t=new uK(e);return Iq(t),t},Vq=function(e,t){return e instanceof uK?X([],[e],t):e},Hq=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}},Uq=function(e,t){for(var n=Hq(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=H(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=H(-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=H(f);var x;if(d<0){var S=X([`vlist`],[X([],[])]);S.style.height=H(-d),x=[X([`vlist-r`],[b,X([`vlist-s`],[new TK(``)])]),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},Wq=(e,t)=>{var n=X([`mspace`],[],t),r=mK(e,t);return n.style.marginRight=H(r),n},Gq=(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},Kq={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`}},qq={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},Jq=function(e,t){var n=qq[e],r=n[0],i=n[1],a=n[2],o=Lq([`katex-overlay`],[new EK([new DK(r)],{width:H(i),height:H(a),style:`width:`+H(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=H(a),o.style.width=H(i),o},Yq={number:3,unit:`mu`},Xq={number:4,unit:`mu`},Zq={number:5,unit:`mu`},Qq={mord:{mop:Yq,mbin:Xq,mrel:Zq,minner:Yq},mop:{mord:Yq,mop:Yq,mrel:Zq,minner:Yq},mbin:{mord:Xq,mop:Xq,mopen:Xq,minner:Xq},mrel:{mord:Zq,mop:Zq,mopen:Zq,minner:Zq},mopen:{},mclose:{mop:Yq,mbin:Xq,mrel:Zq,minner:Yq},mpunct:{mord:Yq,mop:Yq,mrel:Zq,mopen:Yq,mclose:Yq,mpunct:Yq,minner:Yq},minner:{mord:Yq,mop:Yq,mbin:Xq,mrel:Zq,mopen:Yq,mpunct:Yq,minner:Yq}},$q={mord:{mop:Yq},mop:{mord:Yq,mop:Yq},mbin:{},mrel:{},mopen:{},mclose:{mop:Yq},mpunct:{},minner:{mop:Yq}},eJ={},tJ={},nJ={};function Z(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)eJ[n[a]]=e;t&&(r&&(tJ[t]=r),i&&(nJ[t]=i))}function rJ(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(tJ[t]=n),r&&(nJ[t]=r)}var iJ=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},aJ=function(e){return e.type===`ordgroup`?e.body:[e]},oJ=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),sJ=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),cJ={display:GG.DISPLAY,text:GG.TEXT,script:GG.SCRIPT,scriptscript:GG.SCRIPTSCRIPT},lJ={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},uJ=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=gJ(e[a],t);if(o instanceof uK){var s=o.children;i.push(...s)}else i.push(o)}if(Fq(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(cJ[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return dJ(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&sJ.has(r)?t.classes[0]=`mord`:r===`mbin`&&oJ.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),dJ(i,(e,t)=>{var n=mJ(t),r=mJ(e),i=n&&r?e.hasClass(`mtight`)?$q[n]?.[r]:Qq[n]?.[r]:null;if(i)return Wq(i,c)},{node:u},d,f),i},dJ=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=fJ(o);if(s)dJ(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()},fJ=function(e){return e instanceof uK||e instanceof SK||e instanceof xK&&e.hasClass(`enclosing`)?e:null},pJ=function(e,t){var n=fJ(e);if(n){var r=n.children;if(r.length){if(t===`right`)return pJ(r[r.length-1],`right`);if(t===`left`)return pJ(r[0],`left`)}}return e},mJ=function(e,t){return e?(t&&(e=pJ(e,t)),lJ[e.classes[0]]||null):null},hJ=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},gJ=function(e,t,n){if(!e)return X();if(tJ[e.type]){var r=tJ[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 V(`Got group of unknown type: '`+e.type+`'`)};function _J(e,t){var n=X([`katex-base`],e,t),r=X([`katex-strut`]);return r.style.height=H(n.height+n.depth),n.depth&&(r.style.verticalAlign=H(-n.depth)),n.children.unshift(r),n}function vJ(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=uJ(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(_J(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(_J(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(_J(o,t));var l;n?(l=_J(uJ(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=H(u.height+u.depth),u.depth&&(d.style.verticalAlign=H(-u.depth))}return u}function yJ(e){return new uK(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=hK(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof bJ&&this.children[i+1]instanceof bJ){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof bJ;)a+=this.children[++i].toText();e.appendChild(new bJ(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+=yG(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+yG(hK(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(``)}},bJ=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return yG(this.toText())}toText(){return this.text}},xJ=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`,H(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+H(this.width)+`"/>`}toText(){return this.character?this.character:` `}},SJ=new Set([`\\imath`,`\\jmath`]),CJ=new Set([`mrow`,`mtable`]),wJ=function(e,t,n){var r,i;return zK[t][e]&&zK[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(YK,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=zK[t][e].replace),new bJ(e)},TJ=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},EJ={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`},DJ=(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=EJ[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(SJ.has(a))return null;if(zK[r][a]){var o=zK[r][a].replace;o&&(a=o)}var s=Kq[n].fontName;return IK(a,s,r)?Kq[n].variant:null};function OJ(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof bJ&&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 bJ&&n.text===`,`}return!1}var kJ=function(e,t,n){if(e.length===1){var r=jJ(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=jJ(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`||OJ(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&OJ(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||OJ(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 bJ&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof bJ&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},AJ=function(e,t,n){return TJ(kJ(e,t,n))},jJ=function(e,t){if(!e)return new Q(`mrow`);if(nJ[e.type])return nJ[e.type](e,t);throw new V(`Got group of unknown type: '`+e.type+`'`)};function MJ(e,t,n,r,i){var a=kJ(e,n),o=a.length===1&&a[0]instanceof Q&&CJ.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new bJ(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 NJ=[[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]],PJ=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],FJ=function(e,t){return t.size<2?e:NJ[e-1][t.size-1]},IJ=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=PJ[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:FJ(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:PJ[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=FJ(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||=RK(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};IJ.BASESIZE=6;var LJ=e=>new IJ({style:e.displayMode?GG.DISPLAY:GG.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),RJ=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},zJ=function(e,t,n){var r=LJ(n),i;return n.output===`mathml`?MJ(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[vJ(e,r)]):X([`katex`],[MJ(e,t,r,n.displayMode,!1),vJ(e,r)]),RJ(i,n))},BJ=function(e,t){return RJ(X([`katex`],[vJ(e,LJ(t))]),t)},VJ={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":`=`},HJ=function(e){var t=new Q(`mo`,[new bJ(VJ[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},UJ={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]},WJ=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),GJ=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(WJ.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:Lq([],[new EK([new DK(o)],{width:`100%`,height:H(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=UJ[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
|
|
387
|
+
`+h+` children.`);for(var v=0;v<h;v++){var y=new EK([new DK(d[v])],{width:`400em`,height:H(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=Lq([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=H(m),l.push(b)}return{span:X([`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=H(o),a>0&&(i.style.minWidth=H(a)),i},KJ=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 OK({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new OK({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=Lq([],[new EK(c,{width:`100%`,height:H(o)})],i)}return a.height=o,a.style.height=H(o),a},qJ=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],JJ=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],YJ=new Set(qJ),XJ=new Set(JJ);function ZJ(e){return YJ.has(e)}function QJ(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 $J(e){var t=eY(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function eY(e){return e.type===`atom`||XJ.has(e.type)?e:null}function tY(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 V(t,e);return r}var nY=e=>{if(e instanceof TK)return e;if(jK(e)&&e.children.length===1)return nY(e.children[0])},rY=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=QJ(e.base,`accent`),n=r.base,e.base=n,i=AK(gJ(e,t)),e.base=r):(r=QJ(e,`accent`),n=r.base);var a=gJ(n,t.havingCrampedStyle()),o=r.isShifty&&SG(n),s=0;o&&(s=nY(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=GJ(r,t),u=Uq({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+H(2*s)+`)`,marginLeft:H(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=Jq(`vec`,t),f=qq.vec[1]):(d=Nq({type:`textord`,mode:r.mode,text:r.label},t),d=kK(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=H(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=Uq({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},iY=(e,t)=>{var n=e.isStretchy?HJ(e.label):new Q(`mo`,[wJ(e.label,e.mode)]),r=new Q(`mover`,[jJ(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},aY=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=iJ(t[0]),r=!aY.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:rY,mathmlBuilder:iY}),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`&&(Oq({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=gJ(e.base,t),r=GJ(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[Uq({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=HJ(e.label),r=new Q(`munder`,[jJ(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var oY=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=Vq(gJ(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=Vq(gJ(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=GJ(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=Uq({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=Uq({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=HJ(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=oY(jJ(e.body,t));r=e.below?new Q(`munderover`,[n,oY(jJ(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,oY(jJ(e.below,t))]):(r=oY(),r=new Q(`mover`,[n,r]));return r}});function sY(e,t){var n=uJ(e.body,t,!0);return X([e.mclass],n,t)}function cY(e,t){var n,r=kJ(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:aJ(i),isCharacterBox:SG(i)}},htmlBuilder:sY,mathmlBuilder:cY});var lY=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:lY(t[0]),body:aJ(t[1]),isCharacterBox:SG(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`:lY(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:aJ(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:SG(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:lY(t[0]),body:aJ(t[0])}},htmlBuilder(e,t){var n=uJ(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`,kJ(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var uY={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},dY=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),fY=e=>e.type===`textord`&&e.text===`@`,pY=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function mY(e,t,n){var r=uY[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 hY(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new V(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=dY(),c=0;c<o.length;c++)if(!fY(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=$J(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(pY(o[p],l)){f=!1,c=p;break}if(fY(o[p]))throw new V(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new V(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new V(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[mY(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=dY()}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=Vq(gJ(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=H(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[jJ(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=Vq(gJ(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[jJ(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=tY(QJ(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new V(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new V(`\\@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=QJ(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:aJ(i)}},htmlBuilder:(e,t)=>Bq(uJ(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,kJ(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=QJ(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||!Oq({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&&QJ(n,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=H(mK(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,H(mK(e.size,t)))),n}});var gY={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},_Y=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new V(`Expected a control sequence`,e);return t},vY=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},yY=(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(gY[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=gY[r.text]),QJ(t.parseFunction(),`internal`);throw new V(`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 V(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new V(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new V(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new V(`Expected a macro definition`);else s[a].push(r.text);var 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===gY[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=_Y(t.gullet.popToken());return t.gullet.consumeSpaces(),yY(t,r,vY(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=_Y(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return yY(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var bY=function(e,t,n){var r=IK(zK.math[e]&&zK.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},xY=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},SY=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=H(i),e.height-=i,e.depth+=i},CY=function(e,t,n,r,i,a){var o=xY(Aq(e,`Main-Regular`,i,r),t,r,a);return n&&SY(o,r,t),o},wY=function(e,t,n,r){return Aq(e,`Size`+t+`-Regular`,n,r)},TY=function(e,t,n,r,i,a){var o=wY(e,t,i,r),s=xY(X([`delimsizing`,`size`+t],[o],r),GG.TEXT,r,a);return n&&SY(s,r,GG.TEXT),s},EY=function(e,t,n,r){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[Aq(e,t,n,r)])])}},DY=function(e,t,n){var r=MK[`Size4-Regular`][e.charCodeAt(0)]?MK[`Size4-Regular`][e.charCodeAt(0)][4]:MK[`Size1-Regular`][e.charCodeAt(0)][4],i=Lq([],[new EK([new DK(`inner`,oK(e,Math.round(1e3*t)))],{width:H(r),height:H(t),style:`width:`+H(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=H(t),i.style.width=H(r),{type:`elem`,elem:i}},OY=.008,kY={type:`kern`,size:-1*OY},AY=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),jY=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),MY=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`):AY.has(e)?(c=`∣`,u=`vert`,d=333):jY.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=bY(o,f,i),m=p.height+p.depth,h=bY(c,f,i),g=h.height+h.depth,_=bY(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=bY(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=cK(u,Math.round(ee*1e3)),D=new DK(u,ne),re=H(d/1e3),ie=H(te/1e3),ae=Lq([],[new EK([D],{width:re,height:ie,viewBox:`0 0 `+d+` `+te})],r);ae.height=te/1e3,ae.style.width=re,ae.style.height=ie,E.push({type:`elem`,elem:ae})}else{if(E.push(EY(l,f,i,r)),E.push(kY),s===null){var oe=C-m-v+2*OY;E.push(DY(c,oe,r))}else{var se=(C-m-v-y)/2+2*OY;E.push(DY(c,se,r)),E.push(kY),E.push(EY(s,f,i,r)),E.push(kY),E.push(DY(c,se,r))}E.push(kY),E.push(EY(o,f,i,r))}var ce=r.havingBaseStyle(GG.TEXT);return xY(X([`delimsizing`,`mult`],[Uq({positionType:`bottom`,positionData:T,children:E})],ce),GG.TEXT,r,a)},NY=80,PY=.08,FY=function(e,t,n,r,i){return Lq([`hide-tail`],[new EK([new DK(e,aK(e,r,n))],{width:`400em`,height:H(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},IY=function(e,t){var n=t.havingBaseSizing(),r=KY(`\\surd`,e*n.sizeMultiplier,WY,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+NY,e<1?i=1:e<1.4&&(i=.7),s=(1+a+PY)/i,c=(1+a)/i,o=FY(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+NY)*BY[r.size],c=(BY[r.size]+a)/i,s=(BY[r.size]+a+PY)/i,o=FY(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+PY,c=e+a,l=Math.floor(1e3*e+a)+NY,o=FY(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=H(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},LY=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),RY=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),zY=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),BY=[0,1.2,1.8,2.4,3],VY=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),LY.has(e)||zY.has(e))return TY(e,t,!1,n,r,i);if(RY.has(e))return MY(e,BY[t],!1,n,r,i);throw new V(`Illegal delimiter: '`+e+`'`)},HY=[{type:`small`,style:GG.SCRIPTSCRIPT},{type:`small`,style:GG.SCRIPT},{type:`small`,style:GG.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],UY=[{type:`small`,style:GG.SCRIPTSCRIPT},{type:`small`,style:GG.SCRIPT},{type:`small`,style:GG.TEXT},{type:`stack`}],WY=[{type:`small`,style:GG.SCRIPTSCRIPT},{type:`small`,style:GG.SCRIPT},{type:`small`,style:GG.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],GY=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.`)},KY=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=bY(e,GY(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]},qY=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=zY.has(e)?HY:LY.has(e)?WY:UY,s=KY(e,t,o,r);return s.type===`small`?CY(e,s.style,n,r,i,a):s.type===`large`?TY(e,s.size,n,r,i,a):MY(e,t,n,r,i,a)},JY=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 qY(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},YY={"\\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}},XY=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 ZY(e){return`isMiddle`in e}function QY(e,t){var n=eY(e);if(n&&XY.has(n.text))return n;throw n?new V(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new V(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=QY(iJ(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:YY[e.funcName].size,mclass:YY[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):VY(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(wJ(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=H(BY[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function $Y(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 V(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:QY(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=QY(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=QJ(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{$Y(e);for(var n=uJ(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];ZY(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===`.`?hJ(t,[`mopen`]):JY(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(ZY(u)){var d=u.isMiddle;n[l]=JY(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=hJ(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=JY(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{$Y(e);var n=kJ(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[wJ(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[wJ(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return TJ(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=QY(t[0],e);if(!e.parser.leftrightDepth)throw new V(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=hJ(t,[]):(n=VY(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===`|`?wJ(`|`,`text`):wJ(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=QJ(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=Vq(gJ(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=SG(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=mK({number:.6,unit:`pt`},t),l=mK({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=H(d/2+c);var f=Math.floor(1e3*d*i);a=Lq([`hide-tail`],[new EK([new DK(`phase`,rK(f))],{width:`400em`,height:H(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=H(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=KJ(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=H(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=H(h),a.style.borderRightWidth=H(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=Uq({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=Uq({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`,[jJ(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+H(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}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=QJ(t[0],`color-token`).color,o=QJ(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`&&Oq({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 eX={};function tX(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)eX[n[c]]=s;a&&(tJ[t]=a),o&&(nJ[t]=o)}var nX={};function $(e,t){nX[e]=t}var rX=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}},iX=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,rX.range(this,t))}};function aX(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 oX=e=>{if(!e.parser.settings.displayMode)throw new V(`{`+e.envName+`} can be used only in display mode.`)},sX=new Set([`gather`,`gather*`]);function cX(e){if(!e.includes(`ed`))return!e.includes(`*`)}function lX(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 V(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new iX(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(aX(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new V(`Too many tab characters: &`,e.nextToken);Oq({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(aX(e)),m=[],h.push(m),y()}else throw new V(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function uX(e){return e.slice(0,1)===`d`?`display`:`text`}var dX=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(GG.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?mK({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=gJ(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=mK(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],ae=ie.pos-E,oe=e.tags[n],se=void 0;se=oe===!0?X([`eqn-num`],[],t):oe===!1?X([],[],t):X([],uJ(oe,t,!0),t),se.depth=ie.depth,se.height=ie.height,re.push({type:`elem`,elem:se,shift:ae})}for(r=0,D=0;r<o||D<ee.length;++r,++D){for(var ce=ee[D],le=!0;(ue=ce)?.type===`separator`;){var ue;if(le||(ne=X([`arraycolsep`],[]),ne.style.width=H(t.fontMetrics().doubleRuleSep),te.push(ne)),ce.separator===`|`||ce.separator===`:`){var de=ce.separator===`|`?`solid`:`dashed`,fe=X([`vertical-separator`],[],t);fe.style.height=H(_),fe.style.borderRightWidth=H(l),fe.style.borderRightStyle=de,fe.style.margin=`0 `+H(-l/2);var pe=_-E;pe&&(fe.style.verticalAlign=H(-pe)),te.push(fe)}else throw new V(`Invalid separator type: `+ce.separator);D++,ce=ee[D],le=!1}if(!(r>=o)){var me=void 0;(r>0||e.hskipBeforeAndAfter)&&(me=ce?.pregap??d,me!==0&&(ne=X([`arraycolsep`],[]),ne.style.width=H(me),te.push(ne)));var he=[];for(n=0;n<i;++n){var ge=s[n],_e=ge.cells[r];if(_e){var ve=ge.pos-E;_e.depth=ge.depth,_e.height=ge.height,he.push({type:`elem`,elem:_e,shift:ve})}}var ye=Uq({positionType:`individualShift`,children:he}),be=X([`col-align-`+(ce?.align||`c`)],[ye]);te.push(be),(r<o-1||e.hskipBeforeAndAfter)&&(me=ce?.postgap??d,me!==0&&(ne=X([`arraycolsep`],[]),ne.style.width=H(me),te.push(ne)))}}var O=X([`mtable`],te);if(c.length>0){for(var xe=Rq(`katex-hline`,t,l),Se=Rq(`katex-hdashline`,t,l),Ce=[{type:`elem`,elem:O,shift:0}];c.length>0;){var we=c.pop(),Te=we.pos-E;we.isDashed?Ce.push({type:`elem`,elem:Se,shift:Te}):Ce.push({type:`elem`,elem:xe,shift:Te})}O=Uq({positionType:`individualShift`,children:Ce})}if(re.length===0)return X([`mord`],[O],t);var Ee=X([`katex-tag`],[Uq({positionType:`individualShift`,children:re})],t);return Bq([O,Ee])},fX={c:`center `,l:`left `,r:`right `},pX=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`,[jJ(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,H(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=fX[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},mX=function(e,t){e.envName.includes(`ed`)||oX(e);var n=[],r=e.envName===`split`,i=lX(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:cX(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=tY(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new V(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)QJ(QJ(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 V(`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};tX({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(eY(t[0])?[t[0]]:QJ(t[0],`ordgroup`).body).map(function(e){var t=$J(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new V(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return lX(e.parser,r,uX(e.envName))},htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new V(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=lX(e.parser,r,uX(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:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=lX(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(eY(t[0])?[t[0]]:QJ(t[0],`ordgroup`).body).map(function(e){var t=$J(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new V(`Unknown column alignment: `+t,e)});if(n.length>1)throw new V(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=lX(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new V(`{subarray} can contain only one column`);return i},htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=lX(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},uX(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:mX,htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){sX.has(e.envName)&&oX(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:cX(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return lX(e.parser,t,`display`)},htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:mX,htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){oX(e);var t={autoTag:cX(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return lX(e.parser,t,`display`)},htmlBuilder:dX,mathmlBuilder:pX}),tX({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return oX(e),hY(e.parser)},htmlBuilder:dX,mathmlBuilder:pX}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new V(e.funcName+` valid only within array environment`)}});var hX=eX;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 V(`Invalid environment name`,i);var a=tY(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(hX,a))throw new V(`No such environment: `+a,i);var o=hX[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=QJ(n.parseFunction(),`environment`);if(p.name!==a)throw new V(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var gX=(e,t)=>{var n=e.font,r=t.withFont(n);return gJ(e.body,r)},_X=(e,t)=>{var n=e.font,r=t.withFont(n);return jJ(e.body,r)},vX={"\\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=iJ(t[0]),a=r in vX?vX[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:gX,mathmlBuilder:_X}),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:lY(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:SG(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 yX=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=gJ(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=gJ(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=mK(e.barSize,t),u=Rq(`frac-line`,t,d)):u=Rq(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===GG.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=Uq({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=Uq({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===GG.DISPLAY.size?t.fontMetrics().delim1:n.size===GG.SCRIPTSCRIPT.size?t.havingStyle(GG.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?hJ(t,[`mopen`]):qY(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?hJ(t,[`mclose`]):qY(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},bX=(e,t)=>{var n=new Q(`mfrac`,[jJ(e.numer,t),jJ(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=mK(e.barSize,t);n.setAttribute(`linethickness`,H(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new bJ(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new bJ(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return TJ(i)}return n},xX=(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`),xX({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:yX,mathmlBuilder:bX}),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 SX=[`display`,`text`,`script`,`scriptscript`],CX=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=iJ(t[0]),o=a.type===`atom`&&a.family===`open`?CX(a.text):null,s=iJ(t[1]),c=s.type===`atom`&&s.family===`close`?CX(s.text):null,l=QJ(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=QJ(p.body[0],`textord`);f=SX[Number(m.text)]}}else p=QJ(p,`textord`),f=SX[Number(p.text)];return xX({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:QJ(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=QJ(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 wX=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?gJ(e.sup,t.havingStyle(n.sup()),t):gJ(e.sub,t.havingStyle(n.sub()),t),i=QJ(e.base,`horizBrace`)):i=QJ(e,`horizBrace`);var a=gJ(i.base,t.havingBaseStyle(GG.DISPLAY)),o=GJ(i,t),s=i.isOver?Uq({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):Uq({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?Uq({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):Uq({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:wX,mathmlBuilder:(e,t)=>{var n=HJ(e.label);return new Q(e.isOver?`mover`:`munder`,[jJ(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=QJ(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:aJ(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=uJ(e.body,t,!1);return zq(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=AJ(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=QJ(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:aJ(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:aJ(t[0])}},htmlBuilder(e,t){return Bq(uJ(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,kJ(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=QJ(t[0],`raw`).string,a=t[1];n.settings.strict&&Oq({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 V(`\\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:aJ(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=uJ(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)=>AJ(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:aJ(t[0]),mathml:aJ(t[1])}),htmlBuilder:(e,t)=>Bq(uJ(e.html,t,!1)),mathmlBuilder:(e,t)=>AJ(e.mathml,t)});var TX=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new V(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!pK(n))throw new V(`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=QJ(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=TX(d);break;case`height`:a=TX(d);break;case`totalheight`:o=TX(d);break;default:throw new V(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=QJ(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=mK(e.height,t),r=0;e.totalheight.number>0&&(r=mK(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=mK(e.width,t));var a={height:H(n+r)};i>0&&(a.width=H(i)),r>0&&(a.verticalAlign=H(-r));var o=new CK(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=mK(e.height,t),i=0;if(e.totalheight.number>0&&(i=mK(e.totalheight,t)-r,n.setAttribute(`valign`,H(-i))),n.setAttribute(`height`,H(r+i)),e.width.number>0){var a=mK(e.width,t);n.setAttribute(`width`,H(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=QJ(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||Oq({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&Oq({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&Oq({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 Wq(e.dimension,t)},mathmlBuilder(e,t){return new xJ(mK(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([],[gJ(e.body,t)]),n=X([`katex-inner`],[n],t)):n=X([`katex-inner`],[gJ(e.body,t)]);var r=X([`katex-fix`],[]),i=X([e.alignment],[n,r],t),a=X([`katex-strut`]);return a.style.height=H(i.height+i.depth),i.depth&&(a.style.verticalAlign=H(-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`,[jJ(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 V(`Mismatched `+e.funcName)}});var EX=(e,t)=>{switch(t.style.size){case GG.DISPLAY.size:return e.display;case GG.TEXT.size:return e.text;case GG.SCRIPT.size:return e.script;case GG.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:aJ(t[0]),text:aJ(t[1]),script:aJ(t[2]),scriptscript:aJ(t[3])}),htmlBuilder:(e,t)=>Bq(uJ(EX(e,t),t,!1)),mathmlBuilder:(e,t)=>AJ(EX(e,t),t)});var DX=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&SG(n),c,l;if(t){var u=gJ(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=gJ(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=Uq({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:H(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:H(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=Uq({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:H(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=Uq({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:H(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=H(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},OX=new Set([`\\smallint`]),kX=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=QJ(e.base,`op`),i=!0):a=QJ(e,`op`);var o=t.style,s=!1;o.size===GG.DISPLAY.size&&a.symbol&&!OX.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=Aq(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=Jq(d+`Size`+(s?`2`:`1`),t);c=Uq({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=uJ(a.body,t,!0);p.length===1&&p[0]instanceof TK?(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(jq(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof TK||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?DX(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=H(g)),c)},AX=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[wJ(e.name,e.mode)]),OX.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,kJ(e.body,t));else{n=new Q(`mi`,[new bJ(e.name.slice(1))]);var r=new Q(`mo`,[wJ(``,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):yJ([n,r])}return n},jX={"∏":`\\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=jX[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:kX,mathmlBuilder:AX}),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:aJ(r)}}});var MX={"∫":`\\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=MX[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var NX=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=QJ(e.base,`operatorname`),i=!0):a=QJ(e,`operatorname`);var o;if(a.body.length>0){for(var s=uJ(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 TK&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?DX(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:aJ(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:NX,mathmlBuilder:(e,t)=>{for(var n=kJ(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof xJ)){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 bJ?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new bJ(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[wJ(``,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):yJ([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),rJ({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?Bq(uJ(e.body,t,!1)):X([`mord`],uJ(e.body,t,!0),t)},mathmlBuilder(e,t){return AJ(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=gJ(e.body,t.havingCrampedStyle()),r=Rq(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-overline`],[Uq({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 bJ(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[jJ(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:aJ(r)}},htmlBuilder:(e,t)=>Bq(uJ(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,kJ(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`],[gJ(e.body,t.withPhantom())]),X([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,kJ(aJ(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=QJ(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=gJ(e.body,t);return Uq({positionType:`shift`,positionData:-mK(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[jJ(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var PX=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Z({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:PX,htmlBuilder(e,t){return X([`mord`,`reflectbox`],[gJ(e.body,t)],t)},mathmlBuilder(e,t){return jJ(e.body,t)}}),Z({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:PX}),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=QJ(t[0],`size`),o=QJ(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&QJ(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`katex-rule`],[],t),r=mK(e.width,t),i=mK(e.height,t),a=e.shift?mK(e.shift,t):0;return n.style.borderRightWidth=H(r),n.style.borderTopWidth=H(i),n.style.bottom=H(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=mK(e.width,t),r=mK(e.height,t),i=e.shift?mK(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,H(n)),o.setAttribute(`height`,H(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,H(i)):(s.setAttribute(`height`,H(i)),s.setAttribute(`depth`,H(-i))),s.setAttribute(`voffset`,H(i)),s}});function FX(e,t,n){for(var r=uJ(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 Bq(r)}var IX=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:IX,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:IX.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return FX(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,kJ(e.body,n));return r.setAttribute(`mathsize`,H(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]&&QJ(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=$J(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([],[gJ(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`],[Uq({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[jJ(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=gJ(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Vq(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<GG.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=IY(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=H(l);var f=Uq({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(GG.SCRIPTSCRIPT),m=gJ(e.index,p,t);return X([`mord`,`sqrt`],[X([`katex-root`],[Uq({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`,[jJ(n,t),jJ(r,t)]):new Q(`msqrt`,[jJ(n,t)])}});var LX={display:GG.DISPLAY,text:GG.TEXT,script:GG.SCRIPT,scriptscript:GG.SCRIPTSCRIPT};function RX(e){return e in LX}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(!RX(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=LX[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),FX(e.body,r,t)},mathmlBuilder(e,t){var n=LX[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,kJ(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 zX=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===GG.DISPLAY.size||n.alwaysHandleSupSub)?kX:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===GG.DISPLAY.size||n.limits)?NX:null:n.type===`accent`?SG(n.base)?rY:null:n.type===`horizBrace`&&!e.sub===n.isOver?wX:null:null};rJ({type:`supsub`,htmlBuilder(e,t){var n=zX(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=gJ(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&SG(r);if(i){var p=t.havingStyle(t.style.sup());s=gJ(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=gJ(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===GG.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=H(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof TK||y)&&(v=H(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=Uq({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=Uq({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=Uq({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([mJ(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=[jJ(e.base,t)];e.sub&&a.push(jJ(e.sub,t)),e.sup&&a.push(jJ(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===GG.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===GG.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===GG.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===GG.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===GG.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===GG.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),rJ({type:`atom`,htmlBuilder(e,t){return jq(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[wJ(e.text,e.mode)]);if(e.family===`bin`){var r=DJ(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 BX={mi:`italic`,mn:`normal`,mtext:`normal`};rJ({type:`mathord`,htmlBuilder(e,t){return Nq(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[wJ(e.text,e.mode,t)]),r=DJ(e,t)||`italic`;return r!==BX[n.type]&&n.setAttribute(`mathvariant`,r),n}}),rJ({type:`textord`,htmlBuilder(e,t){return Nq(e,t)},mathmlBuilder(e,t){var n=wJ(e.text,e.mode,t),r=DJ(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!==BX[i.type]&&i.setAttribute(`mathvariant`,r),i}});var VX=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),HX=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);rJ({type:`spacing`,htmlBuilder(e,t){var n=HX.get(e.text),r=VX.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=Nq(e,t);return a.classes.push(i),a}return X([`mspace`,i],[jq(e.text,e.mode,t)],t)}if(r)return X([`mspace`,r],[],t);throw new V(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(HX.has(e.text))n=new Q(`mtext`,[new bJ(`\xA0`)]);else if(VX.has(e.text))return new Q(`mspace`);else throw new V(`Unknown type of space "`+e.text+`"`);return n}});var UX=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};rJ({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[UX(),new Q(`mtd`,[AJ(e.body,t)]),UX(),new Q(`mtd`,[AJ(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var WX={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},GX={"\\textbf":`textbf`,"\\textmd":`textmd`},KX={"\\textit":`textit`,"\\textup":`textup`},qX=(e,t)=>{var n=e.font;return n?WX[n]?t.withTextFontFamily(WX[n]):GX[n]?t.withTextFontWeight(GX[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(KX[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:aJ(i),font:r}},htmlBuilder(e,t){var n=qX(e,t);return X([`mord`,`text`],uJ(e.body,n,!0),n)},mathmlBuilder(e,t){var n=qX(e,t);return AJ(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=gJ(e.body,t),r=Rq(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-underline`],[Uq({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 bJ(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[jJ(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=gJ(e.body,t),r=t.fontMetrics().axisHeight;return Uq({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`,[jJ(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new V(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=JX(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(Aq(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),Fq(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new bJ(JX(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var JX=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),YX=eJ,XX=`[ \r
|
|
388
|
+
]`,ZX=`\\\\[a-zA-Z@]+`,QX=`\\\\[^\ud800-\udfff]`,$X=`(`+ZX+`)`+XX+`*`,eZ=`\\\\(
|
|
389
|
+
|[ \r ]+
|
|
390
|
+
?)[ \r ]*`,tZ=`[̀-ͯ]`,nZ=RegExp(tZ+`+$`),rZ=`(`+XX+`+)|`+(eZ+`|`)+`([!-\\[\\]-‧-豈-]`+(tZ+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(tZ+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+$X)+(`|`+QX+`)`),iZ=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(rZ,`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 iX(`EOF`,new rX(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new V(`Unexpected character: '`+e[t]+`'`,new iX(e[t],new rX(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
|
|
391
|
+
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,Oq({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 iX(r,new rX(this,t,this.tokenRegex.lastIndex))}},aZ=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new V(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t 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}},oZ=nX;$(`\\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 sZ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new V("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=sZ[t.text],r==null||r>=n)throw new V(`Invalid base-`+n+` digit `+t.text);for(var i;(i=sZ[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var cZ=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new V(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new V(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new V(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new V(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>cZ(e,!1,!0,!1)),$(`\\renewcommand`,e=>cZ(e,!0,!1,!1)),$(`\\providecommand`,e=>cZ(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),YX[n],zK.math[n],zK.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 lZ={",":`\\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`},uZ=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in lZ?t=lZ[n]:(n.slice(0,4)===`\\not`||n in zK.math&&uZ.has(zK.math[n].group))&&(t=`\\dotsb`),t});var dZ={")":!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 dZ?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in dZ&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in dZ?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new V(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var fZ=H(MK[`Main-Regular`][84][1]-.7*MK[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+fZ+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+fZ+`}{\\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 pZ=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`,pZ(!1)),$(`\\bra@set`,pZ(!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 mZ={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},hZ=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 aZ(oZ,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new iZ(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 iX(`EOF`,n.loc)),this.pushTokens(r),new iX(``,rX.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new V(`Extra }`,i)}else if(i.text===`EOF`)throw new V(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new V(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new V(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new V(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new V(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new V(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new V(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new iX(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 iZ(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(YX,e)||Object.prototype.hasOwnProperty.call(zK.math,e)||Object.prototype.hasOwnProperty.call(zK.text,e)||Object.prototype.hasOwnProperty.call(mZ,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(YX,e)&&!YX[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},gZ=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,_Z=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`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),vZ={"́":{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`}},yZ={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},bZ=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 hZ(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new V(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new iX(`}`)),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&&YX[i.text]&&YX[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new V(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new V(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new V(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new V(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new V(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new V(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(_Z[i.text]){var s=gZ.test(i.text),c=[];for(c.push(new iX(_Z[i.text])),this.consume();;){var l=this.fetch().text;if(!_Z[l]||gZ.test(l)!==s)break;c.unshift(new iX(_Z[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=YX[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new V(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new V(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new V(`Can't use function '`+r+`' in math mode`,n);var 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=YX[e];if(o&&o.handler)return o.handler(a,t,n);throw new V(`No function handler for `+e)}parseArguments(e,t){var n=t.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 V(`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 V(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new V(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new V(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){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 V(`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 V(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new V(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!pK(i))throw new V(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(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:rX.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(mZ,r)){if(this.settings.throwOnError)throw new V(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:rX.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:rX.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:rX.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new V(`\\verb assertion failed --
|
|
392
|
+
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(yZ,t[0])&&!zK[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&Oq({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=yZ[t[0]]+t.slice(1));var i=nZ.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(zK[this.mode][t]){this.settings.strict&&this.mode===`math`&&uq.includes(t)&&Oq({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=zK[this.mode][t].group,s=rX.range(e);a=ZJ(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&&(YG(t.charCodeAt(0))?this.mode===`math`&&Oq({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):Oq({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:rX.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(!vZ[l])throw new V(`Unknown accent ' `+l+`'`,e);var u=vZ[l][this.mode]||vZ[l].text;if(!u)throw new V(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:rX.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};bZ.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var xZ=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new bZ(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new V(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new iX(`\\df@tag`)])}]}return r},SZ=function(e,t,n){t.textContent=``;var r=EZ(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.`),SZ=function(){throw new V(`KaTeX doesn't work in quirks mode.`)});var CZ=function(e,t){return EZ(e,t).toMarkup()},wZ=function(e,t){return xZ(e,new OG(t))},TZ=function(e,t,n){if(n.throwOnError||!(e instanceof V))throw e;var r=X([`katex-error`],[new TK(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},EZ=function(e,t){var n=new OG(t);try{return zJ(xZ(e,n),e,n)}catch(t){return TZ(t,e,n)}},DZ={version:`0.19.0`,render:SZ,renderToString:CZ,ParseError:V,SETTINGS_SCHEMA:wG,__parse:wZ,__renderToDomTree:EZ,__renderToHTMLTree:function(e,t){var n=new OG(t);try{return BJ(xZ(e,n),n)}catch(t){return TZ(t,e,n)}},__setFontMetrics:FK,__defineSymbol:U,__defineFunction:Z,__defineMacro:$,__domTree:{Span:xK,Anchor:SK,SymbolNode:TK,SvgNode:EK,PathNode:DK,LineNode:OK}},OZ=500,kZ=new Map;function AZ(e,t){let n=`${+!!t}:${e}`;if(kZ.has(n)){let e=kZ.get(n)??null;return kZ.delete(n),kZ.set(n,e),e}let r;try{let n=DZ.renderToString(e,{displayMode:t,output:`htmlAndMathml`,throwOnError:!0,trust:!1,strict:`ignore`,maxExpand:1e3,maxSize:50});r=qU.sanitize(n,{USE_PROFILES:{html:!0,svg:!0,mathMl:!0}})}catch{r=null}return kZ.set(n,r),kZ.size>OZ&&kZ.delete(kZ.keys().next().value),r}var jZ=null;function MZ(e,t){let n=jZ;jZ=e;try{return t()}finally{jZ=n}}function NZ(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 PZ(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function FZ(e,t,n){let r=AZ(e,t);return r===null||jZ===null?PZ(n):(jZ.items.push(r),`<span data-math="${jZ.nonce}:${jZ.items.length-1}"></span>`)}var IZ=[/^\$\$[ \t]*\n?([\s\S]+?)\n?[ \t]*\$\$[ \t]*(?:\n|$)/,/^\\\[[ \t]*\n?([\s\S]+?)\n?[ \t]*\\\][ \t]*(?:\n|$)/],LZ=/^(?:\\\(([\s\S]+?)\\\)|(\$\$?)(?![\s$])((?:\\[\s\S]|[^$\\`])+?)(?<!\s)\2(?!\d))/,RZ=/^\\[()[\]]/;function zZ(e,t){let n=e.search(t);return n<0?void 0:n}var BZ=new GV({extensions:[{name:`mathLiteral`,level:`inline`,start:e=>zZ(e,/\\[()[\]]/),tokenizer(e){let t=RZ.exec(e);return t?{type:`mathLiteral`,raw:t[0]}:void 0},renderer:e=>PZ(e.raw)},{name:`mathBlock`,level:`block`,start:e=>e.match(/^(?:\$\$|\\\[)/m)?.index,tokenizer(e){for(let t of IZ){let n=t.exec(e);if(n?.[1]?.trim())return{type:`mathBlock`,raw:n[0],text:n[1].trim()}}},renderer:e=>`<p>${FZ(e.text,!0,e.raw.trimEnd())}</p>\n`},{name:`mathInline`,level:`inline`,start:e=>zZ(e,/\$|\\\(/),tokenizer(e){let t=LZ.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=>FZ(e.text,e.display,e.raw)}],renderer:{code({text:e,lang:t}){return`<pre><code class="${WW(t)?`hljs language-${t??``}`:`hljs`}">${GW(e,t)}</code></pre>`}}});function VZ(e){let t={nonce:crypto.randomUUID(),items:[]},n=MZ(t,()=>BZ.parse(e,{async:!1,gfm:!0,breaks:!0}));return NZ(qU.sanitize(n,{USE_PROFILES:{html:!0}}),t)}function HZ({text:e}){let t=(0,f.useMemo)(()=>VZ(e),[e]);return(0,k.jsx)(`div`,{className:`md`,dangerouslySetInnerHTML:{__html:t}})}function UZ({interaction:e,status:t}){let n=B();return(0,k.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,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.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,k.jsx)(KR,{name:`sparkles`,size:12}),n(`plan.card.badge`)]}),t!==void 0&&(0,k.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:qP(t)})]}),(0,k.jsx)(`p`,{className:`mt-1.5 whitespace-pre-wrap break-words font-semibold text-ink-900`,children:HP(e.title)}),(0,k.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,k.jsx)(`li`,{className:`break-words pl-1`,children:(0,k.jsx)(HZ,{text:e})},t))})]})}function WZ({invocation:e}){let[t,n]=(0,f.useState)(!1);return(0,k.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-sakura-200 bg-surface text-left shadow-soft`,children:[(0,k.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,k.jsx)(`span`,{className:`text-sakura-500`,children:(0,k.jsx)(KR,{name:`sparkles`,size:14})}),(0,k.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-semibold text-sakura-800`,children:[`skill:`,e.name]}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,title:e.location,children:e.location}),(0,k.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:t?`▾`:`▸`})]}),t&&(0,k.jsx)(`div`,{className:`border-t border-sakura-100 px-3 py-2`,children:(0,k.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 GZ({text:e}){let t=B(),[n,r]=(0,f.useState)(!1);return e.trim()===``?null:(0,k.jsxs)(`div`,{className:`rounded-xl border border-dashed border-sakura-300 bg-sakura-50/70`,children:[(0,k.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,k.jsx)(`span`,{"aria-hidden":!0,children:n?`▾`:`▸`}),t(`thinking.label`)]}),n&&(0,k.jsx)(`div`,{className:`px-3 pb-2 text-sm whitespace-pre-wrap text-ink-600 italic`,children:e})]})}var KZ=48,qZ=(e,t)=>e(`task.status.${t}`);function JZ(){let e=B(),t=`var(--color-sakura-200)`,n=`var(--color-sakura-300)`,r=`var(--color-tianyi-800)`;return(0,k.jsxs)(`svg`,{width:`132`,height:`112`,viewBox:`0 0 132 112`,fill:`none`,"aria-hidden":`true`,children:[(0,k.jsx)(`title`,{children:e(`message.cat`)}),(0,k.jsx)(`path`,{d:`M30 46 L24 14 L54 30 Z`,fill:t,stroke:n,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M102 46 L108 14 L78 30 Z`,fill:t,stroke:n,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M32 39 L29 23 L46 32 Z`,fill:n,opacity:`0.55`}),(0,k.jsx)(`path`,{d:`M100 39 L103 23 L86 32 Z`,fill:n,opacity:`0.55`}),(0,k.jsx)(`ellipse`,{cx:`66`,cy:`66`,rx:`44`,ry:`38`,fill:`var(--color-surface)`,stroke:t,strokeWidth:`2.5`}),(0,k.jsx)(`circle`,{cx:`50`,cy:`62`,r:`5`,fill:r}),(0,k.jsx)(`circle`,{cx:`82`,cy:`62`,r:`5`,fill:r}),(0,k.jsx)(`circle`,{cx:`51.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,k.jsx)(`circle`,{cx:`83.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,k.jsx)(`ellipse`,{cx:`40`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:n,opacity:`0.65`}),(0,k.jsx)(`ellipse`,{cx:`92`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:n,opacity:`0.65`}),(0,k.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,k.jsx)(`path`,{d:`M18 64 L32 66 M19 72 L32 70`,stroke:t,strokeWidth:`2`,strokeLinecap:`round`}),(0,k.jsx)(`path`,{d:`M114 64 L100 66 M113 72 L100 70`,stroke:t,strokeWidth:`2`,strokeLinecap:`round`})]})}function YZ({text:e,images:t,skill:n,defaultImagePrompt:r,copy:i}){let a=B();return n===void 0?(0,k.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,k.jsxs)(`div`,{className:`bubble-user chat-bubble px-4 py-2.5 whitespace-pre-wrap${r?` [&>div]:mt-0`:``}`,children:[e,r&&(0,k.jsxs)(`details`,{className:`min-w-0 text-sm`,children:[(0,k.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,k.jsx)(`p`,{className:`pt-2 whitespace-pre-wrap break-words`,children:r.text})]}),t&&(0,k.jsx)(pG,{images:t})]}),(0,k.jsx)(uG,{text:i})]}):(0,k.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,k.jsxs)(`div`,{className:`chat-bubble flex min-w-0 flex-col items-stretch gap-1.5`,children:[(0,k.jsx)(WZ,{invocation:n}),n.args!==``&&(0,k.jsx)(`div`,{className:`bubble-user px-4 py-2.5 whitespace-pre-wrap`,children:n.args})]}),(0,k.jsx)(uG,{text:i})]})}function XZ({thinking:e,text:t}){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(GZ,{text:e}),t.trim()!==``&&(0,k.jsx)(HZ,{text:t})]})}function ZZ({item:e}){let t=B();return e.text.trim()===``&&e.thinking.trim()===``&&e.note===null?null:(0,k.jsxs)(`div`,{className:`chat-row anim-other flex flex-col items-start`,children:[(0,k.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,k.jsx)(XZ,{thinking:e.thinking,text:e.text}),e.note!==null&&(0,k.jsxs)(`div`,{className:`text-xs text-sakura-800 italic`,children:[`⚠ `,JN(e.note,t)]})]}),(0,k.jsx)(uG,{text:cH(e),label:t(`message.copyAnswer`)})]})}function QZ({text:e,decision:t}){let n=B();return(0,k.jsx)(`div`,{className:`chat-row anim-other flex justify-center`,"data-plan-decision":t?``:void 0,children:(0,k.jsx)(`span`,{className:`rounded-full bg-ink-100 px-3 py-1 text-xs text-ink-600`,children:JN(e,n)})})}function $Z({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,k.jsx)(`div`,{className:`chat-row anim-other`,children:(0,k.jsx)(vH,{interaction:r,onLocate:e?()=>{let t=rP().currentSessionId;t&&wF.open(t,e)}:void 0})})}return r?.kind===`submit_plan`?(0,k.jsx)(`div`,{className:`chat-row anim-other`,children:(0,k.jsx)(UZ,{interaction:r,status:n?.version===r.version?n.status:void 0})}):(0,k.jsxs)(`div`,{className:`chat-row anim-other`,children:[(0,k.jsx)(sG,{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,k.jsx)(pG,{images:e.images})]})}function eQ({streaming:e,busy:t}){let n=e.text.trim()!==``||e.thinking.trim()!==``;return(0,k.jsxs)(k.Fragment,{children:[n&&(0,k.jsx)(`div`,{className:`chat-row stream-block flex justify-start`,children:(0,k.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,k.jsx)(XZ,{thinking:e.thinking,text:e.text}),t&&(0,k.jsx)(`span`,{className:`stream-caret`,"aria-hidden":!0})]})}),e.toolCalls.map(e=>(0,k.jsx)(`div`,{className:`chat-row anim-other`,children:(0,k.jsx)(sG,{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 tQ({view:e,busy:t,onSubagent:n,emptyLabel:r,onLoadEarlier:i,tray:a,focusEntry:o}){let s=B(),c=(0,f.useRef)(null),l=(0,f.useRef)(``),u=(0,f.useRef)(!0),d=(0,f.useRef)(!1),[p,m]=(0,f.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,f.useEffect)(()=>{if(!u.current)return;let e=c.current;e!==null&&e.scrollTo({top:e.scrollHeight})}),(0,f.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,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,k.jsx)(`div`,{ref:c,onScroll:()=>{let e=c.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<KZ;if(u.current=t,m(!t),e.scrollTop<=24&&i&&!d.current){d.current=!0,u.current=!1;let t=e.scrollTop,n=e.scrollHeight;i().finally(()=>{requestAnimationFrame(()=>{c.current===e&&(e.scrollTop=t+e.scrollHeight-n),d.current=!1})})}},className:`min-h-0 flex-1 overflow-y-auto`,children:(0,k.jsxs)(`div`,{className:`chat-column flex flex-col gap-3 px-4 py-5`,children:[h.length===0&&g===null&&(r?(0,k.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:r}):(0,k.jsxs)(`div`,{className:`mt-[14vh] flex flex-col items-center gap-4 text-center`,children:[(0,k.jsx)(`div`,{className:`welcome-cat`,children:(0,k.jsx)(JZ,{})}),(0,k.jsxs)(`div`,{className:`text-4xl font-extrabold tracking-tight`,children:[(0,k.jsx)(`span`,{className:`logo-gradient`,children:`neko`}),(0,k.jsx)(`span`,{className:`text-tianyi-600`,children:`.`}),(0,k.jsx)(`span`,{className:`logo-gradient`,children:`harness`})]}),(0,k.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,k.jsxs)(`div`,{"data-entry-id":t.id,children:[n&&(0,k.jsxs)(`details`,{className:`chat-row border-t border-sakura-200 pt-2 text-xs text-ink-500`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer`,children:s(`message.round`,{round:n.round??``,title:n.title,status:qZ(s,n.status)})}),(0,k.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,k.jsx)(YZ,{text:t.text,copy:cH(t),images:t.images,skill:t.skill,defaultImagePrompt:t.defaultImagePrompt})]},t.key)}case`assistant`:return(0,k.jsx)(ZZ,{item:t},t.key);case`tool`:{let r=e?.subagents?.find(e=>e.callId===t.callId);return r&&n?(0,k.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,k.jsx)(`span`,{className:`text-tianyi-700`,children:r.role}),` · `,r.title,(0,k.jsxs)(`span`,{className:`block text-xs text-ink-500`,children:[qZ(s,r.status),` `,r.approvalCount?s(`message.approvalsPending`,{count:r.approvalCount}):s(`message.viewProcess`)]})]},t.key):(0,k.jsxs)(`div`,{children:[(0,k.jsx)($Z,{item:t,pending:e?.questions?.pending,plan:e?.plan?.current}),e?.approvals?.filter(e=>e.callId===t.callId&&e.status!==`pending`).map(e=>(0,k.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,k.jsx)(QZ,{text:t.text,decision:t.planDecision!==void 0},t.key):(0,k.jsx)(mG,{text:t.text,jobId:t.jobId,job:e?.jobs?.find(e=>e.jobId===t.jobId)},t.key);default:return null}}),g!==null&&(0,k.jsx)(eQ,{streaming:g,busy:t})]})}),(p||a)&&(0,k.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,k.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 nQ=()=>document.querySelector(`textarea[data-composer-input]`)?.focus();function rQ(){let{currentSessionId:e}=nP();return e?(0,k.jsx)(iQ,{sessionId:e},e):null}function iQ({sessionId:e}){let t=B(),n=XP(nP()),r=n?.awaiting??null,i=n?.online??!1,[a,o]=(0,f.useState)(null),s=(0,f.useRef)(!0);(0,f.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let c=(0,f.useRef)(new Set),l=(0,f.useRef)(null),u=n?.current??null;return(0,f.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:qP(u.status)}):t(`plan.card.goneOther`))},[r,u,t]),r===null&&a===null?null:(0,k.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,k.jsxs)(`div`,{className:`chat-column flex flex-col gap-1.5`,children:[a!==null&&(0,k.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,k.jsx)(`span`,{className:`max-h-24 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,children:a}),(0,k.jsx)($R,{label:t(`plan.card.dismiss`),onClick:()=>o(null)})]}),r!==null&&(0,k.jsx)(aQ,{sessionId:e,plan:r,online:i,deciding:c.current,onSettled:(e,t)=>{s.current&&o(QP(e,t))}},r.version)]})})}function aQ(e){let t=B(),{plan:n,online:r}=e,[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),p=(0,f.useRef)(!1),m=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useId)();(0,f.useLayoutEffect)(()=>()=>{m.current?.contains(document.activeElement)&&nQ()},[]),(0,f.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),d(``);try{let r=await mP.planRespond(e.sessionId,{version:n.version,decision:i});if(r.status===`awaiting_approval`)throw Error(t(`plan.card.notSaved`));let a=r.status===$P(i.kind)&&(i.kind===`approve`||r.feedback===i.feedback);e.onSettled(r,a)}catch(e){d(t(`plan.card.submitFailed`,{error:tF(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`),d(``);try{await mP.planMode(e.sessionId,`normal`)}catch(e){d(t(`plan.card.exitFailed`,{error:tF(e)}))}finally{e.deciding.delete(n.version),p.current=!1,a(null)}}};return(0,k.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,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1.5`,children:[(0,k.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,k.jsx)(KR,{name:`sparkles`,size:12}),t(`plan.card.badge`)]}),(0,k.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-tianyi-900`,children:[qP(`awaiting_approval`),r?``:t(`plan.card.offline`)]})]}),(0,k.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,k.jsx)(`h2`,{"data-plan-title":!0,className:`whitespace-pre-wrap break-words font-semibold text-ink-900`,children:HP(n.title)}),(0,k.jsx)(`ol`,{"data-plan-steps":!0,className:`list-decimal space-y-1 pl-5 text-ink-900`,children:n.steps.map((e,t)=>(0,k.jsx)(`li`,{className:`break-words pl-1`,children:(0,k.jsx)(HZ,{text:e})},t))}),n.note!==``&&(0,k.jsx)(`div`,{"data-plan-note":!0,className:`break-words text-xs text-ink-700`,children:(0,k.jsx)(HZ,{text:n.note})}),o&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`label`,{htmlFor:`${g}-feedback`,className:`mb-1 block text-xs font-medium text-ink-600`,children:t(`plan.card.feedback`)}),(0,k.jsx)(`textarea`,{ref:h,id:`${g}-feedback`,rows:3,value:c,maxLength:pj.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,k.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t border-tianyi-200 px-3 py-2`,children:[!r&&(0,k.jsx)(`output`,{className:`block text-xs text-sakura-800`,children:t(`plan.card.offlineNote`)}),u&&(0,k.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-sakura-800`,children:u}),(0,k.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:o?(0,k.jsxs)(k.Fragment,{children:[(0,k.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,k.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),d(``)},children:t(`common.cancel`)}),(0,k.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:_===``?t(`plan.card.needFeedback`):`${c.length}/${pj.feedbackChars}`})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.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,k.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,k.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,k.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:t(`plan.card.hint`)})]})})]})]})}var oQ=[],sQ=e=>e instanceof Error?e.message:String(e),cQ=()=>document.querySelector(`textarea[data-composer-input]`)?.focus();function lQ(e){return document.querySelector(`dialog[open]`)!==null||(e?.subagents??[]).some(e=>(e.approvalCount??0)>0&&e.historyThrough===void 0)}function uQ(e,t){if(t)return UP(e);let n=z();return e.status===`cancelled`?n(`question.card.cancelledElsewhere`):n(`question.card.handledElsewhere`,{result:UP(e)})}function dQ(){let{currentSessionId:e}=nP();return e?(0,k.jsx)(fQ,{sessionId:e},e):null}function fQ({sessionId:e}){let t=B(),n=nP(),r=CF(),i=FP(n),a=i?.online??!1,[o,s]=(0,f.useState)(()=>new Set),[c,l]=(0,f.useState)({}),[u,d]=(0,f.useState)(null),p=(0,f.useRef)(!0);(0,f.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=i?.pending??oQ,h=m.map(t=>({summary:t,key:SF(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,f.useLayoutEffect)(()=>{let t=h.some(({key:e})=>wF.state.fold[e]===`open`);for(let{summary:r,key:i}of h){if(wF.state.fold[i]!==void 0)continue;let a=r.id===g?.summary.id&&!t&&!lz(e)&&!lQ(n.view);wF.setFold(i,a?`open`:`folded`),a&&(t=!0)}});let y=(0,f.useCallback)((e,t,n)=>{wF.clearDraft(e),s(t=>new Set(t).add(e)),d(uQ(t,n))},[]),b=i!==null,x=(0,f.useRef)(new Map);(0,f.useEffect)(()=>{if(!b)return;let t=new Map(m.map(t=>[SF(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)||(wF.clearDraft(n),mP.questionGet(e,r.id).then(e=>{p.current&&d(e!==null&&e.status!==`pending`?uQ(e,!1):z()(`question.card.gone`))}).catch(()=>{p.current&&d(z()(`question.card.gone`))}));x.current=t},[b,m,e,o]),(0,f.useEffect)(()=>{a&&l(e=>pQ(e))},[a]);let S=g?.key,C=g?.summary,w=v===void 0;if((0,f.useEffect)(()=>{if(S===void 0||C===void 0||!_||!a||!w)return;let n=S;l(e=>({...e,[n]:{state:`loading`}})),mP.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:sQ(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,k.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,k.jsxs)(`div`,{className:`chat-column flex flex-col gap-1.5`,children:[u!==null&&(0,k.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,k.jsx)(`span`,{className:`max-h-24 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,children:HP(u)}),(0,k.jsx)($R,{label:t(`question.card.dismiss`),onClick:()=>d(null)})]}),h.length>1&&(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-700`,children:[(0,k.jsx)(`span`,{children:t(`question.card.count`,{total:h.length,index:T+1})}),(0,k.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:()=>wF.setActive(e,h[T-1].summary.id),children:t(`question.card.prev`)}),(0,k.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:()=>wF.setActive(e,h[T+1].summary.id),children:t(`question.card.next`)})]}),g!==void 0&&(0,k.jsx)(mQ,{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 pQ(e){return Object.values(e).some(e=>e.state===`error`)?Object.fromEntries(Object.entries(e).filter(([,e])=>e.state!==`error`)):e}function mQ(e){let t=B(),{summary:n,questionKey:r,open:i,online:a}=e,o=CF(),s=wF.draft(r),[c,l]=(0,f.useState)(null),[u,d]=(0,f.useState)(``),p=(0,f.useRef)(!1),m=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null),_=(0,f.useId)(),v=e.slot?.state===`ready`?e.slot.record:null,y=(v?.options.length??n.optionCount)>0;(0,f.useLayoutEffect)(()=>()=>{m.current?.contains(document.activeElement)&&cQ()},[]);let b=o.focus?.key===r?o.focus:null,x=e.slot?.state;(0,f.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`}),wF.consumeFocus(b.nonce)},[b,i,a,x]);let S=!a||c!==null||v===null,C=v!==null&&Dj(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`),d(``);try{let i=await mP.questionRespond(e.sessionId,{id:n.id,version:n.version,response:r});if(i.status===`pending`)throw Error(t(`question.card.notSaved`));e.onSettled(i,WP(i,r))}catch(e){d(t(`question.card.submitFailed`,{error:sQ(e)}))}finally{p.current=!1,l(null)}}},E=()=>{let e=Ej(s);e!==null&&w&&T(e)},ee=HP(n.preview).replace(/\s+/g,` `),te=`${_}-body`;return(0,k.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,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1.5`,children:[(0,k.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,k.jsx)(KR,{name:`sparkles`,size:12}),t(`question.card.section`)]}),(0,k.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-tianyi-900`,children:[t(`question.card.awaiting`),a?``:t(`question.card.offline`)]}),i?(0,k.jsx)(`span`,{className:`min-w-0 flex-1`}):(0,k.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-ink-700`,title:ee,children:[ee,n.preview.length>=fj.previewChars?`…`:``]}),!i&&(s.optionIds.length>0||s.text!==``)&&(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:t(`question.card.draftKept`)}),(0,k.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:()=>wF.setFold(r,i?`folded`:`open`),children:t(i?`question.card.fold`:`question.card.unfold`)})]}),i&&(0,k.jsxs)(k.Fragment,{children:[(0,k.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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-ink-900`,children:HP(n.preview)}),e.slot?.state===`error`?(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.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,k.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,k.jsx)(`output`,{className:`block text-xs text-ink-600`,children:t(a?`question.card.loading`:`question.card.loadOffline`)})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-ink-900`,"data-question-text":!0,children:HP(v.question)}),v.options.length>0&&(0,k.jsxs)(`fieldset`,{className:`min-w-0 space-y-1.5`,"data-question-options":!0,children:[(0,k.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,k.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,k.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:()=>wF.setDraft(r,Tj(v,s,e.id))}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`label`,{htmlFor:i,className:`block cursor-pointer whitespace-pre-wrap break-words`,children:[HP(e.label),e.recommended&&(0,k.jsxs)(k.Fragment,{children:[` `,(0,k.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,k.jsx)(`p`,{id:a,className:`whitespace-pre-wrap break-words text-xs text-ink-600`,children:HP(e.description)})]})]},e.id)}),!v.multiple&&s.optionIds.length>0&&(0,k.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:()=>wF.setDraft(r,{...s,optionIds:[]}),children:t(`question.card.clear`)})]}),(0,k.jsxs)(`div`,{children:[(0,k.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,k.jsx)(`textarea`,{id:`${_}-text`,rows:y?2:3,value:s.text,maxLength:fj.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=>wF.setDraft(r,{...s,text:e.target.value})})]})]})}),(0,k.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t border-tianyi-200 px-3 py-2`,children:[!a&&(0,k.jsx)(`output`,{className:`block text-xs text-sakura-800`,children:t(`question.card.offlineNote`)}),u&&(0,k.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-sakura-800`,children:u}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.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,k.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,k.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:t(C&&c===null?`question.card.needInput`:`question.card.foldHint`)})]})]})]})]})}var hQ={zh:`zh-CN`,en:`en-GB`};function gQ(e,t=zN()){return new Date(e).toLocaleString(hQ[t])}function _Q(e,t=zN()){return new Date(e).toLocaleDateString(hQ[t])}function vQ(e,t,n=zN()){return na(e,t,n)}var yQ=Date.now(),bQ=new Set,xQ,SQ=()=>{yQ=Date.now();for(let e of bQ)e()},CQ=e=>(bQ.add(e),bQ.size===1&&(SQ(),xQ=setInterval(SQ,6e4),window.addEventListener(`focus`,SQ)),()=>{bQ.delete(e),bQ.size||(clearInterval(xQ),window.removeEventListener(`focus`,SQ))}),wQ=()=>(0,f.useSyncExternalStore)(CQ,()=>yQ);function TQ(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:z()(`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 EQ({initialPath:e,onClose:t}){let n=B(),[r,i]=(0,f.useState)(e),[a,o]=(0,f.useState)(e),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(null),[m,h]=(0,f.useState)(!0),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(0),S=(0,f.useRef)(0),C=(0,f.useRef)(null),w=(0,f.useRef)(!1);(0,f.useEffect)(()=>{let e=++S.current;return h(!0),y(``),p(null),mP.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(!d?.next||m)return;let e=++S.current;h(!0),y(``);try{let t=await mP.browse({path:r,query:s,showHidden:l,cursor:d.next});e===S.current&&p({...t,entries:[...d.entries,...t.entries]})}catch(t){e===S.current&&y(String(t))}finally{e===S.current&&h(!1)}},ee=async()=>{if(!(!d||m||w.current)){w.current=!0,_(!0),y(``);try{await mP.addWorkspace(d.path),t()}catch(e){y(String(e))}finally{w.current=!1,_(!1)}}},{root:te,rootLabel:ne,crumbs:D}=TQ(d?.path??r);return(0,k.jsxs)(XR,{title:n(`sessions.addWorkspace`),onClose:t,locked:g,children:[(0,k.jsxs)(`div`,{className:`picker-controls`,children:[(0,k.jsx)(`p`,{className:`text-ink-500`,children:n(`picker2.hint`)}),(0,k.jsxs)(`nav`,{className:`breadcrumbs`,"aria-label":n(`picker2.pathNav`),children:[(0,k.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>T(te),children:ne}),D.map(e=>(0,k.jsxs)(`button`,{type:`button`,disabled:g,onClick:()=>T(e.path),children:[e.label,` /`]},e.path))]}),(0,k.jsxs)(`form`,{className:`path-form`,onSubmit:e=>{e.preventDefault(),T(a)},children:[(0,k.jsx)(`input`,{ref:C,"aria-label":n(`picker2.fullPath`),value:a,disabled:g,onChange:e=>o(e.target.value)}),(0,k.jsx)(`button`,{className:`btn-outline`,type:`submit`,disabled:g,children:n(`picker2.go`)})]}),(0,k.jsxs)(`div`,{className:`filter-row`,children:[(0,k.jsx)(`input`,{"aria-label":n(`picker2.filter`),placeholder:n(`picker2.filterPlaceholder`),value:s,disabled:g,onChange:e=>c(e.target.value)}),(0,k.jsxs)(`label`,{children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:l,disabled:g,onChange:e=>u(e.target.checked)}),n(`picker2.hidden`)]})]})]}),(0,k.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,k.jsxs)(`div`,{role:`alert`,className:`error-text`,children:[v,(0,k.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:g,onClick:()=>x(e=>e+1),children:n(`common.retry`)})]}),d?.parent&&(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:g||m,onClick:()=>T(d.parent),children:[(0,k.jsx)(KR,{name:`up`}),n(`picker2.parent`)]}),d?.entries.map(e=>(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:g||m||!!e.error,title:e.error??e.path,onClick:()=>T(e.path),children:[(0,k.jsx)(KR,{name:`folder`}),(0,k.jsx)(`span`,{className:`truncate min-w-0`,children:e.name}),e.error&&(0,k.jsx)(`span`,{className:`text-ink-500`,children:n(`picker2.inaccessible`)})]},e.path)),m&&(0,k.jsx)(`output`,{className:`empty-text`,children:n(`picker2.loading`)}),!m&&d?.entries.length===0&&(0,k.jsx)(`p`,{className:`empty-text`,children:n(`picker2.noMatch`)}),d?.next&&(0,k.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:m||g,onClick:()=>void E(),children:n(`picker2.more`)})]}),(0,k.jsxs)(`div`,{className:`picker-footer`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:QR(d?.path??r)}),(0,k.jsx)(`p`,{className:`path-text`,children:d?.path??r})]}),(0,k.jsxs)(`div`,{className:`actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:g,onClick:t,children:n(`common.cancel`)}),(0,k.jsx)(`button`,{type:`button`,className:`btn-primary px-3 py-1.5`,disabled:!d||m||g||!!v,onClick:()=>void ee(),children:n(g?`picker2.adding`:`picker2.choose`)})]})]})]})}function DQ({open:e,onClose:t}){let n=B(),r=n(`common.newSession`),i=nP(),a=wQ(),o=qR(),[s,c]=(0,f.useState)(null),l=i.sessions.find(e=>e.id===s?.id),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(null),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(``),T=i.phase!==`ready`||i.operating,E=GN(i.sessions,i.workspaceRoot).filter(e=>ta(e,C)),ee=e=>{e.then(()=>{o&&t()}).catch(gP)},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,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`sidebar-top`,children:[(0,k.jsxs)(`div`,{className:`workspace-heading`,children:[(0,k.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,k.jsx)(`span`,{className:`workspace-mark`,children:(0,k.jsx)(KR,{name:`folder`})}),(0,k.jsx)(`span`,{className:`truncate min-w-0`,children:QR(i.workspaceRoot)||n(`common.workspace`)}),(0,k.jsx)(KR,{name:`chevron`})]}),!o&&(0,k.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":n(`sessions.collapse`),title:n(`sessions.collapse`),onClick:t,children:(0,k.jsx)(KR,{name:`panel`})})]}),(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row font-medium`,disabled:T,onClick:()=>ee(mP.createSession()),children:[(0,k.jsx)(KR,{name:`plus`}),n(`sessions.new`)]}),(0,k.jsxs)(`div`,{className:`search-box`,children:[(0,k.jsx)(KR,{name:`search`}),(0,k.jsx)(`input`,{"aria-label":n(`sessions.searchAria`),placeholder:n(`sessions.searchPlaceholder`),value:C,onChange:e=>w(e.target.value)})]})]}),(0,k.jsxs)(`div`,{className:`section-label`,children:[n(`sessions.heading`),` `,(0,k.jsx)(`span`,{children:E.length})]}),(0,k.jsxs)(`div`,{className:`session-scroll`,children:[(0,k.jsx)(`ul`,{className:`session-list`,children:E.map(e=>(0,k.jsxs)(`li`,{className:`session-row ${e.id===i.currentSessionId?`is-active`:``}`,children:[(0,k.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(mP.selectSession(e.id)),children:[(0,k.jsx)(KR,{name:`chat`}),(0,k.jsxs)(`span`,{className:`session-copy`,children:[(0,k.jsx)(`span`,{className:`truncate min-w-0`,children:Zi(e,r)}),(0,k.jsxs)(`span`,{className:`session-meta${e.awaitingAnswer===!0||e.awaitingPlan===!0?` font-semibold text-tianyi-800`:``}`,children:[(0,k.jsx)(`time`,{dateTime:new Date(Qi(e)).toISOString(),children:vQ(Qi(e),a)}),BP(e)]}),(0,k.jsxs)(`span`,{className:`session-tooltip`,role:`tooltip`,id:`session-tip-${e.id}`,children:[Zi(e,r),(0,k.jsx)(`br`,{}),gQ(Qi(e))]})]})]}),(0,k.jsx)(`button`,{type:`button`,className:`icon-btn row-more`,disabled:T,"aria-label":n(`sessions.actionsFor`,{name:Zi(e,r)}),title:n(`sessions.actions`),onClick:t=>c({anchor:t.currentTarget,id:e.id}),children:(0,k.jsx)(KR,{name:`more`})})]},e.id))}),E.length===0&&(0,k.jsx)(`div`,{className:`empty-text`,children:i.phase===`ready`?n(C?`sessions.noMatch`:`sessions.empty`):n(`sessions.waitingGateway`)})]}),(0,k.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,k.jsx)(`span`,{className:`path-text`,title:i.workspaceRoot,children:i.workspaceRoot}),(0,k.jsxs)(Ur,{to:`/skills`,className:`chrome-row`,onClick:()=>{o&&t()},children:[(0,k.jsx)(KR,{name:`store`}),n(`sessions.market`)]}),(0,k.jsxs)(Ur,{to:`/settings`,className:`chrome-row`,onClick:()=>{o&&t()},children:[(0,k.jsx)(KR,{name:`settings`}),n(`sessions.settings`)]})]})]});return(0,k.jsxs)(k.Fragment,{children:[o?(0,k.jsx)(XR,{title:n(`sessions.drawer`),drawer:!0,onClose:t,children:D}):(0,k.jsx)(`aside`,{className:`chrome sidebar`,"aria-label":n(`sessions.drawer`),children:D}),s&&(0,k.jsx)(ZR,{anchor:s.anchor,label:s.id?n(`sessions.actions`):n(`sessions.chooseWorkspace`),onClose:()=>c(null),children:s.id?(0,k.jsxs)(k.Fragment,{children:[l&&(0,k.jsxs)(`div`,{className:`session-details`,children:[(0,k.jsx)(`strong`,{children:Zi(l,r)}),(0,k.jsx)(`small`,{children:gQ(Qi(l))})]}),(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>{m(s.id),g(``),c(null)},children:[(0,k.jsx)(KR,{name:`archive`}),n(`sessions.archive`)]})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`section-label`,children:n(`common.workspace`)}),(0,k.jsx)(`div`,{className:`workspace-options`,children:i.workspaces.map(e=>{let t=ne(e.path);return(0,k.jsxs)(`div`,{className:`workspace-row ${e.path===i.workspaceRoot?`is-active`:``}`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`workspace-option`,title:e.path,onClick:()=>{c(null),w(``),ee(mP.selectWorkspace(e.path))},children:[(0,k.jsx)(KR,{name:`folder`}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`strong`,{children:QR(e.path)}),(0,k.jsx)(`small`,{children:e.path})]}),e.path===i.workspaceRoot&&(0,k.jsx)(`span`,{role:`img`,"aria-label":n(`sessions.currentWorkspace`),children:`✓`})]}),(0,k.jsx)(`button`,{type:`button`,className:`icon-btn row-remove`,disabled:T||t!==null,"aria-label":n(`sessions.removeWorkspaceAria`,{name:QR(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,k.jsx)(KR,{name:`trash`})}),t&&(0,k.jsx)(`span`,{className:`sr-only`,id:`workspace-remove-${e.path}`,children:t})]},e.path)})}),(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row add-workspace`,onClick:()=>{c(null),d(!0)},children:[(0,k.jsx)(KR,{name:`plus`}),n(`sessions.addWorkspace`)]})]})}),u&&(0,k.jsx)(EQ,{initialPath:i.workspaceRoot,onClose:()=>d(!1)}),_&&(0,k.jsx)(XR,{title:n(`sessions.removeWorkspace`),locked:i.operating||x,onClose:()=>v(null),children:(0,k.jsxs)(`div`,{className:`confirm-body`,children:[(0,k.jsx)(`p`,{children:(0,k.jsx)(`strong`,{children:QR(_)})}),(0,k.jsx)(`p`,{className:`path-text`,title:_,children:_}),(0,k.jsxs)(`ul`,{className:`confirm-notes`,children:[(0,k.jsx)(`li`,{children:n(`sessions.removeWorkspaceNoFiles`)}),(0,k.jsx)(`li`,{children:n(`sessions.removeWorkspaceHidden`,{count:GN(i.sessions,_).length})}),(0,k.jsx)(`li`,{children:n(`sessions.removeWorkspaceRestore`)})]}),y&&(0,k.jsx)(`p`,{role:`alert`,className:`error-text`,children:y}),(0,k.jsxs)(`div`,{className:`actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:i.operating||x,onClick:()=>v(null),children:n(`common.cancel`)}),(0,k.jsx)(`button`,{type:`button`,className:`btn-danger`,disabled:i.operating||x,onClick:()=>{S(!0),b(``),mP.removeWorkspace(_).then(()=>v(null)).catch(e=>b(ZN(e instanceof Error?e.message:String(e)))).finally(()=>S(!1))},children:n(`sessions.confirmRemoveWorkspace`)})]})]})}),p&&(0,k.jsx)(XR,{title:n(`sessions.archive`),locked:i.operating,onClose:()=>m(null),children:(0,k.jsxs)(`div`,{className:`confirm-body`,children:[(0,k.jsx)(`p`,{children:n(`sessions.archiveConfirm`,{name:Zi(i.sessions.find(e=>e.id===p)??{title:``,firstPromptPreview:``},r)})}),h&&(0,k.jsx)(`p`,{role:`alert`,className:`error-text`,children:h}),(0,k.jsxs)(`div`,{className:`actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:i.operating,onClick:()=>m(null),children:n(`common.cancel`)}),(0,k.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:i.operating,onClick:()=>{mP.archiveSession(p).then(()=>m(null)).catch(e=>g(String(e)))},children:n(`sessions.confirmArchive`)})]})]})})]})}function OQ(){let{shell:e}=nP(),t=B(),[n,r]=(0,f.useState)(null),i=Sz(e),a=e?.status===`missing`?JSON.stringify([e.reason,e.detail]):null;return i===void 0||n===a?null:(0,k.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,k.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:i}),(0,k.jsx)($R,{label:t(`shell.dismiss`),onClick:()=>r(a)})]})}function kQ(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 AQ({entry:e,active:t,target:n}){let r=B(),{phase:i,operating:a,view:o}=nP(),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)([]),[m,h]=(0,f.useState)(),[g,_]=(0,f.useState)(!1),[,v]=(0,f.useState)(Date.now);(0,f.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,f.useMemo)(()=>y&&t?mP.subagent(e.agentId):null,[y,t,e.agentId]),x=(0,f.useRef)(0);(0,f.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:kQ(e?.items??[],t.items)})),h(e=>e===void 0?t.historyBefore:e),b.error||u(``))});return()=>{x.current++,t()}},[b]);let S=(0,f.useMemo)(()=>b?(e,t)=>Yi(n=>b.getImage({entryId:e,contentIndex:t,offset:n})):null,[b]),C=(0,f.useMemo)(()=>s?{...s,items:kQ(d,s.items)}:null,[s,d]),w=(0,f.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=>kQ(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,f.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,k.jsxs)(`div`,{className:`${t?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-sakura-100 p-3 text-xs`,children:[(0,k.jsxs)(`span`,{children:[e.historyThrough===void 0?``:r(`subagent.history`),r(`task.status.${e.status}`)]}),s&&(0,k.jsxs)(`span`,{title:r(`subagent.usage`),children:[`↑`,s.usage.input,` ↓`,s.usage.output,` · $`,s.usage.cost.toFixed(4)]}),E&&(0,k.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,k.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,k.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-sakura-800`,children:l}),(0,k.jsx)(dG.Provider,{value:S,children:(0,k.jsx)(tQ,{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 jQ({entries:e,selected:t,open:n,onSelect:r,onClose:i,approval:a,target:o}){let s=B(),c=Yz(),[l,u]=(0,f.useState)([]),d=(0,f.useRef)(null),p=(0,f.useRef)(null),[m,h]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);return(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>h(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,f.useEffect)(()=>{t!==null&&u(e=>e.includes(t)?e:[...e,t])},[t]),(0,f.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}),d.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,m]),(0,k.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,k.jsx)(Zz,{width:c.width,onChange:c.set,onCommit:c.commit,onReset:c.reset}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,k.jsx)(`strong`,{className:`text-sm text-ink-800`,children:s(`subagent.title`)}),(0,k.jsx)(`button`,{ref:d,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,k.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:e.map(e=>(0,k.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,k.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,k.jsx)(`span`,{className:`text-tianyi-700`,children:e.role}),` · `,e.title]}),(0,k.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,k.jsx)(AQ,{entry:i,active:n&&r===t,target:r===t?o:void 0},r):null}),a]})}var MQ={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 NQ(e){let t=B(),n=PP(nP());return n===null||n.total===0?null:(0,k.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,k.jsxs)(`span`,{className:`max-sm:hidden`,"aria-hidden":!0,children:[t(`todo.label`),` `]}),(0,k.jsxs)(`span`,{"aria-hidden":!0,children:[n.completed,`/`,n.total]})]})}function PQ(e){let t=B(),n=PP(nP());return n===null||n.total===0?null:(0,k.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,k.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,k.jsx)(`strong`,{className:`text-ink-800`,children:t(`todo.heading`,{done:n.completed,total:n.total})}),n.offline&&(0,k.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,k.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,k.jsx)(`div`,{className:`chat-column flex min-h-0 flex-1 flex-col`,children:(0,k.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,k.jsx)(`ol`,{className:`space-y-1.5`,children:n.items.map(e=>(0,k.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,"data-status":e.status,children:[(0,k.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 ${MQ[e.status]}`,children:[(0,k.jsx)(KR,{name:e.status===`completed`?`check`:e.status===`in_progress`?`spinner`:`clock`,size:12}),RP(e.status)]}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-ink-800`,children:HP(e.text)})]},e.id))})})})]})}var FQ=class extends Error{constructor(){super(z()(`export.cancelled`)),this.name=`ExportCancelledError`}};async function IQ(e){let{snapshot:t}=e,n=e.now??new Date,r=!1,i=await uH(e.format,{...t,exportedAt:n},{includeThinking:e.includeThinking,loadImage:n=>e.currentSessionId()===t.sessionId?e.readImage(n,t.sessionId):(r=!0,Promise.reject(new FQ))});if(r)throw new FQ;return{...i,fileName:lH(t.title,e.format,n)}}function LQ(e){let t=z();return e.skippedImages>0?t(`export.doneSkipped`,{name:e.fileName,count:e.skippedImages}):t(`export.done`,{name:e.fileName})}function RQ(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 zQ=[{format:`markdown`,label:`Markdown (.md)`},{format:`html`,label:`HTML (.html)`},{format:`json`,label:`JSON (.json)`}];function BQ(){let e=B(),{view:t,currentSessionId:n,sessions:r}=nP(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(!1),u=(0,f.useRef)(!1),d=t===null||n===null||t.items.length===0,p=e(c?`export.busy`:d?`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 IQ({format:i,includeThinking:o,snapshot:{sessionId:n,title:s?Zi(s,e(`common.newSession`)):e(`common.newSession`),model:t.model,cwd:t.cwd,items:t.items},currentSessionId:()=>rP().currentSessionId,readImage:(e,t)=>mP.image(e.entryId,e.contentIndex,t)});RQ(r.fileName,r.content,r.mimeType),iP.notice({level:`info`,text:LQ(r)})}catch(t){iP.notice({level:`error`,text:t instanceof FQ?t.message:e(`export.failed`,{error:t instanceof Error?t.message:String(t)})})}finally{u.current=!1,l(!1)}};return(0,k.jsxs)(k.Fragment,{children:[(0,k.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:d&&!c,title:p,onClick:e=>{c||a(i===null?e.currentTarget:null)},children:[(0,k.jsx)(KR,{name:`download`}),(0,k.jsx)(`span`,{className:`export-label`,children:e(c?`export.busy`:`export.button`)})]}),i&&(0,k.jsxs)(ZR,{anchor:i,label:e(`export.title`),onClose:()=>a(null),children:[(0,k.jsx)(`div`,{className:`section-label`,children:e(`export.format`)}),zQ.map(({format:e,label:t})=>(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>void m(e),children:[(0,k.jsx)(KR,{name:`download`}),t]},e)),(0,k.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":o,className:`chrome-row export-option`,onClick:()=>s(!o),children:[(0,k.jsx)(`span`,{className:`export-check`,"aria-hidden":`true`,children:o?`✓`:``}),e(`export.thinking`)]})]})]})}var VQ={资源管理器:`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 HQ(e,t=z()){let n=VQ[e];return n===void 0?e:t(n)}var UQ=`neko.openTarget`;function WQ(e=localStorage){try{let t=e.getItem(UQ);return t===`vscode`||t===`file-manager`?t:void 0}catch{return}}function GQ(e,t=localStorage){try{t.setItem(UQ,e)}catch{}}function KQ(e,t){return e.find(e=>e.id===t&&e.available)??e.find(e=>e.available)}function qQ(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 JQ(){try{let e=await fetch(`/api/local/session`,{cache:`no-store`});if(!e.ok)return null;let t=await e.json();return qQ(t)?t:null}catch{return null}}var YQ=class extends Error{constructor(e){super(e),this.name=`OpenWorkspaceError`}};async function XQ(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=z();return e.status===403?r(`open.forbidden`):t===`invalid_path`?r(`open.invalidPath`):(t===`unavailable`||t===`launch_failed`)&&n!==void 0&&n!==``?HQ(n,r):r(`open.requestFailedStatus`,{status:e.status})}async function ZQ(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 YQ(z()(`open.requestFailed`,{error:e instanceof Error?e.message:String(e)}))}if(!r.ok)throw new YQ(await XQ(r))}function QQ({size:e=18}){return(0,k.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,k.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,k.jsx)(`path`,{d:`M17.4 7.4 11.6 12l5.8 4.6z`,fill:`#fff`}),(0,k.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 $Q({size:e=18}){return(0,k.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,k.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`18`,rx:`4.5`,fill:`#2F8CF7`}),(0,k.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,k.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 e$({size:e=18}){return(0,k.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,k.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,k.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 t$({size:e=18}){return(0,k.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,k.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,k.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 n$({id:e,label:t,size:n}){return e===`vscode`?(0,k.jsx)(QQ,{size:n}):t===`Finder`?(0,k.jsx)($Q,{size:n}):t===`资源管理器`?(0,k.jsx)(e$,{size:n}):(0,k.jsx)(t$,{size:n})}function r$({ready:e}){let t=B(),{workspaceRoot:n,currentSessionId:r,sessions:i,view:a}=nP(),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(()=>WQ()),[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(!1),h=(0,f.useRef)(!1),g=(0,f.useRef)(!0);if((0,f.useEffect)(()=>(g.current=!0,JQ().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=KQ(o.targets,c),b=e&&r!==null&&v!==``&&y!==void 0&&!p,x=y===void 0?t(`open.title`):t(`open.withTarget`,{target:HQ(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),d(null);try{await ZQ(o.csrf,e,v),GQ(e),l(e)}catch(e){iP.notice({level:`error`,text:t(`open.failed`,{error:e instanceof Error?e.message:String(e)})}),JQ().then(e=>{g.current&&e!==null&&s(e)})}finally{h.current=!1,m(!1)}}},w=e=>{u===null?(d(e),JQ().then(e=>{g.current&&e!==null&&s(e)})):d(null)};return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`span`,{className:`open-split`,"data-open-workspace":!0,children:[(0,k.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,k.jsx)(KR,{name:`folder`}):(0,k.jsx)(n$,{id:y.id,label:y.label})}),(0,k.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,k.jsx)(KR,{name:`chevron`,size:16})})]}),u&&(0,k.jsxs)(ZR,{anchor:u,label:t(`open.title`),onClose:()=>d(null),children:[(0,k.jsx)(`div`,{className:`section-label`,children:t(`open.title`)}),o.targets.map(e=>(0,k.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:!e.available,title:e.available||e.reason===void 0?void 0:HQ(e.reason,t),onClick:()=>void C(e.id),children:[(0,k.jsx)(n$,{id:e.id,label:e.label}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate`,children:HQ(e.label,t)}),!e.available&&e.reason!==void 0&&(0,k.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:HQ(e.reason,t)})]})]},e.id))]})]})}var i$={ready:`common.connected`,connecting:`common.connecting`,reconnecting:`common.reconnecting`,error:`common.connectionFailed`};function a$(e){let t=B(),{workspaceRoot:n,currentSessionId:r,operating:i,sessions:a,view:o}=nP(),s=o?.jobs,c=s?.filter(e=>e.status===`running`).length??0,l=a.find(e=>e.id===r);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`header`,{className:`chrome topbar`,children:[(0,k.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,k.jsx)(KR,{name:`panel`})}),(0,k.jsxs)(`span`,{className:`topbar-path`,title:n,children:[(0,k.jsx)(KR,{name:`folder`}),(0,k.jsx)(`span`,{className:`truncate min-w-0`,children:QR(n)||t(`common.workspace`)})]}),(0,k.jsx)(`span`,{className:`text-ink-500`,children:`/`}),(0,k.jsx)(`span`,{className:`truncate min-w-0`,title:l?Zi(l,t(`common.newSession`)):void 0,children:l?Zi(l,t(`common.newSession`)):t(`common.newSession`)}),(0,k.jsx)(`output`,{className:`conn-status ${e.conn===`ready`?`is-connected`:e.conn===`error`?`is-error`:``}`,children:t(i?`topbar.switching`:i$[e.conn])}),e.todos&&(0,k.jsx)(NQ,{open:e.todos.open,onToggle:e.todos.onToggle,panelId:e.todos.panelId}),s!==void 0&&s.length>0&&e.onToggleJobs&&(0,k.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,k.jsx)(r$,{ready:e.conn===`ready`&&!i}),e.workspace&&(0,k.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,k.jsx)(KR,{name:`panel-right`}),e.workspace.count>0&&(0,k.jsx)(`span`,{className:`workspace-badge`,"aria-hidden":`true`,children:e.workspace.count>99?`99+`:e.workspace.count})]}),(0,k.jsx)(BQ,{})]}),(0,k.jsx)(xz,{})]})}var o$=e=>e instanceof Error?e.message:String(e),s$=e=>e!==void 0&&/not found|ENOENT|不存在/i.test(e);function c$(e){let t=e.lastIndexOf(`/`);return t<0?{name:e,dir:``}:{name:e.slice(t+1),dir:e.slice(0,t)}}function l$(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KiB`:`${(e/1048576).toFixed(1)} MiB`}var u$=e=>e===`main`?z()(`agent.main`):e;function d$(e){if(e===``)return 1;let t=e.split(`
|
|
393
|
+
`).length;return e.endsWith(`
|
|
394
|
+
`)?t-1:t}function f$(e){let t=e.split(`/`).slice(0,-1);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function p$(e,t,n,r=0){let[i,a]=(0,f.useState)({key:e,status:`loading`,data:void 0,error:void 0}),[o,s]=(0,f.useState)(0),c=(0,f.useRef)(n);c.current=n,(0,f.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:o$(t)}))),()=>n.abort()},[e,t,r,o]);let l=(0,f.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 m$=(e,t)=>(0,k.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,k.jsxs)(`span`,{className:`text-[#117555]`,children:[`+`,e]}),` `,(0,k.jsxs)(`span`,{className:`text-sakura-800`,children:[`-`,t]})]}),h$=`shrink-0 rounded-full border px-1.5 py-px text-[11px] leading-4`;function g$(e){let t=B(),{list:n}=e;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`changes-list`,children:[(0,k.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1.5`,children:[e.status===`error`&&(0,k.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 p-2 text-xs text-sakura-800`,children:[(0,k.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`changes.listFailed`,{error:e.error??``})}),(0,k.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,k.jsx)(`output`,{className:`block p-2 text-xs text-ink-500`,children:t(`common.loadingEllipsis`)}),n&&n.files.length===0&&(0,k.jsx)(`div`,{"data-testid":`changes-empty`,className:`p-3 text-sm text-ink-700`,children:(0,k.jsx)(`p`,{className:`font-medium`,children:t(`changes.empty`)})}),n?.files.map(n=>{let{name:r,dir:i}=c$(n.path);return(0,k.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,k.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-ink-800`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:r}),m$(n.added,n.removed),(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:t(`changes.ops`,{count:n.ops})})]}),(0,k.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-ink-500`,children:[n.outside&&(0,k.jsx)(`span`,{className:`${h$} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.outside`)}),(0,k.jsx)(`span`,{className:`min-w-0 max-w-full truncate`,dir:`ltr`,children:i===``?t(`changes.root`):i}),n.agents.map(e=>(0,k.jsx)(`span`,{className:`${h$} border-tianyi-200 bg-tianyi-50 text-tianyi-900`,children:u$(e)},e))]})]},n.path)}),n?.truncated&&(0,k.jsx)(`p`,{role:`note`,className:`p-2 text-xs text-sakura-800`,children:t(`changes.listIncomplete`)})]}),(0,k.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 _$({detail:e}){let t=B(),n=(0,f.useMemo)(()=>[...e.ops].sort((e,t)=>e.seq-t.seq),[e.ops]);return(0,k.jsx)(`ol`,{className:`flex flex-col gap-3 p-3`,children:n.map((n,r)=>(0,k.jsxs)(`li`,{"data-testid":`change-op`,className:`min-w-0 rounded-lg border border-tianyi-200 bg-surface`,children:[(0,k.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,k.jsx)(`span`,{className:`font-medium`,children:r+1}),(0,k.jsx)(`span`,{children:u$(n.agent)}),(0,k.jsx)(`span`,{className:`font-mono text-tianyi-800`,children:n.tool}),m$(n.added,n.removed),n.truncated&&(0,k.jsx)(`span`,{className:`${h$} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.truncated`)})]}),(0,k.jsx)($W,{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 v$(e){let t=B(),n=p$(`change:${e.path}`,e.active,()=>e.api().change(e.path),e.revision),{name:r,dir:i}=c$(e.path),a=n.data,o=a?a.outside===!0:e.outside===!0;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`change-detail`,children:[(0,k.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 px-3 py-2 text-xs`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.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,k.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm text-ink-800`,title:e.path,children:r}),!o&&(0,k.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,k.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-ink-500`,children:[o&&(0,k.jsx)(`span`,{className:`${h$} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.outside`)}),(0,k.jsx)(`span`,{className:`min-w-0 break-all`,title:e.path,children:i===``?t(`viewer.workspaceRoot`):i})]})]}),(0,k.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:[n.status===`error`&&(0,k.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 p-3 text-xs text-sakura-800`,children:[(0,k.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`changes.detailFailed`,{error:n.error??``})}),(0,k.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,k.jsx)(`output`,{className:`block p-3 text-xs text-ink-500`,children:t(`common.loadingEllipsis`)}),a===null&&(0,k.jsx)(`p`,{className:`p-3 text-sm text-ink-600`,children:t(`changes.noRecords`)}),a&&(0,k.jsxs)(k.Fragment,{children:[a.truncated&&(0,k.jsx)(`p`,{role:`note`,className:`px-3 pt-2 text-xs text-sakura-800`,children:t(`changes.detailIncomplete`)}),(0,k.jsx)(_$,{detail:a})]})]})]})}var y$=`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 b$(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 x$({entry:e,parent:t,depth:n,first:r,ctx:i}){let a=B(),o=e.kind===`directory`,s=o&&i.expanded.has(e.path),c=(0,f.useRef)(i.onRowGone);return c.current=i.onRowGone,(0,f.useEffect)(()=>{let t=e.path;return()=>c.current(t)},[e.path]),(0,k.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:y$,style:{paddingLeft:`${.375+n*.875}rem`},onFocus:()=>i.onFocusPath(e.path),onClick:()=>o?i.onToggle(e.path):i.onOpen(e.path),onKeyDown:n=>b$(n,e,t,i),children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:`w-3 shrink-0 text-ink-400`,children:o?s?`▾`:`▸`:``}),(0,k.jsx)(`span`,{"aria-hidden":!0,className:`w-3.5 shrink-0 text-ink-400`,children:o&&(0,k.jsx)(KR,{name:`folder`,size:14})}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.kind===`symlink`&&(0,k.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,k.jsx)(`span`,{className:`shrink-0 text-ink-500`,title:a(`tree.protectedTitle`),role:`img`,"aria-label":a(`tree.protected`),children:(0,k.jsx)(KR,{name:`key`,size:13})})]})}function S$({path:e,depth:t,ctx:n}){let r=B(),i=p$(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,k.jsxs)(k.Fragment,{children:[o?.map((r,i)=>(0,k.jsx)(C$,{entry:r,parent:e,depth:t,first:t===0&&i===0,ctx:n},r.path)),o&&o.length===0&&i.status!==`error`&&(0,k.jsx)(`div`,{className:`py-1 pr-2 text-xs text-ink-500`,style:a,children:r(`tree.emptyDir`)}),!o&&i.status===`loading`&&(0,k.jsx)(`output`,{className:`block py-1 pr-2 text-xs text-ink-500`,style:a,children:r(`common.loadingEllipsis`)}),i.status===`error`&&(0,k.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,k.jsx)(`span`,{className:`min-w-0 break-words`,children:r(`tree.readFailed`,{error:i.error??``})}),(0,k.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,k.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 C$({entry:e,parent:t,depth:n,first:r,ctx:i}){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(x$,{entry:e,parent:t,depth:n,first:r,ctx:i}),e.kind===`directory`&&i.expanded.has(e.path)&&(0,k.jsx)(S$,{path:e.path,depth:n+1,ctx:i})]})}function w$(e){let t=B(),[n,r]=(0,f.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,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,k.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,k.jsx)(`span`,{className:`text-ink-600`,children:t(`tree.readOnly`)}),(0,k.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,k.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,k.jsx)(S$,{path:``,depth:0,ctx:i})})]})}var T$=2e5,E$=`neko.fileZoom`,D$=50,O$=300,k$=10,A$=e=>Math.min(O$,Math.max(D$,Math.round(e)));function j$(){try{let e=Number(localStorage.getItem(E$));return Number.isFinite(e)&&e>0?A$(e):100}catch{return 100}}function M$(e){let t=B(),n=(e.file.content??``).replace(/\n$/,``),r=(0,f.useMemo)(()=>{let t=n.length>T$?void 0:YW(e.file.path);return qU.sanitize(GW(n,t),{USE_PROFILES:{html:!0}})},[n,e.file.path]),i=(0,f.useMemo)(()=>Array.from({length:d$(n)},(e,t)=>t+1).join(`
|
|
395
|
+
`),[n]),a=(0,f.useRef)(null),o=(0,f.useRef)(e.onZoom);return o.current=e.onZoom,(0,f.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),o.current(e.deltaY<0?k$:-10))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,k.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,k.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,k.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,k.jsx)(`pre`,{className:`hljs px-3 py-2 whitespace-pre`,children:(0,k.jsx)(`code`,{dangerouslySetInnerHTML:{__html:r}})})]})})}function N$(e){return(0,k.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,k.jsx)(`p`,{className:`font-medium ${e.tone===`error`?`text-sakura-800`:`text-ink-800`}`,children:e.title}),e.detail&&(0,k.jsx)(`p`,{className:`break-words text-xs text-ink-600`,children:e.detail}),e.action&&(0,k.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 P$(e){let t=B(),n=p$(e.path,e.active,t=>e.api().file(e.path,t)),{name:r,dir:i}=c$(e.path),a=(0,f.useRef)(null);(0,f.useEffect)(()=>a.current?.focus(),[]);let o=e.changes?.files.find(t=>t.path===e.path)?.lastSeq??0,s=e.changes!==void 0,c=(0,f.useRef)(void 0),[l,u]=(0,f.useState)(!1),d=n.data;(0,f.useEffect)(()=>{c.current=s?o:void 0,u(!1)},[d]),(0,f.useEffect)(()=>{s&&(c.current===void 0?c.current=o:o>c.current&&u(!0))},[s,o]);let[p,m]=(0,f.useState)(j$);(0,f.useEffect)(()=>{try{localStorage.setItem(E$,String(p))}catch{}},[p]);let h=e=>m(t=>A$(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`&&!_&&s$(n.error);return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`file-viewer`,children:[(0,k.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 px-3 py-2 text-xs`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.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,k.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm text-ink-800`,title:e.path,children:r}),(0,k.jsxs)(`fieldset`,{"aria-label":t(`viewer.zoom`),className:`flex min-w-0 shrink-0 items-center gap-1`,children:[(0,k.jsx)(`button`,{type:`button`,className:g,"aria-label":t(`viewer.zoomOut`),disabled:p<=D$,onClick:()=>h(-10),children:`−`}),(0,k.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,k.jsx)(`button`,{type:`button`,className:g,"aria-label":t(`viewer.zoomIn`),disabled:p>=O$,onClick:()=>h(k$),children:`+`})]}),(0,k.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,k.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-ink-500`,children:[(0,k.jsx)(`span`,{className:`min-w-0 break-all`,title:e.path,children:i===``?t(`viewer.workspaceRoot`):i}),_&&(0,k.jsx)(`span`,{className:`shrink-0`,children:l$(_.size)})]})]}),l&&(0,k.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,k.jsx)(`span`,{children:t(`viewer.stale`)}),(0,k.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,k.jsx)(N$,{title:t(`viewer.missing`),detail:t(`viewer.missingDetail`),action:{label:t(`common.retry`),run:n.reload}}):n.status===`error`&&!_?(0,k.jsx)(N$,{tone:`error`,title:t(`viewer.readFailed`,{error:n.error??``}),action:{label:t(`common.retry`),run:n.reload}}):_?_.kind===`protected`?(0,k.jsx)(N$,{title:t(`viewer.protected`),detail:t(`viewer.protectedDetail`)}):_.kind===`binary`?(0,k.jsx)(N$,{title:t(`viewer.binary`),detail:t(`viewer.binarySize`,{size:l$(_.size)})}):(0,k.jsxs)(k.Fragment,{children:[n.status===`error`&&(0,k.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,k.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`viewer.refreshFailed`,{error:n.error??``})}),(0,k.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,k.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:l$(_.size)})}),(0,k.jsx)(M$,{file:_,zoom:p,onZoom:h})]}):(0,k.jsx)(N$,{title:t(`common.loadingEllipsis`)})]})}function F$({sessionId:e,open:t,onClose:n,changes:r}){let i=B(),a=Yz(),o=(0,f.useCallback)(()=>mP.workspace(e),[e]),[s,c]=(0,f.useState)(`files`),[l,u]=(0,f.useState)(()=>new Set),[d,p]=(0,f.useState)(null),[m,h]=(0,f.useState)(null),[g,_]=(0,f.useState)(0),v=r?.revision??0,y=(0,f.useId)(),b=e=>`${y}-tab-${e}`,x=`${y}-panel`,S=t&&s===`files`&&d===null,C=t&&s===`files`&&d!==null,w=t&&s===`changes`&&m===null,T=t&&s===`changes`&&m!==null,E=p$(`changes`,w||C,()=>o().changes(),v),ee=(0,f.useRef)(null),te=(0,f.useRef)(null),[ne,D]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>D(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,f.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,f.useRef)(null);(0,f.useEffect)(()=>{let e=re.current;e!==null&&d===null&&s===`files`&&(re.current=null,[...te.current?.querySelectorAll(`[role=treeitem][data-path]`)??[]].find(t=>t.dataset.path===e)?.focus())},[d,s]);let ie=e=>u(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),ae=e=>{u(t=>new Set([...t,...f$(e)])),p(e),c(`files`)},oe=e=>{c(e),document.getElementById(b(e))?.focus()},se=e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`Home`||e.key===`End`)&&(e.preventDefault(),oe(e.key===`ArrowLeft`||e.key===`Home`?`files`:`changes`))},ce=r?.files??0,le=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,k.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,k.jsx)(Zz,{width:a.width,onChange:a.set,onCommit:a.commit,onReset:a.reset}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,k.jsx)(`strong`,{className:`text-sm text-ink-800`,children:i(`common.workspace`)}),(0,k.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,k.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,k.jsx)(`button`,{type:`button`,role:`tab`,id:b(`files`),"aria-selected":s===`files`,"aria-controls":x,tabIndex:s===`files`?0:-1,className:le(`files`),onClick:()=>c(`files`),onKeyDown:se,children:i(`wspanel.files`)}),(0,k.jsx)(`button`,{type:`button`,role:`tab`,id:b(`changes`),"aria-selected":s===`changes`,"aria-controls":x,tabIndex:s===`changes`?0:-1,className:le(`changes`),onClick:()=>c(`changes`),onKeyDown:se,children:i(`wspanel.changes`,{count:ce})})]}),(0,k.jsxs)(`div`,{role:`tabpanel`,id:x,"aria-labelledby":b(s),className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,k.jsx)(`div`,{className:`${s===`files`&&d===null?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:(0,k.jsx)(w$,{api:o,active:S,version:`${g}:${v}`,expanded:l,selected:d,onToggle:ie,onOpen:p,onRefresh:()=>_(e=>e+1)})}),s===`files`&&d!==null&&(0,k.jsx)(P$,{api:o,path:d,active:C,changes:E.data,backLabel:i(`wspanel.backToTree`),onBack:()=>{re.current=d,p(null)}},d),s===`changes`&&m===null&&(0,k.jsx)(g$,{list:E.data,status:E.status,error:E.error,onRetry:E.reload,onSelect:h}),s===`changes`&&m!==null&&(0,k.jsx)(v$,{api:o,path:m,active:T,revision:v,outside:E.data?.files.some(e=>e.path===m&&e.outside),onBack:()=>h(null),onView:ae},m)]})]})}function I$(e,t=!1){let n=BN();(0,f.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=nF(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 L$=8e3;function R$(){let e=B(),{view:t,phase:n,notice:r,operating:i,workspaceRoot:a,currentSessionId:o,retained:s}=nP(),c=qR();(0,f.useEffect)(()=>{if(r?.level!==`info`)return;let e=setTimeout(iP.clearNotice,L$);return()=>clearTimeout(e)},[r]);let l=(0,f.useRef)(0),[u,d]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>d(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let[p,m]=(0,f.useState)({}),h=t?.agents,[g,_]=(0,f.useState)(null),v=(0,f.useRef)(g);v.current=g,(0,f.useEffect)(()=>{_(e=>e&&e.sessionId!==o?null:e)},[o]),(0,f.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,f.useState)(null);(0,f.useEffect)(()=>{o&&t?.changes!==void 0&&C(o)},[o,t?.changes]);let w=(0,f.useId)(),[T,E]=(0,f.useState)(null),ee=PP({view:t,phase:n,operating:i,currentSessionId:o,retained:s}),te=T!==null&&T===o&&(ee?.total??0)>0;I$(FP({view:t,phase:n,operating:i,currentSessionId:o,retained:s})?.pending.length??0,(XP({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,f.useState)(()=>!window.matchMedia(HR).matches);(0,f.useEffect)(()=>{ie(!c)},[c]);let ae=u&&!!p[o??``]?.open,oe=t?.busy??!1,se=t?.status??null;return(0,k.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,k.jsx)(`a`,{href:`#main-content`,className:`skip-link`,children:e(`chat.skip`)}),(0,k.jsx)(DQ,{open:re,onClose:()=>ie(!1)}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,k.jsx)(a$,{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,k.jsx)(OQ,{}),r!==null&&(0,k.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,k.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:r.text}),(0,k.jsx)($R,{label:e(`chat.dismissNotice`),onClick:iP.clearNotice})]}),(0,k.jsxs)(`main`,{id:`main-content`,tabIndex:-1,className:`flex min-h-0 flex-1 flex-col focus:outline-none`,children:[te&&(0,k.jsx)(PQ,{id:w,onClose:()=>E(null)}),!o&&n===`ready`&&!i?(0,k.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-semibold text-ink-900`,children:QR(a)}),(0,k.jsx)(`p`,{className:`text-sm text-ink-600`,children:e(`chat.startHere`)}),(0,k.jsx)(`button`,{type:`button`,className:`btn-primary focus-neko rounded-xl px-4 py-2`,onClick:()=>{mP.createSession().catch(gP)},children:e(`sessions.new`)})]}):(0,k.jsx)(tQ,{view:t,busy:oe,onSubagent:D,tray:(h?.length??0)>0?(0,k.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,k.jsxs)(`div`,{className:`flex max-h-[60dvh] shrink-[0.01] flex-col overflow-y-auto overscroll-contain`,"data-attention-stack":!0,children:[!ae&&(0,k.jsx)(Dz,{}),(0,k.jsx)(dQ,{}),(0,k.jsx)(rQ,{})]}),(0,k.jsx)(mz,{disabled:n!==`ready`||i,busy:oe,status:se})]})]}),Object.entries(p).map(([e,t])=>(0,k.jsx)(jQ,{entries:e===o?h??t.entries:t.entries,approval:ae&&e===o?(0,k.jsx)(Dz,{}):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,k.jsx)(tB,{sessionId:o,jobs:t.jobs,open:y,onClose:()=>_(null)},o),o&&S===o&&(0,k.jsx)(F$,{sessionId:o,open:b,onClose:()=>_(null),changes:t?.changes},`workspace:${o}`)]})}var z$=[{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`}],B$=[{id:`sans`,label:`appearance.font.sans`},{id:`serif`,label:`appearance.font.serif`},{id:`mono`,label:`appearance.font.mono`}],V$=[{id:`13`,label:`appearance.size.13`},{id:`14`,label:`appearance.size.14`},{id:`16`,label:`appearance.size.16`},{id:`18`,label:`appearance.size.18`}],H$=[{id:`regular`,label:`appearance.weight.regular`},{id:`medium`,label:`appearance.weight.medium`},{id:`semibold`,label:`appearance.weight.semibold`}],U$=[{id:`compact`,label:`appearance.leading.compact`},{id:`normal`,label:`appearance.leading.normal`},{id:`relaxed`,label:`appearance.leading.relaxed`}],W$=e=>[e(`appearance.sampleAssistantIntro`),``,"```ts",`function total(items: number[]) {`,` return items.reduce((sum, n) => sum + n, 0);`,`}`,"```",``,`- ${e(`appearance.sampleItem1`)}`,`- ${e(`appearance.sampleItem2`)}`].join(`
|
|
396
|
+
`);function G$(e){return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`appearance-${e.id}`,children:[(0,k.jsx)(`h2`,{id:`appearance-${e.id}`,className:`text-base font-bold text-ink-900`,children:e.title}),e.blurb&&(0,k.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:e.blurb}),(0,k.jsx)(`div`,{className:`mt-3`,children:e.children})]})}function K$(e){let t=B();return(0,k.jsxs)(`fieldset`,{className:`m-0 min-w-0 border-0 p-0`,children:[(0,k.jsx)(`legend`,{className:`text-sm font-semibold text-ink-900`,children:e.label}),(0,k.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.options.map(n=>(0,k.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,k.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,k.jsx)(`p`,{className:`mt-1.5 text-[11px] text-ink-400`,children:e.hint})]})}function q$({theme:e}){let t=B();return(0,k.jsxs)(`span`,{"data-theme":e,className:`block rounded-xl border border-ink-200 bg-base p-2.5 text-ink-900`,children:[(0,k.jsxs)(`span`,{className:`flex items-center gap-1.5 pb-2`,children:[(0,k.jsx)(`span`,{className:`size-2 rounded-full bg-sakura-500`}),(0,k.jsx)(`span`,{className:`size-2 rounded-full bg-tianyi-500`}),(0,k.jsx)(`span`,{className:`h-1.5 w-8 rounded-full bg-ink-200`})]}),(0,k.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,k.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 J$(e){let t=B();return(0,k.jsxs)(`fieldset`,{className:`m-0 min-w-0 border-0 p-0`,children:[(0,k.jsx)(`legend`,{className:`sr-only`,children:t(`appearance.theme`)}),(0,k.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:z$.map(n=>{let r=e.value===n.id;return(0,k.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,k.jsx)(`input`,{type:`radio`,className:`sr-only`,name:`appearance-theme`,value:n.id,checked:r,onChange:()=>e.onPick(n.id)}),(0,k.jsx)(q$,{theme:n.id}),(0,k.jsxs)(`span`,{className:`mt-2 flex items-baseline gap-2 px-1 pb-0.5`,children:[(0,k.jsx)(`span`,{className:`text-sm ${r?`font-bold text-sakura-800`:`font-semibold text-ink-900`}`,children:t(n.label)}),(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(n.blurb)})]})]},n.id)})})]})}function Y$({store:e=zi()}){let t=Bi(e),n=B();return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsx)(G$,{id:`theme`,title:n(`appearance.theme`),children:(0,k.jsx)(J$,{value:t.theme,onPick:t=>e.set({theme:t})})}),(0,k.jsx)(G$,{id:`typography`,title:n(`appearance.typography`),blurb:n(`appearance.typographyBlurb`),children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsx)(K$,{name:`appearance-font`,label:n(`appearance.font`),hint:n(`appearance.fontHint`),options:B$,value:t.font,onPick:t=>e.set({font:t})}),(0,k.jsx)(K$,{name:`appearance-size`,label:n(`appearance.size`),options:V$,value:t.size,onPick:t=>e.set({size:t})}),(0,k.jsx)(K$,{name:`appearance-weight`,label:n(`appearance.weight`),options:H$,value:t.weight,onPick:t=>e.set({weight:t})}),(0,k.jsx)(K$,{name:`appearance-leading`,label:n(`appearance.leading`),options:U$,value:t.leading,onPick:t=>e.set({leading:t})})]})}),(0,k.jsx)(G$,{id:`preview`,title:n(`appearance.sample`),blurb:n(`appearance.sampleBlurb`),children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-base p-3`,"data-testid":`appearance-sample`,children:[(0,k.jsx)(`div`,{className:`bubble-user ml-auto max-w-[85%] px-4 py-2.5 whitespace-pre-wrap`,children:n(`appearance.sampleUser`)}),(0,k.jsx)(`div`,{className:`bubble-assistant max-w-full px-4 py-2.5`,children:(0,k.jsx)(HZ,{text:W$(n)})})]})}),(0,k.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:Ni(t)?n(`appearance.isDefault`):n(`appearance.customized`)}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>e.reset(),disabled:Ni(t),className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,children:n(`appearance.reset`)})]})]})}function X$(){let e=B();return(0,k.jsxs)(vz,{active:`appearance`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`settings.appearance.title`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`settings.appearance.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsx)(Y$,{})})]})}var Z$={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`}},Q$={default:`context.source.default`,config:`context.source.config`,saved:`context.source.saved`};function $$(e){let{settings:t,ready:n,onSelect:r,onReset:i}=e,a=B(),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(!1),[l,u]=(0,f.useState)(``),d=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,k.jsx)(`p`,{className:`text-sm text-ink-500`,children:a(`common.loading`)});let m=t.effective.mode;return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`codemode-mode`,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`h2`,{id:`codemode-mode`,className:`text-base font-bold text-ink-900`,children:a(`codemode.modeTitle`)}),(0,k.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:a(`codemode.current`,{mode:a(Z$[m].label),source:a(Q$[t.source])})})]}),(0,k.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:a(`codemode.newSessionsOnly`)}),(0,k.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-2 border-0 p-0`,disabled:d,children:[(0,k.jsx)(`legend`,{className:`sr-only`,children:a(`codemode.modeTitle`)}),uj.map(e=>(0,k.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`} ${d?`opacity-60`:``}`,children:[(0,k.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,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`font-semibold text-ink-900`,children:a(Z$[e].label)}),(0,k.jsx)(`span`,{className:`block text-xs text-ink-500`,children:a(Z$[e].description)})]})]},e))]}),t.source===`config`&&(0,k.jsx)(`p`,{className:`mt-2 text-[11px] text-ink-400`,children:a(`codemode.fromConfig`)}),(0,k.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(`button`,{type:`button`,disabled:d||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,k.jsx)(`output`,{"aria-live":`polite`,className:`min-h-4 text-xs text-tianyi-800`,children:l})]})]})}function e1(){let{codemodeSettings:e,phase:t}=nP(),n=B();return(0,k.jsxs)(vz,{active:`codemode`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.codemode.title`)}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.codemode.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsx)($$,{settings:e,ready:t===`ready`,onSelect:e=>mP.setCodemodeMode(e),onReset:()=>mP.resetCodemodeMode()})})]})}var t1={compaction:{group:`compaction`,field:`enabled`,key:`compaction.enabled`},pruning:{group:`pruning`,field:`enabled`,key:`pruning.enabled`}},n1=[{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]}],r1={default:`context.source.default`,config:`context.source.config`,saved:`context.source.saved`};function i1(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 a1(e,t){let n=z();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 o1(e,t){let n=z(),{value:r,source:i}=i1(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:a1(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:a1(e.unit,a)}),value:a,selected:i===`saved`}),o}function s1(e,t){let n=z(),{value:r,source:i}=i1(t,e);return n(`context.current`,{value:typeof r==`number`?a1(e.unit,r):n(`context.nearLimit`),source:n(r1[i])})}function c1(e,t){return{[e.group]:{[e.field]:t}}}function l1(e){let t=z(),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 u1=[{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 d1(e){return(0,k.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,k.jsx)(`span`,{className:`inline-block size-5 rounded-full bg-white shadow transition-transform ${e.checked?`translate-x-[22px]`:`translate-x-0.5`}`})})}function f1({items:e}){let t=B();return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-label":t(`context.threshold.aria`),children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-ink-500`,children:[(0,k.jsx)(`span`,{className:`font-semibold text-ink-900`,children:t(`context.threshold.title`)}),(0,k.jsx)(`span`,{children:t(`context.threshold.window`)})]}),(0,k.jsx)(`div`,{className:`px-6`,children:(0,k.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,k.jsxs)(`div`,{className:`absolute top-1/2 -translate-x-1/2 -translate-y-1/2`,style:{left:`${e.percent}%`},children:[(0,k.jsx)(`span`,{className:`block size-4 rounded-full border-2 border-surface shadow ${e.id===`pruning`?`bg-tianyi-500`:`bg-sakura-600`}`}),(0,k.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,k.jsxs)(`div`,{className:`flex justify-between text-[11px] text-ink-400`,children:[(0,k.jsx)(`span`,{children:`0%`}),(0,k.jsx)(`span`,{children:`100%`})]}),e.length===0&&(0,k.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`context.threshold.allOff`)})]})}function p1(e){let{row:t,settings:n,disabled:r,dim:i,onPick:a}=e,o=B(),{source:s}=i1(n,t);return(0,k.jsxs)(`div`,{className:`transition-opacity ${i?`opacity-55`:``}`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3`,children:[(0,k.jsx)(`span`,{className:`text-sm font-semibold text-ink-900`,children:o(t.label)}),(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:s1(t,n)})]}),(0,k.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:o(t.description)}),(0,k.jsxs)(`fieldset`,{className:`m-0 mt-2 flex min-w-0 flex-wrap gap-1.5 border-0 p-0`,children:[(0,k.jsx)(`legend`,{className:`sr-only`,children:o(t.label)}),o1(t,n).map(e=>(0,k.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,k.jsx)(`p`,{className:`mt-1 text-[11px] text-ink-400`,children:o(`context.fromConfig`)})]})}function m1(e){let{settings:t,ready:n,onChange:r,onReset:i}=e,a=B(),[o,s]=(0,f.useState)(0),[c,l]=(0,f.useState)(``),u=!n||!t,d=(0,f.useRef)(0);async function p(e,t){let n=++d.current;s(e=>e+1),l(``);try{await e(),n===d.current&&l(t)}catch{n===d.current&&l(a(`context.saveFailed`))}finally{s(e=>e-1)}}let m=(e,t)=>void p(()=>r(c1(e,t)),t===null?a(`context.restored`,{label:e.label}):a(`context.saved`));if(!t)return(0,k.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,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsx)(f1,{items:l1(t)}),u1.map(e=>{let n=t1[e.id],{value:r,source:i}=i1(t,n);return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`ctx-${e.id}`,children:[(0,k.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,k.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,k.jsx)(KR,{name:e.id===`compaction`?`layers`:`sparkles`,size:16})}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`h2`,{id:`ctx-${e.id}`,className:`text-base font-bold text-ink-900`,children:a(e.title)}),(0,k.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:a(e.blurb)})]}),(0,k.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,k.jsx)(d1,{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,k.jsx)(`span`,{className:`text-[11px] text-ink-400`,children:a(r1[i])})]})]}),(0,k.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-sakura-100 pt-4`,children:n1.filter(t=>t.group===e.id).map(e=>(0,k.jsx)(p1,{row:e,settings:t,disabled:u,dim:r!==!0,onPick:t=>m({...e,label:a(e.label)},t)},e.key))})]},e.id)}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.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,k.jsx)(`output`,{"aria-live":`polite`,className:`min-h-4 text-xs text-tianyi-800`,children:o>0?a(`context.saving`):c})]})]})}function h1(){let{contextSettings:e,phase:t}=nP(),n=B();return(0,k.jsxs)(vz,{active:`context`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.context.title`)}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.context.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsx)(m1,{settings:e,ready:t===`ready`,onChange:e=>mP.setContextSettings(e),onReset:()=>mP.resetContextSettings()})})]})}function g1({store:e=RN()}){let t=B(),n=BN(e),r={zh:t(`language.option.zh`),en:t(`language.option.en`)};return(0,k.jsxs)(`fieldset`,{className:`m-0 min-w-0 rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsx)(`legend`,{className:`sr-only`,children:t(`language.legend`)}),(0,k.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:ON.map(t=>(0,k.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,k.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 _1(){let e=B();return(0,k.jsxs)(vz,{active:`language`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`language.title`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`language.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsx)(g1,{})})]})}var v1=function(e,t){let n=e,r=b1[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=S1.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=S1.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=S1.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=S1.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=S1.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=S1.getErrorCorrectPolynomial(l),d=w1(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=T1.getRSBlocks(e,t),i=E1();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),S1.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=D1(e);break;case`Alphanumeric`:n=O1(e);break;case`Byte`:n=k1(e);break;case`Kanji`:n=A1(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=T1.getRSBlocks(e,r),n=E1();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),S1.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 F1(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+=`<`;break;case`>`:t+=`>`;break;case`&`:t+=`&`;break;case`"`:t+=`"`;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+=`
|
|
397
|
+
`}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+`
|
|
398
|
+
`}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};v1.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},v1.createStringToBytes=function(e,t){let n=function(){let n=N1(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 y1={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},b1={L:1,M:0,Q:3,H:2},x1={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},S1=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 x1.PATTERN000:return function(e,t){return(e+t)%2==0};case x1.PATTERN001:return function(e,t){return e%2==0};case x1.PATTERN010:return function(e,t){return t%3==0};case x1.PATTERN011:return function(e,t){return(e+t)%3==0};case x1.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case x1.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case x1.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case x1.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=w1([1],0);for(let n=0;n<e;n+=1)t=t.multiply(w1([1,C1.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case y1.MODE_NUMBER:return 10;case y1.MODE_ALPHA_NUM:return 9;case y1.MODE_8BIT_BYTE:return 8;case y1.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case y1.MODE_NUMBER:return 12;case y1.MODE_ALPHA_NUM:return 11;case y1.MODE_8BIT_BYTE:return 16;case y1.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case y1.MODE_NUMBER:return 14;case y1.MODE_ALPHA_NUM:return 13;case y1.MODE_8BIT_BYTE:return 16;case y1.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}(),C1=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}(),w1=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]^=C1.gexp(C1.glog(r.getAt(n))+C1.glog(e.getAt(i)));return w1(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=C1.glog(r.getAt(0))-C1.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]^=C1.gexp(C1.glog(e.getAt(r))+t);return w1(n,0).mod(e)},r},T1=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 b1.L:return e[(t-1)*4+0];case b1.M:return e[(t-1)*4+1];case b1.Q:return e[(t-1)*4+2];case b1.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}(),E1=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},D1=function(e){let t=y1.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},O1=function(e){let t=y1.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},k1=function(e){let t=y1.MODE_8BIT_BYTE,n=v1.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},A1=function(e){let t=y1.MODE_KANJI,n=v1.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},j1=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},M1=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},N1=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},P1=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=j1(),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},F1=function(e,t,n){let r=P1(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=j1();r.write(i);let a=M1(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};v1.stringToBytes;var I1=class extends Error{constructor(){super(`gateway_unsupported`),this.name=`GatewayUnsupportedError`}},L1;function R1(){L1=void 0}async function z1(){return L1??=fetch(`/api/mobile/session`,{cache:`no-store`}).then(async e=>{if(!e.ok)throw Error(z()(`pairing.getFailed`,{path:`/api/mobile/session`,status:e.status}));return await e.json()}).catch(e=>{throw L1=void 0,e}),L1}async function B1(e,t,n=!0){let{csrf:r}=await z1(),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 I1;if(i.status===403&&n)return R1(),B1(e,t,!1);if(!i.ok){let e=z()(`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 V1(e){let t=await fetch(e,{cache:`no-store`});if(t.status===501)throw new I1;if(!t.ok)throw Error(z()(`pairing.getFailed`,{path:e,status:t.status}));return await t.json()}var H1={session:()=>z1(),state:()=>V1(`/api/mobile/state`),enable:e=>B1(`/api/mobile/enable`,e),disable:()=>B1(`/api/mobile/disable`,null),createPairing:()=>B1(`/api/mobile/pairing`,null),cancelPairing:()=>B1(`/api/mobile/pairing/cancel`,null),revoke:e=>B1(`/api/mobile/revoke`,{deviceId:e}),regenerateCertificate:()=>B1(`/api/mobile/certificate/regenerate`,null)},U1=2592e6,W1=5e3;function G1(e){return e instanceof Error?e.message:String(e)}function K1(e){let t=B(),n=v1(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,k.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,k.jsx)(`title`,{children:t(`pairing.qrTitle`)}),(0,k.jsx)(`path`,{d:a.join(` `),fill:`currentColor`})]})}function q1(){let{webInfo:e}=nP(),t=B(),n=BN(),[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(`8323`),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(0),[S,C]=(0,f.useState)(null),w=(0,f.useRef)(0),T=(0,f.useCallback)(async()=>{let e=++w.current;try{let t=await H1.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(G1(t))}},[]),E=(0,f.useCallback)(async()=>{if(document.hidden)return;let e=++w.current;try{let t=await H1.state();if(e!==w.current)return;o(t),c(``)}catch{}},[]);(0,f.useEffect)(()=>{let e=!1;return H1.session().then(t=>{e||(i(t.supported),t.supported&&T())}).catch(t=>{e||c(G1(t))}),()=>{e=!0}},[T]),(0,f.useEffect)(()=>{if(r!==!0)return;let e,t=()=>{e!==void 0&&(clearInterval(e),e=void 0)},n=()=>{e===void 0&&(e=setInterval(()=>void E(),W1))},i=()=>{document.hidden?t():(E(),n())};return document.addEventListener(`visibilitychange`,i),n(),()=>{t(),document.removeEventListener(`visibilitychange`,i)}},[r,E]),(0,f.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 H1.disable(),y(null),u(t(`pairing.disabledNotice`));else{let e=Number(m);if(d.trim()===``)throw Error(t(`pairing.addressRequired`));if(!Number.isInteger(e)||e<1||e>65535)throw Error(t(`pairing.portInvalid`));await H1.enable({address:d.trim(),port:e}),u(t(`pairing.enabledNotice`,{address:`${d.trim()}:${e}`}))}await T()}catch(e){c(G1(e))}finally{_(!1)}}}async function D(){_(!0),c(``);try{let e=await H1.createPairing();y(e),u(t(`pairing.qrGenerated`))}catch(e){y(null),c(G1(e))}finally{_(!1)}}async function re(){C(null),_(!0),c(``);try{let e=await H1.regenerateCertificate();y(null),u(t(`pairing.certRotated`,{fingerprint:e.fingerprint.slice(0,12)})),await T()}catch(e){c(G1(e))}finally{_(!1)}}async function ie(e){C(null),_(!0),c(``);try{let n=await H1.revoke(e);u(n.revoked?t(`pairing.revoked`):t(`pairing.revokeMissing`)),await T()}catch(e){c(G1(e))}finally{_(!1)}}if(r===null)return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,k.jsx)(`p`,{className:`mt-2 text-sm text-ink-500`,children:t(`common.loading`)})]});if(!r)return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,k.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,role:`alert`,children:t(`pairing.unsupported`)})]});let ae=a?.certificate??null,oe=ae!==null&&ae.expiresAt-Date.now()<U1,se=a?.wsl??null,ce=a?.state.status===`listening`&&a.state.mode===`wsl-relay`,le=a===null?t(`common.loading`):a.state.status===`listening`?t(`pairing.stateOn`,{address:te,relay:ce?t(`pairing.relayed`):``}):a.state.status===`error`?t(`pairing.stateError`):a.state.status===`disabled`?t(`pairing.stateOff`):t(`credential.working`);return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,k.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:le})]}),(0,k.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:t(`pairing.intro`)}),se!==null&&(0,k.jsx)(`p`,{className:`mb-3 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:t(`pairing.wslNote`)}),se?.error!=null&&(0,k.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:se.error}),a?.state.status===`error`&&(0,k.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,k.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:s}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,k.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:ee===!0,disabled:g||a===null||!ee&&(a?.candidates.length??0)===0&&d===``,onChange:()=>void ne(),className:`focus-neko h-4 w-4 rounded border-sakura-300 accent-sakura-600`}),t(`pairing.allow`)]}),(0,k.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[t(`pairing.address`),(0,k.jsxs)(`select`,{value:d,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,k.jsx)(`option`,{value:``,children:t(se===null?`pairing.noAddress`:`pairing.noAddressWindows`)}),(a?.candidates??[]).map(e=>(0,k.jsx)(`option`,{value:e,children:e===a?.lastConnectedAddress?t(`pairing.lastConnected`,{address:e}):e},e))]})]}),(0,k.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,k.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,k.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(se===null?`pairing.noUsable`:`pairing.noUsableWindows`)}),ee===!0&&(0,k.jsx)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[v!==null&&b>0?(0,k.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,k.jsx)(K1,{text:v.pairingText}),(0,k.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.qrRemaining`,{seconds:b})}),(0,k.jsx)(uG,{text:v.pairingText,label:t(`pairing.copyText`)}),(0,k.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,k.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[v!==null&&b<=0&&(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.qrExpired`)}),(0,k.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,k.jsx)(`p`,{className:`max-w-64 text-xs text-ink-500`,children:t(`pairing.scanHint`,{relay:ce?t(`pairing.relayFirewall`):``})})]})}),(0,k.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:t(`pairing.certificate`)}),ae!==null&&(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.certInfo`,{fingerprint:ae.fingerprint.slice(0,16),date:_Q(ae.expiresAt,n)})}),(0,k.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`)})]}),oe&&(0,k.jsx)(`p`,{className:`mt-2 text-xs text-sakura-800`,role:`alert`,children:t(`pairing.certExpiring`)}),(0,k.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`pairing.regenerateWarning`)})]}),(0,k.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,k.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:t(`pairing.devices`)}),a===null||a.devices.length===0?(0,k.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`pairing.noDevices`)}):(0,k.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2`,children:a.devices.map(e=>(0,k.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:(0,k.jsx)(KR,{name:`phone`,size:15,className:`text-ink-400`})}),(0,k.jsx)(`span`,{className:`text-ink-800`,children:e.name}),(0,k.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,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.lastSeen`,{time:gQ(e.lastSeenAt,n)})}),(0,k.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,k.jsxs)(`p`,{className:`mt-4 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:[t(`pairing.spawnedBefore`),(0,k.jsx)(`code`,{className:`mx-1`,children:`neko serve`}),t(`pairing.spawnedAfter`)]}),(0,k.jsx)(`output`,{className:`mt-3 block min-h-4 text-xs text-tianyi-800`,"aria-live":`polite`,children:l}),S===`regenerate`&&(0,k.jsxs)(XR,{title:t(`pairing.regenerate`),onClose:()=>C(null),children:[(0,k.jsx)(`p`,{className:`text-sm text-ink-700`,children:t(`pairing.regenerateConfirm`)}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.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,k.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,k.jsxs)(XR,{title:t(`pairing.revokeTitle`,{name:S.name}),onClose:()=>C(null),children:[(0,k.jsx)(`p`,{className:`text-sm text-ink-700`,children:t(`pairing.revokeConfirm`)}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.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,k.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 J1(){let e=B();return(0,k.jsxs)(vz,{active:`mobile`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`settings.mobile.title`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`settings.mobile.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsx)(q1,{})})]})}var Y1={saved:`credential.source.saved`,environment:`credential.source.environment`,runtime:`credential.source.runtime`,keyless:`credential.source.keyless`,none:`credential.source.none`};function X1(e){let{spec:t,status:n,ready:r,enable:i,note:a}=e,o=t.name,s=B(),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(!1),p=(0,f.useRef)(!1),[m,h]=(0,f.useState)(``);async function g(e,t){if(!p.current){p.current=!0,d(!0),h(``);try{await e(),h(t)}catch{h(s(`credential.failed`))}finally{p.current=!1,d(!1)}}}async function _(e){await g(async()=>{e?await mP.removeCredential(t.id):await mP.saveCredential(t.id,c),l(``)},s(e?`credential.removed`:`credential.saved`))}let v=u||!r||!n;return(0,k.jsxs)(`section`,{id:`credential-${t.id}`,className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:o}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i&&(0,k.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,k.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,k.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:s(n?Y1[n.source]:`common.loading`)})]})]}),(0,k.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,k.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_(!1)},children:[(0,k.jsx)(`label`,{className:`sr-only`,htmlFor:`${t.id}-key`,children:s(`credential.keyLabel`,{name:o})}),(0,k.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,k.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,k.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,k.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,k.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,k.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:m})]})}var Z1=`credential-`;function Q1(){let e=typeof window>`u`?``:window.location.hash.slice(1),t=e.startsWith(Z1)?e.slice(11):``;return iF.some(e=>e.id===t)?t:`deepseek`}function $1(){let{credentials:e,phase:t}=nP(),n=B(),r=t===`ready`&&e!==null,[i,a]=(0,f.useState)(Q1);(0,f.useEffect)(()=>{let e=()=>a(Q1());return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[]);let o=iF.find(e=>e.id===i)??iF[0],s=t=>e?.statuses[t.id]?.enabled!==!1,c=iF.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=iF.filter(s).length,u=e!==null;return(0,f.useEffect)(()=>{u&&window.location.hash===`#${Z1}${i}`&&document.getElementById(`${Z1}${i}`)?.scrollIntoView?.({block:`center`})},[u,i]),(0,k.jsxs)(vz,{active:`credentials`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.credentials.title`)}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.credentials.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,k.jsx)(`div`,{className:`w-full min-w-0 sm:w-80`,children:(0,k.jsx)(tz,{label:n(`settings.credentials.providerLabel`),options:c,value:o.id,onChange:a})}),(0,k.jsx)(`span`,{className:`text-xs text-ink-500`,children:n(`settings.credentials.enabledCount`,{enabled:l,total:iF.length})})]}),(0,k.jsx)(X1,{spec:o,status:e?.statuses[o.id],ready:r,enable:{enabled:s(o),locked:o.id===`deepseek`,onChange:e=>mP.setProviderEnabled(o.id,e)}},o.id)]})})]})}var e0=[`tavily`,`deepseek`],t0={tavily:`Tavily`,deepseek:`DeepSeek`},n0={saved:`search.source.saved`,environment:`search.source.environment`,runtime:`search.source.runtime`,keyless:`search.source.keyless`,none:`search.source.none`};function r0(e,t){let n=z(),r=e=>{let r=t?.statuses[e];return n(r?n0[r.source]:`common.loading`)},i={tavily:n(`search.tavilyDescription`,{source:r(`tavily`)}),deepseek:n(`search.deepseekDescription`,{source:r(`deepseek`)})};return e0.map(t=>({value:t,label:t0[t],description:i[t],selected:e?.selected===t}))}function i0(e,t){return e?.selected===`deepseek`&&t?.statuses.deepseek?.source===`none`?z()(`search.deepseekWarning`):null}function a0(e){let{settings:t,credentials:n,ready:r,onSelect:i}=e,a=B(),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(!1),[l,u]=(0,f.useState)(``),d=i0(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:t0[e]}))}catch{u(a(`search.saveFailed`))}finally{c.current=!1,s(!1)}}}let m=o||!r||!t;return(0,k.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`search-service`,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`h2`,{id:`search-service`,className:`text-base font-bold text-ink-900`,children:a(`search.service`)}),(0,k.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:t?a(`search.current`,{name:t0[t.selected]}):a(`common.loading`)})]}),(0,k.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:a(`search.intro`)}),(0,k.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,disabled:m,children:[(0,k.jsx)(`legend`,{className:`sr-only`,children:a(`search.service`)}),r0(t,n).map(e=>(0,k.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,k.jsx)(`input`,{type:`radio`,name:`search-provider`,value:e.value,checked:e.selected,onChange:()=>void p(e.value),className:`mt-1`}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`font-semibold text-ink-900`,children:e.label}),(0,k.jsx)(`span`,{className:`block text-xs text-ink-500`,children:e.description})]})]},e.value))]}),d&&(0,k.jsx)(`p`,{className:`mt-3 text-xs text-sakura-800`,children:d}),(0,k.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:l})]})}var o0=iF.find(e=>e.id===`deepseek`);function s0(){let{credentials:e,searchSettings:t,phase:n}=nP(),r=B(),i=n===`ready`&&e!==null;return(0,k.jsxs)(vz,{active:`search`,children:[(0,k.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,k.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:r(`settings.search.title`)}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:r(n===`ready`?`common.connected`:`common.connecting`)})]}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:r(`settings.search.intro`)})]}),(0,k.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsx)(a0,{settings:t,credentials:e,ready:i,onSelect:e=>mP.setSearchProvider(e)}),aF.map(t=>(0,k.jsx)(X1,{spec:t,status:e?.statuses[t.id],ready:i},t.id)),o0&&(0,k.jsx)(X1,{spec:o0,status:e?.statuses[o0.id],ready:i,note:r(`settings.search.deepseekNote`)})]})})]})}var c0=[`documents`,`development`,`frontend`,`research`,`skills`,`automation`,`database`,`writing`,`uncategorized`],l0=(e,t)=>c0.includes(t)?e(`skills.category.${t}`):t,u0=(e,t)=>e(`skills.scope.${t}`),d0=e=>e>=1048576?`${(e/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`,f0=e=>e===``?``:e.slice(0,10),p0=e=>e instanceof I?e.reason??null:null;function m0(e,t,n){let r=new Map;for(let i of e){let e=t===`category`?l0(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 h0({skill:e}){let t=B();return(0,k.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs`,children:[e.installed.project&&(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,k.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,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,k.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,k.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 py-0.5 text-ink-600`,children:t(`skills.badge.builtin`)})]})}function g0({confirm:e,onClose:t}){let n=B(),[r,i]=(0,f.useState)(!1);return(0,k.jsx)(_0,{children:(0,k.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":n(`common.cancel`),onClick:t,className:`absolute inset-0 bg-ink-900/20`}),(0,k.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,k.jsx)(`h3`,{className:`text-base font-bold text-ink-900`,children:e.title}),(0,k.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,children:e.body}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.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,k.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 _0({children:e}){return(0,dL.createPortal)(e,document.body)}function v0({name:e,onClose:t,onChanged:n}){let r=B(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(`about`),[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)(null);(0,f.useEffect)(()=>{let t=!1;return a(null),s(null),d(null),l(`about`),v(``),mP.marketDetail(e).then(e=>{t||a(e)}).catch(e=>{t||s(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e]),(0,f.useEffect)(()=>{if(c!==`preview`||u!==null||p!==null)return;let t=!1;return mP.marketPreview(e).then(e=>{t||d(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 mP.marketInstall(e,t,i);v(o.shadowedBy===`project`?r(`skills.installedShadowed`):r(`skills.installed`)),n();let s=await mP.marketDetail(e);a(s)}catch(n){p0(n)===`skill_exists`&&!i?b({title:r(`skills.overwriteTitle`),body:r(`skills.overwriteBody`,{scope:u0(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:u0(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:u0(r,t),name:e}),confirmLabel:r(`skills.uninstall`),danger:!0,action:async()=>{g(t),v(``);try{await mP.marketUninstall(e,t),v(r(`skills.uninstalled`)),n(),a(await mP.marketDetail(e))}catch(e){v(r(`skills.opFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{g(null)}}})};return(0,k.jsxs)(_0,{children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":r(`skills.closeDetail`),onClick:t,className:`fixed inset-0 z-40 bg-ink-900/10`}),(0,k.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,k.jsxs)(`header`,{className:`flex items-center justify-between gap-2 border-b border-sakura-100 px-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-sakura-500`,children:(0,k.jsx)(KR,{name:`sparkles`,size:16})}),(0,k.jsx)(`h2`,{className:`truncate text-lg font-bold text-ink-900`,children:e}),i&&(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-ink-400`,children:i.version})]}),(0,k.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,k.jsx)(KR,{name:`close`,size:16})})]}),(0,k.jsx)(`div`,{className:`flex gap-1 border-b border-sakura-100 px-4 py-2`,children:[`about`,`preview`].map(e=>(0,k.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,k.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:[o!==null&&(0,k.jsx)(`p`,{className:`text-sm text-sakura-800`,children:r(`skills.loadFailed`,{error:o})}),i===null&&o===null&&(0,k.jsx)(`p`,{className:`text-sm text-ink-500`,children:r(`common.loadingEllipsis`)}),i!==null&&c===`about`&&(0,k.jsxs)(`div`,{className:`space-y-3`,children:[(0,k.jsx)(`p`,{className:`text-sm text-ink-700`,children:i.description}),(0,k.jsx)(`dl`,{className:`space-y-1.5 text-xs text-ink-600`,children:[[r(`skills.field.category`),l0(r,i.category)],[r(`skills.field.source`),i.source],[r(`skills.field.size`),d0(i.sizeBytes)],[`SHA-256`,`${i.sha256.slice(0,12)}…`],[r(`skills.field.uploaded`),f0(i.uploadedAt)],...i.license===``?[]:[[r(`skills.field.license`),i.license]]].map(([e,t])=>(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`dt`,{className:`w-14 shrink-0 text-ink-400`,children:e}),(0,k.jsx)(`dd`,{className:`min-w-0 font-mono`,children:t})]},e))}),(0,k.jsxs)(`div`,{className:`rounded-xl bg-ink-50 px-3 py-2 text-xs text-ink-600`,children:[(0,k.jsx)(h0,{skill:i}),!i.installed.project&&!i.installed.user&&!i.installed.builtin&&r(`skills.notInstalled`)]})]}),i!==null&&c===`preview`&&(0,k.jsxs)(`div`,{children:[u===null&&p===null&&(0,k.jsx)(`p`,{className:`text-sm text-ink-500`,children:r(`skills.previewLoading`)}),p!==null&&(0,k.jsx)(`p`,{className:`text-sm text-sakura-800`,children:r(`skills.previewFailed`,{error:p})}),u!==null&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(HZ,{text:u.body}),(0,k.jsx)(`h3`,{className:`mb-1 mt-4 text-xs font-medium text-ink-400`,children:r(`skills.packageFiles`)}),(0,k.jsx)(`ul`,{className:`space-y-0.5 font-mono text-xs text-ink-600`,children:u.files.map(e=>(0,k.jsx)(`li`,{children:e},e))})]})]})]}),i!==null&&(0,k.jsxs)(`footer`,{className:`space-y-2 border-t border-sakura-100 px-4 py-3`,children:[_!==``&&(0,k.jsx)(`output`,{className:`block text-xs text-tianyi-800`,children:_}),i.installed.builtin&&!i.installed.user&&!i.installed.project?(0,k.jsx)(`p`,{className:`text-xs text-ink-500`,children:r(`skills.builtinNote`)}):(0,k.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`user`,`project`].map(e=>{let t=e===`user`?i.installed.user:i.installed.project,n=u0(r,e);return t?(0,k.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,k.jsx)(KR,{name:`trash`,size:14}),h===e?r(`skills.processing`):r(`skills.uninstallScope`,{scope:n})]},e):(0,k.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,k.jsx)(KR,{name:`download`,size:14}),h===e?r(`skills.installing`):r(`skills.installScope`,{scope:n})]},e)})})]})]}),y&&(0,k.jsx)(g0,{confirm:y,onClose:()=>b(null)})]})}function y0(){let e=B(),{phase:t}=nP(),[n,r]=(0,f.useState)([]),[i,a]=(0,f.useState)(!0),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(`category`),[p,m]=(0,f.useState)(null),h=(0,f.useRef)(0),g=()=>{let e=++h.current;a(!0),s(null),mP.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,f.useEffect)(()=>{t===`ready`&&g()},[t]);let _=(0,f.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,f.useMemo)(()=>m0(_,u,e),[_,u,e]);return(0,k.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base`,children:[(0,k.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,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-wrap items-center gap-3`,children:[(0,k.jsx)(Ur,{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,k.jsx)(`span`,{className:`text-ink-300`,children:`/`}),(0,k.jsx)(`h1`,{className:`text-base font-bold text-ink-900 sm:text-lg`,children:e(`skills.title`)}),(0,k.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2 sm:gap-3`,children:[(0,k.jsx)(`div`,{className:`flex rounded-full border border-sakura-200 p-0.5 text-xs`,children:[`category`,`source`].map(t=>(0,k.jsx)(`button`,{type:`button`,onClick:()=>d(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,k.jsxs)(`label`,{className:`relative`,children:[(0,k.jsx)(`span`,{className:`sr-only`,children:e(`skills.search`)}),(0,k.jsx)(`span`,{className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-400`,children:(0,k.jsx)(KR,{name:`search`,size:14})}),(0,k.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,k.jsx)(`span`,{className:`text-xs text-ink-400`,children:e(t===`ready`?`common.connected`:`common.connecting`)})]})]})}),(0,k.jsxs)(`main`,{className:`mx-auto w-full max-w-7xl flex-1 px-4 py-6 sm:px-6`,children:[i&&(0,k.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e(t===`ready`?`skills.loadingCatalog`:`skills.waitingGateway`)}),o!==null&&(0,k.jsxs)(`div`,{className:`mx-auto max-w-md rounded-card border border-sakura-200 bg-surface p-6 text-center shadow-soft`,children:[(0,k.jsx)(`p`,{className:`text-sm text-ink-700`,children:e(`skills.catalogFailed`)}),(0,k.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-ink-400`,children:o}),(0,k.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,k.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e(`skills.noMatch`)}),v.map(([e,t])=>(0,k.jsxs)(`section`,{className:`mb-7`,children:[(0,k.jsxs)(`h2`,{className:`mb-2.5 flex items-baseline gap-2 text-lg font-bold text-ink-900`,children:[e,(0,k.jsx)(`span`,{className:`text-xs font-normal text-ink-400`,children:t.length})]}),(0,k.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,k.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,k.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`truncate text-base font-bold text-ink-900`,children:e.name}),(0,k.jsx)(h0,{skill:e})]}),(0,k.jsx)(`p`,{className:`mb-2.5 line-clamp-2 min-h-10 text-sm text-ink-500`,children:e.description}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-400`,children:[(0,k.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2 py-0.5 text-tianyi-800`,children:e.source}),(0,k.jsx)(`span`,{className:`font-mono`,children:e.version}),(0,k.jsx)(`span`,{children:d0(e.sizeBytes)})]})]},e.name))})]},e))]}),p!==null&&(0,k.jsx)(v0,{name:p,onClose:()=>m(null),onChanged:()=>g()})]})}var b0=Jr({component:()=>(0,k.jsx)(ii,{})}),x0=Kr({getParentRoute:()=>b0,path:`/`,component:R$}),S0=Kr({getParentRoute:()=>b0,path:`/settings`,component:$1}),C0=Kr({getParentRoute:()=>b0,path:`/settings/search`,component:s0}),w0=Kr({getParentRoute:()=>b0,path:`/settings/codemode`,component:e1}),T0=Kr({getParentRoute:()=>b0,path:`/settings/context`,component:h1}),E0=Kr({getParentRoute:()=>b0,path:`/settings/appearance`,component:X$}),D0=Kr({getParentRoute:()=>b0,path:`/settings/language`,component:_1}),O0=Kr({getParentRoute:()=>b0,path:`/settings/mobile`,component:J1}),k0=Kr({getParentRoute:()=>b0,path:`/skills`,component:y0}),A0=Kr({getParentRoute:()=>b0,path:`/about`,component:wz}),j0=ui({routeTree:b0.addChildren([x0,S0,C0,T0,w0,E0,D0,O0,k0,A0])});zi().start(),RN().start(),fP();var M0=document.getElementById(`root`);M0!==null&&(0,yi.createRoot)(M0).render((0,k.jsx)(f.StrictMode,{children:(0,k.jsx)(pi,{router:j0})}));
|