lookatstudy-mobile 0.12.1
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.txt +19 -0
- package/install-termux.sh +327 -0
- package/package.json +10 -0
- package/seed-course.json +679 -0
- package/server.cjs +495218 -0
- package/sql-wasm.wasm +0 -0
- package/web/assets/abnfDiagram-N423BO3Z-BFNTWI49.js +1 -0
- package/web/assets/api-web-BSU76jU3.js +1 -0
- package/web/assets/app-height-D5bf5z0g.js +1 -0
- package/web/assets/arc-Ci0WYiAH.js +1 -0
- package/web/assets/architectureDiagram-T3A2C74G-DX5jRTha.js +36 -0
- package/web/assets/blockDiagram-VBNYF7ZC-DjzKFpxY.js +132 -0
- package/web/assets/c4Diagram-5PPSVZJV-CIG-Sdcg.js +10 -0
- package/web/assets/channel-BmMZwizg.js +1 -0
- package/web/assets/chunk-2GRJ4B5K-D1h0uIyK.js +1 -0
- package/web/assets/chunk-2Q5K7J3B-cLoZ93yC.js +1 -0
- package/web/assets/chunk-5RXB4S5H-CSaMcbxs.js +231 -0
- package/web/assets/chunk-5VM5RSS4-JLvS-B89.js +15 -0
- package/web/assets/chunk-6Q2QTUOP-DXM7xtsH.js +88 -0
- package/web/assets/chunk-GF5L2VYU-BMXbp2Lo.js +206 -0
- package/web/assets/chunk-JWPE2WC7-DPQPMhNL.js +1 -0
- package/web/assets/chunk-KBJHAD2P-Bh3aU5gZ.js +1 -0
- package/web/assets/chunk-RYQCIY6F-wL-LEvWn.js +1 -0
- package/web/assets/chunk-XXDRQBXY-BPEP-05C.js +1 -0
- package/web/assets/classDiagram-JCYQIIEL-vXvWKIQn.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-vXvWKIQn.js +1 -0
- package/web/assets/cose-bilkent-JH36ORCC-CIy59RcY.js +1 -0
- package/web/assets/cynefin-VYW2F7L2-jbV2BJ_V.js +178 -0
- package/web/assets/cynefinDiagram-MW4NZA55-Cc7aMDYj.js +62 -0
- package/web/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/web/assets/dagre-VZM6K2ZE-Dsdu5Zt7.js +4 -0
- package/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/web/assets/diagram-7IWD3JNH-DJ4Yft6o.js +30 -0
- package/web/assets/diagram-B4RE2ZJO-CBh3xkIP.js +3 -0
- package/web/assets/diagram-LBJQPF4R-C-Iljnoj.js +24 -0
- package/web/assets/diagram-Q27KOJAE-8HHiRyk2.js +24 -0
- package/web/assets/diagram-UB23O5K3-C3K2kFAQ.js +41 -0
- package/web/assets/ebnfDiagram-BXEA7PRR-r1mdnIKj.js +1 -0
- package/web/assets/erDiagram-JOGREHBK-dYLNtxz3.js +85 -0
- package/web/assets/flowDiagram-UKHOOZJN-BYDIRoMm.js +156 -0
- package/web/assets/ganttDiagram-PKOTCBZU-CnCtvDzl.js +292 -0
- package/web/assets/gitGraphDiagram-DS77QQ5N-rG8kwFmL.js +106 -0
- package/web/assets/graph-C9eacEi8.js +1 -0
- package/web/assets/index-132uBtFQ.css +1 -0
- package/web/assets/index-CG9cZjNC.js +548 -0
- package/web/assets/infoDiagram-6WML65LV-BTcUhfqr.js +2 -0
- package/web/assets/init-Gi6I4Gst.js +1 -0
- package/web/assets/ishikawaDiagram-WSZJBQD7-CJviqcY8.js +70 -0
- package/web/assets/journeyDiagram-NVQOT4AX-8JWo64Wa.js +139 -0
- package/web/assets/kanban-definition-27J2QSJJ-BHD0yFL_.js +89 -0
- package/web/assets/katex-C5jXJg4s.js +257 -0
- package/web/assets/layout-DEXfKzaS.js +1 -0
- package/web/assets/linear-CT2ADXOb.js +1 -0
- package/web/assets/map-Czzmt4hB.js +1 -0
- package/web/assets/mermaid.core-DntY_Zhl.js +314 -0
- package/web/assets/mindmap-definition-FAOFIHXS-B_yUIQHi.js +96 -0
- package/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/web/assets/pegDiagram-VL7TDLO6-BopqqStm.js +1 -0
- package/web/assets/pieDiagram-7S7Q4E2Y-Com2ypw6.js +39 -0
- package/web/assets/quadrantDiagram-CIZ2JOQS-G0dlgjbr.js +7 -0
- package/web/assets/railroadDiagram-AXF67PYL-ChpuDwPP.js +1 -0
- package/web/assets/requirementDiagram-LRYGKXZP-CDD5pE1Z.js +84 -0
- package/web/assets/sankeyDiagram-W5VNT64P-DO-0GGh4.js +40 -0
- package/web/assets/sequenceDiagram-SI44F4Z6-__Qnpiz7.js +162 -0
- package/web/assets/sizeCapture-X5ZJPWSS-BxPWVmpa.js +1 -0
- package/web/assets/stateDiagram-OKZ733FA-DD0m6rt6.js +1 -0
- package/web/assets/stateDiagram-v2-UEYNNEHI-BHOUKhEe.js +1 -0
- package/web/assets/swimlanes-SLNWSIFB-m5XzOcas.js +2 -0
- package/web/assets/swimlanesDiagram-ULZ7WXOC-Bs3hfWP0.js +8 -0
- package/web/assets/timeline-definition-Z64GVDOM-D19Nd7I_.js +120 -0
- package/web/assets/vennDiagram-T6HMQDX7-DqFIJV1L.js +34 -0
- package/web/assets/wardleyDiagram-T6FBY63Y-CKVK_9QD.js +78 -0
- package/web/assets/xychartDiagram-ELKLHX3M-B85Rr0Fa.js +7 -0
- package/web/icon-192.png +0 -0
- package/web/icon-512.png +0 -0
- package/web/index.html +53 -0
- package/web/manifest.webmanifest +31 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
var HA=Object.defineProperty;var FA=(e,t,n)=>t in e?HA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qh=(e,t,n)=>FA(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const VA="modulepreload",qA=function(e,t){return new URL(e,t).href},Xb={},zc=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let l=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=l(n.map(m=>{if(m=qA(m,i),m in Xb)return;Xb[m]=!0;const g=m.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(!!i)for(let E=c.length-1;E>=0;E--){const T=c[E];if(T.href===m&&(!g||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const y=document.createElement("link");if(y.rel=g?"stylesheet":VA,g||(y.as="script"),y.crossOrigin="",y.href=m,h&&y.setAttribute("nonce",h),document.head.appendChild(y),g)return new Promise((E,T)=>{y.addEventListener("load",E),y.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var Kb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yh={exports:{}},Ho={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Qb;function YA(){if(Qb)return Ho;Qb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:l,ref:o!==void 0?o:null,props:s}}return Ho.Fragment=t,Ho.jsx=n,Ho.jsxs=n,Ho}var $b;function GA(){return $b||($b=1,Yh.exports=YA()),Yh.exports}var x=GA(),Gh={exports:{}},Ve={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Wb;function XA(){if(Wb)return Ve;Wb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function p(Y){return Y===null||typeof Y!="object"?null:(Y=b&&Y[b]||Y["@@iterator"],typeof Y=="function"?Y:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function k(Y,G,B){this.props=Y,this.context=G,this.refs=T,this.updater=B||y}k.prototype.isReactComponent={},k.prototype.setState=function(Y,G){if(typeof Y!="object"&&typeof Y!="function"&&Y!=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,Y,G,"setState")},k.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function M(){}M.prototype=k.prototype;function N(Y,G,B){this.props=Y,this.context=G,this.refs=T,this.updater=B||y}var O=N.prototype=new M;O.constructor=N,E(O,k.prototype),O.isPureReactComponent=!0;var A=Array.isArray;function C(){}var L={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function j(Y,G,B){var ne=B.ref;return{$$typeof:e,type:Y,key:G,ref:ne!==void 0?ne:null,props:B}}function D(Y,G){return j(Y.type,G,Y.props)}function P(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function U(Y){var G={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(B){return G[B]})}var J=/\/+/g;function q(Y,G){return typeof Y=="object"&&Y!==null&&Y.key!=null?U(""+Y.key):G.toString(36)}function z(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(C,C):(Y.status="pending",Y.then(function(G){Y.status==="pending"&&(Y.status="fulfilled",Y.value=G)},function(G){Y.status==="pending"&&(Y.status="rejected",Y.reason=G)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function H(Y,G,B,ne,K){var $=typeof Y;($==="undefined"||$==="boolean")&&(Y=null);var se=!1;if(Y===null)se=!0;else switch($){case"bigint":case"string":case"number":se=!0;break;case"object":switch(Y.$$typeof){case e:case t:se=!0;break;case m:return se=Y._init,H(se(Y._payload),G,B,ne,K)}}if(se)return K=K(Y),se=ne===""?"."+q(Y,0):ne,A(K)?(B="",se!=null&&(B=se.replace(J,"$&/")+"/"),H(K,G,B,"",function(qe){return qe})):K!=null&&(P(K)&&(K=D(K,B+(K.key==null||Y&&Y.key===K.key?"":(""+K.key).replace(J,"$&/")+"/")+se)),G.push(K)),1;se=0;var de=ne===""?".":ne+":";if(A(Y))for(var Ce=0;Ce<Y.length;Ce++)ne=Y[Ce],$=de+q(ne,Ce),se+=H(ne,G,B,$,K);else if(Ce=p(Y),typeof Ce=="function")for(Y=Ce.call(Y),Ce=0;!(ne=Y.next()).done;)ne=ne.value,$=de+q(ne,Ce++),se+=H(ne,G,B,$,K);else if($==="object"){if(typeof Y.then=="function")return H(z(Y),G,B,ne,K);throw G=String(Y),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return se}function X(Y,G,B){if(Y==null)return Y;var ne=[],K=0;return H(Y,ne,"","",function($){return G.call(B,$,K++)}),ne}function Z(Y){if(Y._status===-1){var G=Y._result;G=G(),G.then(function(B){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=B)},function(B){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=B)}),Y._status===-1&&(Y._status=0,Y._result=G)}if(Y._status===1)return Y._result.default;throw Y._result}var ie=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y=="object"&&Y!==null&&typeof Y.message=="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)},V={map:X,forEach:function(Y,G,B){X(Y,function(){G.apply(this,arguments)},B)},count:function(Y){var G=0;return X(Y,function(){G++}),G},toArray:function(Y){return X(Y,function(G){return G})||[]},only:function(Y){if(!P(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}};return Ve.Activity=g,Ve.Children=V,Ve.Component=k,Ve.Fragment=n,Ve.Profiler=o,Ve.PureComponent=N,Ve.StrictMode=i,Ve.Suspense=d,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return L.H.useMemoCache(Y)}},Ve.cache=function(Y){return function(){return Y.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(Y,G,B){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var ne=E({},Y.props),K=Y.key;if(G!=null)for($ in G.key!==void 0&&(K=""+G.key),G)!_.call(G,$)||$==="key"||$==="__self"||$==="__source"||$==="ref"&&G.ref===void 0||(ne[$]=G[$]);var $=arguments.length-2;if($===1)ne.children=B;else if(1<$){for(var se=Array($),de=0;de<$;de++)se[de]=arguments[de+2];ne.children=se}return j(Y.type,K,ne)},Ve.createContext=function(Y){return Y={$$typeof:l,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:s,_context:Y},Y},Ve.createElement=function(Y,G,B){var ne,K={},$=null;if(G!=null)for(ne in G.key!==void 0&&($=""+G.key),G)_.call(G,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(K[ne]=G[ne]);var se=arguments.length-2;if(se===1)K.children=B;else if(1<se){for(var de=Array(se),Ce=0;Ce<se;Ce++)de[Ce]=arguments[Ce+2];K.children=de}if(Y&&Y.defaultProps)for(ne in se=Y.defaultProps,se)K[ne]===void 0&&(K[ne]=se[ne]);return j(Y,$,K)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(Y){return{$$typeof:c,render:Y}},Ve.isValidElement=P,Ve.lazy=function(Y){return{$$typeof:m,_payload:{_status:-1,_result:Y},_init:Z}},Ve.memo=function(Y,G){return{$$typeof:h,type:Y,compare:G===void 0?null:G}},Ve.startTransition=function(Y){var G=L.T,B={};L.T=B;try{var ne=Y(),K=L.S;K!==null&&K(B,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(C,ie)}catch($){ie($)}finally{G!==null&&B.types!==null&&(G.types=B.types),L.T=G}},Ve.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ve.use=function(Y){return L.H.use(Y)},Ve.useActionState=function(Y,G,B){return L.H.useActionState(Y,G,B)},Ve.useCallback=function(Y,G){return L.H.useCallback(Y,G)},Ve.useContext=function(Y){return L.H.useContext(Y)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(Y,G){return L.H.useDeferredValue(Y,G)},Ve.useEffect=function(Y,G){return L.H.useEffect(Y,G)},Ve.useEffectEvent=function(Y){return L.H.useEffectEvent(Y)},Ve.useId=function(){return L.H.useId()},Ve.useImperativeHandle=function(Y,G,B){return L.H.useImperativeHandle(Y,G,B)},Ve.useInsertionEffect=function(Y,G){return L.H.useInsertionEffect(Y,G)},Ve.useLayoutEffect=function(Y,G){return L.H.useLayoutEffect(Y,G)},Ve.useMemo=function(Y,G){return L.H.useMemo(Y,G)},Ve.useOptimistic=function(Y,G){return L.H.useOptimistic(Y,G)},Ve.useReducer=function(Y,G,B){return L.H.useReducer(Y,G,B)},Ve.useRef=function(Y){return L.H.useRef(Y)},Ve.useState=function(Y){return L.H.useState(Y)},Ve.useSyncExternalStore=function(Y,G,B){return L.H.useSyncExternalStore(Y,G,B)},Ve.useTransition=function(){return L.H.useTransition()},Ve.version="19.2.8",Ve}var Zb;function tp(){return Zb||(Zb=1,Gh.exports=XA()),Gh.exports}var R=tp();const np=Ml(R);var Xh={exports:{}},Fo={},Kh={exports:{}},Qh={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Jb;function KA(){return Jb||(Jb=1,(function(e){function t(H,X){var Z=H.length;H.push(X);e:for(;0<Z;){var ie=Z-1>>>1,V=H[ie];if(0<o(V,X))H[ie]=X,H[Z]=V,Z=ie;else break e}}function n(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var X=H[0],Z=H.pop();if(Z!==X){H[0]=Z;e:for(var ie=0,V=H.length,Y=V>>>1;ie<Y;){var G=2*(ie+1)-1,B=H[G],ne=G+1,K=H[ne];if(0>o(B,Z))ne<V&&0>o(K,B)?(H[ie]=K,H[ne]=Z,ie=ne):(H[ie]=B,H[G]=Z,ie=G);else if(ne<V&&0>o(K,Z))H[ie]=K,H[ne]=Z,ie=ne;else break e}}return X}function o(H,X){var Z=H.sortIndex-X.sortIndex;return Z!==0?Z:H.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],h=[],m=1,g=null,b=3,p=!1,y=!1,E=!1,T=!1,k=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function O(H){for(var X=n(h);X!==null;){if(X.callback===null)i(h);else if(X.startTime<=H)i(h),X.sortIndex=X.expirationTime,t(d,X);else break;X=n(h)}}function A(H){if(E=!1,O(H),!y)if(n(d)!==null)y=!0,C||(C=!0,U());else{var X=n(h);X!==null&&z(A,X.startTime-H)}}var C=!1,L=-1,_=5,j=-1;function D(){return T?!0:!(e.unstable_now()-j<_)}function P(){if(T=!1,C){var H=e.unstable_now();j=H;var X=!0;try{e:{y=!1,E&&(E=!1,M(L),L=-1),p=!0;var Z=b;try{t:{for(O(H),g=n(d);g!==null&&!(g.expirationTime>H&&D());){var ie=g.callback;if(typeof ie=="function"){g.callback=null,b=g.priorityLevel;var V=ie(g.expirationTime<=H);if(H=e.unstable_now(),typeof V=="function"){g.callback=V,O(H),X=!0;break t}g===n(d)&&i(d),O(H)}else i(d);g=n(d)}if(g!==null)X=!0;else{var Y=n(h);Y!==null&&z(A,Y.startTime-H),X=!1}}break e}finally{g=null,b=Z,p=!1}X=void 0}}finally{X?U():C=!1}}}var U;if(typeof N=="function")U=function(){N(P)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,q=J.port2;J.port1.onmessage=P,U=function(){q.postMessage(null)}}else U=function(){k(P,0)};function z(H,X){L=k(function(){H(e.unstable_now())},X)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var Z=b;b=X;try{return H()}finally{b=Z}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var Z=b;b=H;try{return X()}finally{b=Z}},e.unstable_scheduleCallback=function(H,X,Z){var ie=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ie+Z:ie):Z=ie,H){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=Z+V,H={id:m++,callback:X,priorityLevel:H,startTime:Z,expirationTime:V,sortIndex:-1},Z>ie?(H.sortIndex=Z,t(h,H),n(d)===null&&H===n(h)&&(E?(M(L),L=-1):E=!0,z(A,Z-ie))):(H.sortIndex=V,t(d,H),y||p||(y=!0,C||(C=!0,U()))),H},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(H){var X=b;return function(){var Z=b;b=X;try{return H.apply(this,arguments)}finally{b=Z}}}})(Qh)),Qh}var ey;function QA(){return ey||(ey=1,Kh.exports=KA()),Kh.exports}var $h={exports:{}},cn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var ty;function $A(){if(ty)return cn;ty=1;var e=tp();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(d,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:d,containerInfo:h,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,cn.createPortal=function(d,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(d,h,null,m)},cn.flushSync=function(d){var h=l.T,m=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=h,i.p=m,i.d.f()}},cn.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(d,h))},cn.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},cn.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,p=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?i.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:p}):m==="script"&&i.d.X(d,{crossOrigin:g,integrity:b,fetchPriority:p,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},cn.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=c(h.as,h.crossOrigin);i.d.M(d,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(d)},cn.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin);i.d.L(d,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},cn.preloadModule=function(d,h){if(typeof d=="string")if(h){var m=c(h.as,h.crossOrigin);i.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(d)},cn.requestFormReset=function(d){i.d.r(d)},cn.unstable_batchedUpdates=function(d,h){return d(h)},cn.useFormState=function(d,h,m){return l.H.useFormState(d,h,m)},cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},cn.version="19.2.8",cn}var ny;function dE(){if(ny)return $h.exports;ny=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$h.exports=$A(),$h.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var ay;function WA(){if(ay)return Fo;ay=1;var e=QA(),t=tp(),n=dE();function i(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var r=a,u=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(u=r.return),a=r.return;while(a)}return r.tag===3?u:null}function l(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function c(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function d(a){if(s(a)!==a)throw Error(i(188))}function h(a){var r=a.alternate;if(!r){if(r=s(a),r===null)throw Error(i(188));return r!==a?null:a}for(var u=a,f=r;;){var v=u.return;if(v===null)break;var S=v.alternate;if(S===null){if(f=v.return,f!==null){u=f;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===u)return d(v),a;if(S===f)return d(v),r;S=S.sibling}throw Error(i(188))}if(u.return!==f.return)u=v,f=S;else{for(var I=!1,F=v.child;F;){if(F===u){I=!0,u=v,f=S;break}if(F===f){I=!0,f=v,u=S;break}F=F.sibling}if(!I){for(F=S.child;F;){if(F===u){I=!0,u=S,f=v;break}if(F===f){I=!0,f=S,u=v;break}F=F.sibling}if(!I)throw Error(i(189))}}if(u.alternate!==f)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?a:r}function m(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=m(a),r!==null)return r;a=a.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function U(a){return a===null||typeof a!="object"?null:(a=P&&a[P]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function q(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case E:return"Fragment";case k:return"Profiler";case T:return"StrictMode";case A:return"Suspense";case C:return"SuspenseList";case j:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case y:return"Portal";case N:return a.displayName||"Context";case M:return(a._context.displayName||"Context")+".Consumer";case O:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case L:return r=a.displayName||null,r!==null?r:q(a.type)||"Memo";case _:r=a._payload,a=a._init;try{return q(a(r))}catch{}}return null}var z=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ie=[],V=-1;function Y(a){return{current:a}}function G(a){0>V||(a.current=ie[V],ie[V]=null,V--)}function B(a,r){V++,ie[V]=a.current,a.current=r}var ne=Y(null),K=Y(null),$=Y(null),se=Y(null);function de(a,r){switch(B($,r),B(K,a),B(ne,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?gb(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=gb(r),a=xb(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}G(ne),B(ne,a)}function Ce(){G(ne),G(K),G($)}function qe(a){a.memoizedState!==null&&B(se,a);var r=ne.current,u=xb(r,a.type);r!==u&&(B(K,a),B(ne,u))}function $e(a){K.current===a&&(G(ne),G(K)),se.current===a&&(G(se),Po._currentValue=Z)}var We,Ct;function Rt(a){if(We===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);We=r&&r[1]||"",Ct=-1<u.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+We+a+Ct}var Nt=!1;function Kt(a,r){if(!a||Nt)return"";Nt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(r){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(me){var fe=me}Reflect.construct(a,[],Ee)}else{try{Ee.call()}catch(me){fe=me}a.call(Ee.prototype)}}else{try{throw Error()}catch(me){fe=me}(Ee=a())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=f.DetermineComponentFrameRoot(),I=S[0],F=S[1];if(I&&F){var te=I.split(`
|
|
44
|
+
`),ce=F.split(`
|
|
45
|
+
`);for(v=f=0;f<te.length&&!te[f].includes("DetermineComponentFrameRoot");)f++;for(;v<ce.length&&!ce[v].includes("DetermineComponentFrameRoot");)v++;if(f===te.length||v===ce.length)for(f=te.length-1,v=ce.length-1;1<=f&&0<=v&&te[f]!==ce[v];)v--;for(;1<=f&&0<=v;f--,v--)if(te[f]!==ce[v]){if(f!==1||v!==1)do if(f--,v--,0>v||te[f]!==ce[v]){var xe=`
|
|
46
|
+
`+te[f].replace(" at new "," at ");return a.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",a.displayName)),xe}while(1<=f&&0<=v);break}}}finally{Nt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Rt(u):""}function mn(a,r){switch(a.tag){case 26:case 27:case 5:return Rt(a.type);case 16:return Rt("Lazy");case 13:return a.child!==r&&r!==null?Rt("Suspense Fallback"):Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 15:return Kt(a.type,!1);case 11:return Kt(a.type.render,!1);case 1:return Kt(a.type,!0);case 31:return Rt("Activity");default:return""}}function pn(a){try{var r="",u=null;do r+=mn(a,u),u=a,a=a.return;while(a);return r}catch(f){return`
|
|
47
|
+
Error generating stack: `+f.message+`
|
|
48
|
+
`+f.stack}}var Qt=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,gn=e.unstable_cancelCallback,Ht=e.unstable_shouldYield,ge=e.unstable_requestPaint,Ue=e.unstable_now,Ie=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Te=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,_e=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,Ae=e.log,Ze=e.unstable_setDisableYieldValue,Qe=null,Ge=null;function Jt(a){if(typeof Ae=="function"&&Ze(a),Ge&&typeof Ge.setStrictMode=="function")try{Ge.setStrictMode(Qe,a)}catch{}}var ft=Math.clz32?Math.clz32:Ld,Yn=Math.log,rt=Math.LN2;function Ld(a){return a>>>=0,a===0?32:31-(Yn(a)/rt|0)|0}var Gn=256,Ir=262144,Rn=4194304;function ua(a){var r=a&42;if(r!==0)return r;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function qi(a,r,u){var f=a.pendingLanes;if(f===0)return 0;var v=0,S=a.suspendedLanes,I=a.pingedLanes;a=a.warmLanes;var F=f&134217727;return F!==0?(f=F&~S,f!==0?v=ua(f):(I&=F,I!==0?v=ua(I):u||(u=F&~a,u!==0&&(v=ua(u))))):(F=f&~S,F!==0?v=ua(F):I!==0?v=ua(I):u||(u=f&~a,u!==0&&(v=ua(u)))),v===0?0:r!==0&&r!==v&&(r&S)===0&&(S=v&-v,u=r&-r,S>=u||S===32&&(u&4194048)!==0)?r:v}function oi(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function jr(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Pr(){var a=Rn;return Rn<<=1,(Rn&62914560)===0&&(Rn=4194304),a}function Yi(a){for(var r=[],u=0;31>u;u++)r.push(a);return r}function Gi(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Od(a,r,u,f,v,S){var I=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var F=a.entanglements,te=a.expirationTimes,ce=a.hiddenUpdates;for(u=I&~u;0<u;){var xe=31-ft(u),Ee=1<<xe;F[xe]=0,te[xe]=-1;var fe=ce[xe];if(fe!==null)for(ce[xe]=null,xe=0;xe<fe.length;xe++){var me=fe[xe];me!==null&&(me.lane&=-536870913)}u&=~Ee}f!==0&&Yl(a,f,0),S!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=S&~(I&~r))}function Yl(a,r,u){a.pendingLanes|=r,a.suspendedLanes&=~r;var f=31-ft(r);a.entangledLanes|=r,a.entanglements[f]=a.entanglements[f]|1073741824|u&261930}function Gl(a,r){var u=a.entangledLanes|=r;for(a=a.entanglements;u;){var f=31-ft(u),v=1<<f;v&r|a[f]&r&&(a[f]|=r),u&=~v}}function Xl(a,r){var u=r&-r;return u=(u&42)!==0?1:Xs(u),(u&(a.suspendedLanes|r))!==0?0:u}function Xs(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Xi(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ks(){var a=X.p;return a!==0?a:(a=window.event,a===void 0?32:zb(a.type))}function Ki(a,r){var u=X.p;try{return X.p=a,r()}finally{X.p=u}}var va=Math.random().toString(36).slice(2),$t="__reactFiber$"+va,gt="__reactProps$"+va,Oa="__reactContainer$"+va,Dt="__reactEvents$"+va,Id="__reactListeners$"+va,Qs="__reactHandles$"+va,$s="__reactResources$"+va,Qi="__reactMarker$"+va;function Br(a){delete a[$t],delete a[gt],delete a[Dt],delete a[Id],delete a[Qs]}function Xn(a){var r=a[$t];if(r)return r;for(var u=a.parentNode;u;){if(r=u[Oa]||u[$t]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=wb(a);a!==null;){if(u=a[$t])return u;a=wb(a)}return r}a=u,u=a.parentNode}return null}function Ia(a){if(a=a[$t]||a[Oa]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function $i(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(i(33))}function ja(a){var r=a[$s];return r||(r=a[$s]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Pt(a){a[Qi]=!0}var Ws=new Set,Kl={};function ca(a,r){li(a,r),li(a+"Capture",r)}function li(a,r){for(Kl[a]=r,a=0;a<r.length;a++)Ws.add(r[a])}var Zs=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]*$"),oe={},ye={};function Ne(a){return Qt.call(ye,a)?!0:Qt.call(oe,a)?!1:Zs.test(a)?ye[a]=!0:(oe[a]=!0,!1)}function je(a,r,u){if(Ne(r))if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var f=r.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+u)}}function lt(a,r,u){if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+u)}}function Lt(a,r,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(r,u,""+f)}}function En(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function lg(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ow(a,r,u){var f=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,S=f.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return v.call(this)},set:function(I){u=""+I,S.call(this,I)}}),Object.defineProperty(a,r,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(I){u=""+I},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function jd(a){if(!a._valueTracker){var r=lg(a)?"checked":"value";a._valueTracker=Ow(a,r,""+a[r])}}function ug(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var u=r.getValue(),f="";return a&&(f=lg(a)?a.checked?"true":"false":a.value),a=f,a!==u?(r.setValue(a),!0):!1}function Ql(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Iw=/[\n"\\]/g;function Kn(a){return a.replace(Iw,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Pd(a,r,u,f,v,S,I,F){a.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?a.type=I:a.removeAttribute("type"),r!=null?I==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+En(r)):a.value!==""+En(r)&&(a.value=""+En(r)):I!=="submit"&&I!=="reset"||a.removeAttribute("value"),r!=null?Bd(a,I,En(r)):u!=null?Bd(a,I,En(u)):f!=null&&a.removeAttribute("value"),v==null&&S!=null&&(a.defaultChecked=!!S),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?a.name=""+En(F):a.removeAttribute("name")}function cg(a,r,u,f,v,S,I,F){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),r!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||r!=null)){jd(a);return}u=u!=null?""+En(u):"",r=r!=null?""+En(r):u,F||r===a.value||(a.value=r),a.defaultValue=r}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=F?a.checked:!!f,a.defaultChecked=!!f,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(a.name=I),jd(a)}function Bd(a,r,u){r==="number"&&Ql(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Ur(a,r,u,f){if(a=a.options,r){r={};for(var v=0;v<u.length;v++)r["$"+u[v]]=!0;for(u=0;u<a.length;u++)v=r.hasOwnProperty("$"+a[u].value),a[u].selected!==v&&(a[u].selected=v),v&&f&&(a[u].defaultSelected=!0)}else{for(u=""+En(u),r=null,v=0;v<a.length;v++){if(a[v].value===u){a[v].selected=!0,f&&(a[v].defaultSelected=!0);return}r!==null||a[v].disabled||(r=a[v])}r!==null&&(r.selected=!0)}}function dg(a,r,u){if(r!=null&&(r=""+En(r),r!==a.value&&(a.value=r),u==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=u!=null?""+En(u):""}function fg(a,r,u,f){if(r==null){if(f!=null){if(u!=null)throw Error(i(92));if(z(f)){if(1<f.length)throw Error(i(93));f=f[0]}u=f}u==null&&(u=""),r=u}u=En(r),a.defaultValue=u,f=a.textContent,f===u&&f!==""&&f!==null&&(a.value=f),jd(a)}function zr(a,r){if(r){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=r;return}}a.textContent=r}var jw=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 hg(a,r,u){var f=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":f?a.setProperty(r,u):typeof u!="number"||u===0||jw.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function mg(a,r,u){if(r!=null&&typeof r!="object")throw Error(i(62));if(a=a.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||r!=null&&r.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var v in r)f=r[v],r.hasOwnProperty(v)&&u[v]!==f&&hg(a,v,f)}else for(var S in r)r.hasOwnProperty(S)&&hg(a,S,r[S])}function Ud(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Pw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Bw=/^[\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 $l(a){return Bw.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Pa(){}var zd=null;function Hd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Hr=null,Fr=null;function pg(a){var r=Ia(a);if(r&&(a=r.stateNode)){var u=a[gt]||null;e:switch(a=r.stateNode,r.type){case"input":if(Pd(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Kn(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var f=u[r];if(f!==a&&f.form===a.form){var v=f[gt]||null;if(!v)throw Error(i(90));Pd(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(r=0;r<u.length;r++)f=u[r],f.form===a.form&&ug(f)}break e;case"textarea":dg(a,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&Ur(a,!!u.multiple,r,!1)}}}var Fd=!1;function gg(a,r,u){if(Fd)return a(r,u);Fd=!0;try{var f=a(r);return f}finally{if(Fd=!1,(Hr!==null||Fr!==null)&&(Pu(),Hr&&(r=Hr,a=Fr,Fr=Hr=null,pg(r),a)))for(r=0;r<a.length;r++)pg(a[r])}}function Js(a,r){var u=a.stateNode;if(u===null)return null;var f=u[gt]||null;if(f===null)return null;u=f[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(i(231,r,typeof u));return u}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vd=!1;if(Ba)try{var eo={};Object.defineProperty(eo,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{Vd=!1}var ui=null,qd=null,Wl=null;function xg(){if(Wl)return Wl;var a,r=qd,u=r.length,f,v="value"in ui?ui.value:ui.textContent,S=v.length;for(a=0;a<u&&r[a]===v[a];a++);var I=u-a;for(f=1;f<=I&&r[u-f]===v[S-f];f++);return Wl=v.slice(a,1<f?1-f:void 0)}function Zl(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function Jl(){return!0}function bg(){return!1}function Tn(a){function r(u,f,v,S,I){this._reactName=u,this._targetInst=v,this.type=f,this.nativeEvent=S,this.target=I,this.currentTarget=null;for(var F in a)a.hasOwnProperty(F)&&(u=a[F],this[F]=u?u(S):S[F]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Jl:bg,this.isPropagationStopped=bg,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Jl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),r}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=Tn(Wi),to=g({},Wi,{view:0,detail:0}),Uw=Tn(to),Yd,Gd,no,tu=g({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==no&&(no&&a.type==="mousemove"?(Yd=a.screenX-no.screenX,Gd=a.screenY-no.screenY):Gd=Yd=0,no=a),Yd)},movementY:function(a){return"movementY"in a?a.movementY:Gd}}),yg=Tn(tu),zw=g({},tu,{dataTransfer:0}),Hw=Tn(zw),Fw=g({},to,{relatedTarget:0}),Xd=Tn(Fw),Vw=g({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),qw=Tn(Vw),Yw=g({},Wi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Gw=Tn(Yw),Xw=g({},Wi,{data:0}),vg=Tn(Xw),Kw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qw={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"},$w={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ww(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=$w[a])?!!r[a]:!1}function Kd(){return Ww}var Zw=g({},to,{key:function(a){if(a.key){var r=Kw[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Zl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Qw[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kd,charCode:function(a){return a.type==="keypress"?Zl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Zl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Jw=Tn(Zw),ek=g({},tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Eg=Tn(ek),tk=g({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kd}),nk=Tn(tk),ak=g({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ik=Tn(ak),rk=g({},tu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),sk=Tn(rk),ok=g({},Wi,{newState:0,oldState:0}),lk=Tn(ok),uk=[9,13,27,32],Qd=Ba&&"CompositionEvent"in window,ao=null;Ba&&"documentMode"in document&&(ao=document.documentMode);var ck=Ba&&"TextEvent"in window&&!ao,Tg=Ba&&(!Qd||ao&&8<ao&&11>=ao),Sg=" ",wg=!1;function kg(a,r){switch(a){case"keyup":return uk.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ag(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Vr=!1;function dk(a,r){switch(a){case"compositionend":return Ag(r);case"keypress":return r.which!==32?null:(wg=!0,Sg);case"textInput":return a=r.data,a===Sg&&wg?null:a;default:return null}}function fk(a,r){if(Vr)return a==="compositionend"||!Qd&&kg(a,r)?(a=xg(),Wl=qd=ui=null,Vr=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Tg&&r.locale!=="ko"?null:r.data;default:return null}}var hk={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 Cg(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!hk[a.type]:r==="textarea"}function Ng(a,r,u,f){Hr?Fr?Fr.push(f):Fr=[f]:Hr=f,r=qu(r,"onChange"),0<r.length&&(u=new eu("onChange","change",null,u,f),a.push({event:u,listeners:r}))}var io=null,ro=null;function mk(a){cb(a,0)}function nu(a){var r=$i(a);if(ug(r))return a}function _g(a,r){if(a==="change")return r}var Mg=!1;if(Ba){var $d;if(Ba){var Wd="oninput"in document;if(!Wd){var Rg=document.createElement("div");Rg.setAttribute("oninput","return;"),Wd=typeof Rg.oninput=="function"}$d=Wd}else $d=!1;Mg=$d&&(!document.documentMode||9<document.documentMode)}function Dg(){io&&(io.detachEvent("onpropertychange",Lg),ro=io=null)}function Lg(a){if(a.propertyName==="value"&&nu(ro)){var r=[];Ng(r,ro,a,Hd(a)),gg(mk,r)}}function pk(a,r,u){a==="focusin"?(Dg(),io=r,ro=u,io.attachEvent("onpropertychange",Lg)):a==="focusout"&&Dg()}function gk(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return nu(ro)}function xk(a,r){if(a==="click")return nu(r)}function bk(a,r){if(a==="input"||a==="change")return nu(r)}function yk(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Dn=typeof Object.is=="function"?Object.is:yk;function so(a,r){if(Dn(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var u=Object.keys(a),f=Object.keys(r);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var v=u[f];if(!Qt.call(r,v)||!Dn(a[v],r[v]))return!1}return!0}function Og(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ig(a,r){var u=Og(a);a=0;for(var f;u;){if(u.nodeType===3){if(f=a+u.textContent.length,a<=r&&f>=r)return{node:u,offset:r-a};a=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Og(u)}}function jg(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?jg(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Pg(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=Ql(a.document);r instanceof a.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)a=r.contentWindow;else break;r=Ql(a.document)}return r}function Zd(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var vk=Ba&&"documentMode"in document&&11>=document.documentMode,qr=null,Jd=null,oo=null,ef=!1;function Bg(a,r,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ef||qr==null||qr!==Ql(f)||(f=qr,"selectionStart"in f&&Zd(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),oo&&so(oo,f)||(oo=f,f=qu(Jd,"onSelect"),0<f.length&&(r=new eu("onSelect","select",null,r,u),a.push({event:r,listeners:f}),r.target=qr)))}function Zi(a,r){var u={};return u[a.toLowerCase()]=r.toLowerCase(),u["Webkit"+a]="webkit"+r,u["Moz"+a]="moz"+r,u}var Yr={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionrun:Zi("Transition","TransitionRun"),transitionstart:Zi("Transition","TransitionStart"),transitioncancel:Zi("Transition","TransitionCancel"),transitionend:Zi("Transition","TransitionEnd")},tf={},Ug={};Ba&&(Ug=document.createElement("div").style,"AnimationEvent"in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),"TransitionEvent"in window||delete Yr.transitionend.transition);function Ji(a){if(tf[a])return tf[a];if(!Yr[a])return a;var r=Yr[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Ug)return tf[a]=r[u];return a}var zg=Ji("animationend"),Hg=Ji("animationiteration"),Fg=Ji("animationstart"),Ek=Ji("transitionrun"),Tk=Ji("transitionstart"),Sk=Ji("transitioncancel"),Vg=Ji("transitionend"),qg=new Map,nf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");nf.push("scrollEnd");function da(a,r){qg.set(a,r),ca(r,[a])}var au=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Qn=[],Gr=0,af=0;function iu(){for(var a=Gr,r=af=Gr=0;r<a;){var u=Qn[r];Qn[r++]=null;var f=Qn[r];Qn[r++]=null;var v=Qn[r];Qn[r++]=null;var S=Qn[r];if(Qn[r++]=null,f!==null&&v!==null){var I=f.pending;I===null?v.next=v:(v.next=I.next,I.next=v),f.pending=v}S!==0&&Yg(u,v,S)}}function ru(a,r,u,f){Qn[Gr++]=a,Qn[Gr++]=r,Qn[Gr++]=u,Qn[Gr++]=f,af|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function rf(a,r,u,f){return ru(a,r,u,f),su(a)}function er(a,r){return ru(a,null,null,r),su(a)}function Yg(a,r,u){a.lanes|=u;var f=a.alternate;f!==null&&(f.lanes|=u);for(var v=!1,S=a.return;S!==null;)S.childLanes|=u,f=S.alternate,f!==null&&(f.childLanes|=u),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(v=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,v&&r!==null&&(v=31-ft(u),a=S.hiddenUpdates,f=a[v],f===null?a[v]=[r]:f.push(r),r.lane=u|536870912),S):null}function su(a){if(50<Mo)throw Mo=0,mh=null,Error(i(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Xr={};function wk(a,r,u,f){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(a,r,u,f){return new wk(a,r,u,f)}function sf(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ua(a,r){var u=a.alternate;return u===null?(u=Ln(a.tag,r,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=r,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,r=a.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function Gg(a,r){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,r=u.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function ou(a,r,u,f,v,S){var I=0;if(f=a,typeof a=="function")sf(a)&&(I=1);else if(typeof a=="string")I=_A(a,u,ne.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case j:return a=Ln(31,u,r,v),a.elementType=j,a.lanes=S,a;case E:return tr(u.children,v,S,r);case T:I=8,v|=24;break;case k:return a=Ln(12,u,r,v|2),a.elementType=k,a.lanes=S,a;case A:return a=Ln(13,u,r,v),a.elementType=A,a.lanes=S,a;case C:return a=Ln(19,u,r,v),a.elementType=C,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:I=10;break e;case M:I=9;break e;case O:I=11;break e;case L:I=14;break e;case _:I=16,f=null;break e}I=29,u=Error(i(130,a===null?"null":typeof a,"")),f=null}return r=Ln(I,u,r,v),r.elementType=a,r.type=f,r.lanes=S,r}function tr(a,r,u,f){return a=Ln(7,a,f,r),a.lanes=u,a}function of(a,r,u){return a=Ln(6,a,null,r),a.lanes=u,a}function Xg(a){var r=Ln(18,null,null,0);return r.stateNode=a,r}function lf(a,r,u){return r=Ln(4,a.children!==null?a.children:[],a.key,r),r.lanes=u,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Kg=new WeakMap;function $n(a,r){if(typeof a=="object"&&a!==null){var u=Kg.get(a);return u!==void 0?u:(r={value:a,source:r,stack:pn(r)},Kg.set(a,r),r)}return{value:a,source:r,stack:pn(r)}}var Kr=[],Qr=0,lu=null,lo=0,Wn=[],Zn=0,ci=null,Ea=1,Ta="";function za(a,r){Kr[Qr++]=lo,Kr[Qr++]=lu,lu=a,lo=r}function Qg(a,r,u){Wn[Zn++]=Ea,Wn[Zn++]=Ta,Wn[Zn++]=ci,ci=a;var f=Ea;a=Ta;var v=32-ft(f)-1;f&=~(1<<v),u+=1;var S=32-ft(r)+v;if(30<S){var I=v-v%5;S=(f&(1<<I)-1).toString(32),f>>=I,v-=I,Ea=1<<32-ft(r)+v|u<<v|f,Ta=S+a}else Ea=1<<S|u<<v|f,Ta=a}function uf(a){a.return!==null&&(za(a,1),Qg(a,1,0))}function cf(a){for(;a===lu;)lu=Kr[--Qr],Kr[Qr]=null,lo=Kr[--Qr],Kr[Qr]=null;for(;a===ci;)ci=Wn[--Zn],Wn[Zn]=null,Ta=Wn[--Zn],Wn[Zn]=null,Ea=Wn[--Zn],Wn[Zn]=null}function $g(a,r){Wn[Zn++]=Ea,Wn[Zn++]=Ta,Wn[Zn++]=ci,Ea=r.id,Ta=r.overflow,ci=a}var an=null,kt=null,st=!1,di=null,Jn=!1,df=Error(i(519));function fi(a){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo($n(r,a)),df}function Wg(a){var r=a.stateNode,u=a.type,f=a.memoizedProps;switch(r[$t]=a,r[gt]=f,u){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(u=0;u<Do.length;u++)tt(Do[u],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":tt("invalid",r),cg(r,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":tt("invalid",r);break;case"textarea":tt("invalid",r),fg(r,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||f.suppressHydrationWarning===!0||mb(r.textContent,u)?(f.popover!=null&&(tt("beforetoggle",r),tt("toggle",r)),f.onScroll!=null&&tt("scroll",r),f.onScrollEnd!=null&&tt("scrollend",r),f.onClick!=null&&(r.onclick=Pa),r=!0):r=!1,r||fi(a,!0)}function Zg(a){for(an=a.return;an;)switch(an.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:an=an.return}}function $r(a){if(a!==an)return!1;if(!st)return Zg(a),st=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||_h(a.type,a.memoizedProps)),u=!u),u&&kt&&fi(a),Zg(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));kt=Sb(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));kt=Sb(a)}else r===27?(r=kt,Ai(a.type)?(a=Oh,Oh=null,kt=a):kt=r):kt=an?ta(a.stateNode.nextSibling):null;return!0}function nr(){kt=an=null,st=!1}function ff(){var a=di;return a!==null&&(An===null?An=a:An.push.apply(An,a),di=null),a}function uo(a){di===null?di=[a]:di.push(a)}var hf=Y(null),ar=null,Ha=null;function hi(a,r,u){B(hf,r._currentValue),r._currentValue=u}function Fa(a){a._currentValue=hf.current,G(hf)}function mf(a,r,u){for(;a!==null;){var f=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,f!==null&&(f.childLanes|=r)):f!==null&&(f.childLanes&r)!==r&&(f.childLanes|=r),a===u)break;a=a.return}}function pf(a,r,u,f){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var S=v.dependencies;if(S!==null){var I=v.child;S=S.firstContext;e:for(;S!==null;){var F=S;S=v;for(var te=0;te<r.length;te++)if(F.context===r[te]){S.lanes|=u,F=S.alternate,F!==null&&(F.lanes|=u),mf(S.return,u,a),f||(I=null);break e}S=F.next}}else if(v.tag===18){if(I=v.return,I===null)throw Error(i(341));I.lanes|=u,S=I.alternate,S!==null&&(S.lanes|=u),mf(I,u,a),I=null}else I=v.child;if(I!==null)I.return=v;else for(I=v;I!==null;){if(I===a){I=null;break}if(v=I.sibling,v!==null){v.return=I.return,I=v;break}I=I.return}v=I}}function Wr(a,r,u,f){a=null;for(var v=r,S=!1;v!==null;){if(!S){if((v.flags&524288)!==0)S=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var I=v.alternate;if(I===null)throw Error(i(387));if(I=I.memoizedProps,I!==null){var F=v.type;Dn(v.pendingProps.value,I.value)||(a!==null?a.push(F):a=[F])}}else if(v===se.current){if(I=v.alternate,I===null)throw Error(i(387));I.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(Po):a=[Po])}v=v.return}a!==null&&pf(r,a,u,f),r.flags|=262144}function uu(a){for(a=a.firstContext;a!==null;){if(!Dn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function ir(a){ar=a,Ha=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function rn(a){return Jg(ar,a)}function cu(a,r){return ar===null&&ir(a),Jg(a,r)}function Jg(a,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},Ha===null){if(a===null)throw Error(i(308));Ha=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Ha=Ha.next=r;return u}var kk=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(u,f){a.push(f)}};this.abort=function(){r.aborted=!0,a.forEach(function(u){return u()})}},Ak=e.unstable_scheduleCallback,Ck=e.unstable_NormalPriority,Ft={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gf(){return{controller:new kk,data:new Map,refCount:0}}function co(a){a.refCount--,a.refCount===0&&Ak(Ck,function(){a.controller.abort()})}var fo=null,xf=0,Zr=0,Jr=null;function Nk(a,r){if(fo===null){var u=fo=[];xf=0,Zr=vh(),Jr={status:"pending",value:void 0,then:function(f){u.push(f)}}}return xf++,r.then(e1,e1),r}function e1(){if(--xf===0&&fo!==null){Jr!==null&&(Jr.status="fulfilled");var a=fo;fo=null,Zr=0,Jr=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function _k(a,r){var u=[],f={status:"pending",value:null,reason:null,then:function(v){u.push(v)}};return a.then(function(){f.status="fulfilled",f.value=r;for(var v=0;v<u.length;v++)(0,u[v])(r)},function(v){for(f.status="rejected",f.reason=v,v=0;v<u.length;v++)(0,u[v])(void 0)}),f}var t1=H.S;H.S=function(a,r){Bx=Ue(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Nk(a,r),t1!==null&&t1(a,r)};var rr=Y(null);function bf(){var a=rr.current;return a!==null?a:vt.pooledCache}function du(a,r){r===null?B(rr,rr.current):B(rr,r.pool)}function n1(){var a=bf();return a===null?null:{parent:Ft._currentValue,pool:a}}var es=Error(i(460)),yf=Error(i(474)),fu=Error(i(542)),hu={then:function(){}};function a1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function i1(a,r,u){switch(u=a[u],u===void 0?a.push(r):u!==r&&(r.then(Pa,Pa),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,s1(a),a;default:if(typeof r.status=="string")r.then(Pa,Pa);else{if(a=vt,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=r,a.status="pending",a.then(function(f){if(r.status==="pending"){var v=r;v.status="fulfilled",v.value=f}},function(f){if(r.status==="pending"){var v=r;v.status="rejected",v.reason=f}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,s1(a),a}throw or=r,es}}function sr(a){try{var r=a._init;return r(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(or=u,es):u}}var or=null;function r1(){if(or===null)throw Error(i(459));var a=or;return or=null,a}function s1(a){if(a===es||a===fu)throw Error(i(483))}var ts=null,ho=0;function mu(a){var r=ho;return ho+=1,ts===null&&(ts=[]),i1(ts,a,r)}function mo(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function pu(a,r){throw r.$$typeof===b?Error(i(525)):(a=Object.prototype.toString.call(r),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function o1(a){function r(re,ae){if(a){var ue=re.deletions;ue===null?(re.deletions=[ae],re.flags|=16):ue.push(ae)}}function u(re,ae){if(!a)return null;for(;ae!==null;)r(re,ae),ae=ae.sibling;return null}function f(re){for(var ae=new Map;re!==null;)re.key!==null?ae.set(re.key,re):ae.set(re.index,re),re=re.sibling;return ae}function v(re,ae){return re=Ua(re,ae),re.index=0,re.sibling=null,re}function S(re,ae,ue){return re.index=ue,a?(ue=re.alternate,ue!==null?(ue=ue.index,ue<ae?(re.flags|=67108866,ae):ue):(re.flags|=67108866,ae)):(re.flags|=1048576,ae)}function I(re){return a&&re.alternate===null&&(re.flags|=67108866),re}function F(re,ae,ue,ve){return ae===null||ae.tag!==6?(ae=of(ue,re.mode,ve),ae.return=re,ae):(ae=v(ae,ue),ae.return=re,ae)}function te(re,ae,ue,ve){var Pe=ue.type;return Pe===E?xe(re,ae,ue.props.children,ve,ue.key):ae!==null&&(ae.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===_&&sr(Pe)===ae.type)?(ae=v(ae,ue.props),mo(ae,ue),ae.return=re,ae):(ae=ou(ue.type,ue.key,ue.props,null,re.mode,ve),mo(ae,ue),ae.return=re,ae)}function ce(re,ae,ue,ve){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==ue.containerInfo||ae.stateNode.implementation!==ue.implementation?(ae=lf(ue,re.mode,ve),ae.return=re,ae):(ae=v(ae,ue.children||[]),ae.return=re,ae)}function xe(re,ae,ue,ve,Pe){return ae===null||ae.tag!==7?(ae=tr(ue,re.mode,ve,Pe),ae.return=re,ae):(ae=v(ae,ue),ae.return=re,ae)}function Ee(re,ae,ue){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=of(""+ae,re.mode,ue),ae.return=re,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case p:return ue=ou(ae.type,ae.key,ae.props,null,re.mode,ue),mo(ue,ae),ue.return=re,ue;case y:return ae=lf(ae,re.mode,ue),ae.return=re,ae;case _:return ae=sr(ae),Ee(re,ae,ue)}if(z(ae)||U(ae))return ae=tr(ae,re.mode,ue,null),ae.return=re,ae;if(typeof ae.then=="function")return Ee(re,mu(ae),ue);if(ae.$$typeof===N)return Ee(re,cu(re,ae),ue);pu(re,ae)}return null}function fe(re,ae,ue,ve){var Pe=ae!==null?ae.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Pe!==null?null:F(re,ae,""+ue,ve);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case p:return ue.key===Pe?te(re,ae,ue,ve):null;case y:return ue.key===Pe?ce(re,ae,ue,ve):null;case _:return ue=sr(ue),fe(re,ae,ue,ve)}if(z(ue)||U(ue))return Pe!==null?null:xe(re,ae,ue,ve,null);if(typeof ue.then=="function")return fe(re,ae,mu(ue),ve);if(ue.$$typeof===N)return fe(re,ae,cu(re,ue),ve);pu(re,ue)}return null}function me(re,ae,ue,ve,Pe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return re=re.get(ue)||null,F(ae,re,""+ve,Pe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case p:return re=re.get(ve.key===null?ue:ve.key)||null,te(ae,re,ve,Pe);case y:return re=re.get(ve.key===null?ue:ve.key)||null,ce(ae,re,ve,Pe);case _:return ve=sr(ve),me(re,ae,ue,ve,Pe)}if(z(ve)||U(ve))return re=re.get(ue)||null,xe(ae,re,ve,Pe,null);if(typeof ve.then=="function")return me(re,ae,ue,mu(ve),Pe);if(ve.$$typeof===N)return me(re,ae,ue,cu(ae,ve),Pe);pu(ae,ve)}return null}function De(re,ae,ue,ve){for(var Pe=null,ut=null,Oe=ae,Ke=ae=0,it=null;Oe!==null&&Ke<ue.length;Ke++){Oe.index>Ke?(it=Oe,Oe=null):it=Oe.sibling;var ct=fe(re,Oe,ue[Ke],ve);if(ct===null){Oe===null&&(Oe=it);break}a&&Oe&&ct.alternate===null&&r(re,Oe),ae=S(ct,ae,Ke),ut===null?Pe=ct:ut.sibling=ct,ut=ct,Oe=it}if(Ke===ue.length)return u(re,Oe),st&&za(re,Ke),Pe;if(Oe===null){for(;Ke<ue.length;Ke++)Oe=Ee(re,ue[Ke],ve),Oe!==null&&(ae=S(Oe,ae,Ke),ut===null?Pe=Oe:ut.sibling=Oe,ut=Oe);return st&&za(re,Ke),Pe}for(Oe=f(Oe);Ke<ue.length;Ke++)it=me(Oe,re,Ke,ue[Ke],ve),it!==null&&(a&&it.alternate!==null&&Oe.delete(it.key===null?Ke:it.key),ae=S(it,ae,Ke),ut===null?Pe=it:ut.sibling=it,ut=it);return a&&Oe.forEach(function(Ri){return r(re,Ri)}),st&&za(re,Ke),Pe}function ze(re,ae,ue,ve){if(ue==null)throw Error(i(151));for(var Pe=null,ut=null,Oe=ae,Ke=ae=0,it=null,ct=ue.next();Oe!==null&&!ct.done;Ke++,ct=ue.next()){Oe.index>Ke?(it=Oe,Oe=null):it=Oe.sibling;var Ri=fe(re,Oe,ct.value,ve);if(Ri===null){Oe===null&&(Oe=it);break}a&&Oe&&Ri.alternate===null&&r(re,Oe),ae=S(Ri,ae,Ke),ut===null?Pe=Ri:ut.sibling=Ri,ut=Ri,Oe=it}if(ct.done)return u(re,Oe),st&&za(re,Ke),Pe;if(Oe===null){for(;!ct.done;Ke++,ct=ue.next())ct=Ee(re,ct.value,ve),ct!==null&&(ae=S(ct,ae,Ke),ut===null?Pe=ct:ut.sibling=ct,ut=ct);return st&&za(re,Ke),Pe}for(Oe=f(Oe);!ct.done;Ke++,ct=ue.next())ct=me(Oe,re,Ke,ct.value,ve),ct!==null&&(a&&ct.alternate!==null&&Oe.delete(ct.key===null?Ke:ct.key),ae=S(ct,ae,Ke),ut===null?Pe=ct:ut.sibling=ct,ut=ct);return a&&Oe.forEach(function(zA){return r(re,zA)}),st&&za(re,Ke),Pe}function yt(re,ae,ue,ve){if(typeof ue=="object"&&ue!==null&&ue.type===E&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case p:e:{for(var Pe=ue.key;ae!==null;){if(ae.key===Pe){if(Pe=ue.type,Pe===E){if(ae.tag===7){u(re,ae.sibling),ve=v(ae,ue.props.children),ve.return=re,re=ve;break e}}else if(ae.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===_&&sr(Pe)===ae.type){u(re,ae.sibling),ve=v(ae,ue.props),mo(ve,ue),ve.return=re,re=ve;break e}u(re,ae);break}else r(re,ae);ae=ae.sibling}ue.type===E?(ve=tr(ue.props.children,re.mode,ve,ue.key),ve.return=re,re=ve):(ve=ou(ue.type,ue.key,ue.props,null,re.mode,ve),mo(ve,ue),ve.return=re,re=ve)}return I(re);case y:e:{for(Pe=ue.key;ae!==null;){if(ae.key===Pe)if(ae.tag===4&&ae.stateNode.containerInfo===ue.containerInfo&&ae.stateNode.implementation===ue.implementation){u(re,ae.sibling),ve=v(ae,ue.children||[]),ve.return=re,re=ve;break e}else{u(re,ae);break}else r(re,ae);ae=ae.sibling}ve=lf(ue,re.mode,ve),ve.return=re,re=ve}return I(re);case _:return ue=sr(ue),yt(re,ae,ue,ve)}if(z(ue))return De(re,ae,ue,ve);if(U(ue)){if(Pe=U(ue),typeof Pe!="function")throw Error(i(150));return ue=Pe.call(ue),ze(re,ae,ue,ve)}if(typeof ue.then=="function")return yt(re,ae,mu(ue),ve);if(ue.$$typeof===N)return yt(re,ae,cu(re,ue),ve);pu(re,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ae!==null&&ae.tag===6?(u(re,ae.sibling),ve=v(ae,ue),ve.return=re,re=ve):(u(re,ae),ve=of(ue,re.mode,ve),ve.return=re,re=ve),I(re)):u(re,ae)}return function(re,ae,ue,ve){try{ho=0;var Pe=yt(re,ae,ue,ve);return ts=null,Pe}catch(Oe){if(Oe===es||Oe===fu)throw Oe;var ut=Ln(29,Oe,null,re.mode);return ut.lanes=ve,ut.return=re,ut}finally{}}}var lr=o1(!0),l1=o1(!1),mi=!1;function vf(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function pi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function gi(a,r,u){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,(dt&2)!==0){var v=f.pending;return v===null?r.next=r:(r.next=v.next,v.next=r),f.pending=r,r=su(a),Yg(a,null,u),r}return ru(a,f,r,u),su(a)}function po(a,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var f=r.lanes;f&=a.pendingLanes,u|=f,r.lanes=u,Gl(a,u)}}function Tf(a,r){var u=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var v=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var I={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?v=S=I:S=S.next=I,u=u.next}while(u!==null);S===null?v=S=r:S=S.next=r}else v=S=r;u={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:f.shared,callbacks:f.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=r:a.next=r,u.lastBaseUpdate=r}var Sf=!1;function go(){if(Sf){var a=Jr;if(a!==null)throw a}}function xo(a,r,u,f){Sf=!1;var v=a.updateQueue;mi=!1;var S=v.firstBaseUpdate,I=v.lastBaseUpdate,F=v.shared.pending;if(F!==null){v.shared.pending=null;var te=F,ce=te.next;te.next=null,I===null?S=ce:I.next=ce,I=te;var xe=a.alternate;xe!==null&&(xe=xe.updateQueue,F=xe.lastBaseUpdate,F!==I&&(F===null?xe.firstBaseUpdate=ce:F.next=ce,xe.lastBaseUpdate=te))}if(S!==null){var Ee=v.baseState;I=0,xe=ce=te=null,F=S;do{var fe=F.lane&-536870913,me=fe!==F.lane;if(me?(at&fe)===fe:(f&fe)===fe){fe!==0&&fe===Zr&&(Sf=!0),xe!==null&&(xe=xe.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var De=a,ze=F;fe=r;var yt=u;switch(ze.tag){case 1:if(De=ze.payload,typeof De=="function"){Ee=De.call(yt,Ee,fe);break e}Ee=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=ze.payload,fe=typeof De=="function"?De.call(yt,Ee,fe):De,fe==null)break e;Ee=g({},Ee,fe);break e;case 2:mi=!0}}fe=F.callback,fe!==null&&(a.flags|=64,me&&(a.flags|=8192),me=v.callbacks,me===null?v.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},xe===null?(ce=xe=me,te=Ee):xe=xe.next=me,I|=fe;if(F=F.next,F===null){if(F=v.shared.pending,F===null)break;me=F,F=me.next,me.next=null,v.lastBaseUpdate=me,v.shared.pending=null}}while(!0);xe===null&&(te=Ee),v.baseState=te,v.firstBaseUpdate=ce,v.lastBaseUpdate=xe,S===null&&(v.shared.lanes=0),Ei|=I,a.lanes=I,a.memoizedState=Ee}}function u1(a,r){if(typeof a!="function")throw Error(i(191,a));a.call(r)}function c1(a,r){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)u1(u[a],r)}var ns=Y(null),gu=Y(0);function d1(a,r){a=Wa,B(gu,a),B(ns,r),Wa=a|r.baseLanes}function wf(){B(gu,Wa),B(ns,ns.current)}function kf(){Wa=gu.current,G(ns),G(gu)}var On=Y(null),ea=null;function xi(a){var r=a.alternate;B(Bt,Bt.current&1),B(On,a),ea===null&&(r===null||ns.current!==null||r.memoizedState!==null)&&(ea=a)}function Af(a){B(Bt,Bt.current),B(On,a),ea===null&&(ea=a)}function f1(a){a.tag===22?(B(Bt,Bt.current),B(On,a),ea===null&&(ea=a)):bi()}function bi(){B(Bt,Bt.current),B(On,On.current)}function In(a){G(On),ea===a&&(ea=null),G(Bt)}var Bt=Y(0);function xu(a){for(var r=a;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Dh(u)||Lh(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Va=0,Xe=null,xt=null,Vt=null,bu=!1,as=!1,ur=!1,yu=0,bo=0,is=null,Mk=0;function Ot(){throw Error(i(321))}function Cf(a,r){if(r===null)return!1;for(var u=0;u<r.length&&u<a.length;u++)if(!Dn(a[u],r[u]))return!1;return!0}function Nf(a,r,u,f,v,S){return Va=S,Xe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=a===null||a.memoizedState===null?Q1:Vf,ur=!1,S=u(f,v),ur=!1,as&&(S=m1(r,u,f,v)),h1(a),S}function h1(a){H.H=Eo;var r=xt!==null&&xt.next!==null;if(Va=0,Vt=xt=Xe=null,bu=!1,bo=0,is=null,r)throw Error(i(300));a===null||qt||(a=a.dependencies,a!==null&&uu(a)&&(qt=!0))}function m1(a,r,u,f){Xe=a;var v=0;do{if(as&&(is=null),bo=0,as=!1,25<=v)throw Error(i(301));if(v+=1,Vt=xt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}H.H=$1,S=r(u,f)}while(as);return S}function Rk(){var a=H.H,r=a.useState()[0];return r=typeof r.then=="function"?yo(r):r,a=a.useState()[0],(xt!==null?xt.memoizedState:null)!==a&&(Xe.flags|=1024),r}function _f(){var a=yu!==0;return yu=0,a}function Mf(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function Rf(a){if(bu){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}bu=!1}Va=0,Vt=xt=Xe=null,as=!1,bo=yu=0,is=null}function xn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Xe.memoizedState=Vt=a:Vt=Vt.next=a,Vt}function Ut(){if(xt===null){var a=Xe.alternate;a=a!==null?a.memoizedState:null}else a=xt.next;var r=Vt===null?Xe.memoizedState:Vt.next;if(r!==null)Vt=r,xt=a;else{if(a===null)throw Xe.alternate===null?Error(i(467)):Error(i(310));xt=a,a={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Vt===null?Xe.memoizedState=Vt=a:Vt=Vt.next=a}return Vt}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(a){var r=bo;return bo+=1,is===null&&(is=[]),a=i1(is,a,r),r=Xe,(Vt===null?r.memoizedState:Vt.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?Q1:Vf),a}function Eu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return yo(a);if(a.$$typeof===N)return rn(a)}throw Error(i(438,String(a)))}function Df(a){var r=null,u=Xe.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var f=Xe.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(r={data:f.data.map(function(v){return v.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=vu(),Xe.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(a),f=0;f<a;f++)u[f]=D;return r.index++,u}function qa(a,r){return typeof r=="function"?r(a):r}function Tu(a){var r=Ut();return Lf(r,xt,a)}function Lf(a,r,u){var f=a.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=u;var v=a.baseQueue,S=f.pending;if(S!==null){if(v!==null){var I=v.next;v.next=S.next,S.next=I}r.baseQueue=v=S,f.pending=null}if(S=a.baseState,v===null)a.memoizedState=S;else{r=v.next;var F=I=null,te=null,ce=r,xe=!1;do{var Ee=ce.lane&-536870913;if(Ee!==ce.lane?(at&Ee)===Ee:(Va&Ee)===Ee){var fe=ce.revertLane;if(fe===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),Ee===Zr&&(xe=!0);else if((Va&fe)===fe){ce=ce.next,fe===Zr&&(xe=!0);continue}else Ee={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},te===null?(F=te=Ee,I=S):te=te.next=Ee,Xe.lanes|=fe,Ei|=fe;Ee=ce.action,ur&&u(S,Ee),S=ce.hasEagerState?ce.eagerState:u(S,Ee)}else fe={lane:Ee,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},te===null?(F=te=fe,I=S):te=te.next=fe,Xe.lanes|=Ee,Ei|=Ee;ce=ce.next}while(ce!==null&&ce!==r);if(te===null?I=S:te.next=F,!Dn(S,a.memoizedState)&&(qt=!0,xe&&(u=Jr,u!==null)))throw u;a.memoizedState=S,a.baseState=I,a.baseQueue=te,f.lastRenderedState=S}return v===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function Of(a){var r=Ut(),u=r.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=a;var f=u.dispatch,v=u.pending,S=r.memoizedState;if(v!==null){u.pending=null;var I=v=v.next;do S=a(S,I.action),I=I.next;while(I!==v);Dn(S,r.memoizedState)||(qt=!0),r.memoizedState=S,r.baseQueue===null&&(r.baseState=S),u.lastRenderedState=S}return[S,f]}function p1(a,r,u){var f=Xe,v=Ut(),S=st;if(S){if(u===void 0)throw Error(i(407));u=u()}else u=r();var I=!Dn((xt||v).memoizedState,u);if(I&&(v.memoizedState=u,qt=!0),v=v.queue,Pf(b1.bind(null,f,v,a),[a]),v.getSnapshot!==r||I||Vt!==null&&Vt.memoizedState.tag&1){if(f.flags|=2048,rs(9,{destroy:void 0},x1.bind(null,f,v,u,r),null),vt===null)throw Error(i(349));S||(Va&127)!==0||g1(f,r,u)}return u}function g1(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=Xe.updateQueue,r===null?(r=vu(),Xe.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function x1(a,r,u,f){r.value=u,r.getSnapshot=f,y1(r)&&v1(a)}function b1(a,r,u){return u(function(){y1(r)&&v1(a)})}function y1(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!Dn(a,u)}catch{return!0}}function v1(a){var r=er(a,2);r!==null&&Cn(r,a,2)}function If(a){var r=xn();if(typeof a=="function"){var u=a;if(a=u(),ur){Jt(!0);try{u()}finally{Jt(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:a},r}function E1(a,r,u,f){return a.baseState=u,Lf(a,xt,typeof f=="function"?f:qa)}function Dk(a,r,u,f,v){if(ku(a))throw Error(i(485));if(a=r.action,a!==null){var S={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){S.listeners.push(I)}};H.T!==null?u(!0):S.isTransition=!1,f(S),u=r.pending,u===null?(S.next=r.pending=S,T1(r,S)):(S.next=u.next,r.pending=u.next=S)}}function T1(a,r){var u=r.action,f=r.payload,v=a.state;if(r.isTransition){var S=H.T,I={};H.T=I;try{var F=u(v,f),te=H.S;te!==null&&te(I,F),S1(a,r,F)}catch(ce){jf(a,r,ce)}finally{S!==null&&I.types!==null&&(S.types=I.types),H.T=S}}else try{S=u(v,f),S1(a,r,S)}catch(ce){jf(a,r,ce)}}function S1(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){w1(a,r,f)},function(f){return jf(a,r,f)}):w1(a,r,u)}function w1(a,r,u){r.status="fulfilled",r.value=u,k1(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,T1(a,u)))}function jf(a,r,u){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do r.status="rejected",r.reason=u,k1(r),r=r.next;while(r!==f)}a.action=null}function k1(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function A1(a,r){return r}function C1(a,r){if(st){var u=vt.formState;if(u!==null){e:{var f=Xe;if(st){if(kt){t:{for(var v=kt,S=Jn;v.nodeType!==8;){if(!S){v=null;break t}if(v=ta(v.nextSibling),v===null){v=null;break t}}S=v.data,v=S==="F!"||S==="F"?v:null}if(v){kt=ta(v.nextSibling),f=v.data==="F!";break e}}fi(f)}f=!1}f&&(r=u[0])}}return u=xn(),u.memoizedState=u.baseState=r,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A1,lastRenderedState:r},u.queue=f,u=G1.bind(null,Xe,f),f.dispatch=u,f=If(!1),S=Ff.bind(null,Xe,!1,f.queue),f=xn(),v={state:r,dispatch:null,action:a,pending:null},f.queue=v,u=Dk.bind(null,Xe,v,S,u),v.dispatch=u,f.memoizedState=a,[r,u,!1]}function N1(a){var r=Ut();return _1(r,xt,a)}function _1(a,r,u){if(r=Lf(a,r,A1)[0],a=Tu(qa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var f=yo(r)}catch(I){throw I===es?fu:I}else f=r;r=Ut();var v=r.queue,S=v.dispatch;return u!==r.memoizedState&&(Xe.flags|=2048,rs(9,{destroy:void 0},Lk.bind(null,v,u),null)),[f,S,a]}function Lk(a,r){a.action=r}function M1(a){var r=Ut(),u=xt;if(u!==null)return _1(r,u,a);Ut(),r=r.memoizedState,u=Ut();var f=u.queue.dispatch;return u.memoizedState=a,[r,f,!1]}function rs(a,r,u,f){return a={tag:a,create:u,deps:f,inst:r,next:null},r=Xe.updateQueue,r===null&&(r=vu(),Xe.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=a.next=a:(f=u.next,u.next=a,a.next=f,r.lastEffect=a),a}function R1(){return Ut().memoizedState}function Su(a,r,u,f){var v=xn();Xe.flags|=a,v.memoizedState=rs(1|r,{destroy:void 0},u,f===void 0?null:f)}function wu(a,r,u,f){var v=Ut();f=f===void 0?null:f;var S=v.memoizedState.inst;xt!==null&&f!==null&&Cf(f,xt.memoizedState.deps)?v.memoizedState=rs(r,S,u,f):(Xe.flags|=a,v.memoizedState=rs(1|r,S,u,f))}function D1(a,r){Su(8390656,8,a,r)}function Pf(a,r){wu(2048,8,a,r)}function Ok(a){Xe.flags|=4;var r=Xe.updateQueue;if(r===null)r=vu(),Xe.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function L1(a){var r=Ut().memoizedState;return Ok({ref:r,nextImpl:a}),function(){if((dt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function O1(a,r){return wu(4,2,a,r)}function I1(a,r){return wu(4,4,a,r)}function j1(a,r){if(typeof r=="function"){a=a();var u=r(a);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function P1(a,r,u){u=u!=null?u.concat([a]):null,wu(4,4,j1.bind(null,r,a),u)}function Bf(){}function B1(a,r){var u=Ut();r=r===void 0?null:r;var f=u.memoizedState;return r!==null&&Cf(r,f[1])?f[0]:(u.memoizedState=[a,r],a)}function U1(a,r){var u=Ut();r=r===void 0?null:r;var f=u.memoizedState;if(r!==null&&Cf(r,f[1]))return f[0];if(f=a(),ur){Jt(!0);try{a()}finally{Jt(!1)}}return u.memoizedState=[f,r],f}function Uf(a,r,u){return u===void 0||(Va&1073741824)!==0&&(at&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=zx(),Xe.lanes|=a,Ei|=a,u)}function z1(a,r,u,f){return Dn(u,r)?u:ns.current!==null?(a=Uf(a,u,f),Dn(a,r)||(qt=!0),a):(Va&42)===0||(Va&1073741824)!==0&&(at&261930)===0?(qt=!0,a.memoizedState=u):(a=zx(),Xe.lanes|=a,Ei|=a,r)}function H1(a,r,u,f,v){var S=X.p;X.p=S!==0&&8>S?S:8;var I=H.T,F={};H.T=F,Ff(a,!1,r,u);try{var te=v(),ce=H.S;if(ce!==null&&ce(F,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var xe=_k(te,f);vo(a,r,xe,Bn(a))}else vo(a,r,f,Bn(a))}catch(Ee){vo(a,r,{then:function(){},status:"rejected",reason:Ee},Bn())}finally{X.p=S,I!==null&&F.types!==null&&(I.types=F.types),H.T=I}}function Ik(){}function zf(a,r,u,f){if(a.tag!==5)throw Error(i(476));var v=F1(a).queue;H1(a,v,r,Z,u===null?Ik:function(){return V1(a),u(f)})}function F1(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:Z},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:u},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function V1(a){var r=F1(a);r.next===null&&(r=a.alternate.memoizedState),vo(a,r.next.queue,{},Bn())}function Hf(){return rn(Po)}function q1(){return Ut().memoizedState}function Y1(){return Ut().memoizedState}function jk(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var u=Bn();a=pi(u);var f=gi(r,a,u);f!==null&&(Cn(f,r,u),po(f,r,u)),r={cache:gf()},a.payload=r;return}r=r.return}}function Pk(a,r,u){var f=Bn();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ku(a)?X1(r,u):(u=rf(a,r,u,f),u!==null&&(Cn(u,a,f),K1(u,r,f)))}function G1(a,r,u){var f=Bn();vo(a,r,u,f)}function vo(a,r,u,f){var v={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ku(a))X1(r,v);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=r.lastRenderedReducer,S!==null))try{var I=r.lastRenderedState,F=S(I,u);if(v.hasEagerState=!0,v.eagerState=F,Dn(F,I))return ru(a,r,v,0),vt===null&&iu(),!1}catch{}finally{}if(u=rf(a,r,v,f),u!==null)return Cn(u,a,f),K1(u,r,f),!0}return!1}function Ff(a,r,u,f){if(f={lane:2,revertLane:vh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},ku(a)){if(r)throw Error(i(479))}else r=rf(a,u,f,2),r!==null&&Cn(r,a,2)}function ku(a){var r=a.alternate;return a===Xe||r!==null&&r===Xe}function X1(a,r){as=bu=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function K1(a,r,u){if((u&4194048)!==0){var f=r.lanes;f&=a.pendingLanes,u|=f,r.lanes=u,Gl(a,u)}}var Eo={readContext:rn,use:Eu,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Eo.useEffectEvent=Ot;var Q1={readContext:rn,use:Eu,useCallback:function(a,r){return xn().memoizedState=[a,r===void 0?null:r],a},useContext:rn,useEffect:D1,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,Su(4194308,4,j1.bind(null,r,a),u)},useLayoutEffect:function(a,r){return Su(4194308,4,a,r)},useInsertionEffect:function(a,r){Su(4,2,a,r)},useMemo:function(a,r){var u=xn();r=r===void 0?null:r;var f=a();if(ur){Jt(!0);try{a()}finally{Jt(!1)}}return u.memoizedState=[f,r],f},useReducer:function(a,r,u){var f=xn();if(u!==void 0){var v=u(r);if(ur){Jt(!0);try{u(r)}finally{Jt(!1)}}}else v=r;return f.memoizedState=f.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},f.queue=a,a=a.dispatch=Pk.bind(null,Xe,a),[f.memoizedState,a]},useRef:function(a){var r=xn();return a={current:a},r.memoizedState=a},useState:function(a){a=If(a);var r=a.queue,u=G1.bind(null,Xe,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:Bf,useDeferredValue:function(a,r){var u=xn();return Uf(u,a,r)},useTransition:function(){var a=If(!1);return a=H1.bind(null,Xe,a.queue,!0,!1),xn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var f=Xe,v=xn();if(st){if(u===void 0)throw Error(i(407));u=u()}else{if(u=r(),vt===null)throw Error(i(349));(at&127)!==0||g1(f,r,u)}v.memoizedState=u;var S={value:u,getSnapshot:r};return v.queue=S,D1(b1.bind(null,f,S,a),[a]),f.flags|=2048,rs(9,{destroy:void 0},x1.bind(null,f,S,u,r),null),u},useId:function(){var a=xn(),r=vt.identifierPrefix;if(st){var u=Ta,f=Ea;u=(f&~(1<<32-ft(f)-1)).toString(32)+u,r="_"+r+"R_"+u,u=yu++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=Mk++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:Hf,useFormState:C1,useActionState:C1,useOptimistic:function(a){var r=xn();r.memoizedState=r.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=Ff.bind(null,Xe,!0,u),u.dispatch=r,[a,r]},useMemoCache:Df,useCacheRefresh:function(){return xn().memoizedState=jk.bind(null,Xe)},useEffectEvent:function(a){var r=xn(),u={impl:a};return r.memoizedState=u,function(){if((dt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Vf={readContext:rn,use:Eu,useCallback:B1,useContext:rn,useEffect:Pf,useImperativeHandle:P1,useInsertionEffect:O1,useLayoutEffect:I1,useMemo:U1,useReducer:Tu,useRef:R1,useState:function(){return Tu(qa)},useDebugValue:Bf,useDeferredValue:function(a,r){var u=Ut();return z1(u,xt.memoizedState,a,r)},useTransition:function(){var a=Tu(qa)[0],r=Ut().memoizedState;return[typeof a=="boolean"?a:yo(a),r]},useSyncExternalStore:p1,useId:q1,useHostTransitionStatus:Hf,useFormState:N1,useActionState:N1,useOptimistic:function(a,r){var u=Ut();return E1(u,xt,a,r)},useMemoCache:Df,useCacheRefresh:Y1};Vf.useEffectEvent=L1;var $1={readContext:rn,use:Eu,useCallback:B1,useContext:rn,useEffect:Pf,useImperativeHandle:P1,useInsertionEffect:O1,useLayoutEffect:I1,useMemo:U1,useReducer:Of,useRef:R1,useState:function(){return Of(qa)},useDebugValue:Bf,useDeferredValue:function(a,r){var u=Ut();return xt===null?Uf(u,a,r):z1(u,xt.memoizedState,a,r)},useTransition:function(){var a=Of(qa)[0],r=Ut().memoizedState;return[typeof a=="boolean"?a:yo(a),r]},useSyncExternalStore:p1,useId:q1,useHostTransitionStatus:Hf,useFormState:M1,useActionState:M1,useOptimistic:function(a,r){var u=Ut();return xt!==null?E1(u,xt,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Df,useCacheRefresh:Y1};$1.useEffectEvent=L1;function qf(a,r,u,f){r=a.memoizedState,u=u(f,r),u=u==null?r:g({},r,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Yf={enqueueSetState:function(a,r,u){a=a._reactInternals;var f=Bn(),v=pi(f);v.payload=r,u!=null&&(v.callback=u),r=gi(a,v,f),r!==null&&(Cn(r,a,f),po(r,a,f))},enqueueReplaceState:function(a,r,u){a=a._reactInternals;var f=Bn(),v=pi(f);v.tag=1,v.payload=r,u!=null&&(v.callback=u),r=gi(a,v,f),r!==null&&(Cn(r,a,f),po(r,a,f))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var u=Bn(),f=pi(u);f.tag=2,r!=null&&(f.callback=r),r=gi(a,f,u),r!==null&&(Cn(r,a,u),po(r,a,u))}};function W1(a,r,u,f,v,S,I){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,S,I):r.prototype&&r.prototype.isPureReactComponent?!so(u,f)||!so(v,S):!0}function Z1(a,r,u,f){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,f),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,f),r.state!==a&&Yf.enqueueReplaceState(r,r.state,null)}function cr(a,r){var u=r;if("ref"in r){u={};for(var f in r)f!=="ref"&&(u[f]=r[f])}if(a=a.defaultProps){u===r&&(u=g({},u));for(var v in a)u[v]===void 0&&(u[v]=a[v])}return u}function J1(a){au(a)}function ex(a){console.error(a)}function tx(a){au(a)}function Au(a,r){try{var u=a.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(f){setTimeout(function(){throw f})}}function nx(a,r,u){try{var f=a.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Gf(a,r,u){return u=pi(u),u.tag=3,u.payload={element:null},u.callback=function(){Au(a,r)},u}function ax(a){return a=pi(a),a.tag=3,a}function ix(a,r,u,f){var v=u.type.getDerivedStateFromError;if(typeof v=="function"){var S=f.value;a.payload=function(){return v(S)},a.callback=function(){nx(r,u,f)}}var I=u.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(a.callback=function(){nx(r,u,f),typeof v!="function"&&(Ti===null?Ti=new Set([this]):Ti.add(this));var F=f.stack;this.componentDidCatch(f.value,{componentStack:F!==null?F:""})})}function Bk(a,r,u,f,v){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(r=u.alternate,r!==null&&Wr(r,u,v,!0),u=On.current,u!==null){switch(u.tag){case 31:case 13:return ea===null?Bu():u.alternate===null&&It===0&&(It=3),u.flags&=-257,u.flags|=65536,u.lanes=v,f===hu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([f]):r.add(f),xh(a,f,v)),!1;case 22:return u.flags|=65536,f===hu?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([f]):u.add(f)),xh(a,f,v)),!1}throw Error(i(435,u.tag))}return xh(a,f,v),Bu(),!1}if(st)return r=On.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=v,f!==df&&(a=Error(i(422),{cause:f}),uo($n(a,u)))):(f!==df&&(r=Error(i(423),{cause:f}),uo($n(r,u))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,f=$n(f,u),v=Gf(a.stateNode,f,v),Tf(a,v),It!==4&&(It=2)),!1;var S=Error(i(520),{cause:f});if(S=$n(S,u),_o===null?_o=[S]:_o.push(S),It!==4&&(It=2),r===null)return!0;f=$n(f,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,a=v&-v,u.lanes|=a,a=Gf(u.stateNode,f,a),Tf(u,a),!1;case 1:if(r=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ti===null||!Ti.has(S))))return u.flags|=65536,v&=-v,u.lanes|=v,v=ax(v),ix(v,a,u,f),Tf(u,v),!1}u=u.return}while(u!==null);return!1}var Xf=Error(i(461)),qt=!1;function sn(a,r,u,f){r.child=a===null?l1(r,null,u,f):lr(r,a.child,u,f)}function rx(a,r,u,f,v){u=u.render;var S=r.ref;if("ref"in f){var I={};for(var F in f)F!=="ref"&&(I[F]=f[F])}else I=f;return ir(r),f=Nf(a,r,u,I,S,v),F=_f(),a!==null&&!qt?(Mf(a,r,v),Ya(a,r,v)):(st&&F&&uf(r),r.flags|=1,sn(a,r,f,v),r.child)}function sx(a,r,u,f,v){if(a===null){var S=u.type;return typeof S=="function"&&!sf(S)&&S.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=S,ox(a,r,S,f,v)):(a=ou(u.type,null,f,r,r.mode,v),a.ref=r.ref,a.return=r,r.child=a)}if(S=a.child,!th(a,v)){var I=S.memoizedProps;if(u=u.compare,u=u!==null?u:so,u(I,f)&&a.ref===r.ref)return Ya(a,r,v)}return r.flags|=1,a=Ua(S,f),a.ref=r.ref,a.return=r,r.child=a}function ox(a,r,u,f,v){if(a!==null){var S=a.memoizedProps;if(so(S,f)&&a.ref===r.ref)if(qt=!1,r.pendingProps=f=S,th(a,v))(a.flags&131072)!==0&&(qt=!0);else return r.lanes=a.lanes,Ya(a,r,v)}return Kf(a,r,u,f,v)}function lx(a,r,u,f){var v=f.children,S=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((r.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,a!==null){for(f=r.child=a.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~S}else f=0,r.child=null;return ux(a,r,S,u,f)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&du(r,S!==null?S.cachePool:null),S!==null?d1(r,S):wf(),f1(r);else return f=r.lanes=536870912,ux(a,r,S!==null?S.baseLanes|u:u,u,f)}else S!==null?(du(r,S.cachePool),d1(r,S),bi(),r.memoizedState=null):(a!==null&&du(r,null),wf(),bi());return sn(a,r,v,u),r.child}function To(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ux(a,r,u,f,v){var S=bf();return S=S===null?null:{parent:Ft._currentValue,pool:S},r.memoizedState={baseLanes:u,cachePool:S},a!==null&&du(r,null),wf(),f1(r),a!==null&&Wr(a,r,f,!0),r.childLanes=v,null}function Cu(a,r){return r=_u({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function cx(a,r,u){return lr(r,a.child,null,u),a=Cu(r,r.pendingProps),a.flags|=2,In(r),r.memoizedState=null,a}function Uk(a,r,u){var f=r.pendingProps,v=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(st){if(f.mode==="hidden")return a=Cu(r,f),r.lanes=536870912,To(null,a);if(Af(r),(a=kt)?(a=Tb(a,Jn),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:ci!==null?{id:Ea,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},u=Xg(a),u.return=r,r.child=u,an=r,kt=null)):a=null,a===null)throw fi(r);return r.lanes=536870912,null}return Cu(r,f)}var S=a.memoizedState;if(S!==null){var I=S.dehydrated;if(Af(r),v)if(r.flags&256)r.flags&=-257,r=cx(a,r,u);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(i(558));else if(qt||Wr(a,r,u,!1),v=(u&a.childLanes)!==0,qt||v){if(f=vt,f!==null&&(I=Xl(f,u),I!==0&&I!==S.retryLane))throw S.retryLane=I,er(a,I),Cn(f,a,I),Xf;Bu(),r=cx(a,r,u)}else a=S.treeContext,kt=ta(I.nextSibling),an=r,st=!0,di=null,Jn=!1,a!==null&&$g(r,a),r=Cu(r,f),r.flags|=4096;return r}return a=Ua(a.child,{mode:f.mode,children:f.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Nu(a,r){var u=r.ref;if(u===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(a===null||a.ref!==u)&&(r.flags|=4194816)}}function Kf(a,r,u,f,v){return ir(r),u=Nf(a,r,u,f,void 0,v),f=_f(),a!==null&&!qt?(Mf(a,r,v),Ya(a,r,v)):(st&&f&&uf(r),r.flags|=1,sn(a,r,u,v),r.child)}function dx(a,r,u,f,v,S){return ir(r),r.updateQueue=null,u=m1(r,f,u,v),h1(a),f=_f(),a!==null&&!qt?(Mf(a,r,S),Ya(a,r,S)):(st&&f&&uf(r),r.flags|=1,sn(a,r,u,S),r.child)}function fx(a,r,u,f,v){if(ir(r),r.stateNode===null){var S=Xr,I=u.contextType;typeof I=="object"&&I!==null&&(S=rn(I)),S=new u(f,S),r.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Yf,r.stateNode=S,S._reactInternals=r,S=r.stateNode,S.props=f,S.state=r.memoizedState,S.refs={},vf(r),I=u.contextType,S.context=typeof I=="object"&&I!==null?rn(I):Xr,S.state=r.memoizedState,I=u.getDerivedStateFromProps,typeof I=="function"&&(qf(r,u,I,f),S.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(I=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),I!==S.state&&Yf.enqueueReplaceState(S,S.state,null),xo(r,f,S,v),go(),S.state=r.memoizedState),typeof S.componentDidMount=="function"&&(r.flags|=4194308),f=!0}else if(a===null){S=r.stateNode;var F=r.memoizedProps,te=cr(u,F);S.props=te;var ce=S.context,xe=u.contextType;I=Xr,typeof xe=="object"&&xe!==null&&(I=rn(xe));var Ee=u.getDerivedStateFromProps;xe=typeof Ee=="function"||typeof S.getSnapshotBeforeUpdate=="function",F=r.pendingProps!==F,xe||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(F||ce!==I)&&Z1(r,S,f,I),mi=!1;var fe=r.memoizedState;S.state=fe,xo(r,f,S,v),go(),ce=r.memoizedState,F||fe!==ce||mi?(typeof Ee=="function"&&(qf(r,u,Ee,f),ce=r.memoizedState),(te=mi||W1(r,u,te,f,fe,ce,I))?(xe||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(r.flags|=4194308)):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=f,r.memoizedState=ce),S.props=f,S.state=ce,S.context=I,f=te):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{S=r.stateNode,Ef(a,r),I=r.memoizedProps,xe=cr(u,I),S.props=xe,Ee=r.pendingProps,fe=S.context,ce=u.contextType,te=Xr,typeof ce=="object"&&ce!==null&&(te=rn(ce)),F=u.getDerivedStateFromProps,(ce=typeof F=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(I!==Ee||fe!==te)&&Z1(r,S,f,te),mi=!1,fe=r.memoizedState,S.state=fe,xo(r,f,S,v),go();var me=r.memoizedState;I!==Ee||fe!==me||mi||a!==null&&a.dependencies!==null&&uu(a.dependencies)?(typeof F=="function"&&(qf(r,u,F,f),me=r.memoizedState),(xe=mi||W1(r,u,xe,f,fe,me,te)||a!==null&&a.dependencies!==null&&uu(a.dependencies))?(ce||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(f,me,te),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(f,me,te)),typeof S.componentDidUpdate=="function"&&(r.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof S.componentDidUpdate!="function"||I===a.memoizedProps&&fe===a.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||I===a.memoizedProps&&fe===a.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=me),S.props=f,S.state=me,S.context=te,f=xe):(typeof S.componentDidUpdate!="function"||I===a.memoizedProps&&fe===a.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||I===a.memoizedProps&&fe===a.memoizedState||(r.flags|=1024),f=!1)}return S=f,Nu(a,r),f=(r.flags&128)!==0,S||f?(S=r.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:S.render(),r.flags|=1,a!==null&&f?(r.child=lr(r,a.child,null,v),r.child=lr(r,null,u,v)):sn(a,r,u,v),r.memoizedState=S.state,a=r.child):a=Ya(a,r,v),a}function hx(a,r,u,f){return nr(),r.flags|=256,sn(a,r,u,f),r.child}var Qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $f(a){return{baseLanes:a,cachePool:n1()}}function Wf(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=Pn),a}function mx(a,r,u){var f=r.pendingProps,v=!1,S=(r.flags&128)!==0,I;if((I=S)||(I=a!==null&&a.memoizedState===null?!1:(Bt.current&2)!==0),I&&(v=!0,r.flags&=-129),I=(r.flags&32)!==0,r.flags&=-33,a===null){if(st){if(v?xi(r):bi(),(a=kt)?(a=Tb(a,Jn),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:ci!==null?{id:Ea,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},u=Xg(a),u.return=r,r.child=u,an=r,kt=null)):a=null,a===null)throw fi(r);return Lh(a)?r.lanes=32:r.lanes=536870912,null}var F=f.children;return f=f.fallback,v?(bi(),v=r.mode,F=_u({mode:"hidden",children:F},v),f=tr(f,v,u,null),F.return=r,f.return=r,F.sibling=f,r.child=F,f=r.child,f.memoizedState=$f(u),f.childLanes=Wf(a,I,u),r.memoizedState=Qf,To(null,f)):(xi(r),Zf(r,F))}var te=a.memoizedState;if(te!==null&&(F=te.dehydrated,F!==null)){if(S)r.flags&256?(xi(r),r.flags&=-257,r=Jf(a,r,u)):r.memoizedState!==null?(bi(),r.child=a.child,r.flags|=128,r=null):(bi(),F=f.fallback,v=r.mode,f=_u({mode:"visible",children:f.children},v),F=tr(F,v,u,null),F.flags|=2,f.return=r,F.return=r,f.sibling=F,r.child=f,lr(r,a.child,null,u),f=r.child,f.memoizedState=$f(u),f.childLanes=Wf(a,I,u),r.memoizedState=Qf,r=To(null,f));else if(xi(r),Lh(F)){if(I=F.nextSibling&&F.nextSibling.dataset,I)var ce=I.dgst;I=ce,f=Error(i(419)),f.stack="",f.digest=I,uo({value:f,source:null,stack:null}),r=Jf(a,r,u)}else if(qt||Wr(a,r,u,!1),I=(u&a.childLanes)!==0,qt||I){if(I=vt,I!==null&&(f=Xl(I,u),f!==0&&f!==te.retryLane))throw te.retryLane=f,er(a,f),Cn(I,a,f),Xf;Dh(F)||Bu(),r=Jf(a,r,u)}else Dh(F)?(r.flags|=192,r.child=a.child,r=null):(a=te.treeContext,kt=ta(F.nextSibling),an=r,st=!0,di=null,Jn=!1,a!==null&&$g(r,a),r=Zf(r,f.children),r.flags|=4096);return r}return v?(bi(),F=f.fallback,v=r.mode,te=a.child,ce=te.sibling,f=Ua(te,{mode:"hidden",children:f.children}),f.subtreeFlags=te.subtreeFlags&65011712,ce!==null?F=Ua(ce,F):(F=tr(F,v,u,null),F.flags|=2),F.return=r,f.return=r,f.sibling=F,r.child=f,To(null,f),f=r.child,F=a.child.memoizedState,F===null?F=$f(u):(v=F.cachePool,v!==null?(te=Ft._currentValue,v=v.parent!==te?{parent:te,pool:te}:v):v=n1(),F={baseLanes:F.baseLanes|u,cachePool:v}),f.memoizedState=F,f.childLanes=Wf(a,I,u),r.memoizedState=Qf,To(a.child,f)):(xi(r),u=a.child,a=u.sibling,u=Ua(u,{mode:"visible",children:f.children}),u.return=r,u.sibling=null,a!==null&&(I=r.deletions,I===null?(r.deletions=[a],r.flags|=16):I.push(a)),r.child=u,r.memoizedState=null,u)}function Zf(a,r){return r=_u({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function _u(a,r){return a=Ln(22,a,null,r),a.lanes=0,a}function Jf(a,r,u){return lr(r,a.child,null,u),a=Zf(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function px(a,r,u){a.lanes|=r;var f=a.alternate;f!==null&&(f.lanes|=r),mf(a.return,r,u)}function eh(a,r,u,f,v,S){var I=a.memoizedState;I===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:v,treeForkCount:S}:(I.isBackwards=r,I.rendering=null,I.renderingStartTime=0,I.last=f,I.tail=u,I.tailMode=v,I.treeForkCount=S)}function gx(a,r,u){var f=r.pendingProps,v=f.revealOrder,S=f.tail;f=f.children;var I=Bt.current,F=(I&2)!==0;if(F?(I=I&1|2,r.flags|=128):I&=1,B(Bt,I),sn(a,r,f,u),f=st?lo:0,!F&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&px(a,u,r);else if(a.tag===19)px(a,u,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(u=r.child,v=null;u!==null;)a=u.alternate,a!==null&&xu(a)===null&&(v=u),u=u.sibling;u=v,u===null?(v=r.child,r.child=null):(v=u.sibling,u.sibling=null),eh(r,!1,v,u,S,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,v=r.child,r.child=null;v!==null;){if(a=v.alternate,a!==null&&xu(a)===null){r.child=v;break}a=v.sibling,v.sibling=u,u=v,v=a}eh(r,!0,u,null,S,f);break;case"together":eh(r,!1,null,null,void 0,f);break;default:r.memoizedState=null}return r.child}function Ya(a,r,u){if(a!==null&&(r.dependencies=a.dependencies),Ei|=r.lanes,(u&r.childLanes)===0)if(a!==null){if(Wr(a,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(i(153));if(r.child!==null){for(a=r.child,u=Ua(a,a.pendingProps),r.child=u,u.return=r;a.sibling!==null;)a=a.sibling,u=u.sibling=Ua(a,a.pendingProps),u.return=r;u.sibling=null}return r.child}function th(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&uu(a)))}function zk(a,r,u){switch(r.tag){case 3:de(r,r.stateNode.containerInfo),hi(r,Ft,a.memoizedState.cache),nr();break;case 27:case 5:qe(r);break;case 4:de(r,r.stateNode.containerInfo);break;case 10:hi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Af(r),null;break;case 13:var f=r.memoizedState;if(f!==null)return f.dehydrated!==null?(xi(r),r.flags|=128,null):(u&r.child.childLanes)!==0?mx(a,r,u):(xi(r),a=Ya(a,r,u),a!==null?a.sibling:null);xi(r);break;case 19:var v=(a.flags&128)!==0;if(f=(u&r.childLanes)!==0,f||(Wr(a,r,u,!1),f=(u&r.childLanes)!==0),v){if(f)return gx(a,r,u);r.flags|=128}if(v=r.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),B(Bt,Bt.current),f)break;return null;case 22:return r.lanes=0,lx(a,r,u,r.pendingProps);case 24:hi(r,Ft,a.memoizedState.cache)}return Ya(a,r,u)}function xx(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)qt=!0;else{if(!th(a,u)&&(r.flags&128)===0)return qt=!1,zk(a,r,u);qt=(a.flags&131072)!==0}else qt=!1,st&&(r.flags&1048576)!==0&&Qg(r,lo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var f=r.pendingProps;if(a=sr(r.elementType),r.type=a,typeof a=="function")sf(a)?(f=cr(a,f),r.tag=1,r=fx(null,r,a,f,u)):(r.tag=0,r=Kf(null,r,a,f,u));else{if(a!=null){var v=a.$$typeof;if(v===O){r.tag=11,r=rx(null,r,a,f,u);break e}else if(v===L){r.tag=14,r=sx(null,r,a,f,u);break e}}throw r=q(a)||a,Error(i(306,r,""))}}return r;case 0:return Kf(a,r,r.type,r.pendingProps,u);case 1:return f=r.type,v=cr(f,r.pendingProps),fx(a,r,f,v,u);case 3:e:{if(de(r,r.stateNode.containerInfo),a===null)throw Error(i(387));f=r.pendingProps;var S=r.memoizedState;v=S.element,Ef(a,r),xo(r,f,null,u);var I=r.memoizedState;if(f=I.cache,hi(r,Ft,f),f!==S.cache&&pf(r,[Ft],u,!0),go(),f=I.element,S.isDehydrated)if(S={element:f,isDehydrated:!1,cache:I.cache},r.updateQueue.baseState=S,r.memoizedState=S,r.flags&256){r=hx(a,r,f,u);break e}else if(f!==v){v=$n(Error(i(424)),r),uo(v),r=hx(a,r,f,u);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(kt=ta(a.firstChild),an=r,st=!0,di=null,Jn=!0,u=l1(r,null,f,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(nr(),f===v){r=Ya(a,r,u);break e}sn(a,r,f,u)}r=r.child}return r;case 26:return Nu(a,r),a===null?(u=Nb(r.type,null,r.pendingProps,null))?r.memoizedState=u:st||(u=r.type,a=r.pendingProps,f=Yu($.current).createElement(u),f[$t]=r,f[gt]=a,on(f,u,a),Pt(f),r.stateNode=f):r.memoizedState=Nb(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return qe(r),a===null&&st&&(f=r.stateNode=kb(r.type,r.pendingProps,$.current),an=r,Jn=!0,v=kt,Ai(r.type)?(Oh=v,kt=ta(f.firstChild)):kt=v),sn(a,r,r.pendingProps.children,u),Nu(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&st&&((v=f=kt)&&(f=gA(f,r.type,r.pendingProps,Jn),f!==null?(r.stateNode=f,an=r,kt=ta(f.firstChild),Jn=!1,v=!0):v=!1),v||fi(r)),qe(r),v=r.type,S=r.pendingProps,I=a!==null?a.memoizedProps:null,f=S.children,_h(v,S)?f=null:I!==null&&_h(v,I)&&(r.flags|=32),r.memoizedState!==null&&(v=Nf(a,r,Rk,null,null,u),Po._currentValue=v),Nu(a,r),sn(a,r,f,u),r.child;case 6:return a===null&&st&&((a=u=kt)&&(u=xA(u,r.pendingProps,Jn),u!==null?(r.stateNode=u,an=r,kt=null,a=!0):a=!1),a||fi(r)),null;case 13:return mx(a,r,u);case 4:return de(r,r.stateNode.containerInfo),f=r.pendingProps,a===null?r.child=lr(r,null,f,u):sn(a,r,f,u),r.child;case 11:return rx(a,r,r.type,r.pendingProps,u);case 7:return sn(a,r,r.pendingProps,u),r.child;case 8:return sn(a,r,r.pendingProps.children,u),r.child;case 12:return sn(a,r,r.pendingProps.children,u),r.child;case 10:return f=r.pendingProps,hi(r,r.type,f.value),sn(a,r,f.children,u),r.child;case 9:return v=r.type._context,f=r.pendingProps.children,ir(r),v=rn(v),f=f(v),r.flags|=1,sn(a,r,f,u),r.child;case 14:return sx(a,r,r.type,r.pendingProps,u);case 15:return ox(a,r,r.type,r.pendingProps,u);case 19:return gx(a,r,u);case 31:return Uk(a,r,u);case 22:return lx(a,r,u,r.pendingProps);case 24:return ir(r),f=rn(Ft),a===null?(v=bf(),v===null&&(v=vt,S=gf(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=u),v=S),r.memoizedState={parent:f,cache:v},vf(r),hi(r,Ft,v)):((a.lanes&u)!==0&&(Ef(a,r),xo(r,null,null,u),go()),v=a.memoizedState,S=r.memoizedState,v.parent!==f?(v={parent:f,cache:f},r.memoizedState=v,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=v),hi(r,Ft,f)):(f=S.cache,hi(r,Ft,f),f!==v.cache&&pf(r,[Ft],u,!0))),sn(a,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Ga(a){a.flags|=4}function nh(a,r,u,f,v){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(qx())a.flags|=8192;else throw or=hu,yf}else a.flags&=-16777217}function bx(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Lb(r))if(qx())a.flags|=8192;else throw or=hu,yf}function Mu(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?Pr():536870912,a.lanes|=r,us|=r)}function So(a,r){if(!st)switch(a.tailMode){case"hidden":r=a.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function At(a){var r=a.alternate!==null&&a.alternate.child===a.child,u=0,f=0;if(r)for(var v=a.child;v!==null;)u|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)u|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=f,a.childLanes=u,r}function Hk(a,r,u){var f=r.pendingProps;switch(cf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(r),null;case 1:return At(r),null;case 3:return u=r.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),r.memoizedState.cache!==f&&(r.flags|=2048),Fa(Ft),Ce(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&($r(r)?Ga(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,ff())),At(r),null;case 26:var v=r.type,S=r.memoizedState;return a===null?(Ga(r),S!==null?(At(r),bx(r,S)):(At(r),nh(r,v,null,f,u))):S?S!==a.memoizedState?(Ga(r),At(r),bx(r,S)):(At(r),r.flags&=-16777217):(a=a.memoizedProps,a!==f&&Ga(r),At(r),nh(r,v,a,f,u)),null;case 27:if($e(r),u=$.current,v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==f&&Ga(r);else{if(!f){if(r.stateNode===null)throw Error(i(166));return At(r),null}a=ne.current,$r(r)?Wg(r):(a=kb(v,f,u),r.stateNode=a,Ga(r))}return At(r),null;case 5:if($e(r),v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==f&&Ga(r);else{if(!f){if(r.stateNode===null)throw Error(i(166));return At(r),null}if(S=ne.current,$r(r))Wg(r);else{var I=Yu($.current);switch(S){case 1:S=I.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:S=I.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":S=I.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":S=I.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":S=I.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof f.is=="string"?I.createElement("select",{is:f.is}):I.createElement("select"),f.multiple?S.multiple=!0:f.size&&(S.size=f.size);break;default:S=typeof f.is=="string"?I.createElement(v,{is:f.is}):I.createElement(v)}}S[$t]=r,S[gt]=f;e:for(I=r.child;I!==null;){if(I.tag===5||I.tag===6)S.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===r)break e;for(;I.sibling===null;){if(I.return===null||I.return===r)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}r.stateNode=S;e:switch(on(S,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Ga(r)}}return At(r),nh(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,u),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==f&&Ga(r);else{if(typeof f!="string"&&r.stateNode===null)throw Error(i(166));if(a=$.current,$r(r)){if(a=r.stateNode,u=r.memoizedProps,f=null,v=an,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}a[$t]=r,a=!!(a.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||mb(a.nodeValue,u)),a||fi(r,!0)}else a=Yu(a).createTextNode(f),a[$t]=r,r.stateNode=a}return At(r),null;case 31:if(u=r.memoizedState,a===null||a.memoizedState!==null){if(f=$r(r),u!==null){if(a===null){if(!f)throw Error(i(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[$t]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),a=!1}else u=ff(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return r.flags&256?(In(r),r):(In(r),null);if((r.flags&128)!==0)throw Error(i(558))}return At(r),null;case 13:if(f=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=$r(r),f!==null&&f.dehydrated!==null){if(a===null){if(!v)throw Error(i(318));if(v=r.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(i(317));v[$t]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),v=!1}else v=ff(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return r.flags&256?(In(r),r):(In(r),null)}return In(r),(r.flags&128)!==0?(r.lanes=u,r):(u=f!==null,a=a!==null&&a.memoizedState!==null,u&&(f=r.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),S=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(S=f.memoizedState.cachePool.pool),S!==v&&(f.flags|=2048)),u!==a&&u&&(r.child.flags|=8192),Mu(r,r.updateQueue),At(r),null);case 4:return Ce(),a===null&&wh(r.stateNode.containerInfo),At(r),null;case 10:return Fa(r.type),At(r),null;case 19:if(G(Bt),f=r.memoizedState,f===null)return At(r),null;if(v=(r.flags&128)!==0,S=f.rendering,S===null)if(v)So(f,!1);else{if(It!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(S=xu(a),S!==null){for(r.flags|=128,So(f,!1),a=S.updateQueue,r.updateQueue=a,Mu(r,a),r.subtreeFlags=0,a=u,u=r.child;u!==null;)Gg(u,a),u=u.sibling;return B(Bt,Bt.current&1|2),st&&za(r,f.treeForkCount),r.child}a=a.sibling}f.tail!==null&&Ue()>Iu&&(r.flags|=128,v=!0,So(f,!1),r.lanes=4194304)}else{if(!v)if(a=xu(S),a!==null){if(r.flags|=128,v=!0,a=a.updateQueue,r.updateQueue=a,Mu(r,a),So(f,!0),f.tail===null&&f.tailMode==="hidden"&&!S.alternate&&!st)return At(r),null}else 2*Ue()-f.renderingStartTime>Iu&&u!==536870912&&(r.flags|=128,v=!0,So(f,!1),r.lanes=4194304);f.isBackwards?(S.sibling=r.child,r.child=S):(a=f.last,a!==null?a.sibling=S:r.child=S,f.last=S)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=Ue(),a.sibling=null,u=Bt.current,B(Bt,v?u&1|2:u&1),st&&za(r,f.treeForkCount),a):(At(r),null);case 22:case 23:return In(r),kf(),f=r.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(r.flags|=8192):f&&(r.flags|=8192),f?(u&536870912)!==0&&(r.flags&128)===0&&(At(r),r.subtreeFlags&6&&(r.flags|=8192)):At(r),u=r.updateQueue,u!==null&&Mu(r,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==u&&(r.flags|=2048),a!==null&&G(rr),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Fa(Ft),At(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function Fk(a,r){switch(cf(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Fa(Ft),Ce(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return $e(r),null;case 31:if(r.memoizedState!==null){if(In(r),r.alternate===null)throw Error(i(340));nr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(In(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(i(340));nr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return G(Bt),null;case 4:return Ce(),null;case 10:return Fa(r.type),null;case 22:case 23:return In(r),kf(),a!==null&&G(rr),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Fa(Ft),null;case 25:return null;default:return null}}function yx(a,r){switch(cf(r),r.tag){case 3:Fa(Ft),Ce();break;case 26:case 27:case 5:$e(r);break;case 4:Ce();break;case 31:r.memoizedState!==null&&In(r);break;case 13:In(r);break;case 19:G(Bt);break;case 10:Fa(r.type);break;case 22:case 23:In(r),kf(),a!==null&&G(rr);break;case 24:Fa(Ft)}}function wo(a,r){try{var u=r.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var v=f.next;u=v;do{if((u.tag&a)===a){f=void 0;var S=u.create,I=u.inst;f=S(),I.destroy=f}u=u.next}while(u!==v)}}catch(F){mt(r,r.return,F)}}function yi(a,r,u){try{var f=r.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var S=v.next;f=S;do{if((f.tag&a)===a){var I=f.inst,F=I.destroy;if(F!==void 0){I.destroy=void 0,v=r;var te=u,ce=F;try{ce()}catch(xe){mt(v,te,xe)}}}f=f.next}while(f!==S)}}catch(xe){mt(r,r.return,xe)}}function vx(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{c1(r,u)}catch(f){mt(a,a.return,f)}}}function Ex(a,r,u){u.props=cr(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(f){mt(a,r,f)}}function ko(a,r){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof u=="function"?a.refCleanup=u(f):u.current=f}}catch(v){mt(a,r,v)}}function Sa(a,r){var u=a.ref,f=a.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(v){mt(a,r,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(v){mt(a,r,v)}else u.current=null}function Tx(a){var r=a.type,u=a.memoizedProps,f=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(v){mt(a,a.return,v)}}function ah(a,r,u){try{var f=a.stateNode;cA(f,a.type,u,r),f[gt]=r}catch(v){mt(a,a.return,v)}}function Sx(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ai(a.type)||a.tag===4}function ih(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Sx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ai(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function rh(a,r,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(a),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=Pa));else if(f!==4&&(f===27&&Ai(a.type)&&(u=a.stateNode,r=null),a=a.child,a!==null))for(rh(a,r,u),a=a.sibling;a!==null;)rh(a,r,u),a=a.sibling}function Ru(a,r,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,r?u.insertBefore(a,r):u.appendChild(a);else if(f!==4&&(f===27&&Ai(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Ru(a,r,u),a=a.sibling;a!==null;)Ru(a,r,u),a=a.sibling}function wx(a){var r=a.stateNode,u=a.memoizedProps;try{for(var f=a.type,v=r.attributes;v.length;)r.removeAttributeNode(v[0]);on(r,f,u),r[$t]=a,r[gt]=u}catch(S){mt(a,a.return,S)}}var Xa=!1,Yt=!1,sh=!1,kx=typeof WeakSet=="function"?WeakSet:Set,en=null;function Vk(a,r){if(a=a.containerInfo,Ch=Zu,a=Pg(a),Zd(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var v=f.anchorOffset,S=f.focusNode;f=f.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var I=0,F=-1,te=-1,ce=0,xe=0,Ee=a,fe=null;t:for(;;){for(var me;Ee!==u||v!==0&&Ee.nodeType!==3||(F=I+v),Ee!==S||f!==0&&Ee.nodeType!==3||(te=I+f),Ee.nodeType===3&&(I+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)fe=Ee,Ee=me;for(;;){if(Ee===a)break t;if(fe===u&&++ce===v&&(F=I),fe===S&&++xe===f&&(te=I),(me=Ee.nextSibling)!==null)break;Ee=fe,fe=Ee.parentNode}Ee=me}u=F===-1||te===-1?null:{start:F,end:te}}else u=null}u=u||{start:0,end:0}}else u=null;for(Nh={focusedElem:a,selectionRange:u},Zu=!1,en=r;en!==null;)if(r=en,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,en=a;else for(;en!==null;){switch(r=en,S=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)v=a[u],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,u=r,v=S.memoizedProps,S=S.memoizedState,f=u.stateNode;try{var De=cr(u.type,v);a=f.getSnapshotBeforeUpdate(De,S),f.__reactInternalSnapshotBeforeUpdate=a}catch(ze){mt(u,u.return,ze)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,u=a.nodeType,u===9)Rh(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Rh(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=r.sibling,a!==null){a.return=r.return,en=a;break}en=r.return}}function Ax(a,r,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:Qa(a,u),f&4&&wo(5,u);break;case 1:if(Qa(a,u),f&4)if(a=u.stateNode,r===null)try{a.componentDidMount()}catch(I){mt(u,u.return,I)}else{var v=cr(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(v,r,a.__reactInternalSnapshotBeforeUpdate)}catch(I){mt(u,u.return,I)}}f&64&&vx(u),f&512&&ko(u,u.return);break;case 3:if(Qa(a,u),f&64&&(a=u.updateQueue,a!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{c1(a,r)}catch(I){mt(u,u.return,I)}}break;case 27:r===null&&f&4&&wx(u);case 26:case 5:Qa(a,u),r===null&&f&4&&Tx(u),f&512&&ko(u,u.return);break;case 12:Qa(a,u);break;case 31:Qa(a,u),f&4&&_x(a,u);break;case 13:Qa(a,u),f&4&&Mx(a,u),f&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=Zk.bind(null,u),bA(a,u))));break;case 22:if(f=u.memoizedState!==null||Xa,!f){r=r!==null&&r.memoizedState!==null||Yt,v=Xa;var S=Yt;Xa=f,(Yt=r)&&!S?$a(a,u,(u.subtreeFlags&8772)!==0):Qa(a,u),Xa=v,Yt=S}break;case 30:break;default:Qa(a,u)}}function Cx(a){var r=a.alternate;r!==null&&(a.alternate=null,Cx(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Br(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var _t=null,Sn=!1;function Ka(a,r,u){for(u=u.child;u!==null;)Nx(a,r,u),u=u.sibling}function Nx(a,r,u){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(Qe,u)}catch{}switch(u.tag){case 26:Yt||Sa(u,r),Ka(a,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Yt||Sa(u,r);var f=_t,v=Sn;Ai(u.type)&&(_t=u.stateNode,Sn=!1),Ka(a,r,u),Oo(u.stateNode),_t=f,Sn=v;break;case 5:Yt||Sa(u,r);case 6:if(f=_t,v=Sn,_t=null,Ka(a,r,u),_t=f,Sn=v,_t!==null)if(Sn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(u.stateNode)}catch(S){mt(u,r,S)}else try{_t.removeChild(u.stateNode)}catch(S){mt(u,r,S)}break;case 18:_t!==null&&(Sn?(a=_t,vb(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),xs(a)):vb(_t,u.stateNode));break;case 4:f=_t,v=Sn,_t=u.stateNode.containerInfo,Sn=!0,Ka(a,r,u),_t=f,Sn=v;break;case 0:case 11:case 14:case 15:yi(2,u,r),Yt||yi(4,u,r),Ka(a,r,u);break;case 1:Yt||(Sa(u,r),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Ex(u,r,f)),Ka(a,r,u);break;case 21:Ka(a,r,u);break;case 22:Yt=(f=Yt)||u.memoizedState!==null,Ka(a,r,u),Yt=f;break;default:Ka(a,r,u)}}function _x(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{xs(a)}catch(u){mt(r,r.return,u)}}}function Mx(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{xs(a)}catch(u){mt(r,r.return,u)}}function qk(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new kx),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new kx),r;default:throw Error(i(435,a.tag))}}function Du(a,r){var u=qk(a);r.forEach(function(f){if(!u.has(f)){u.add(f);var v=Jk.bind(null,a,f);f.then(v,v)}})}function wn(a,r){var u=r.deletions;if(u!==null)for(var f=0;f<u.length;f++){var v=u[f],S=a,I=r,F=I;e:for(;F!==null;){switch(F.tag){case 27:if(Ai(F.type)){_t=F.stateNode,Sn=!1;break e}break;case 5:_t=F.stateNode,Sn=!1;break e;case 3:case 4:_t=F.stateNode.containerInfo,Sn=!0;break e}F=F.return}if(_t===null)throw Error(i(160));Nx(S,I,v),_t=null,Sn=!1,S=v.alternate,S!==null&&(S.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Rx(r,a),r=r.sibling}var fa=null;function Rx(a,r){var u=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:wn(r,a),kn(a),f&4&&(yi(3,a,a.return),wo(3,a),yi(5,a,a.return));break;case 1:wn(r,a),kn(a),f&512&&(Yt||u===null||Sa(u,u.return)),f&64&&Xa&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var v=fa;if(wn(r,a),kn(a),f&512&&(Yt||u===null||Sa(u,u.return)),f&4){var S=u!==null?u.memoizedState:null;if(f=a.memoizedState,u===null)if(f===null)if(a.stateNode===null){e:{f=a.type,u=a.memoizedProps,v=v.ownerDocument||v;t:switch(f){case"title":S=v.getElementsByTagName("title")[0],(!S||S[Qi]||S[$t]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=v.createElement(f),v.head.insertBefore(S,v.querySelector("head > title"))),on(S,f,u),S[$t]=a,Pt(S),f=S;break e;case"link":var I=Rb("link","href",v).get(f+(u.href||""));if(I){for(var F=0;F<I.length;F++)if(S=I[F],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){I.splice(F,1);break t}}S=v.createElement(f),on(S,f,u),v.head.appendChild(S);break;case"meta":if(I=Rb("meta","content",v).get(f+(u.content||""))){for(F=0;F<I.length;F++)if(S=I[F],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){I.splice(F,1);break t}}S=v.createElement(f),on(S,f,u),v.head.appendChild(S);break;default:throw Error(i(468,f))}S[$t]=a,Pt(S),f=S}a.stateNode=f}else Db(v,a.type,a.stateNode);else a.stateNode=Mb(v,f,a.memoizedProps);else S!==f?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,f===null?Db(v,a.type,a.stateNode):Mb(v,f,a.memoizedProps)):f===null&&a.stateNode!==null&&ah(a,a.memoizedProps,u.memoizedProps)}break;case 27:wn(r,a),kn(a),f&512&&(Yt||u===null||Sa(u,u.return)),u!==null&&f&4&&ah(a,a.memoizedProps,u.memoizedProps);break;case 5:if(wn(r,a),kn(a),f&512&&(Yt||u===null||Sa(u,u.return)),a.flags&32){v=a.stateNode;try{zr(v,"")}catch(De){mt(a,a.return,De)}}f&4&&a.stateNode!=null&&(v=a.memoizedProps,ah(a,v,u!==null?u.memoizedProps:v)),f&1024&&(sh=!0);break;case 6:if(wn(r,a),kn(a),f&4){if(a.stateNode===null)throw Error(i(162));f=a.memoizedProps,u=a.stateNode;try{u.nodeValue=f}catch(De){mt(a,a.return,De)}}break;case 3:if(Ku=null,v=fa,fa=Gu(r.containerInfo),wn(r,a),fa=v,kn(a),f&4&&u!==null&&u.memoizedState.isDehydrated)try{xs(r.containerInfo)}catch(De){mt(a,a.return,De)}sh&&(sh=!1,Dx(a));break;case 4:f=fa,fa=Gu(a.stateNode.containerInfo),wn(r,a),kn(a),fa=f;break;case 12:wn(r,a),kn(a);break;case 31:wn(r,a),kn(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Du(a,f)));break;case 13:wn(r,a),kn(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Ou=Ue()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Du(a,f)));break;case 22:v=a.memoizedState!==null;var te=u!==null&&u.memoizedState!==null,ce=Xa,xe=Yt;if(Xa=ce||v,Yt=xe||te,wn(r,a),Yt=xe,Xa=ce,kn(a),f&8192)e:for(r=a.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,v&&(u===null||te||Xa||Yt||dr(a)),u=null,r=a;;){if(r.tag===5||r.tag===26){if(u===null){te=u=r;try{if(S=te.stateNode,v)I=S.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{F=te.stateNode;var Ee=te.memoizedProps.style,fe=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;F.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(De){mt(te,te.return,De)}}}else if(r.tag===6){if(u===null){te=r;try{te.stateNode.nodeValue=v?"":te.memoizedProps}catch(De){mt(te,te.return,De)}}}else if(r.tag===18){if(u===null){te=r;try{var me=te.stateNode;v?Eb(me,!0):Eb(te.stateNode,!1)}catch(De){mt(te,te.return,De)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}f&4&&(f=a.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Du(a,u))));break;case 19:wn(r,a),kn(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Du(a,f)));break;case 30:break;case 21:break;default:wn(r,a),kn(a)}}function kn(a){var r=a.flags;if(r&2){try{for(var u,f=a.return;f!==null;){if(Sx(f)){u=f;break}f=f.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var v=u.stateNode,S=ih(a);Ru(a,S,v);break;case 5:var I=u.stateNode;u.flags&32&&(zr(I,""),u.flags&=-33);var F=ih(a);Ru(a,F,I);break;case 3:case 4:var te=u.stateNode.containerInfo,ce=ih(a);rh(a,ce,te);break;default:throw Error(i(161))}}catch(xe){mt(a,a.return,xe)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function Dx(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;Dx(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function Qa(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Ax(a,r.alternate,r),r=r.sibling}function dr(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:yi(4,r,r.return),dr(r);break;case 1:Sa(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&Ex(r,r.return,u),dr(r);break;case 27:Oo(r.stateNode);case 26:case 5:Sa(r,r.return),dr(r);break;case 22:r.memoizedState===null&&dr(r);break;case 30:dr(r);break;default:dr(r)}a=a.sibling}}function $a(a,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var f=r.alternate,v=a,S=r,I=S.flags;switch(S.tag){case 0:case 11:case 15:$a(v,S,u),wo(4,S);break;case 1:if($a(v,S,u),f=S,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ce){mt(f,f.return,ce)}if(f=S,v=f.updateQueue,v!==null){var F=f.stateNode;try{var te=v.shared.hiddenCallbacks;if(te!==null)for(v.shared.hiddenCallbacks=null,v=0;v<te.length;v++)u1(te[v],F)}catch(ce){mt(f,f.return,ce)}}u&&I&64&&vx(S),ko(S,S.return);break;case 27:wx(S);case 26:case 5:$a(v,S,u),u&&f===null&&I&4&&Tx(S),ko(S,S.return);break;case 12:$a(v,S,u);break;case 31:$a(v,S,u),u&&I&4&&_x(v,S);break;case 13:$a(v,S,u),u&&I&4&&Mx(v,S);break;case 22:S.memoizedState===null&&$a(v,S,u),ko(S,S.return);break;case 30:break;default:$a(v,S,u)}r=r.sibling}}function oh(a,r){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&co(u))}function lh(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&co(a))}function ha(a,r,u,f){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Lx(a,r,u,f),r=r.sibling}function Lx(a,r,u,f){var v=r.flags;switch(r.tag){case 0:case 11:case 15:ha(a,r,u,f),v&2048&&wo(9,r);break;case 1:ha(a,r,u,f);break;case 3:ha(a,r,u,f),v&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&co(a)));break;case 12:if(v&2048){ha(a,r,u,f),a=r.stateNode;try{var S=r.memoizedProps,I=S.id,F=S.onPostCommit;typeof F=="function"&&F(I,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(te){mt(r,r.return,te)}}else ha(a,r,u,f);break;case 31:ha(a,r,u,f);break;case 13:ha(a,r,u,f);break;case 23:break;case 22:S=r.stateNode,I=r.alternate,r.memoizedState!==null?S._visibility&2?ha(a,r,u,f):Ao(a,r):S._visibility&2?ha(a,r,u,f):(S._visibility|=2,ss(a,r,u,f,(r.subtreeFlags&10256)!==0||!1)),v&2048&&oh(I,r);break;case 24:ha(a,r,u,f),v&2048&&lh(r.alternate,r);break;default:ha(a,r,u,f)}}function ss(a,r,u,f,v){for(v=v&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var S=a,I=r,F=u,te=f,ce=I.flags;switch(I.tag){case 0:case 11:case 15:ss(S,I,F,te,v),wo(8,I);break;case 23:break;case 22:var xe=I.stateNode;I.memoizedState!==null?xe._visibility&2?ss(S,I,F,te,v):Ao(S,I):(xe._visibility|=2,ss(S,I,F,te,v)),v&&ce&2048&&oh(I.alternate,I);break;case 24:ss(S,I,F,te,v),v&&ce&2048&&lh(I.alternate,I);break;default:ss(S,I,F,te,v)}r=r.sibling}}function Ao(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=a,f=r,v=f.flags;switch(f.tag){case 22:Ao(u,f),v&2048&&oh(f.alternate,f);break;case 24:Ao(u,f),v&2048&&lh(f.alternate,f);break;default:Ao(u,f)}r=r.sibling}}var Co=8192;function os(a,r,u){if(a.subtreeFlags&Co)for(a=a.child;a!==null;)Ox(a,r,u),a=a.sibling}function Ox(a,r,u){switch(a.tag){case 26:os(a,r,u),a.flags&Co&&a.memoizedState!==null&&MA(u,fa,a.memoizedState,a.memoizedProps);break;case 5:os(a,r,u);break;case 3:case 4:var f=fa;fa=Gu(a.stateNode.containerInfo),os(a,r,u),fa=f;break;case 22:a.memoizedState===null&&(f=a.alternate,f!==null&&f.memoizedState!==null?(f=Co,Co=16777216,os(a,r,u),Co=f):os(a,r,u));break;default:os(a,r,u)}}function Ix(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function No(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var f=r[u];en=f,Px(f,a)}Ix(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)jx(a),a=a.sibling}function jx(a){switch(a.tag){case 0:case 11:case 15:No(a),a.flags&2048&&yi(9,a,a.return);break;case 3:No(a);break;case 12:No(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Lu(a)):No(a);break;default:No(a)}}function Lu(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var f=r[u];en=f,Px(f,a)}Ix(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:yi(8,r,r.return),Lu(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,Lu(r));break;default:Lu(r)}a=a.sibling}}function Px(a,r){for(;en!==null;){var u=en;switch(u.tag){case 0:case 11:case 15:yi(8,u,r);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:co(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,en=f;else e:for(u=a;en!==null;){f=en;var v=f.sibling,S=f.return;if(Cx(f),f===u){en=null;break e}if(v!==null){v.return=S,en=v;break e}en=S}}}var Yk={getCacheForType:function(a){var r=rn(Ft),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return rn(Ft).controller.signal}},Gk=typeof WeakMap=="function"?WeakMap:Map,dt=0,vt=null,et=null,at=0,ht=0,jn=null,vi=!1,ls=!1,uh=!1,Wa=0,It=0,Ei=0,fr=0,ch=0,Pn=0,us=0,_o=null,An=null,dh=!1,Ou=0,Bx=0,Iu=1/0,ju=null,Ti=null,Wt=0,Si=null,cs=null,Za=0,fh=0,hh=null,Ux=null,Mo=0,mh=null;function Bn(){return(dt&2)!==0&&at!==0?at&-at:H.T!==null?vh():Ks()}function zx(){if(Pn===0)if((at&536870912)===0||st){var a=Ir;Ir<<=1,(Ir&3932160)===0&&(Ir=262144),Pn=a}else Pn=536870912;return a=On.current,a!==null&&(a.flags|=32),Pn}function Cn(a,r,u){(a===vt&&(ht===2||ht===9)||a.cancelPendingCommit!==null)&&(ds(a,0),wi(a,at,Pn,!1)),Gi(a,u),((dt&2)===0||a!==vt)&&(a===vt&&((dt&2)===0&&(fr|=u),It===4&&wi(a,at,Pn,!1)),wa(a))}function Hx(a,r,u){if((dt&6)!==0)throw Error(i(327));var f=!u&&(r&127)===0&&(r&a.expiredLanes)===0||oi(a,r),v=f?Qk(a,r):gh(a,r,!0),S=f;do{if(v===0){ls&&!f&&wi(a,r,0,!1);break}else{if(u=a.current.alternate,S&&!Xk(u)){v=gh(a,r,!1),S=!1;continue}if(v===2){if(S=r,a.errorRecoveryDisabledLanes&S)var I=0;else I=a.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){r=I;e:{var F=a;v=_o;var te=F.current.memoizedState.isDehydrated;if(te&&(ds(F,I).flags|=256),I=gh(F,I,!1),I!==2){if(uh&&!te){F.errorRecoveryDisabledLanes|=S,fr|=S,v=4;break e}S=An,An=v,S!==null&&(An===null?An=S:An.push.apply(An,S))}v=I}if(S=!1,v!==2)continue}}if(v===1){ds(a,0),wi(a,r,0,!0);break}e:{switch(f=a,S=v,S){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:wi(f,r,Pn,!vi);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(v=Ou+300-Ue(),10<v)){if(wi(f,r,Pn,!vi),qi(f,0,!0)!==0)break e;Za=r,f.timeoutHandle=bb(Fx.bind(null,f,u,An,ju,dh,r,Pn,fr,us,vi,S,"Throttled",-0,0),v);break e}Fx(f,u,An,ju,dh,r,Pn,fr,us,vi,S,null,-0,0)}}break}while(!0);wa(a)}function Fx(a,r,u,f,v,S,I,F,te,ce,xe,Ee,fe,me){if(a.timeoutHandle=-1,Ee=r.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pa},Ox(r,S,Ee);var De=(S&62914560)===S?Ou-Ue():(S&4194048)===S?Bx-Ue():0;if(De=RA(Ee,De),De!==null){Za=S,a.cancelPendingCommit=De($x.bind(null,a,r,S,u,f,v,I,F,te,xe,Ee,null,fe,me)),wi(a,S,I,!ce);return}}$x(a,r,S,u,f,v,I,F,te)}function Xk(a){for(var r=a;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var v=u[f],S=v.getSnapshot;v=v.value;try{if(!Dn(S(),v))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function wi(a,r,u,f){r&=~ch,r&=~fr,a.suspendedLanes|=r,a.pingedLanes&=~r,f&&(a.warmLanes|=r),f=a.expirationTimes;for(var v=r;0<v;){var S=31-ft(v),I=1<<S;f[S]=-1,v&=~I}u!==0&&Yl(a,u,r)}function Pu(){return(dt&6)===0?(Ro(0),!1):!0}function ph(){if(et!==null){if(ht===0)var a=et.return;else a=et,Ha=ar=null,Rf(a),ts=null,ho=0,a=et;for(;a!==null;)yx(a.alternate,a),a=a.return;et=null}}function ds(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,hA(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Za=0,ph(),vt=a,et=u=Ua(a.current,null),at=r,ht=0,jn=null,vi=!1,ls=oi(a,r),uh=!1,us=Pn=ch=fr=Ei=It=0,An=_o=null,dh=!1,(r&8)!==0&&(r|=r&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=r;0<f;){var v=31-ft(f),S=1<<v;r|=a[v],f&=~S}return Wa=r,iu(),u}function Vx(a,r){Xe=null,H.H=Eo,r===es||r===fu?(r=r1(),ht=3):r===yf?(r=r1(),ht=4):ht=r===Xf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,jn=r,et===null&&(It=1,Au(a,$n(r,a.current)))}function qx(){var a=On.current;return a===null?!0:(at&4194048)===at?ea===null:(at&62914560)===at||(at&536870912)!==0?a===ea:!1}function Yx(){var a=H.H;return H.H=Eo,a===null?Eo:a}function Gx(){var a=H.A;return H.A=Yk,a}function Bu(){It=4,vi||(at&4194048)!==at&&On.current!==null||(ls=!0),(Ei&134217727)===0&&(fr&134217727)===0||vt===null||wi(vt,at,Pn,!1)}function gh(a,r,u){var f=dt;dt|=2;var v=Yx(),S=Gx();(vt!==a||at!==r)&&(ju=null,ds(a,r)),r=!1;var I=It;e:do try{if(ht!==0&&et!==null){var F=et,te=jn;switch(ht){case 8:ph(),I=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(r=!0);var ce=ht;if(ht=0,jn=null,fs(a,F,te,ce),u&&ls){I=0;break e}break;default:ce=ht,ht=0,jn=null,fs(a,F,te,ce)}}Kk(),I=It;break}catch(xe){Vx(a,xe)}while(!0);return r&&a.shellSuspendCounter++,Ha=ar=null,dt=f,H.H=v,H.A=S,et===null&&(vt=null,at=0,iu()),I}function Kk(){for(;et!==null;)Xx(et)}function Qk(a,r){var u=dt;dt|=2;var f=Yx(),v=Gx();vt!==a||at!==r?(ju=null,Iu=Ue()+500,ds(a,r)):ls=oi(a,r);e:do try{if(ht!==0&&et!==null){r=et;var S=jn;t:switch(ht){case 1:ht=0,jn=null,fs(a,r,S,1);break;case 2:case 9:if(a1(S)){ht=0,jn=null,Kx(r);break}r=function(){ht!==2&&ht!==9||vt!==a||(ht=7),wa(a)},S.then(r,r);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:a1(S)?(ht=0,jn=null,Kx(r)):(ht=0,jn=null,fs(a,r,S,7));break;case 5:var I=null;switch(et.tag){case 26:I=et.memoizedState;case 5:case 27:var F=et;if(I?Lb(I):F.stateNode.complete){ht=0,jn=null;var te=F.sibling;if(te!==null)et=te;else{var ce=F.return;ce!==null?(et=ce,Uu(ce)):et=null}break t}}ht=0,jn=null,fs(a,r,S,5);break;case 6:ht=0,jn=null,fs(a,r,S,6);break;case 8:ph(),It=6;break e;default:throw Error(i(462))}}$k();break}catch(xe){Vx(a,xe)}while(!0);return Ha=ar=null,H.H=f,H.A=v,dt=u,et!==null?0:(vt=null,at=0,iu(),It)}function $k(){for(;et!==null&&!Ht();)Xx(et)}function Xx(a){var r=xx(a.alternate,a,Wa);a.memoizedProps=a.pendingProps,r===null?Uu(a):et=r}function Kx(a){var r=a,u=r.alternate;switch(r.tag){case 15:case 0:r=dx(u,r,r.pendingProps,r.type,void 0,at);break;case 11:r=dx(u,r,r.pendingProps,r.type.render,r.ref,at);break;case 5:Rf(r);default:yx(u,r),r=et=Gg(r,Wa),r=xx(u,r,Wa)}a.memoizedProps=a.pendingProps,r===null?Uu(a):et=r}function fs(a,r,u,f){Ha=ar=null,Rf(r),ts=null,ho=0;var v=r.return;try{if(Bk(a,v,r,u,at)){It=1,Au(a,$n(u,a.current)),et=null;return}}catch(S){if(v!==null)throw et=v,S;It=1,Au(a,$n(u,a.current)),et=null;return}r.flags&32768?(st||f===1?a=!0:ls||(at&536870912)!==0?a=!1:(vi=a=!0,(f===2||f===9||f===3||f===6)&&(f=On.current,f!==null&&f.tag===13&&(f.flags|=16384))),Qx(r,a)):Uu(r)}function Uu(a){var r=a;do{if((r.flags&32768)!==0){Qx(r,vi);return}a=r.return;var u=Hk(r.alternate,r,Wa);if(u!==null){et=u;return}if(r=r.sibling,r!==null){et=r;return}et=r=a}while(r!==null);It===0&&(It=5)}function Qx(a,r){do{var u=Fk(a.alternate,a);if(u!==null){u.flags&=32767,et=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(a=a.sibling,a!==null)){et=a;return}et=a=u}while(a!==null);It=6,et=null}function $x(a,r,u,f,v,S,I,F,te){a.cancelPendingCommit=null;do zu();while(Wt!==0);if((dt&6)!==0)throw Error(i(327));if(r!==null){if(r===a.current)throw Error(i(177));if(S=r.lanes|r.childLanes,S|=af,Od(a,u,S,I,F,te),a===vt&&(et=vt=null,at=0),cs=r,Si=a,Za=u,fh=S,hh=v,Ux=f,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,eA(Re,function(){return tb(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||f){f=H.T,H.T=null,v=X.p,X.p=2,I=dt,dt|=4;try{Vk(a,r,u)}finally{dt=I,X.p=v,H.T=f}}Wt=1,Wx(),Zx(),Jx()}}function Wx(){if(Wt===1){Wt=0;var a=Si,r=cs,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var f=X.p;X.p=2;var v=dt;dt|=4;try{Rx(r,a);var S=Nh,I=Pg(a.containerInfo),F=S.focusedElem,te=S.selectionRange;if(I!==F&&F&&F.ownerDocument&&jg(F.ownerDocument.documentElement,F)){if(te!==null&&Zd(F)){var ce=te.start,xe=te.end;if(xe===void 0&&(xe=ce),"selectionStart"in F)F.selectionStart=ce,F.selectionEnd=Math.min(xe,F.value.length);else{var Ee=F.ownerDocument||document,fe=Ee&&Ee.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),De=F.textContent.length,ze=Math.min(te.start,De),yt=te.end===void 0?ze:Math.min(te.end,De);!me.extend&&ze>yt&&(I=yt,yt=ze,ze=I);var re=Ig(F,ze),ae=Ig(F,yt);if(re&&ae&&(me.rangeCount!==1||me.anchorNode!==re.node||me.anchorOffset!==re.offset||me.focusNode!==ae.node||me.focusOffset!==ae.offset)){var ue=Ee.createRange();ue.setStart(re.node,re.offset),me.removeAllRanges(),ze>yt?(me.addRange(ue),me.extend(ae.node,ae.offset)):(ue.setEnd(ae.node,ae.offset),me.addRange(ue))}}}}for(Ee=[],me=F;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<Ee.length;F++){var ve=Ee[F];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Zu=!!Ch,Nh=Ch=null}finally{dt=v,X.p=f,H.T=u}}a.current=r,Wt=2}}function Zx(){if(Wt===2){Wt=0;var a=Si,r=cs,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var f=X.p;X.p=2;var v=dt;dt|=4;try{Ax(a,r.alternate,r)}finally{dt=v,X.p=f,H.T=u}}Wt=3}}function Jx(){if(Wt===4||Wt===3){Wt=0,ge();var a=Si,r=cs,u=Za,f=Ux;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Wt=5:(Wt=0,cs=Si=null,eb(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Ti=null),Xi(u),r=r.stateNode,Ge&&typeof Ge.onCommitFiberRoot=="function")try{Ge.onCommitFiberRoot(Qe,r,void 0,(r.current.flags&128)===128)}catch{}if(f!==null){r=H.T,v=X.p,X.p=2,H.T=null;try{for(var S=a.onRecoverableError,I=0;I<f.length;I++){var F=f[I];S(F.value,{componentStack:F.stack})}}finally{H.T=r,X.p=v}}(Za&3)!==0&&zu(),wa(a),v=a.pendingLanes,(u&261930)!==0&&(v&42)!==0?a===mh?Mo++:(Mo=0,mh=a):Mo=0,Ro(0)}}function eb(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,co(r)))}function zu(){return Wx(),Zx(),Jx(),tb()}function tb(){if(Wt!==5)return!1;var a=Si,r=fh;fh=0;var u=Xi(Za),f=H.T,v=X.p;try{X.p=32>u?32:u,H.T=null,u=hh,hh=null;var S=Si,I=Za;if(Wt=0,cs=Si=null,Za=0,(dt&6)!==0)throw Error(i(331));var F=dt;if(dt|=4,jx(S.current),Lx(S,S.current,I,u),dt=F,Ro(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(Qe,S)}catch{}return!0}finally{X.p=v,H.T=f,eb(a,r)}}function nb(a,r,u){r=$n(u,r),r=Gf(a.stateNode,r,2),a=gi(a,r,2),a!==null&&(Gi(a,2),wa(a))}function mt(a,r,u){if(a.tag===3)nb(a,a,u);else for(;r!==null;){if(r.tag===3){nb(r,a,u);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ti===null||!Ti.has(f))){a=$n(u,a),u=ax(2),f=gi(r,u,2),f!==null&&(ix(u,f,r,a),Gi(f,2),wa(f));break}}r=r.return}}function xh(a,r,u){var f=a.pingCache;if(f===null){f=a.pingCache=new Gk;var v=new Set;f.set(r,v)}else v=f.get(r),v===void 0&&(v=new Set,f.set(r,v));v.has(u)||(uh=!0,v.add(u),a=Wk.bind(null,a,r,u),r.then(a,a))}function Wk(a,r,u){var f=a.pingCache;f!==null&&f.delete(r),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,vt===a&&(at&u)===u&&(It===4||It===3&&(at&62914560)===at&&300>Ue()-Ou?(dt&2)===0&&ds(a,0):ch|=u,us===at&&(us=0)),wa(a)}function ab(a,r){r===0&&(r=Pr()),a=er(a,r),a!==null&&(Gi(a,r),wa(a))}function Zk(a){var r=a.memoizedState,u=0;r!==null&&(u=r.retryLane),ab(a,u)}function Jk(a,r){var u=0;switch(a.tag){case 31:case 13:var f=a.stateNode,v=a.memoizedState;v!==null&&(u=v.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(i(314))}f!==null&&f.delete(r),ab(a,u)}function eA(a,r){return pt(a,r)}var Hu=null,hs=null,bh=!1,Fu=!1,yh=!1,ki=0;function wa(a){a!==hs&&a.next===null&&(hs===null?Hu=hs=a:hs=hs.next=a),Fu=!0,bh||(bh=!0,nA())}function Ro(a,r){if(!yh&&Fu){yh=!0;do for(var u=!1,f=Hu;f!==null;){if(a!==0){var v=f.pendingLanes;if(v===0)var S=0;else{var I=f.suspendedLanes,F=f.pingedLanes;S=(1<<31-ft(42|a)+1)-1,S&=v&~(I&~F),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,ob(f,S))}else S=at,S=qi(f,f===vt?S:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(S&3)===0||oi(f,S)||(u=!0,ob(f,S));f=f.next}while(u);yh=!1}}function tA(){ib()}function ib(){Fu=bh=!1;var a=0;ki!==0&&fA()&&(a=ki);for(var r=Ue(),u=null,f=Hu;f!==null;){var v=f.next,S=rb(f,r);S===0?(f.next=null,u===null?Hu=v:u.next=v,v===null&&(hs=u)):(u=f,(a!==0||(S&3)!==0)&&(Fu=!0)),f=v}Wt!==0&&Wt!==5||Ro(a),ki!==0&&(ki=0)}function rb(a,r){for(var u=a.suspendedLanes,f=a.pingedLanes,v=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var I=31-ft(S),F=1<<I,te=v[I];te===-1?((F&u)===0||(F&f)!==0)&&(v[I]=jr(F,r)):te<=r&&(a.expiredLanes|=F),S&=~F}if(r=vt,u=at,u=qi(a,a===r?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,u===0||a===r&&(ht===2||ht===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&gn(f),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||oi(a,u)){if(r=u&-u,r===a.callbackPriority)return r;switch(f!==null&&gn(f),Xi(u)){case 2:case 8:u=Te;break;case 32:u=Re;break;case 268435456:u=Ye;break;default:u=Re}return f=sb.bind(null,a),u=pt(u,f),a.callbackPriority=r,a.callbackNode=u,r}return f!==null&&f!==null&&gn(f),a.callbackPriority=2,a.callbackNode=null,2}function sb(a,r){if(Wt!==0&&Wt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(zu()&&a.callbackNode!==u)return null;var f=at;return f=qi(a,a===vt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(Hx(a,f,r),rb(a,Ue()),a.callbackNode!=null&&a.callbackNode===u?sb.bind(null,a):null)}function ob(a,r){if(zu())return null;Hx(a,r,!0)}function nA(){mA(function(){(dt&6)!==0?pt(he,tA):ib()})}function vh(){if(ki===0){var a=Zr;a===0&&(a=Gn,Gn<<=1,(Gn&261888)===0&&(Gn=256)),ki=a}return ki}function lb(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:$l(""+a)}function ub(a,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,a.id&&u.setAttribute("form",a.id),r.parentNode.insertBefore(u,r),a=new FormData(a),u.parentNode.removeChild(u),a}function aA(a,r,u,f,v){if(r==="submit"&&u&&u.stateNode===v){var S=lb((v[gt]||null).action),I=f.submitter;I&&(r=(r=I[gt]||null)?lb(r.formAction):I.getAttribute("formAction"),r!==null&&(S=r,I=null));var F=new eu("action","action",null,f,v);a.push({event:F,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ki!==0){var te=I?ub(v,I):new FormData(v);zf(u,{pending:!0,data:te,method:v.method,action:S},null,te)}}else typeof S=="function"&&(F.preventDefault(),te=I?ub(v,I):new FormData(v),zf(u,{pending:!0,data:te,method:v.method,action:S},S,te))},currentTarget:v}]})}}for(var Eh=0;Eh<nf.length;Eh++){var Th=nf[Eh],iA=Th.toLowerCase(),rA=Th[0].toUpperCase()+Th.slice(1);da(iA,"on"+rA)}da(zg,"onAnimationEnd"),da(Hg,"onAnimationIteration"),da(Fg,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(Ek,"onTransitionRun"),da(Tk,"onTransitionStart"),da(Sk,"onTransitionCancel"),da(Vg,"onTransitionEnd"),li("onMouseEnter",["mouseout","mouseover"]),li("onMouseLeave",["mouseout","mouseover"]),li("onPointerEnter",["pointerout","pointerover"]),li("onPointerLeave",["pointerout","pointerover"]),ca("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ca("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ca("onBeforeInput",["compositionend","keypress","textInput","paste"]),ca("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ca("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ca("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),sA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function cb(a,r){r=(r&4)!==0;for(var u=0;u<a.length;u++){var f=a[u],v=f.event;f=f.listeners;e:{var S=void 0;if(r)for(var I=f.length-1;0<=I;I--){var F=f[I],te=F.instance,ce=F.currentTarget;if(F=F.listener,te!==S&&v.isPropagationStopped())break e;S=F,v.currentTarget=ce;try{S(v)}catch(xe){au(xe)}v.currentTarget=null,S=te}else for(I=0;I<f.length;I++){if(F=f[I],te=F.instance,ce=F.currentTarget,F=F.listener,te!==S&&v.isPropagationStopped())break e;S=F,v.currentTarget=ce;try{S(v)}catch(xe){au(xe)}v.currentTarget=null,S=te}}}}function tt(a,r){var u=r[Dt];u===void 0&&(u=r[Dt]=new Set);var f=a+"__bubble";u.has(f)||(db(r,a,2,!1),u.add(f))}function Sh(a,r,u){var f=0;r&&(f|=4),db(u,a,f,r)}var Vu="_reactListening"+Math.random().toString(36).slice(2);function wh(a){if(!a[Vu]){a[Vu]=!0,Ws.forEach(function(u){u!=="selectionchange"&&(sA.has(u)||Sh(u,!1,a),Sh(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Vu]||(r[Vu]=!0,Sh("selectionchange",!1,r))}}function db(a,r,u,f){switch(zb(r)){case 2:var v=OA;break;case 8:v=IA;break;default:v=Uh}u=v.bind(null,r,u,a),v=void 0,!Vd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(v=!0),f?v!==void 0?a.addEventListener(r,u,{capture:!0,passive:v}):a.addEventListener(r,u,!0):v!==void 0?a.addEventListener(r,u,{passive:v}):a.addEventListener(r,u,!1)}function kh(a,r,u,f,v){var S=f;if((r&1)===0&&(r&2)===0&&f!==null)e:for(;;){if(f===null)return;var I=f.tag;if(I===3||I===4){var F=f.stateNode.containerInfo;if(F===v)break;if(I===4)for(I=f.return;I!==null;){var te=I.tag;if((te===3||te===4)&&I.stateNode.containerInfo===v)return;I=I.return}for(;F!==null;){if(I=Xn(F),I===null)return;if(te=I.tag,te===5||te===6||te===26||te===27){f=S=I;continue e}F=F.parentNode}}f=f.return}gg(function(){var ce=S,xe=Hd(u),Ee=[];e:{var fe=qg.get(a);if(fe!==void 0){var me=eu,De=a;switch(a){case"keypress":if(Zl(u)===0)break e;case"keydown":case"keyup":me=Jw;break;case"focusin":De="focus",me=Xd;break;case"focusout":De="blur",me=Xd;break;case"beforeblur":case"afterblur":me=Xd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Hw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=nk;break;case zg:case Hg:case Fg:me=qw;break;case Vg:me=ik;break;case"scroll":case"scrollend":me=Uw;break;case"wheel":me=sk;break;case"copy":case"cut":case"paste":me=Gw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Eg;break;case"toggle":case"beforetoggle":me=lk}var ze=(r&4)!==0,yt=!ze&&(a==="scroll"||a==="scrollend"),re=ze?fe!==null?fe+"Capture":null:fe;ze=[];for(var ae=ce,ue;ae!==null;){var ve=ae;if(ue=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ue===null||re===null||(ve=Js(ae,re),ve!=null&&ze.push(Lo(ae,ve,ue))),yt)break;ae=ae.return}0<ze.length&&(fe=new me(fe,De,null,u,xe),Ee.push({event:fe,listeners:ze}))}}if((r&7)===0){e:{if(fe=a==="mouseover"||a==="pointerover",me=a==="mouseout"||a==="pointerout",fe&&u!==zd&&(De=u.relatedTarget||u.fromElement)&&(Xn(De)||De[Oa]))break e;if((me||fe)&&(fe=xe.window===xe?xe:(fe=xe.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?(De=u.relatedTarget||u.toElement,me=ce,De=De?Xn(De):null,De!==null&&(yt=s(De),ze=De.tag,De!==yt||ze!==5&&ze!==27&&ze!==6)&&(De=null)):(me=null,De=ce),me!==De)){if(ze=yg,ve="onMouseLeave",re="onMouseEnter",ae="mouse",(a==="pointerout"||a==="pointerover")&&(ze=Eg,ve="onPointerLeave",re="onPointerEnter",ae="pointer"),yt=me==null?fe:$i(me),ue=De==null?fe:$i(De),fe=new ze(ve,ae+"leave",me,u,xe),fe.target=yt,fe.relatedTarget=ue,ve=null,Xn(xe)===ce&&(ze=new ze(re,ae+"enter",De,u,xe),ze.target=ue,ze.relatedTarget=yt,ve=ze),yt=ve,me&&De)t:{for(ze=oA,re=me,ae=De,ue=0,ve=re;ve;ve=ze(ve))ue++;ve=0;for(var Pe=ae;Pe;Pe=ze(Pe))ve++;for(;0<ue-ve;)re=ze(re),ue--;for(;0<ve-ue;)ae=ze(ae),ve--;for(;ue--;){if(re===ae||ae!==null&&re===ae.alternate){ze=re;break t}re=ze(re),ae=ze(ae)}ze=null}else ze=null;me!==null&&fb(Ee,fe,me,ze,!1),De!==null&&yt!==null&&fb(Ee,yt,De,ze,!0)}}e:{if(fe=ce?$i(ce):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var ut=_g;else if(Cg(fe))if(Mg)ut=bk;else{ut=gk;var Oe=pk}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ce&&Ud(ce.elementType)&&(ut=_g):ut=xk;if(ut&&(ut=ut(a,ce))){Ng(Ee,ut,u,xe);break e}Oe&&Oe(a,fe,ce),a==="focusout"&&ce&&fe.type==="number"&&ce.memoizedProps.value!=null&&Bd(fe,"number",fe.value)}switch(Oe=ce?$i(ce):window,a){case"focusin":(Cg(Oe)||Oe.contentEditable==="true")&&(qr=Oe,Jd=ce,oo=null);break;case"focusout":oo=Jd=qr=null;break;case"mousedown":ef=!0;break;case"contextmenu":case"mouseup":case"dragend":ef=!1,Bg(Ee,u,xe);break;case"selectionchange":if(vk)break;case"keydown":case"keyup":Bg(Ee,u,xe)}var Ke;if(Qd)e:{switch(a){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Vr?kg(a,u)&&(it="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(it="onCompositionStart");it&&(Tg&&u.locale!=="ko"&&(Vr||it!=="onCompositionStart"?it==="onCompositionEnd"&&Vr&&(Ke=xg()):(ui=xe,qd="value"in ui?ui.value:ui.textContent,Vr=!0)),Oe=qu(ce,it),0<Oe.length&&(it=new vg(it,a,null,u,xe),Ee.push({event:it,listeners:Oe}),Ke?it.data=Ke:(Ke=Ag(u),Ke!==null&&(it.data=Ke)))),(Ke=ck?dk(a,u):fk(a,u))&&(it=qu(ce,"onBeforeInput"),0<it.length&&(Oe=new vg("onBeforeInput","beforeinput",null,u,xe),Ee.push({event:Oe,listeners:it}),Oe.data=Ke)),aA(Ee,a,ce,u,xe)}cb(Ee,r)})}function Lo(a,r,u){return{instance:a,listener:r,currentTarget:u}}function qu(a,r){for(var u=r+"Capture",f=[];a!==null;){var v=a,S=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||S===null||(v=Js(a,u),v!=null&&f.unshift(Lo(a,v,S)),v=Js(a,r),v!=null&&f.push(Lo(a,v,S))),a.tag===3)return f;a=a.return}return[]}function oA(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function fb(a,r,u,f,v){for(var S=r._reactName,I=[];u!==null&&u!==f;){var F=u,te=F.alternate,ce=F.stateNode;if(F=F.tag,te!==null&&te===f)break;F!==5&&F!==26&&F!==27||ce===null||(te=ce,v?(ce=Js(u,S),ce!=null&&I.unshift(Lo(u,ce,te))):v||(ce=Js(u,S),ce!=null&&I.push(Lo(u,ce,te)))),u=u.return}I.length!==0&&a.push({event:r,listeners:I})}var lA=/\r\n?/g,uA=/\u0000|\uFFFD/g;function hb(a){return(typeof a=="string"?a:""+a).replace(lA,`
|
|
49
|
+
`).replace(uA,"")}function mb(a,r){return r=hb(r),hb(a)===r}function bt(a,r,u,f,v,S){switch(u){case"children":typeof f=="string"?r==="body"||r==="textarea"&&f===""||zr(a,f):(typeof f=="number"||typeof f=="bigint")&&r!=="body"&&zr(a,""+f);break;case"className":lt(a,"class",f);break;case"tabIndex":lt(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":lt(a,u,f);break;case"style":mg(a,f,S);break;case"data":if(r!=="object"){lt(a,"data",f);break}case"src":case"href":if(f===""&&(r!=="a"||u!=="href")){a.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=$l(""+f),a.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(r!=="input"&&bt(a,r,"name",v.name,v,null),bt(a,r,"formEncType",v.formEncType,v,null),bt(a,r,"formMethod",v.formMethod,v,null),bt(a,r,"formTarget",v.formTarget,v,null)):(bt(a,r,"encType",v.encType,v,null),bt(a,r,"method",v.method,v,null),bt(a,r,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=$l(""+f),a.setAttribute(u,f);break;case"onClick":f!=null&&(a.onclick=Pa);break;case"onScroll":f!=null&&tt("scroll",a);break;case"onScrollEnd":f!=null&&tt("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(u=f.__html,u!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){a.removeAttribute("xlink:href");break}u=$l(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""+f):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":f===!0?a.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,f):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(u,f):a.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(u):a.setAttribute(u,f);break;case"popover":tt("beforetoggle",a),tt("toggle",a),je(a,"popover",f);break;case"xlinkActuate":Lt(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Lt(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Lt(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Lt(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Lt(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Lt(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Lt(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Lt(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Lt(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":je(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Pw.get(u)||u,je(a,u,f))}}function Ah(a,r,u,f,v,S){switch(u){case"style":mg(a,f,S);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(u=f.__html,u!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"children":typeof f=="string"?zr(a,f):(typeof f=="number"||typeof f=="bigint")&&zr(a,""+f);break;case"onScroll":f!=null&&tt("scroll",a);break;case"onScrollEnd":f!=null&&tt("scrollend",a);break;case"onClick":f!=null&&(a.onclick=Pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kl.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(v=u.endsWith("Capture"),r=u.slice(2,v?u.length-7:void 0),S=a[gt]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(r,S,v),typeof f=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(r,f,v);break e}u in a?a[u]=f:f===!0?a.setAttribute(u,""):je(a,u,f)}}}function on(a,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",a),tt("load",a);var f=!1,v=!1,S;for(S in u)if(u.hasOwnProperty(S)){var I=u[S];if(I!=null)switch(S){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:bt(a,r,S,I,u,null)}}v&&bt(a,r,"srcSet",u.srcSet,u,null),f&&bt(a,r,"src",u.src,u,null);return;case"input":tt("invalid",a);var F=S=I=v=null,te=null,ce=null;for(f in u)if(u.hasOwnProperty(f)){var xe=u[f];if(xe!=null)switch(f){case"name":v=xe;break;case"type":I=xe;break;case"checked":te=xe;break;case"defaultChecked":ce=xe;break;case"value":S=xe;break;case"defaultValue":F=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(i(137,r));break;default:bt(a,r,f,xe,u,null)}}cg(a,S,F,te,ce,I,v,!1);return;case"select":tt("invalid",a),f=I=S=null;for(v in u)if(u.hasOwnProperty(v)&&(F=u[v],F!=null))switch(v){case"value":S=F;break;case"defaultValue":I=F;break;case"multiple":f=F;default:bt(a,r,v,F,u,null)}r=S,u=I,a.multiple=!!f,r!=null?Ur(a,!!f,r,!1):u!=null&&Ur(a,!!f,u,!0);return;case"textarea":tt("invalid",a),S=v=f=null;for(I in u)if(u.hasOwnProperty(I)&&(F=u[I],F!=null))switch(I){case"value":f=F;break;case"defaultValue":v=F;break;case"children":S=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(91));break;default:bt(a,r,I,F,u,null)}fg(a,f,v,S);return;case"option":for(te in u)if(u.hasOwnProperty(te)&&(f=u[te],f!=null))switch(te){case"selected":a.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:bt(a,r,te,f,u,null)}return;case"dialog":tt("beforetoggle",a),tt("toggle",a),tt("cancel",a),tt("close",a);break;case"iframe":case"object":tt("load",a);break;case"video":case"audio":for(f=0;f<Do.length;f++)tt(Do[f],a);break;case"image":tt("error",a),tt("load",a);break;case"details":tt("toggle",a);break;case"embed":case"source":case"link":tt("error",a),tt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in u)if(u.hasOwnProperty(ce)&&(f=u[ce],f!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:bt(a,r,ce,f,u,null)}return;default:if(Ud(r)){for(xe in u)u.hasOwnProperty(xe)&&(f=u[xe],f!==void 0&&Ah(a,r,xe,f,u,void 0));return}}for(F in u)u.hasOwnProperty(F)&&(f=u[F],f!=null&&bt(a,r,F,f,u,null))}function cA(a,r,u,f){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,S=null,I=null,F=null,te=null,ce=null,xe=null;for(me in u){var Ee=u[me];if(u.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":te=Ee;default:f.hasOwnProperty(me)||bt(a,r,me,null,f,Ee)}}for(var fe in f){var me=f[fe];if(Ee=u[fe],f.hasOwnProperty(fe)&&(me!=null||Ee!=null))switch(fe){case"type":S=me;break;case"name":v=me;break;case"checked":ce=me;break;case"defaultChecked":xe=me;break;case"value":I=me;break;case"defaultValue":F=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,r));break;default:me!==Ee&&bt(a,r,fe,me,f,Ee)}}Pd(a,I,F,te,ce,xe,S,v);return;case"select":me=I=F=fe=null;for(S in u)if(te=u[S],u.hasOwnProperty(S)&&te!=null)switch(S){case"value":break;case"multiple":me=te;default:f.hasOwnProperty(S)||bt(a,r,S,null,f,te)}for(v in f)if(S=f[v],te=u[v],f.hasOwnProperty(v)&&(S!=null||te!=null))switch(v){case"value":fe=S;break;case"defaultValue":F=S;break;case"multiple":I=S;default:S!==te&&bt(a,r,v,S,f,te)}r=F,u=I,f=me,fe!=null?Ur(a,!!u,fe,!1):!!f!=!!u&&(r!=null?Ur(a,!!u,r,!0):Ur(a,!!u,u?[]:"",!1));return;case"textarea":me=fe=null;for(F in u)if(v=u[F],u.hasOwnProperty(F)&&v!=null&&!f.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:bt(a,r,F,null,f,v)}for(I in f)if(v=f[I],S=u[I],f.hasOwnProperty(I)&&(v!=null||S!=null))switch(I){case"value":fe=v;break;case"defaultValue":me=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:v!==S&&bt(a,r,I,v,f,S)}dg(a,fe,me);return;case"option":for(var De in u)if(fe=u[De],u.hasOwnProperty(De)&&fe!=null&&!f.hasOwnProperty(De))switch(De){case"selected":a.selected=!1;break;default:bt(a,r,De,null,f,fe)}for(te in f)if(fe=f[te],me=u[te],f.hasOwnProperty(te)&&fe!==me&&(fe!=null||me!=null))switch(te){case"selected":a.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:bt(a,r,te,fe,f,me)}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 ze in u)fe=u[ze],u.hasOwnProperty(ze)&&fe!=null&&!f.hasOwnProperty(ze)&&bt(a,r,ze,null,f,fe);for(ce in f)if(fe=f[ce],me=u[ce],f.hasOwnProperty(ce)&&fe!==me&&(fe!=null||me!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,r));break;default:bt(a,r,ce,fe,f,me)}return;default:if(Ud(r)){for(var yt in u)fe=u[yt],u.hasOwnProperty(yt)&&fe!==void 0&&!f.hasOwnProperty(yt)&&Ah(a,r,yt,void 0,f,fe);for(xe in f)fe=f[xe],me=u[xe],!f.hasOwnProperty(xe)||fe===me||fe===void 0&&me===void 0||Ah(a,r,xe,fe,f,me);return}}for(var re in u)fe=u[re],u.hasOwnProperty(re)&&fe!=null&&!f.hasOwnProperty(re)&&bt(a,r,re,null,f,fe);for(Ee in f)fe=f[Ee],me=u[Ee],!f.hasOwnProperty(Ee)||fe===me||fe==null&&me==null||bt(a,r,Ee,fe,f,me)}function pb(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dA(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var v=u[f],S=v.transferSize,I=v.initiatorType,F=v.duration;if(S&&F&&pb(I)){for(I=0,F=v.responseEnd,f+=1;f<u.length;f++){var te=u[f],ce=te.startTime;if(ce>F)break;var xe=te.transferSize,Ee=te.initiatorType;xe&&pb(Ee)&&(te=te.responseEnd,I+=xe*(te<F?1:(F-ce)/(te-ce)))}if(--f,r+=8*(S+I)/(v.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Ch=null,Nh=null;function Yu(a){return a.nodeType===9?a:a.ownerDocument}function gb(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xb(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function _h(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Mh=null;function fA(){var a=window.event;return a&&a.type==="popstate"?a===Mh?!1:(Mh=a,!0):(Mh=null,!1)}var bb=typeof setTimeout=="function"?setTimeout:void 0,hA=typeof clearTimeout=="function"?clearTimeout:void 0,yb=typeof Promise=="function"?Promise:void 0,mA=typeof queueMicrotask=="function"?queueMicrotask:typeof yb<"u"?function(a){return yb.resolve(null).then(a).catch(pA)}:bb;function pA(a){setTimeout(function(){throw a})}function Ai(a){return a==="head"}function vb(a,r){var u=r,f=0;do{var v=u.nextSibling;if(a.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"||u==="/&"){if(f===0){a.removeChild(v),xs(r);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")Oo(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Oo(u);for(var S=u.firstChild;S;){var I=S.nextSibling,F=S.nodeName;S[Qi]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=I}}else u==="body"&&Oo(a.ownerDocument.body);u=v}while(u);xs(r)}function Eb(a,r){var u=a;a=0;do{var f=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=f}while(u)}function Rh(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Rh(u),Br(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function gA(a,r,u,f){for(;a.nodeType===1;){var v=u;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[Qi])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var S=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=ta(a.nextSibling),a===null)break}return null}function xA(a,r,u){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=ta(a.nextSibling),a===null))return null;return a}function Tb(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=ta(a.nextSibling),a===null))return null;return a}function Dh(a){return a.data==="$?"||a.data==="$~"}function Lh(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function bA(a,r){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||u.readyState!=="loading")r();else{var f=function(){r(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function ta(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var Oh=null;function Sb(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(r===0)return ta(a.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}a=a.nextSibling}return null}function wb(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return a;r--}else u!=="/$"&&u!=="/&"||r++}a=a.previousSibling}return null}function kb(a,r,u){switch(r=Yu(u),a){case"html":if(a=r.documentElement,!a)throw Error(i(452));return a;case"head":if(a=r.head,!a)throw Error(i(453));return a;case"body":if(a=r.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Oo(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Br(a)}var na=new Map,Ab=new Set;function Gu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ja=X.d;X.d={f:yA,r:vA,D:EA,C:TA,L:SA,m:wA,X:AA,S:kA,M:CA};function yA(){var a=Ja.f(),r=Pu();return a||r}function vA(a){var r=Ia(a);r!==null&&r.tag===5&&r.type==="form"?V1(r):Ja.r(a)}var ms=typeof document>"u"?null:document;function Cb(a,r,u){var f=ms;if(f&&typeof r=="string"&&r){var v=Kn(r);v='link[rel="'+a+'"][href="'+v+'"]',typeof u=="string"&&(v+='[crossorigin="'+u+'"]'),Ab.has(v)||(Ab.add(v),a={rel:a,crossOrigin:u,href:r},f.querySelector(v)===null&&(r=f.createElement("link"),on(r,"link",a),Pt(r),f.head.appendChild(r)))}}function EA(a){Ja.D(a),Cb("dns-prefetch",a,null)}function TA(a,r){Ja.C(a,r),Cb("preconnect",a,r)}function SA(a,r,u){Ja.L(a,r,u);var f=ms;if(f&&a&&r){var v='link[rel="preload"][as="'+Kn(r)+'"]';r==="image"&&u&&u.imageSrcSet?(v+='[imagesrcset="'+Kn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(v+='[imagesizes="'+Kn(u.imageSizes)+'"]')):v+='[href="'+Kn(a)+'"]';var S=v;switch(r){case"style":S=ps(a);break;case"script":S=gs(a)}na.has(S)||(a=g({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:a,as:r},u),na.set(S,a),f.querySelector(v)!==null||r==="style"&&f.querySelector(Io(S))||r==="script"&&f.querySelector(jo(S))||(r=f.createElement("link"),on(r,"link",a),Pt(r),f.head.appendChild(r)))}}function wA(a,r){Ja.m(a,r);var u=ms;if(u&&a){var f=r&&typeof r.as=="string"?r.as:"script",v='link[rel="modulepreload"][as="'+Kn(f)+'"][href="'+Kn(a)+'"]',S=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=gs(a)}if(!na.has(S)&&(a=g({rel:"modulepreload",href:a},r),na.set(S,a),u.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(jo(S)))return}f=u.createElement("link"),on(f,"link",a),Pt(f),u.head.appendChild(f)}}}function kA(a,r,u){Ja.S(a,r,u);var f=ms;if(f&&a){var v=ja(f).hoistableStyles,S=ps(a);r=r||"default";var I=v.get(S);if(!I){var F={loading:0,preload:null};if(I=f.querySelector(Io(S)))F.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":r},u),(u=na.get(S))&&Ih(a,u);var te=I=f.createElement("link");Pt(te),on(te,"link",a),te._p=new Promise(function(ce,xe){te.onload=ce,te.onerror=xe}),te.addEventListener("load",function(){F.loading|=1}),te.addEventListener("error",function(){F.loading|=2}),F.loading|=4,Xu(I,r,f)}I={type:"stylesheet",instance:I,count:1,state:F},v.set(S,I)}}}function AA(a,r){Ja.X(a,r);var u=ms;if(u&&a){var f=ja(u).hoistableScripts,v=gs(a),S=f.get(v);S||(S=u.querySelector(jo(v)),S||(a=g({src:a,async:!0},r),(r=na.get(v))&&jh(a,r),S=u.createElement("script"),Pt(S),on(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(v,S))}}function CA(a,r){Ja.M(a,r);var u=ms;if(u&&a){var f=ja(u).hoistableScripts,v=gs(a),S=f.get(v);S||(S=u.querySelector(jo(v)),S||(a=g({src:a,async:!0,type:"module"},r),(r=na.get(v))&&jh(a,r),S=u.createElement("script"),Pt(S),on(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(v,S))}}function Nb(a,r,u,f){var v=(v=$.current)?Gu(v):null;if(!v)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=ps(u.href),u=ja(v).hoistableStyles,f=u.get(r),f||(f={type:"style",instance:null,count:0,state:null},u.set(r,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=ps(u.href);var S=ja(v).hoistableStyles,I=S.get(a);if(I||(v=v.ownerDocument||v,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,I),(S=v.querySelector(Io(a)))&&!S._p&&(I.instance=S,I.state.loading=5),na.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},na.set(a,u),S||NA(v,a,u,I.state))),r&&f===null)throw Error(i(528,""));return I}if(r&&f!==null)throw Error(i(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=gs(u),u=ja(v).hoistableScripts,f=u.get(r),f||(f={type:"script",instance:null,count:0,state:null},u.set(r,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function ps(a){return'href="'+Kn(a)+'"'}function Io(a){return'link[rel="stylesheet"]['+a+"]"}function _b(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function NA(a,r,u,f){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?f.loading=1:(r=a.createElement("link"),f.preload=r,r.addEventListener("load",function(){return f.loading|=1}),r.addEventListener("error",function(){return f.loading|=2}),on(r,"link",u),Pt(r),a.head.appendChild(r))}function gs(a){return'[src="'+Kn(a)+'"]'}function jo(a){return"script[async]"+a}function Mb(a,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var f=a.querySelector('style[data-href~="'+Kn(u.href)+'"]');if(f)return r.instance=f,Pt(f),f;var v=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),Pt(f),on(f,"style",v),Xu(f,u.precedence,a),r.instance=f;case"stylesheet":v=ps(u.href);var S=a.querySelector(Io(v));if(S)return r.state.loading|=4,r.instance=S,Pt(S),S;f=_b(u),(v=na.get(v))&&Ih(f,v),S=(a.ownerDocument||a).createElement("link"),Pt(S);var I=S;return I._p=new Promise(function(F,te){I.onload=F,I.onerror=te}),on(S,"link",f),r.state.loading|=4,Xu(S,u.precedence,a),r.instance=S;case"script":return S=gs(u.src),(v=a.querySelector(jo(S)))?(r.instance=v,Pt(v),v):(f=u,(v=na.get(S))&&(f=g({},u),jh(f,v)),a=a.ownerDocument||a,v=a.createElement("script"),Pt(v),on(v,"link",f),a.head.appendChild(v),r.instance=v);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(f=r.instance,r.state.loading|=4,Xu(f,u.precedence,a));return r.instance}function Xu(a,r,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,S=v,I=0;I<f.length;I++){var F=f[I];if(F.dataset.precedence===r)S=F;else if(S!==v)break}S?S.parentNode.insertBefore(a,S.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(a,r.firstChild))}function Ih(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function jh(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var Ku=null;function Rb(a,r,u){if(Ku===null){var f=new Map,v=Ku=new Map;v.set(u,f)}else v=Ku,f=v.get(u),f||(f=new Map,v.set(u,f));if(f.has(a))return f;for(f.set(a,null),u=u.getElementsByTagName(a),v=0;v<u.length;v++){var S=u[v];if(!(S[Qi]||S[$t]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var I=S.getAttribute(r)||"";I=a+I;var F=f.get(I);F?F.push(S):f.set(I,[S])}}return f}function Db(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function _A(a,r,u){if(u===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Lb(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function MA(a,r,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var v=ps(f.href),S=r.querySelector(Io(v));if(S){r=S._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=Qu.bind(a),r.then(a,a)),u.state.loading|=4,u.instance=S,Pt(S);return}S=r.ownerDocument||r,f=_b(f),(v=na.get(v))&&Ih(f,v),S=S.createElement("link"),Pt(S);var I=S;I._p=new Promise(function(F,te){I.onload=F,I.onerror=te}),on(S,"link",f),u.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=Qu.bind(a),r.addEventListener("load",u),r.addEventListener("error",u))}}var Ph=0;function RA(a,r){return a.stylesheets&&a.count===0&&Wu(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var f=setTimeout(function(){if(a.stylesheets&&Wu(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+r);0<a.imgBytes&&Ph===0&&(Ph=62500*dA());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Wu(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Ph?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function Qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wu(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var $u=null;function Wu(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,$u=new Map,r.forEach(DA,a),$u=null,Qu.call(a))}function DA(a,r){if(!(r.state.loading&4)){var u=$u.get(a);if(u)var f=u.get(null);else{u=new Map,$u.set(a,u);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var I=v[S];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(u.set(I.dataset.precedence,I),f=I)}f&&u.set(null,f)}v=r.instance,I=v.getAttribute("data-precedence"),S=u.get(I)||f,S===f&&u.set(null,v),u.set(I,v),this.count++,f=Qu.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),S?S.parentNode.insertBefore(v,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),r.state.loading|=4}}var Po={$$typeof:N,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function LA(a,r,u,f,v,S,I,F,te){this.tag=1,this.containerInfo=a,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=Yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yi(0),this.hiddenUpdates=Yi(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function Ob(a,r,u,f,v,S,I,F,te,ce,xe,Ee){return a=new LA(a,r,u,I,te,ce,xe,Ee,F),r=1,S===!0&&(r|=24),S=Ln(3,null,null,r),a.current=S,S.stateNode=a,r=gf(),r.refCount++,a.pooledCache=r,r.refCount++,S.memoizedState={element:f,isDehydrated:u,cache:r},vf(S),a}function Ib(a){return a?(a=Xr,a):Xr}function jb(a,r,u,f,v,S){v=Ib(v),f.context===null?f.context=v:f.pendingContext=v,f=pi(r),f.payload={element:u},S=S===void 0?null:S,S!==null&&(f.callback=S),u=gi(a,f,r),u!==null&&(Cn(u,a,r),po(u,a,r))}function Pb(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function Bh(a,r){Pb(a,r),(a=a.alternate)&&Pb(a,r)}function Bb(a){if(a.tag===13||a.tag===31){var r=er(a,67108864);r!==null&&Cn(r,a,67108864),Bh(a,67108864)}}function Ub(a){if(a.tag===13||a.tag===31){var r=Bn();r=Xs(r);var u=er(a,r);u!==null&&Cn(u,a,r),Bh(a,r)}}var Zu=!0;function OA(a,r,u,f){var v=H.T;H.T=null;var S=X.p;try{X.p=2,Uh(a,r,u,f)}finally{X.p=S,H.T=v}}function IA(a,r,u,f){var v=H.T;H.T=null;var S=X.p;try{X.p=8,Uh(a,r,u,f)}finally{X.p=S,H.T=v}}function Uh(a,r,u,f){if(Zu){var v=zh(f);if(v===null)kh(a,r,f,Ju,u),Hb(a,f);else if(PA(v,a,r,u,f))f.stopPropagation();else if(Hb(a,f),r&4&&-1<jA.indexOf(a)){for(;v!==null;){var S=Ia(v);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var I=ua(S.pendingLanes);if(I!==0){var F=S;for(F.pendingLanes|=2,F.entangledLanes|=2;I;){var te=1<<31-ft(I);F.entanglements[1]|=te,I&=~te}wa(S),(dt&6)===0&&(Iu=Ue()+500,Ro(0))}}break;case 31:case 13:F=er(S,2),F!==null&&Cn(F,S,2),Pu(),Bh(S,2)}if(S=zh(f),S===null&&kh(a,r,f,Ju,u),S===v)break;v=S}v!==null&&f.stopPropagation()}else kh(a,r,f,null,u)}}function zh(a){return a=Hd(a),Hh(a)}var Ju=null;function Hh(a){if(Ju=null,a=Xn(a),a!==null){var r=s(a);if(r===null)a=null;else{var u=r.tag;if(u===13){if(a=l(r),a!==null)return a;a=null}else if(u===31){if(a=c(r),a!==null)return a;a=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return Ju=a,null}function zb(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ie()){case he:return 2;case Te:return 8;case Re:case _e:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ci=null,Ni=null,_i=null,Bo=new Map,Uo=new Map,Mi=[],jA="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 Hb(a,r){switch(a){case"focusin":case"focusout":Ci=null;break;case"dragenter":case"dragleave":Ni=null;break;case"mouseover":case"mouseout":_i=null;break;case"pointerover":case"pointerout":Bo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(r.pointerId)}}function zo(a,r,u,f,v,S){return a===null||a.nativeEvent!==S?(a={blockedOn:r,domEventName:u,eventSystemFlags:f,nativeEvent:S,targetContainers:[v]},r!==null&&(r=Ia(r),r!==null&&Bb(r)),a):(a.eventSystemFlags|=f,r=a.targetContainers,v!==null&&r.indexOf(v)===-1&&r.push(v),a)}function PA(a,r,u,f,v){switch(r){case"focusin":return Ci=zo(Ci,a,r,u,f,v),!0;case"dragenter":return Ni=zo(Ni,a,r,u,f,v),!0;case"mouseover":return _i=zo(_i,a,r,u,f,v),!0;case"pointerover":var S=v.pointerId;return Bo.set(S,zo(Bo.get(S)||null,a,r,u,f,v)),!0;case"gotpointercapture":return S=v.pointerId,Uo.set(S,zo(Uo.get(S)||null,a,r,u,f,v)),!0}return!1}function Fb(a){var r=Xn(a.target);if(r!==null){var u=s(r);if(u!==null){if(r=u.tag,r===13){if(r=l(u),r!==null){a.blockedOn=r,Ki(a.priority,function(){Ub(u)});return}}else if(r===31){if(r=c(u),r!==null){a.blockedOn=r,Ki(a.priority,function(){Ub(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function ec(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=zh(a.nativeEvent);if(u===null){u=a.nativeEvent;var f=new u.constructor(u.type,u);zd=f,u.target.dispatchEvent(f),zd=null}else return r=Ia(u),r!==null&&Bb(r),a.blockedOn=u,!1;r.shift()}return!0}function Vb(a,r,u){ec(a)&&u.delete(r)}function BA(){Fh=!1,Ci!==null&&ec(Ci)&&(Ci=null),Ni!==null&&ec(Ni)&&(Ni=null),_i!==null&&ec(_i)&&(_i=null),Bo.forEach(Vb),Uo.forEach(Vb)}function tc(a,r){a.blockedOn===r&&(a.blockedOn=null,Fh||(Fh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,BA)))}var nc=null;function qb(a){nc!==a&&(nc=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nc===a&&(nc=null);for(var r=0;r<a.length;r+=3){var u=a[r],f=a[r+1],v=a[r+2];if(typeof f!="function"){if(Hh(f||u)===null)continue;break}var S=Ia(u);S!==null&&(a.splice(r,3),r-=3,zf(S,{pending:!0,data:v,method:u.method,action:f},f,v))}}))}function xs(a){function r(te){return tc(te,a)}Ci!==null&&tc(Ci,a),Ni!==null&&tc(Ni,a),_i!==null&&tc(_i,a),Bo.forEach(r),Uo.forEach(r);for(var u=0;u<Mi.length;u++){var f=Mi[u];f.blockedOn===a&&(f.blockedOn=null)}for(;0<Mi.length&&(u=Mi[0],u.blockedOn===null);)Fb(u),u.blockedOn===null&&Mi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var v=u[f],S=u[f+1],I=v[gt]||null;if(typeof S=="function")I||qb(u);else if(I){var F=null;if(S&&S.hasAttribute("formAction")){if(v=S,I=S[gt]||null)F=I.formAction;else if(Hh(v)!==null)continue}else F=I.action;typeof F=="function"?u[f+1]=F:(u.splice(f,3),f-=3),qb(u)}}}function Yb(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(I){return v=I})},focusReset:"manual",scroll:"manual"})}function r(){v!==null&&(v(),v=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),v!==null&&(v(),v=null)}}}function Vh(a){this._internalRoot=a}ac.prototype.render=Vh.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(i(409));var u=r.current,f=Bn();jb(u,f,a,r,null,null)},ac.prototype.unmount=Vh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;jb(a.current,2,null,a,null,null),Pu(),r[Oa]=null}};function ac(a){this._internalRoot=a}ac.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ks();a={blockedOn:null,target:a,priority:r};for(var u=0;u<Mi.length&&r!==0&&r<Mi[u].priority;u++);Mi.splice(u,0,a),u===0&&Fb(a)}};var Gb=t.version;if(Gb!=="19.2.8")throw Error(i(527,Gb,"19.2.8"));X.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=h(r),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var UA={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{Qe=ic.inject(UA),Ge=ic}catch{}}return Fo.createRoot=function(a,r){if(!o(a))throw Error(i(299));var u=!1,f="",v=J1,S=ex,I=tx;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(I=r.onRecoverableError)),r=Ob(a,1,!1,null,null,u,f,null,v,S,I,Yb),a[Oa]=r.current,wh(a),new Vh(r)},Fo.hydrateRoot=function(a,r,u){if(!o(a))throw Error(i(299));var f=!1,v="",S=J1,I=ex,F=tx,te=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(I=u.onCaughtError),u.onRecoverableError!==void 0&&(F=u.onRecoverableError),u.formState!==void 0&&(te=u.formState)),r=Ob(a,1,!0,r,u??null,f,v,te,S,I,F,Yb),r.context=Ib(null),u=r.current,f=Bn(),f=Xs(f),v=pi(f),v.callback=null,gi(u,v,f),u=f,r.current.lanes=u,Gi(r,u),wa(r),a[Oa]=r.current,wh(a),new ac(r)},Fo.version="19.2.8",Fo}var iy;function ZA(){if(iy)return Xh.exports;iy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xh.exports=WA(),Xh.exports}var JA=ZA();const eC=Ml(JA);/**
|
|
50
|
+
* @license lucide-react v0.468.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const tC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fE=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
|
|
55
|
+
* @license lucide-react v0.468.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var nC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
60
|
+
* @license lucide-react v0.468.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const aC=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:l,...c},d)=>R.createElement("svg",{ref:d,...nC,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:fE("lucide",o),...c},[...l.map(([h,m])=>R.createElement(h,m)),...Array.isArray(s)?s:[s]]));/**
|
|
65
|
+
* @license lucide-react v0.468.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const Me=(e,t)=>{const n=R.forwardRef(({className:i,...o},s)=>R.createElement(aC,{ref:s,iconNode:t,className:fE(`lucide-${tC(e)}`,i),...o}));return n.displayName=`${e}`,n};/**
|
|
70
|
+
* @license lucide-react v0.468.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const iC=Me("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
75
|
+
* @license lucide-react v0.468.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const a0=Me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
80
|
+
* @license lucide-react v0.468.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const rC=Me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
85
|
+
* @license lucide-react v0.468.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const sC=Me("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
|
|
90
|
+
* @license lucide-react v0.468.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const ii=Me("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
95
|
+
* @license lucide-react v0.468.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const oC=Me("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
100
|
+
* @license lucide-react v0.468.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const lC=Me("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
105
|
+
* @license lucide-react v0.468.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const Fn=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
110
|
+
* @license lucide-react v0.468.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const ap=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
115
|
+
* @license lucide-react v0.468.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const uC=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
120
|
+
* @license lucide-react v0.468.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const hE=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
125
|
+
* @license lucide-react v0.468.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const i0=Me("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
130
|
+
* @license lucide-react v0.468.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const ai=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
135
|
+
* @license lucide-react v0.468.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const cC=Me("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
140
|
+
* @license lucide-react v0.468.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const dC=Me("CircleSlash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
145
|
+
* @license lucide-react v0.468.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const Ms=Me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
150
|
+
* @license lucide-react v0.468.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const mE=Me("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
155
|
+
* @license lucide-react v0.468.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const pE=Me("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
160
|
+
* @license lucide-react v0.468.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const fC=Me("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
165
|
+
* @license lucide-react v0.468.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const gE=Me("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
|
|
170
|
+
* @license lucide-react v0.468.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const hC=Me("Dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);/**
|
|
175
|
+
* @license lucide-react v0.468.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const mC=Me("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
180
|
+
* @license lucide-react v0.468.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const Rl=Me("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
185
|
+
* @license lucide-react v0.468.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const xE=Me("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
|
|
190
|
+
* @license lucide-react v0.468.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const pC=Me("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/**
|
|
195
|
+
* @license lucide-react v0.468.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const gC=Me("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
200
|
+
* @license lucide-react v0.468.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const xC=Me("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
205
|
+
* @license lucide-react v0.468.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const bE=Me("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
|
|
210
|
+
* @license lucide-react v0.468.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const bC=Me("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
|
|
215
|
+
* @license lucide-react v0.468.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const yC=Me("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
220
|
+
* @license lucide-react v0.468.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const vC=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
225
|
+
* @license lucide-react v0.468.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const Hc=Me("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
230
|
+
* @license lucide-react v0.468.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const EC=Me("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
235
|
+
* @license lucide-react v0.468.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const ip=Me("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
240
|
+
* @license lucide-react v0.468.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const TC=Me("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
245
|
+
* @license lucide-react v0.468.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const rp=Me("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
|
|
250
|
+
* @license lucide-react v0.468.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const Dl=Me("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
255
|
+
* @license lucide-react v0.468.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const yE=Me("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
260
|
+
* @license lucide-react v0.468.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const SC=Me("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
265
|
+
* @license lucide-react v0.468.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const wC=Me("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
|
|
270
|
+
* @license lucide-react v0.468.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const kC=Me("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
275
|
+
* @license lucide-react v0.468.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const AC=Me("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
|
|
280
|
+
* @license lucide-react v0.468.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const ry=Me("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
285
|
+
* @license lucide-react v0.468.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const CC=Me("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
290
|
+
* @license lucide-react v0.468.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const NC=Me("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
295
|
+
* @license lucide-react v0.468.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const _C=Me("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
300
|
+
* @license lucide-react v0.468.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const MC=Me("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
305
|
+
* @license lucide-react v0.468.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const vl=Me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
310
|
+
* @license lucide-react v0.468.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/const sy=Me("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
|
|
315
|
+
* @license lucide-react v0.468.0 - ISC
|
|
316
|
+
*
|
|
317
|
+
* This source code is licensed under the ISC license.
|
|
318
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
+
*/const ud=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
320
|
+
* @license lucide-react v0.468.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/const Wh=Me("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/**
|
|
325
|
+
* @license lucide-react v0.468.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const vE=Me("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
|
|
330
|
+
* @license lucide-react v0.468.0 - ISC
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the ISC license.
|
|
333
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/const RC=Me("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
335
|
+
* @license lucide-react v0.468.0 - ISC
|
|
336
|
+
*
|
|
337
|
+
* This source code is licensed under the ISC license.
|
|
338
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
+
*/const DC=Me("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
|
340
|
+
* @license lucide-react v0.468.0 - ISC
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the ISC license.
|
|
343
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
+
*/const Ac=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
345
|
+
* @license lucide-react v0.468.0 - ISC
|
|
346
|
+
*
|
|
347
|
+
* This source code is licensed under the ISC license.
|
|
348
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
+
*/const LC=Me("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
350
|
+
* @license lucide-react v0.468.0 - ISC
|
|
351
|
+
*
|
|
352
|
+
* This source code is licensed under the ISC license.
|
|
353
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
+
*/const OC=Me("ScanText",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]);/**
|
|
355
|
+
* @license lucide-react v0.468.0 - ISC
|
|
356
|
+
*
|
|
357
|
+
* This source code is licensed under the ISC license.
|
|
358
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
+
*/const sp=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
360
|
+
* @license lucide-react v0.468.0 - ISC
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the ISC license.
|
|
363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/const IC=Me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
365
|
+
* @license lucide-react v0.468.0 - ISC
|
|
366
|
+
*
|
|
367
|
+
* This source code is licensed under the ISC license.
|
|
368
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
+
*/const Fc=Me("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
370
|
+
* @license lucide-react v0.468.0 - ISC
|
|
371
|
+
*
|
|
372
|
+
* This source code is licensed under the ISC license.
|
|
373
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
+
*/const op=Me("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
375
|
+
* @license lucide-react v0.468.0 - ISC
|
|
376
|
+
*
|
|
377
|
+
* This source code is licensed under the ISC license.
|
|
378
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
+
*/const jC=Me("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
380
|
+
* @license lucide-react v0.468.0 - ISC
|
|
381
|
+
*
|
|
382
|
+
* This source code is licensed under the ISC license.
|
|
383
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
+
*/const PC=Me("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/**
|
|
385
|
+
* @license lucide-react v0.468.0 - ISC
|
|
386
|
+
*
|
|
387
|
+
* This source code is licensed under the ISC license.
|
|
388
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
+
*/const r0=Me("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
390
|
+
* @license lucide-react v0.468.0 - ISC
|
|
391
|
+
*
|
|
392
|
+
* This source code is licensed under the ISC license.
|
|
393
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
+
*/const BC=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
395
|
+
* @license lucide-react v0.468.0 - ISC
|
|
396
|
+
*
|
|
397
|
+
* This source code is licensed under the ISC license.
|
|
398
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
+
*/const EE=Me("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
400
|
+
* @license lucide-react v0.468.0 - ISC
|
|
401
|
+
*
|
|
402
|
+
* This source code is licensed under the ISC license.
|
|
403
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
+
*/const UC=Me("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
405
|
+
* @license lucide-react v0.468.0 - ISC
|
|
406
|
+
*
|
|
407
|
+
* This source code is licensed under the ISC license.
|
|
408
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
+
*/const TE=Me("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
|
|
410
|
+
* @license lucide-react v0.468.0 - ISC
|
|
411
|
+
*
|
|
412
|
+
* This source code is licensed under the ISC license.
|
|
413
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
+
*/const Rs=Me("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
415
|
+
* @license lucide-react v0.468.0 - ISC
|
|
416
|
+
*
|
|
417
|
+
* This source code is licensed under the ISC license.
|
|
418
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
+
*/const zC=Me("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
420
|
+
* @license lucide-react v0.468.0 - ISC
|
|
421
|
+
*
|
|
422
|
+
* This source code is licensed under the ISC license.
|
|
423
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
+
*/const SE=Me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
425
|
+
* @license lucide-react v0.468.0 - ISC
|
|
426
|
+
*
|
|
427
|
+
* This source code is licensed under the ISC license.
|
|
428
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
+
*/const s0=Me("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
430
|
+
* @license lucide-react v0.468.0 - ISC
|
|
431
|
+
*
|
|
432
|
+
* This source code is licensed under the ISC license.
|
|
433
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
+
*/const ri=Me("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
435
|
+
* @license lucide-react v0.468.0 - ISC
|
|
436
|
+
*
|
|
437
|
+
* This source code is licensed under the ISC license.
|
|
438
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
+
*/const HC=Me("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
|
440
|
+
* @license lucide-react v0.468.0 - ISC
|
|
441
|
+
*
|
|
442
|
+
* This source code is licensed under the ISC license.
|
|
443
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
+
*/const FC=Me("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
445
|
+
* @license lucide-react v0.468.0 - ISC
|
|
446
|
+
*
|
|
447
|
+
* This source code is licensed under the ISC license.
|
|
448
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
+
*/const VC=Me("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
450
|
+
* @license lucide-react v0.468.0 - ISC
|
|
451
|
+
*
|
|
452
|
+
* This source code is licensed under the ISC license.
|
|
453
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
+
*/const lp=Me("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
455
|
+
* @license lucide-react v0.468.0 - ISC
|
|
456
|
+
*
|
|
457
|
+
* This source code is licensed under the ISC license.
|
|
458
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
+
*/const la=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
460
|
+
* @license lucide-react v0.468.0 - ISC
|
|
461
|
+
*
|
|
462
|
+
* This source code is licensed under the ISC license.
|
|
463
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
+
*/const o0=Me("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),be=new Proxy({},{get(e,t){if(typeof window>"u"||!window.api)throw new Error(`window.api 未注入(尝试访问 ${t})。请检查 preload 是否正确加载。`);const n=window.api[t];if(typeof n!="function")throw new Error(`window.api.${t} 不是函数`);return n}}),Vo=typeof navigator<"u"&&navigator.userAgent.includes("Electron"),qC=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function wE(e){if(!e)return 0;const t=(e.match(qC)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function YC(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function GC(e,t){const n=e.reduce((i,o)=>i+o,0);return n<=0||t<=0?e.map(()=>0):e.map(i=>t*i/n)}function bs(e){return e<1e3?String(Math.round(e)):e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.round(e/1e3)}k`}const kE=.5,XC=.9,KC=.85;var up=dE();const AE="lookatstudy-lang";let Vc=typeof localStorage>"u"?"zh-CN":localStorage.getItem(AE)||"zh-CN";const l0=new Set;function CE(e){return l0.add(e),()=>{l0.delete(e)}}const oy={"zh-CN":{"action.close":"关闭","action.delete":"删除","action.undo":"撤销","action.confirm":"确认","action.cancel":"取消","header.toggleLeft":"切换左栏 (Ctrl+B)","header.toggleRight":"切换右栏","header.font.smaller":"缩小字号","header.font.larger":"放大字号","header.settings":"设置 (Ctrl+S)","header.xp":"XP","header.theme.dark":"切换到亮色","header.theme.light":"切换到暗色","map.tab.map":"课程地图","map.tab.import":"导入课程","map.course.none":"未选择课程","map.review.label":"复习","map.search.label":"搜索","map.search.placeholder":"搜索章节、课时或内容…","map.search.close":"关闭","map.search.clear":"清空","map.search.noResults":"没有匹配的结果","map.search.contentGroup":"内容匹配","chat.action.startLearning":"开始学习「{title}」","chat.action.startLearningPrompt":`我想开始学「{title}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
|
|
465
|
+
1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
|
|
466
|
+
2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
|
|
467
|
+
3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
|
|
468
|
+
铁律:起手不要讲座、不要用 generate_quiz 出计分题、不要计分。把我勾住是唯一目标。`,"starter.go-deeper.label":"深入这点","starter.go-deeper.hint":"把刚揭晓的概念讲深一层","starter.go-deeper.message":"帮我深入讲讲「{title}」刚才那个核心点——展开它的结构、细节和容易忽略的边界。","starter.give-example.label":"举个例子","starter.give-example.hint":"用真实例子帮你看懂","starter.give-example.message":"给我一个「{title}」的实际例子或用法,让我更具体地理解。","starter.quiz-me.label":"考考我","starter.quiz-me.hint":"出题检验(答对涨掌握度)","starter.quiz-me.message":"出一道关于「{title}」的应用题考考我,看我是否真懂了——我答完请判断对错。","starter.confused.label":"我没太懂","starter.confused.hint":"告诉 AI 你卡在哪(会记下)","starter.confused.message":"关于「{title}」,我有地方不太懂,帮我理一理——先问我是哪里不清楚。","map.world.study":"学习","map.world.practice":"实操","pane.switcher":"视图切换","pane.map":"课程","pane.chat":"导师","pane.notes":"黑板","map.streaming.notice":"AI 正在回答,完成后可切换节点","map.generating":"正在生成课程路径…","map.empty.cta.title":"开始你的第一门课","map.empty.cta.desc":"导入一个 GitHub 学习仓库,自动生成选关路径","map.empty.cta.btn":"点这里导入 →","map.empty.practice":"这个课程暂无实操练习内容","node.locked.chapterHint":"(完成本章所有课时后解锁)","node.due.hint":"(待复习)","import.empty":"还没有课程。用下方导入第一个吧。","import.cta":"导入新课程","import.tab.url":"URL","import.tab.md":"MD","import.tab.folder":"文件夹","import.btn.url":"导入","import.btn.url.busy":"导入中…","import.placeholder.name":"课程名称","import.placeholder.md":"粘贴 Markdown 内容…","import.btn.md":"生成课程","import.btn.md.busy":"生成中…","import.folder.desc":"递归扫描 .txt/.md/.html/.pdf,适合已下载的课程资料包。","import.btn.folder":"选择文件夹","import.tab.pack":"课程包","import.btn.pack":"选择课程包文件导入","import.pack.desc":"课程包是别人分享的导入方案快照(零 AI 调用,秒过分类和结构设计)。GitHub 仓库内容一致时直接复用;有更新会自动丢弃消失文件对应的课。","import.export":"导出","import.folder.pathPlaceholder":"服务器侧文件夹路径(如 /storage/emulated/0/Download/我的课程)","import.folder.pathRequired":"请填写服务器侧文件夹路径","import.pack.export":"导出课程包(分享给别人零 AI 导入)","import.pack.exported":"课程包已导出:{path}","import.error.resume":"从断点重试(跳过已完成的 AI 步骤)","import.success.reused":"复用已有方案,零 AI 调用","import.btn.folder.busy":"处理中…","import.delete":"删除","import.delete.confirm":"所有进度和练习都会清除,无法撤销。","import.delete.current":"删除当前课程","course.empty.title":"选择一门课程开始学习","course.empty.desc":"从左侧「导入课程」面板选择一门已导入的课程,或导入新课程。","import.success.md":"生成成功","import.success.folder":"导入成功","import.error.network":`
|
|
469
|
+
|
|
470
|
+
网络受限或私有仓库请改用「Markdown」方式。`,"import.progress.elapsed":"已 {s}s","import.progress.title":"正在导入课程…","import.progress.starting":"正在启动…","import.progress.note":"导入在后台进行,可继续浏览其他课程","import.progress.cancel":"取消导入","import.cancelled":"已取消导入","toast.threadCreateFailed":"创建失败了,再试一次","toast.threadCreated":"新对话","toast.threadRenamed":"已重命名","toast.threadArchived":"已归档","toast.threadDeleted":"已删除","toast.threadDefault":"新会话","toast.restored":"已恢复","toast.noteSaved":"已加到笔记","toast.noteDeleted":"已删除笔记","toast.artifactSaved":"已记到笔记本","artifact.type.concept_map":"概念图","artifact.type.quiz":"练习题","artifact.type.compare_table":"对比表","artifact.type.diagram":"流程图","artifact.type.code_walkthrough":"代码讲解","artifact.type.unknown":"产物","command.placeholder":"输入指令或问题…(↑↓ 选择,Enter 确认)","command.empty.node":"没有匹配的命令","command.empty.nonode":"先在左侧选一个节点,才能用这些命令","command.footer.hint":"AI 导师会根据指令生成对应内容","command.footer.keys":"↵ 确认 · esc 关闭","command.group.node":"基于当前节点","command.group.mode":"学习模式","command.group.nav":"导航","command.explain_simple":"用大白话解释这一节","command.quiz_3":"出 3 道练习题考考我","command.concept_map":"画个概念图理清结构","command.compare_prev":"和上一节做对比表","command.socratic":"切到苏格拉底模式(提问引导)","command.exam_mode":"切到考试冲刺模式","review.title":"复习","review.nudge":"📅 今天有 {n} 个待复习,点左侧地图的「复习」入口巩固一下","review.loading":"正在检查哪些课该复习了…","review.empty.title":"还没有复习项","review.empty.desc":"完成一些练习后,这里会出现间隔复习提醒","review.due.count":"个待复习","review.start":"开始复习","review.shuffle":"混合练习(随机交错)","review.interleave":"交错复习","review.reviewLesson":"复习该课","review.selectSection":"选择章节","review.dueIn":"待复习","review.noDueInSection":"该章节暂无待复习内容","review.srsHint":"复习提醒","review.myProgress":"我的课程进度","review.overdueQuickHint":"逾期项,点击直接复习","review.quadrant.overdue":"逾期","review.quadrant.short":"短期","review.quadrant.long":"长期","review.quadrant.inactive":"待激活","review.quadrant.more":"更多","review.tip":"复习采用 SM-2 间隔重复算法。逾期项优先复习;长期记忆项间隔更长。单次复习封顶 {n} 题,避免积压压垮节奏。","review.selfrated":"✓ 已记录,掌握度已更新","review.selfrate.title":"复习完了吗?给自己打分","review.selfrate.again":"忘了","review.selfrate.again.hint":"明天重练","review.selfrate.remembered":"记得","review.selfrate.remembered.hint":"推迟几天","review.selfrate.mastered":"很熟","review.selfrate.mastered.hint":"很久后再看","lang.original":"原文","error.checkReadyFailed":"无法检查就绪状态","notebook.tab.explain":"讲解","notebook.tab.notes":"笔记","notebook.tab.board":"黑板","notebook.board.empty":"对话里产生概念图、流程图、对比表、代码讲解时,这里会实时展示最新的一幅大图,方便边看边问。","notebook.zone.understand":"理解","notebook.zone.note":"记录","notebook.zone.practice":"练习","notebook.empty.explain.title":"选一节课开始","notebook.empty.explain.desc":"在左侧地图选一个课时,这里会显示讲解内容","notebook.empty.notes.title":"还没有笔记","notebook.empty.notes.desc":"选中讲解文字画线,或让 AI 生成概念图/对比表,会出现在这里","settings.heading.provider":"AI 服务商","settings.heading.custom":"自定义 Provider","settings.heading.goal":"学习目标","settings.heading.language":"界面语言","settings.heading.multimodal":"多模态 / 图片","settings.group.ai":"AI 模型","settings.group.vision":"AI 看图","settings.group.appearance":"外观与语言","settings.row.provider":"服务商","settings.row.theme":"主题","settings.row.interface_lang":"界面语言","settings.row.import_lang":"导入偏好","settings.custom.form_title":"添加自定义 Provider","settings.footer.hint":"AI 模型区的改动需保存后生效,其余即时生效","settings.footer.save":"保存 AI 配置","header.energy":"今日能量","header.level.title":"等级(累计经验值的持久成长线,不随每日能量清零)","settings.title":"设置","view.tree":"技能树","view.dashboard":"仪表盘","view.import":"导入课程","mode.chat":"💬 对话","mode.exercise":"📝 练习","mode.settings":"⚙️ 设置","chat.starter.hint":"💡 从下面选一个开始,或者直接输入你的问题","chat.no_key.title":"还没有配置 AI 模型","chat.no_key.desc":"配置后即可开始 AI 导师对话和练习","chat.no_key.btn":"去配置模型","chat.input.placeholder":"问 AI 导师…(Enter 发送)","chat.input.no_node":"先在左侧选一个 lesson…","chat.send":"发送","chat.stop":"停止","chat.clear":"清空对话历史","chat.selection.quote":"提问这段","chat.soul.label":"风格:","chat.no_key.short":"未配置 AI 模型","chat.no_key.cta":"去配置 →","chat.attach.add":"添加图片或文件(可粘贴 / 拖拽)","chat.attach.remove":"移除 {name}","chat.attach.tooMany":"一条消息最多 {n} 个附件","chat.attach.tooLargeImage":"图片超过 5MB:{name}","chat.attach.tooLargeText":"文本文件超过 256KB:{name}","chat.attach.unsupported":"暂不支持该类型:{name}(支持图片与常见文本 / 代码文件)","chat.attach.visionUnsupported":"当前模型不支持看图,请用右侧模型切换器选一个带眼睛图标的模型,或在设置 → AI 看图里配置视觉模型覆盖","chat.attach.bridgeChip":"主模型是纯文本:图片将先由 {model} 转译成文字再交给它","chat.attach.preview":"查看 {name}","chat.attach.textChip":"文本附件,内容已随消息发给 AI","chat.attach.imageOnlyText":"请看这张图片。","context.label":"上下文","context.aria":"上下文已用 {p}","context.approx":"约","context.system":"系统提示","context.node":"课文","context.learner":"学习者状态","context.history":"对话历史","context.draft":"草稿","context.unknownWindow":"模型窗口未知","model.picker.label":"模型","model.picker.manage":"管理模型与密钥…","model.picker.vision":"支持看图","model.picker.noneConfigured":"还没有配置任何 provider 密钥","effort.label":"思考强度","effort.auto.label":"自动","effort.auto.desc":"模型默认行为,不干预","effort.fast.label":"快速","effort.fast.desc":"尽量关思考,答得快、省 token","effort.deep.label":"深度","effort.deep.desc":"尽量开思考,难题多想几步","effort.unsupported":"当前 provider 暂不支持思考强度切换","soul.direct":"精讲","soul.guide":"引导","soul.practice":"实战","soul.direct.desc":"精讲派 · 新手/想搞懂时用。先讲清楚再确认,给完整范例,不让你猜","soul.guide.desc":"引导派 · 有点基础、想自己推时用。不直接给答案,用引导性问题帮你推导","soul.practice.desc":"实战派 · 想动手时用。围绕真实世界的乱问题,在做中把概念织成网","settings.provider":"AI 服务商(Provider)","settings.model":"模型(Model)","settings.apikey":"API Key","settings.test":"测试连接","settings.testing":"测试中…","settings.save":"保存设置","settings.saved":"✅ 已保存","settings.daily_goal":"每日学习目标(XP)","settings.custom.add":"+ 添加自定义 Provider","settings.language":"语言(Language)","settings.add_custom":"自定义","settings.custom.label_ph":"名称","settings.custom.baseurl_ph":"Base URL(如 https://api.example.com/v1)","settings.custom.model_ph":"模型 ID","settings.custom.apikey_ph":"API Key(可选)","settings.custom.save":"保存","settings.custom.windowLabel":"上下文窗口(tokens)","settings.custom.windowPh":"如 128000 或 128k(留空 = 未知)","settings.custom.windowHint":"当前模型的最大上下文,可在模型官方文档查到。填了输入框旁的上下文表才会显示占比。","settings.delete_custom":"删除此自定义 Provider","settings.delete_custom_confirm":"删除自定义 Provider「{name}」?无法撤销。","settings.key.overwrite_ph":"覆盖…","settings.key.paste_ph":"粘贴 key","settings.key.get":"获取 →","settings.refresh":"刷新","settings.discovering":"刷新中…","settings.discover_failed":"刷新失败(可能网络受限)","settings.daily_goal.hint":"XP / 天(每答对一题 +10 XP)","settings.heading.theme":"外观","settings.theme.auto":"跟随系统","settings.theme.light":"浅色","settings.theme.dark":"深色","settings.theme.following":"当前跟随系统:{mode}","settings.heading.lang_pref":"语言偏好","settings.lang_pref.desc":"导入课程时自动按此偏好选择翻译。仓库原文语言与偏好一致时直接用原文;无对应翻译时也用原文。","settings.img_download":"图片下载","settings.img_download.desc":"导入课程时自动下载 md/notebook 里引用的图片(默认开启)","settings.multimodal.toggle":"AI 看图(聊天时)","settings.multimodal.toggle.desc":"开启后,聊天时 AI 能看到当前课关联的图片并讲解;问图/图表/架构图时生效(需 vision 模型)。导入时下载图片由上面的「图片下载」控制。","settings.group.memory":"学习者记忆","settings.memory.toggle":"让 AI 记住我","settings.memory.toggle.desc":"开启后,AI 会跨会话记住你的学习方式(偏好/卡点/反复混淆),越教越懂你。你拿皇冠(通关一节)时自动总结;也可手动触发。所有记忆只存本地。","settings.multimodal.current_model":"当前主模型:{model}","settings.multimodal.not_selected":"(未选)","settings.multimodal.hint_custom":"自定义 provider — 视觉能力未知。如不支持看图,在下方覆盖一个 vision 模型。","settings.multimodal.hint_preset":"如当前模型不支持 vision,可在下方配置专门的 vision 模型。常见:GLM-4V / GPT-4o / Claude 3.5 / Gemini。","settings.multimodal.override_title":"Vision 模型覆盖(可选 — 留空则复用主模型)","settings.multimodal.override_bridge_hint":"主模型不支持看图时,聊天中上传的图片会先由该模型转译成文字描述,再交给主模型解读(图像转译桥)。","settings.multimodal.no_override":"(不覆盖 — 用主模型)","settings.multimodal.group_preset":"预设 Provider","settings.multimodal.group_custom":"自定义 Provider","settings.multimodal.vision_capable":"vision","settings.multimodal.save_override":"保存覆盖配置","settings.multimodal.test_override":"测试模型","settings.saved_text":"已保存","settings.key.configured":"已配置","settings.custom.test_label":"(测试)","settings.proto.openai":"OpenAI 兼容","chat.empty.overview":"这是这一课的概览","chat.empty.summary.title":"本课摘要","chat.empty.summary.none":"暂无摘要,点开始学习让 AI 帮你了解这一课","chat.empty.start":"开始学习","chat.empty.greeting":"👋 准备好了吗?这一课我们慢慢来。","chat.empty.keyless.title":"内容已在右侧,先读一读","chat.empty.keyless.desc":"配置好 AI 模型,就能和我对练、做练习、追踪掌握度。","chat.empty.keyless.btn":"去配置 AI 模型","chat.empty.no_node.title":"从左侧地图选一个节点","chat.empty.no_node.desc":"点击圆球节点开始学习。绿色=可学,金色=已掌握,紫色=章节考试","chat.scroll.bottom":"回到底部","chat.speech.speak":"朗读这条消息","chat.speech.stop":"停止朗读","chat.speech.progress":"{n}/{total} 句","chat.speech.model_missing":"语音模型还没下载。到 设置 → 语音能力 下载后即可朗读。","chat.speech.engine_unavailable":"语音引擎未就位。桌面版开箱可用;Termux 端运行 bash install-termux.sh --voice 安装(约 12MB)。","chat.speech.dictation":"语音输入","chat.speech.dictation_stop":"结束听写","chat.speech.asr_model_missing":"语音输入模型还没下载。到 设置 → 语音能力 下载后即可说话。","chat.speech.asr_start_fail":"麦克风启动失败,请检查系统权限。","settings.speech.title":"语音能力","settings.speech.desc":"本地语音朗读与语音输入。模型下载后离线可用,不联网不上传。","settings.speech.model.tts":"朗读引擎(Kokoro,约 430MB)","settings.speech.model.asr":"语音输入引擎(Zipformer,约 200MB)","settings.speech.state.absent":"未下载","settings.speech.state.ready":"已就绪","settings.speech.state.error":"出错","settings.speech.download":"下载","settings.speech.delete":"删除","settings.speech.license":"Apache-2.0 · 本地推理","chat.friction.trigger":"我卡住了","chat.friction.hint":"选一个最接近的感受(可选写一句原因),AI 会记住并据此调整讲解。","chat.friction.confused":"糊涂","chat.friction.blocked":"卡住","chat.friction.frustrated":"受挫","chat.friction.desc_placeholder":"具体卡在哪了?(可选)","chat.friction.cancel":"取消","chat.friction.submit":"记下","chat.friction.saved":"已记下,AI 会据此调整这一课的讲法","chat.mastered.toast":"👑 太棒了!你掌握了这一课","chat.note.add":"加笔记","chat.note.add.title":"把这段对话存到记录区","chat.reasoning.label":"思考过程","chat.reasoning.chars":"{n} 字","chat.proposal.title":"AI 提议","chat.proposal.fallback":"提议({tool})","chat.proposal.apply":"应用","chat.proposal.reject":"拒绝","chat.proposal.mastered.title":"AI 建议你已掌握这节课","chat.proposal.mastered.hint":"采纳后本课解锁皇冠、进入复习排期。","chat.proposal.confirm":"确认掌握","chat.proposal.later":"再练练","chat.proposal.applied":"已采纳 · 本课已掌握","chat.proposal.rejected":"已忽略,继续学习","chat.copy":"复制","chat.copied":"已复制","chat.tool.get_node_info":"读取节点信息","chat.tool.record_answer":"记录答题观测","chat.tool.mark_mastered":"标记掌握","chat.tool.show_concept_map":"生成概念图","chat.tool.generate_quiz":"出练习题","chat.tool.compare_table":"生成对比表","chat.tool.draw_diagram":"画流程图","chat.tool.show_code_walkthrough":"代码讲解","thread.empty.no_node":"未选节点","thread.empty.hint":"输入问题开始","thread.actions.label":"操作","thread.new.label":"新建会话","thread.menu.rename":"重命名","thread.menu.archive":"归档","thread.delete.confirm":"删除会话「{name}」?消息也会一并删除。","notebook.empty.select_node":"从左侧地图选一个节点开始学习,讲解会显示在这里","notebook.empty.no_notes_message":"这一节还没有笔记。选中讲解文字「加笔记」,或问 AI「画个概念图」「出 3 道题」「做个对比表」","notebook.node_type.section":"章节","notebook.node_type.concept":"概念","notebook.node_type.lesson":"课时","notebook.content.loading":"正在加载这一节的讲解…","notebook.content.load_failed":"内容加载失败。","notebook.content.retry":"重试","notebook.content.render_failed":"这段内容渲染失败(可能翻译格式有问题)。","notebook.content.truncated":"…(截断)","notebook.content.retry_render":"重试渲染","notebook.content.empty":"这一节还没有讲解内容。问 AI 导师:「给我讲讲这一节」","notebook.images.heading":"插图({n})","notebook.quote.template":"关于这段内容「{text}」,我不太懂,请帮我解释:","notebook.quote.ask":"提问","notebook.quote.add_note":"加笔记","notebook.quote.save_note.title":"把选中文字存到记录区,带溯源跳转","notebook.quote.hint":"选中讲解文字点「加笔记」;AI 生成的概念图/对比表/练习卡会自动进「笔记」标签","notebook.source.label":"来源","notebook.source.jump_content":"跳到讲解原位","notebook.source.jump_chat":"跳到对话原位","notebook.zone.understand.subtitle":"AI 帮你梳理的知识结构","notebook.zone.understand.empty_hint":"问 AI「画个概念图」「做个对比表」梳理这一节","notebook.zone.note.subtitle":"你的画线,点击可跳回原位","notebook.zone.note.empty_hint":"选中讲解或对话的文字,点「加笔记」存到这里","notebook.zone.practice.subtitle_empty":"做题检验掌握,可重做","notebook.zone.practice.subtitle_stats":"{n} 题 · 上次答对 {c} · 答错 {w}","notebook.zone.practice.empty_hint":"问 AI「出 3 道题考考我」,题目会自动进这里","notebook.note.comment.ph_new":"写下你对这段画线的注释…","notebook.note.comment.ph_edit":"编辑注释…(清空保存即可删除)","notebook.action.save":"保存","notebook.action.cancel":"取消","notebook.note.edit_comment":"编辑注释","notebook.note.add_comment":"加注释","notebook.note.pinned":"已置顶","notebook.note.pin":"置顶","notebook.note.unpin":"取消置顶","notebook.note.delete":"删除","notebook.quiz.last_correct":"上次答对","notebook.quiz.last_wrong":"上次答错","notebook.artifact.broken":"产物数据损坏","notebook.asset.loading":"加载中…","exam.loading":"正在生成章节考试题…","exam.errorTitle":"考试加载失败","exam.errorEmpty":"题目生成失败,请稍后重试","exam.reload":"重新加载","exam.question.label":"第 {n} 题","exam.next":"下一题","exam.submit":"提交考试","exam.accuracy":"正确率 {n}%","exam.stars.congrats":"恭喜,获得 {n} 星!","exam.stars.thisAndBest":"本次 {n} 星 · 历史最佳 {m} 星","exam.stars.failed":"未达 60%,再接再厉","exam.review.title":"逐题回顾","exam.review.questionFallback":"(题目 {n})","exam.review.yourAnswer":"你的答案:","exam.review.correctAnswer":"正确:","exam.review.unanswered":"(未答)","exam.retry":"重新考试(题目已缓存)","exam.generating.title":"正在生成章节考试题…","exam.generating.stage":"AI 正在按本章知识点逐批出题","exam.generating.kcProgress":"已覆盖 {done} / {total} 个知识点","exam.generating.preparing":"准备中…","exam.generating.canLeave":"可以离开本页,生成会在后台继续;完成后会通知你。","exam.failed.retry":"重新生成","exam.ready.title":"考试已生成","exam.ready.meta":"{q} 题 · 覆盖 {kc} 个知识点 · 预计 {min} 分钟","exam.ready.toast":"「{title}」的考试题已生成,随时可以开考","exam.start":"开始考试","exam.retryExam":"重新考试","exam.regenerate":"重新出题","exam.regenerate.confirmMsg":"重新出题会丢弃当前题库,并让 AI 按本章知识点重新出一批(历史成绩保留)。","exam.submitting":"正在判分…","exam.q.progress":"第 {i} / {n} 题","exam.q.next":"下一题","exam.q.submit":"提交考试","exam.terminated.banner":"本场考试因中途离开被终止,未答的题按答错计分。","exam.result.score":"{correct} / {total} 题正确","exam.result.accuracy":"正确率 {pct}%","exam.result.best":"历史最好:{stars} 星","exam.result.attempts":"已考 {n} 次","exam.result.kcBreakdown":"按知识点","exam.result.weakKc":"薄弱 · 建议复习","exam.result.correctLabel":"答对","exam.result.unanswered":"未答","exam.result.yourAnswer":"你的答案:","exam.result.correctAnswer":"正确答案:","exam.result.review":"逐题回顾","exam.leave.title":"离开将终止考试","exam.leave.message":"未答的题将按答错计分,本场成绩会被记录。确定要离开吗?","exam.leave.confirm":"终止并离开","exam.leave.cancel":"继续考试","error.renderFailed":"这部分内容渲染失败(可能格式有问题)。","error.retry":"重试","artifact.unknownHeader":"产物(未识别类型)","artifact.zoomOut":"缩小","artifact.zoomReset":"重置缩放","artifact.zoomIn":"放大","artifact.canvas.fit":"适屏","artifact.viewer.open":"放大查看","artifact.viewer.hint":"双指缩放 · 单指拖动 · Ctrl+滚轮","artifact.conceptmap.stats":"{nodes} 个概念 · {edges} 个关系 · Ctrl+滚轮缩放 · 拖动平移","artifact.codewalk.sectionLabel":"逐段讲解(点击定位代码)","artifact.codewalk.lineSingle":"第 {n} 行","artifact.codewalk.lineRange":"第 {a}-{b} 行","artifact.diagram.flowchart":"流程图","artifact.diagram.sequence":"时序图","artifact.diagram.state":"状态图","artifact.mermaid.openLive":"在 mermaid.live 打开(可编辑)","artifact.mermaid.rendering":"渲染图中…","artifact.mermaid.renderFailed":"渲染失败,显示源码(可复制到 mermaid.live 查看)","artifact.mermaid.errorPrefix":"错误: {msg}","artifact.mermaid.hint":"Ctrl+滚轮缩放 · 拖动平移查看","quiz.questionProgress":"第 {cur}/{total} 题","quiz.answeredCorrect":"已答对 {n}","quiz.correct":"答对了","quiz.wrong":"答错了","quiz.finish":"完成练习","quiz.scoreSummary":"{correct}/{total} 答对","quiz.hook.label":"📊 答题完成:{{correct}}/{{total}}","quiz.hook.finish":"完成答题","quiz.hook.sent":"成绩单已交给导师,等待分析…","quiz.hook.message":`我刚做完了答题卡{{title}},成绩 {{correct}}/{{total}}。下面是逐题情况:
|
|
471
|
+
请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"quiz.hook.lineOk":"✅ 第{{n}}题「{{prompt}}」:答对","quiz.hook.lineWrong":"❌ 第{{n}}题「{{prompt}}」:我选了「{{chosen}}」,正确答案是「{{answer}}」","quiz.allCorrectHint":"全部答对,掌握度已提议更新","quiz.tryAgainHint":"再练一组巩固一下","quiz.action.nextPrompt":"接下来可以:","quiz.action.explainWrong":"讲讲我答错的","quiz.action.retry":"再来一组","quiz.action.goDeeper":"深入讲讲原理","quiz.action.markMastered":"确认我掌握了","quiz.action.nextTopic":"下一个知识点","guess.header":"来猜一个","guess.pickedPrefix":"我猜:","guess.waitReveal":"已猜,等 AI 揭晓 ⋯","import.deleted":"已删除:{title}","exercise.title":"📝 练习","exercise.generate":"出一道练习","exercise.submit":"提交答案","exercise.next":"下一题 →","exercise.correct":"✅ 答对了!","exercise.wrong":"❌ 答错了","exercise.types.mcq":"选择题","exercise.types.fill_blank":"填空题","exercise.types.true_false":"判断题","dashboard.title":"学习仪表盘","dashboard.stat.streak":"连续天数","dashboard.stat.due":"今日待复习","dashboard.stat.mastery":"整体掌握度","dashboard.review":"去复习","dashboard.cleared":"已清空","dashboard.export.md":"📄 导出报告","dashboard.export.json":"导出 JSON","dashboard.section_mastery":"按章节掌握度","dashboard.mini.sections":"章节掌握度","dashboard.mini.struggle":"你的薄弱点(点开重学)","import.title":"导入课程","import.url":"GitHub URL","import.markdown":"粘贴 Markdown","import.btn":"导入","import.md_btn":"生成课程","streak.days":"天","streak.title":"连续学习 {n} 天 · 最长 {m} 天","streak.freeze.title":"剩余冻结 {n} 个:漏签一天可自动保住连击"},en:{"action.close":"Close","action.delete":"Delete","action.undo":"Undo","action.confirm":"Confirm","action.cancel":"Cancel","header.toggleLeft":"Toggle left pane (Ctrl+B)","header.toggleRight":"Toggle right pane","header.font.smaller":"Decrease font size","header.font.larger":"Increase font size","header.settings":"Settings (Ctrl+S)","header.xp":"XP","header.theme.dark":"Switch to light","header.theme.light":"Switch to dark","map.tab.map":"Course Map","map.tab.import":"Import","map.course.none":"No course selected","map.review.label":"Review","map.search.label":"Search","map.search.placeholder":"Search chapters, lessons or content…","map.search.close":"Close","map.search.clear":"Clear","map.search.noResults":"No results","map.search.contentGroup":"Content matches","chat.action.startLearning":"Start learning “{title}”","chat.action.startLearningPrompt":`I want to start learning “{title}”, but I'm low on energy right now — don't lecture me with concepts and don't quiz me with scored questions. Open like this instead:
|
|
472
|
+
1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
|
|
473
|
+
2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
|
|
474
|
+
3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
|
|
475
|
+
Iron rules: no lecture to start, no generate_quiz scored questions, no scoring. Hooking me is the only goal.`,"starter.go-deeper.label":"Go deeper","starter.go-deeper.hint":"Unpack the concept one level down","starter.go-deeper.message":"Go deeper on “{title}” — expand the structure, the details, and the easy-to-miss edge cases of the core point we just uncovered.","starter.give-example.label":"Give an example","starter.give-example.hint":"Make it concrete with a real example","starter.give-example.message":"Give me a concrete example or use case for “{title}” so I can understand it more tangibly.","starter.quiz-me.label":"Quiz me","starter.quiz-me.hint":"Retrieve and apply (correct answers raise mastery)","starter.quiz-me.message":"Quiz me with one applied question about “{title}” to check whether I really get it — judge my answer when I respond.","starter.confused.label":"I'm lost","starter.confused.hint":"Tell the AI where you're stuck (it takes notes)","starter.confused.message":"I'm fuzzy on part of “{title}” — help me untangle it, and start by asking which part isn't clear.","map.world.study":"Learn","map.world.practice":"Practice","pane.switcher":"Switch view","pane.map":"Course","pane.chat":"Tutor","pane.notes":"Blackboard","map.streaming.notice":"AI is responding. Switch nodes after it finishes.","map.generating":"Generating course path…","map.empty.cta.title":"Start your first course","map.empty.cta.desc":"Import a GitHub learning repo to auto-generate a skill path","map.empty.cta.btn":"Click to import →","map.empty.practice":"No practice content for this course","node.locked.chapterHint":"(unlocks after completing all lessons in this chapter)","node.due.hint":"(due for review)","import.empty":"No courses yet. Import your first one below.","import.cta":"Import New Course","import.tab.url":"URL","import.tab.md":"MD","import.tab.folder":"Folder","import.btn.url":"Import","import.btn.url.busy":"Importing…","import.placeholder.name":"Course name","import.placeholder.md":"Paste Markdown content…","import.btn.md":"Generate Course","import.btn.md.busy":"Generating…","import.folder.desc":"Recursively scans .txt/.md/.html/.pdf. For downloaded course material packs.","import.btn.folder":"Select Folder","import.tab.pack":"Pack","import.btn.pack":"Pick a course pack file","import.pack.desc":"A course pack is a shared import-plan snapshot — zero AI calls, classification and structure design are instant. Reused as-is when the GitHub repo matches; if the repo moved on, lessons pointing at removed files are dropped automatically.","import.export":"Export","import.folder.pathPlaceholder":"Server-side folder path (e.g. /storage/emulated/0/Download/my-course)","import.folder.pathRequired":"Enter the server-side folder path first","import.pack.export":"Export course pack (share for zero-AI import)","import.pack.exported":"Course pack exported: {path}","import.error.resume":"Retry from checkpoint (skips finished AI steps)","import.success.reused":"reused saved plan, zero AI calls","import.btn.folder.busy":"Processing…","import.delete":"Delete","import.delete.confirm":"All progress and exercises will be erased. This cannot be undone.","import.delete.current":"Delete current course","course.empty.title":"Pick a course to start learning","course.empty.desc":"Choose an imported course from the Import panel on the left, or import a new one.","import.success.md":"Generated","import.success.folder":"Imported","import.error.network":`
|
|
476
|
+
|
|
477
|
+
For restricted networks or private repos, use the Markdown method.`,"import.progress.elapsed":"{s}s elapsed","import.progress.title":"Importing course…","import.progress.starting":"Starting…","import.progress.note":"Import runs in the background — keep browsing other courses","import.progress.cancel":"Cancel import","import.cancelled":"Import cancelled","toast.threadCreateFailed":"Couldn't create — try again","toast.threadCreated":"New chat","toast.threadRenamed":"Renamed","toast.threadArchived":"Archived","toast.threadDeleted":"Deleted","toast.threadDefault":"New thread","toast.restored":"Restored","toast.noteSaved":"Added to notes","toast.noteDeleted":"Note deleted","toast.artifactSaved":"Saved to notebook","artifact.type.concept_map":"Concept Map","artifact.type.quiz":"Quiz","artifact.type.compare_table":"Comparison Table","artifact.type.diagram":"Diagram","artifact.type.code_walkthrough":"Code Walkthrough","artifact.type.unknown":"Artifact","command.placeholder":"Type a command or question… (↑↓ to select, Enter to confirm)","command.empty.node":"No matching commands","command.empty.nonode":"Select a node on the left first","command.footer.hint":"The AI tutor generates content based on your command","command.footer.keys":"↵ confirm · esc to close","command.group.node":"Current Node","command.group.mode":"Study Mode","command.group.nav":"Navigation","command.explain_simple":"Explain this section in plain words","command.quiz_3":"Give me 3 practice questions","command.concept_map":"Draw a concept map","command.compare_prev":"Compare with the previous section","command.socratic":"Switch to Socratic mode (guided questions)","command.exam_mode":"Switch to Exam prep mode","review.title":"Review","review.nudge":"📅 {n} review(s) due today — tap the Review entry in the map to consolidate","review.loading":"Checking what to review…","review.empty.title":"No reviews yet","review.empty.desc":"Complete some exercises and spaced-repetition reminders will appear here","review.due.count":"due","review.start":"Start Review","review.shuffle":"Shuffle (interleaved)","review.interleave":"Interleaved Review","review.reviewLesson":"Review","review.selectSection":"Select a section","review.dueIn":"due","review.noDueInSection":"No reviews in this section","review.srsHint":"Review Reminders","review.myProgress":"My Progress","review.overdueQuickHint":"Overdue items — click to review","review.quadrant.overdue":"Overdue","review.quadrant.short":"Short-term","review.quadrant.long":"Long-term","review.quadrant.inactive":"Inactive","review.quadrant.more":"more","review.tip":"Review uses the SM-2 spaced repetition algorithm. Overdue items first; long-term memory items have longer intervals. Capped at {n} items per session to avoid backlog overwhelm.","review.selfrated":"✓ Recorded. Mastery updated.","review.selfrate.title":"Done reviewing? Rate yourself","review.selfrate.again":"Forgot","review.selfrate.again.hint":"Review tomorrow","review.selfrate.remembered":"Recalled","review.selfrate.remembered.hint":"In a few days","review.selfrate.mastered":"Easy","review.selfrate.mastered.hint":"Much later","lang.original":"Original","error.checkReadyFailed":"Could not check readiness","notebook.tab.explain":"Explain","notebook.tab.notes":"Notes","notebook.tab.board":"Blackboard","notebook.board.empty":"When the tutor produces a concept map, diagram, comparison table, or code walkthrough in chat, the latest one is rendered here in full size.","notebook.zone.understand":"Understand","notebook.zone.note":"Notes","notebook.zone.practice":"Practice","notebook.empty.explain.title":"Pick a lesson to start","notebook.empty.explain.desc":"Select a lesson in the map on the left; its explanation shows here.","notebook.empty.notes.title":"No notes yet","notebook.empty.notes.desc":"Highlight text in the explanation, or have the AI generate a concept map / comparison table — it shows up here.","settings.heading.provider":"AI Provider","settings.heading.custom":"Custom Provider","settings.heading.goal":"Study Goal","settings.heading.language":"Interface Language","settings.heading.multimodal":"Multimodal / Images","settings.group.ai":"AI Model","settings.group.vision":"AI Vision","settings.group.appearance":"Appearance & Language","settings.row.provider":"Provider","settings.row.theme":"Theme","settings.row.interface_lang":"Interface language","settings.row.import_lang":"Import preference","settings.custom.form_title":"Add custom provider","settings.footer.hint":"AI Model changes need Save; everything else is instant.","settings.footer.save":"Save AI config","header.energy":"Today's energy","header.level.title":"Level (cumulative XP growth line — doesn't reset with daily energy)","settings.title":"Settings","view.tree":"Skill Tree","view.dashboard":"Dashboard","view.import":"Import Course","mode.chat":"💬 Chat","mode.exercise":"📝 Practice","mode.settings":"⚙️ Settings","chat.starter.hint":"💡 Pick one to start, or type your question","chat.no_key.title":"No AI model configured","chat.no_key.desc":"Configure a model to start AI tutoring and practice","chat.no_key.btn":"Configure Model","chat.input.placeholder":"Ask your AI tutor… (Enter to send)","chat.input.no_node":"Select a lesson on the left…","chat.send":"Send","chat.stop":"Stop","chat.clear":"Clear chat history","chat.selection.quote":"Ask about this","chat.soul.label":"Style:","chat.no_key.short":"AI model not configured","chat.no_key.cta":"Configure →","chat.attach.add":"Add image or file (paste / drag also works)","chat.attach.remove":"Remove {name}","chat.attach.tooMany":"Up to {n} attachments per message","chat.attach.tooLargeImage":"Image over 5MB: {name}","chat.attach.tooLargeText":"Text file over 256KB: {name}","chat.attach.unsupported":"Unsupported type: {name} (images and common text / code files)","chat.attach.visionUnsupported":"Current model can't see images — pick one with the eye icon in the model switcher, or set a vision model override in Settings → AI vision","chat.attach.bridgeChip":"Main model is text-only: images will be transcribed to text by {model} first","chat.attach.preview":"View {name}","chat.attach.textChip":"Text attachment, content sent with the message","chat.attach.imageOnlyText":"Please look at this image.","context.label":"Context","context.aria":"{p} of context used","context.approx":"~","context.system":"System prompt","context.node":"Lesson","context.learner":"Learner state","context.history":"History","context.draft":"Draft","context.unknownWindow":"model window unknown","model.picker.label":"Model","model.picker.manage":"Manage models & keys…","model.picker.vision":"Vision capable","model.picker.noneConfigured":"No provider key configured yet","effort.label":"Thinking effort","effort.auto.label":"Auto","effort.auto.desc":"Model default, no override","effort.fast.label":"Fast","effort.fast.desc":"Thinking off when possible — quicker, fewer tokens","effort.deep.label":"Deep","effort.deep.desc":"Thinking on when possible — extra steps for hard problems","effort.unsupported":"Current provider doesn't support effort switching","soul.direct":"Direct","soul.guide":"Guide","soul.practice":"Practice","soul.direct.desc":"Direct · for beginners or low energy. Explains clearly then checks, gives full worked examples — never makes you guess","soul.guide.desc":"Guide · when you have some footing and want to reason it out. No direct answers — guiding questions help you derive it","soul.practice.desc":"Practice · for hands-on learners. Each concept lands on a messy real-world problem; learn by doing and connect the dots","settings.provider":"AI Provider","settings.model":"Model","settings.apikey":"API Key","settings.test":"Test Connection","settings.testing":"Testing…","settings.save":"Save Settings","settings.saved":"✅ Saved","settings.daily_goal":"Daily Goal (XP)","settings.custom.add":"+ Add Custom Provider","settings.language":"Language","settings.add_custom":"Custom","settings.custom.label_ph":"Name","settings.custom.baseurl_ph":"Base URL (e.g. https://api.example.com/v1)","settings.custom.model_ph":"Model ID","settings.custom.apikey_ph":"API Key (optional)","settings.custom.save":"Save","settings.custom.windowLabel":"Context window (tokens)","settings.custom.windowPh":"e.g. 128000 or 128k (empty = unknown)","settings.custom.windowHint":"Max context of the current model, found in its official docs. The composer context meter only shows a percentage when this is set.","settings.delete_custom":"Delete this custom provider","settings.delete_custom_confirm":'Delete custom provider "{name}"? This cannot be undone.',"settings.key.overwrite_ph":"Overwrite…","settings.key.paste_ph":"Paste key","settings.key.get":"Get key →","settings.refresh":"Refresh","settings.discovering":"Refreshing…","settings.discover_failed":"Refresh failed (network may be restricted)","settings.daily_goal.hint":"XP / day (+10 XP per correct answer)","settings.heading.theme":"Appearance","settings.theme.auto":"System","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.following":"Following system: {mode}","settings.heading.lang_pref":"Language Preference","settings.lang_pref.desc":"When importing a course, auto-pick the translation matching this preference. If the repo's source language already matches, the original is used; if no translation exists, the original is used as well.","settings.img_download":"Image download","settings.img_download.desc":"Auto-download images referenced in markdown/notebooks during import (on by default)","settings.multimodal.toggle":"AI vision (in chat)","settings.multimodal.toggle.desc":"When on, the AI can see and explain this lesson's images during chat — used for diagrams/charts/architecture (needs a vision model). Import-time image download is controlled by “Image download” above.","settings.group.memory":"Learner memory","settings.memory.toggle":"Let the AI remember me","settings.memory.toggle.desc":"When on, the AI remembers how you learn across sessions (preferences / stuck points / recurring confusions) and adapts over time. Auto-summarized when you earn a crown (clear a node); also manually triggerable. All memory stays local.","settings.multimodal.current_model":"Current main model: {model}","settings.multimodal.not_selected":"(none)","settings.multimodal.hint_custom":"Custom provider — vision capability unknown. If it can't see images, override a vision model below.","settings.multimodal.hint_preset":"If the current model lacks vision, configure a dedicated vision model below. Common: GLM-4V / GPT-4o / Claude 3.5 / Gemini.","settings.multimodal.override_title":"Vision model override (optional — leave blank to reuse main model)","settings.multimodal.override_bridge_hint":"When the main model is text-only, images uploaded in chat are transcribed to text by this model before reaching the main model (image bridge).","settings.multimodal.no_override":"(no override — use main model)","settings.multimodal.group_preset":"Preset providers","settings.multimodal.group_custom":"Custom providers","settings.multimodal.vision_capable":"vision","settings.multimodal.save_override":"Save override","settings.multimodal.test_override":"Test model","settings.saved_text":"Saved","settings.key.configured":"Configured","settings.custom.test_label":"(test)","settings.proto.openai":"OpenAI-compatible","chat.empty.overview":"Overview of this lesson","chat.empty.summary.title":"Lesson Summary","chat.empty.summary.none":"No summary yet — click Start to let the AI walk you through this lesson.","chat.empty.start":"Start Learning","chat.empty.greeting":"👋 Ready? Let's take this one step at a time.","chat.empty.keyless.title":"The lesson is on the right — give it a read","chat.empty.keyless.desc":"Configure an AI model to practice with me, do exercises, and track mastery.","chat.empty.keyless.btn":"Configure AI model","chat.empty.no_node.title":"Pick a node from the map on the left","chat.empty.no_node.desc":"Click a node to start learning. Green = available, Gold = mastered, Purple = chapter exam","chat.scroll.bottom":"Scroll to bottom","chat.speech.speak":"Read aloud","chat.speech.stop":"Stop reading","chat.speech.progress":"{n}/{total}","chat.speech.model_missing":"Speech model not downloaded yet. Get it in Settings → Speech.","chat.speech.engine_unavailable":"Speech engine not installed. Desktop has it built in; on Termux run: bash install-termux.sh --voice (~12MB).","chat.speech.dictation":"Voice input","chat.speech.dictation_stop":"Stop dictation","chat.speech.asr_model_missing":"Voice input model not downloaded yet. Get it in Settings → Speech.","chat.speech.asr_start_fail":"Microphone failed to start. Check system permissions.","settings.speech.title":"Speech","settings.speech.desc":"Local text-to-speech and voice input. Models run offline once downloaded.","settings.speech.model.tts":"Read-aloud engine (Kokoro, ~430MB)","settings.speech.model.asr":"Voice input engine (Zipformer, ~200MB)","settings.speech.state.absent":"Not downloaded","settings.speech.state.ready":"Ready","settings.speech.state.error":"Error","settings.speech.download":"Download","settings.speech.delete":"Delete","settings.speech.license":"Apache-2.0 · local inference","chat.friction.trigger":"I'm stuck","chat.friction.hint":"Pick what fits (optional one-liner). The AI will remember and adapt how it teaches this.","chat.friction.confused":"Confused","chat.friction.blocked":"Blocked","chat.friction.frustrated":"Frustrated","chat.friction.desc_placeholder":"Where exactly? (optional)","chat.friction.cancel":"Cancel","chat.friction.submit":"Log it","chat.friction.saved":"Logged — the AI will adapt how it teaches this lesson","chat.mastered.toast":"👑 You mastered this lesson!","chat.note.add":"Add note","chat.note.add.title":"Save this message to your notes","chat.reasoning.label":"Reasoning","chat.reasoning.chars":"{n} chars","chat.proposal.title":"AI Proposal","chat.proposal.fallback":"Proposal ({tool})","chat.proposal.apply":"Apply","chat.proposal.reject":"Reject","chat.proposal.mastered.title":"AI suggests you've mastered this lesson","chat.proposal.mastered.hint":"Accept to unlock the crown and schedule reviews.","chat.proposal.confirm":"Confirm mastery","chat.proposal.later":"Keep practicing","chat.proposal.applied":"Accepted · lesson mastered","chat.proposal.rejected":"Dismissed, keep learning","chat.copy":"Copy","chat.copied":"Copied","chat.tool.get_node_info":"Read node info","chat.tool.record_answer":"Record answer","chat.tool.mark_mastered":"Mark mastered","chat.tool.show_concept_map":"Generate concept map","chat.tool.generate_quiz":"Generate quiz","chat.tool.compare_table":"Generate comparison table","chat.tool.draw_diagram":"Draw diagram","chat.tool.show_code_walkthrough":"Code walkthrough","thread.empty.no_node":"No node selected","thread.empty.hint":"Type to start","thread.actions.label":"Actions","thread.new.label":"New thread","thread.menu.rename":"Rename","thread.menu.archive":"Archive","thread.delete.confirm":'Delete thread "{name}"? Messages will also be deleted.',"notebook.empty.select_node":"Pick a node from the map on the left — its explanation shows here.","notebook.empty.no_notes_message":'No notes for this lesson yet. Select explanation text to "Add note", or ask the AI to "draw a concept map", "generate 3 questions", or "make a comparison table".',"notebook.node_type.section":"Chapter","notebook.node_type.concept":"Concept","notebook.node_type.lesson":"Lesson","notebook.content.loading":"Loading this lesson…","notebook.content.load_failed":"Failed to load content. ","notebook.content.retry":"Retry","notebook.content.render_failed":"This content failed to render (possibly malformed translation).","notebook.content.truncated":"…(truncated)","notebook.content.retry_render":"Retry render","notebook.content.empty":'No explanation for this lesson yet. Ask the AI tutor: "Walk me through this lesson."',"notebook.images.heading":"Images ({n})","notebook.quote.template":"About this passage 「{text}」, I don't quite get it. Please explain:","notebook.quote.ask":"Ask","notebook.quote.add_note":"Add note","notebook.quote.save_note.title":"Save the selected text to your notes (with source jump)","notebook.quote.hint":"Select any text in the explanation to add a note; AI-generated concept maps, comparison tables, and quiz cards land in the Notes tab automatically.","notebook.source.label":"Source","notebook.source.jump_content":"Jump to explanation","notebook.source.jump_chat":"Jump to chat message","notebook.zone.understand.subtitle":"Knowledge structure the AI lays out for you","notebook.zone.understand.empty_hint":'Ask the AI to "draw a concept map" or "make a comparison table" to structure this lesson',"notebook.zone.note.subtitle":"Your highlights — click to jump back to source","notebook.zone.note.empty_hint":'Select text in the explanation or chat, then "Add note" to save here',"notebook.zone.practice.subtitle_empty":"Test your grasp; redoable","notebook.zone.practice.subtitle_stats":"{n} questions · last correct {c} · wrong {w}","notebook.zone.practice.empty_hint":'Ask the AI "give me 3 questions" — they land here',"notebook.note.comment.ph_new":"Write a note about this highlight…","notebook.note.comment.ph_edit":"Edit note… (clear + save to delete)","notebook.action.save":"Save","notebook.action.cancel":"Cancel","notebook.note.edit_comment":"Edit note","notebook.note.add_comment":"Add note","notebook.note.pinned":"Pinned","notebook.note.pin":"Pin","notebook.note.unpin":"Unpin","notebook.note.delete":"Delete","notebook.quiz.last_correct":"Last correct","notebook.quiz.last_wrong":"Last wrong","notebook.artifact.broken":"Broken artifact data","notebook.asset.loading":"Loading…","exam.loading":"Generating exam questions…","exam.errorTitle":"Exam failed to load","exam.errorEmpty":"Failed to generate questions. Please try again later.","exam.reload":"Reload","exam.question.label":"Question {n}","exam.next":"Next","exam.submit":"Submit Exam","exam.accuracy":"Accuracy {n}%","exam.stars.congrats":"Congratulations! {n} stars earned!","exam.stars.thisAndBest":"This run: {n} stars · Best: {m} stars","exam.stars.failed":"Below 60%. Keep practicing!","exam.review.title":"Question Review","exam.review.questionFallback":"(Question {n})","exam.review.yourAnswer":"Your answer:","exam.review.correctAnswer":"Correct:","exam.review.unanswered":"(no answer)","exam.retry":"Retake exam (questions cached)","exam.generating.title":"Generating chapter exam…","exam.generating.stage":"AI is writing questions knowledge point by knowledge point","exam.generating.kcProgress":"{done} / {total} knowledge points covered","exam.generating.preparing":"Preparing…","exam.generating.canLeave":"You can leave this page — generation continues in the background and you'll be notified.","exam.failed.retry":"Regenerate","exam.ready.title":"Exam ready","exam.ready.meta":"{q} questions · {kc} knowledge points · ~{min} min","exam.ready.toast":'Exam questions for "{title}" are ready',"exam.start":"Start exam","exam.retryExam":"Retake exam","exam.regenerate":"New questions","exam.regenerate.confirmMsg":"Regenerating discards the current questions and has the AI write a fresh set for this chapter (past scores are kept).","exam.submitting":"Grading…","exam.q.progress":"Question {i} / {n}","exam.q.next":"Next","exam.q.submit":"Submit exam","exam.terminated.banner":"This attempt was terminated by leaving mid-exam. Unanswered questions were counted as wrong.","exam.result.score":"{correct} / {total} correct","exam.result.accuracy":"Accuracy {pct}%","exam.result.best":"Best: {stars} stars","exam.result.attempts":"{n} attempts","exam.result.kcBreakdown":"By knowledge point","exam.result.weakKc":"Weak · review suggested","exam.result.correctLabel":"Correct","exam.result.unanswered":"No answer","exam.result.yourAnswer":"Your answer:","exam.result.correctAnswer":"Correct answer:","exam.result.review":"Question review","exam.leave.title":"Leaving will end the exam","exam.leave.message":"Unanswered questions will be counted as wrong and this attempt will be recorded. Leave anyway?","exam.leave.confirm":"End and leave","exam.leave.cancel":"Keep going","error.renderFailed":"This content failed to render (possibly malformed).","error.retry":"Retry","artifact.unknownHeader":"Artifact (unknown type)","artifact.zoomOut":"Zoom out","artifact.zoomReset":"Reset zoom","artifact.zoomIn":"Zoom in","artifact.canvas.fit":"Fit","artifact.viewer.open":"Open large view","artifact.viewer.hint":"Pinch to zoom · drag to pan · Ctrl+scroll","artifact.conceptmap.stats":"{nodes} concepts · {edges} relations · Ctrl+scroll to zoom · drag to pan","artifact.codewalk.sectionLabel":"Step-by-step notes (click to jump to code)","artifact.codewalk.lineSingle":"Line {n}","artifact.codewalk.lineRange":"Lines {a}-{b}","artifact.diagram.flowchart":"Flowchart","artifact.diagram.sequence":"Sequence","artifact.diagram.state":"State","artifact.mermaid.openLive":"Open in mermaid.live (editable)","artifact.mermaid.rendering":"Rendering diagram…","artifact.mermaid.renderFailed":"Render failed. Showing source (copy to mermaid.live to view).","artifact.mermaid.errorPrefix":"Error: {msg}","artifact.mermaid.hint":"Ctrl+scroll to zoom · drag to pan","quiz.questionProgress":"Q {cur}/{total}","quiz.answeredCorrect":"{n} correct","quiz.correct":"Correct","quiz.wrong":"Wrong","quiz.finish":"Finish","quiz.scoreSummary":"{correct}/{total} correct","quiz.hook.label":"📊 Quiz done: {{correct}}/{{total}}","quiz.hook.finish":"Finish quiz","quiz.hook.sent":"Results sent to your tutor, awaiting analysis…","quiz.hook.message":`I just finished the quiz{{title}}, scoring {{correct}}/{{total}}. Per-question breakdown below:
|
|
478
|
+
Based on my performance, decide what comes next: explain why I got questions wrong and the right reasoning, or judge whether I can move on. Do not re-issue the same set of questions, and do not just say well done.`,"quiz.hook.lineOk":"✅ Q{{n}}: {{prompt}} — correct","quiz.hook.lineWrong":"❌ Q{{n}}: {{prompt}} — I chose {{chosen}}, correct answer is {{answer}}","quiz.allCorrectHint":"All correct! Mastery update proposed.","quiz.tryAgainHint":"Practice another set to consolidate.","quiz.action.nextPrompt":"What's next:","quiz.action.explainWrong":"Explain what I got wrong","quiz.action.retry":"Another set","quiz.action.goDeeper":"Go deeper","quiz.action.markMastered":"Confirm I've mastered it","quiz.action.nextTopic":"Next topic","guess.header":"Take a guess","guess.pickedPrefix":"I guess: ","guess.waitReveal":"Guessed — waiting for the reveal…","import.deleted":"Deleted: {title}","exercise.title":"📝 Practice","exercise.generate":"Generate a question","exercise.submit":"Submit Answer","exercise.next":"Next →","exercise.correct":"✅ Correct!","exercise.wrong":"❌ Wrong","exercise.types.mcq":"Multiple Choice","exercise.types.fill_blank":"Fill in the Blank","exercise.types.true_false":"True or False","dashboard.title":"Learning Dashboard","dashboard.stat.streak":"Streak","dashboard.stat.due":"Due Today","dashboard.stat.mastery":"Overall Mastery","dashboard.review":"Review","dashboard.cleared":"Cleared","dashboard.export.md":"📄 Export Report","dashboard.export.json":"Export JSON","dashboard.section_mastery":"Mastery by Section","dashboard.mini.sections":"Mastery by section","dashboard.mini.struggle":"Your struggle spots (tap to relearn)","import.title":"Import Course","import.url":"GitHub URL","import.markdown":"Paste Markdown","import.btn":"Import","import.md_btn":"Generate Course","streak.days":"days","streak.title":"{n}-day streak · longest {m} days","streak.freeze.title":"{n} freeze left: saves your streak on a missed day"}};function Ds(){return Vc}function QC(e){e!==Vc&&(Vc=e,typeof localStorage<"u"&&localStorage.setItem(AE,e),l0.forEach(t=>t()))}function cp(e,t=Vc,n){var o,s;let i=((o=oy[t])==null?void 0:o[e])??((s=oy["zh-CN"])==null?void 0:s[e])??e;if(n)for(const[l,c]of Object.entries(n))i=i.replaceAll(`{${l}}`,String(c));return i}function He(){const e=R.useSyncExternalStore(CE,Ds,Ds);return R.useCallback((t,n)=>cp(t,e,n),[e])}function NE(){return R.useSyncExternalStore(CE,Ds,Ds)}const $C=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].map(e=>`${e}:not([hidden])`).join(",");function ly(e){return Array.from(e.querySelectorAll($C)).filter(t=>t.offsetParent!==null||t===document.activeElement)}function Bs(e,t){R.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const i=document.activeElement,s=ly(n)[0]??n,l=window.setTimeout(()=>s.focus(),0),c=d=>{if(d.key!=="Tab")return;const h=ly(n);if(h.length===0){d.preventDefault(),n.focus();return}const m=h[0],g=h[h.length-1];d.shiftKey?(document.activeElement===m||!n.contains(document.activeElement))&&(d.preventDefault(),g.focus()):document.activeElement===g&&(d.preventDefault(),m.focus())};return n.addEventListener("keydown",c),()=>{if(window.clearTimeout(l),n.removeEventListener("keydown",c),i&&document.body.contains(i))try{i.focus()}catch{}}},[e,t])}const rc=220;function cd({anchorRect:e,message:t,onConfirm:n,onCancel:i,confirmLabel:o,cancelLabel:s,danger:l=!1,testid:c="confirm-card"}){const d=He(),h=R.useRef(null);Bs(h,!0);const m=o??d("action.confirm"),g=s??d("action.cancel");R.useEffect(()=>{const k=N=>{h.current&&!h.current.contains(N.target)&&i()},M=N=>{N.key==="Escape"&&i(),N.key==="Enter"&&(N.preventDefault(),n())};return document.addEventListener("mousedown",k),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",M)}},[i,n]);const b=window.innerWidth,p=window.innerHeight,y=e.right-rc,E=Math.max(8,Math.min(y,b-rc-8)),T=e.bottom+4+rc>p?Math.max(8,e.top-4-rc):e.bottom+4;return up.createPortal(x.jsxs("div",{ref:h,className:`confirm-card fixed z-[60] w-[220px] bg-surface-0 rounded-xl shadow-elevated border p-3 ${l?"border-warning/50":"border-[var(--border)]"}`,style:{left:E,top:T},role:"alertdialog","aria-modal":"false","data-testid":c,onClick:k=>k.stopPropagation(),children:[x.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),x.jsxs("div",{className:"flex gap-2 justify-end",children:[x.jsx("button",{onClick:i,"data-testid":`${c}-cancel`,className:"px-2.5 py-1 rounded-md text-label font-bold text-ink-muted hover:text-ink-strong hover:bg-surface-3 transition-colors",children:g}),x.jsx("button",{onClick:n,"data-testid":`${c}-confirm`,className:"btn-3d-brand px-2.5 py-1 text-label",style:l?{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"}:void 0,children:m})]})]}),document.body)}function WC(e,t,n){return[...e].sort((i,o)=>i.orderIdx-o.orderIdx).map(i=>{const o=t.filter(c=>c.parentId===i.id).sort((c,d)=>c.orderIdx-d.orderIdx),s=o.filter(c=>c.type==="lesson"),l=s.length>0&&s.every(c=>{var d;return(((d=n[c.id])==null?void 0:d.mastery)??0)>=kE});return{section:i,lessons:o,chapterLessonsMastered:l}})}function u0(e,t,n){var i;return e.type==="exam"?!n:(((i=t[e.id])==null?void 0:i.status)??"locked")==="locked"}function ZC(e,t){const n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;const i=o=>{const s=o.toLowerCase();return n.every(l=>s.includes(l))};return e.map(o=>{if(i(o.section.title))return o;const s=o.lessons.filter(l=>i(l.title));return s.length>0?{...o,lessons:s}:null}).filter(o=>o!==null)}function JC(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return null;const i=e.toLowerCase().indexOf(n.toLowerCase());return i>=0?[i,i+n.length]:null}function eN(e){const t=He(),[n,i]=R.useState(""),[o,s]=R.useState([]),l=R.useRef(null);R.useEffect(()=>{var E;(E=l.current)==null||E.focus()},[]);const c=R.useMemo(()=>WC(e.sections,e.tree,e.progressMap),[e.sections,e.tree,e.progressMap]),d=R.useMemo(()=>ZC(c,n),[c,n]),h=R.useMemo(()=>new Set(e.tree.map(E=>E.id)),[e.tree]),m=R.useMemo(()=>new Set(d.flatMap(E=>E.lessons.map(T=>T.id))),[d]),g=R.useMemo(()=>new Map(e.tree.map(E=>[E.id,E])),[e.tree]),b=R.useMemo(()=>new Map(c.map(E=>[E.section.id,E.chapterLessonsMastered])),[c]);R.useEffect(()=>{const E=n.trim();if(E.length<2){s([]);return}const T=setTimeout(()=>{be.searchContent(E).then(k=>{s(k.filter(M=>h.has(M.nodeId)&&!m.has(M.nodeId)).slice(0,8))}).catch(()=>s([]))},250);return()=>clearTimeout(T)},[n,h,m]);const p=R.useMemo(()=>{for(const E of d){const T=E.lessons.find(k=>!u0(k,e.progressMap,E.chapterLessonsMastered));if(T)return T}return null},[d,e.progressMap]),y=d.length>0||o.length>0;return x.jsxs("div",{"data-testid":"course-search-panel",className:"absolute inset-0 z-50 flex flex-col",style:{background:"rgb(var(--surface-rail-rgb) / 0.96)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},onKeyDown:E=>{E.key==="Escape"&&e.onClose()},children:[x.jsxs("div",{className:"flex items-center gap-1.5 m-2 p-1.5 rounded-lg bg-black/40 ring-1 ring-white/15 focus-within:ring-brand/60 transition-colors",children:[x.jsx(sp,{className:"w-4 h-4 text-white/50 shrink-0"}),x.jsx("input",{ref:l,value:n,onChange:E=>i(E.target.value),onKeyDown:E=>{E.key==="Enter"&&p&&e.onJump(p)},placeholder:t("map.search.placeholder"),"data-testid":"course-search-input",className:"flex-1 bg-transparent text-body text-white placeholder:text-white/35 outline-none min-w-0"}),n&&x.jsx("button",{onClick:()=>{var E;i(""),(E=l.current)==null||E.focus()},"aria-label":t("map.search.clear"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:x.jsx(la,{className:"w-3.5 h-3.5"})}),x.jsx("button",{onClick:e.onClose,"data-testid":"course-search-close","aria-label":t("map.search.close"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:x.jsx(la,{className:"w-3.5 h-3.5"})})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-2",children:[!y&&x.jsx("div",{"data-testid":"course-search-empty",className:"text-center text-label text-white/60 mt-8 px-4",children:t("map.search.noResults")}),d.map((E,T)=>x.jsx(tN,{row:E,sectionIndex:T,query:n,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onPick:e.onJump},E.section.id)),o.length>0&&x.jsxs("div",{"data-testid":"course-search-content-group",className:"pt-1",children:[x.jsx("div",{className:"px-1.5 py-1 text-caption font-bold text-white/50 uppercase tracking-wider",children:t("map.search.contentGroup")}),o.map(E=>{const T=g.get(E.nodeId);if(!T)return null;const k=u0(T,e.progressMap,b.get(T.parentId??"")??!1);return x.jsxs("button",{disabled:k,"data-testid":`search-content-row-${T.id.slice(0,8)}`,onClick:()=>!k&&e.onJump(T),className:`w-full text-left px-2 py-1.5 rounded-lg transition-colors ${k?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${T.id===e.selectedNodeId?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(ii,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),x.jsx("span",{className:"flex-1 text-label font-bold text-white truncate",children:x.jsx(c0,{text:E.title,query:n})})]}),x.jsx("div",{className:"text-caption text-white/55 line-clamp-2 leading-snug pl-5.5",children:E.snippet})]},E.nodeId)})]})]})]})}function tN({row:e,sectionIndex:t,query:n,progressMap:i,selectedNodeId:o,onPick:s}){const l=He(),c=(e.section.world??"study")==="practice";return x.jsxs("div",{"data-testid":`search-section-${e.section.id.slice(0,8)}`,children:[x.jsxs("div",{className:"flex items-center gap-2 px-1.5 py-1",children:[x.jsx("span",{className:"w-5 h-5 rounded-full bg-gold text-neutral-900 text-caption font-extrabold flex items-center justify-center shrink-0 ring-2 ring-gold/40",children:t+1}),x.jsx("span",{className:"text-label font-bold text-white truncate flex-1",children:x.jsx(c0,{text:e.section.title,query:n})}),c&&x.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded-full bg-accent/20 text-accent text-caption font-bold",children:l("map.world.practice")})]}),e.lessons.map(d=>{var b;const h=u0(d,i,e.chapterLessonsMastered),m=((b=i[d.id])==null?void 0:b.status)??"locked",g=d.type==="exam";return x.jsxs("button",{disabled:h,"data-testid":`search-row-${d.id.slice(0,8)}`,onClick:()=>!h&&s(d),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors ${h?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${d.id===o?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[h?x.jsx(TC,{className:"w-3.5 h-3.5 text-white/50 shrink-0"}):g?x.jsx(Rs,{className:"w-3.5 h-3.5 text-accent shrink-0"}):m==="mastered"?x.jsx(gE,{className:"w-3.5 h-3.5 text-gold shrink-0"}):x.jsx(ii,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),x.jsx("span",{className:"flex-1 text-label text-white truncate",children:x.jsx(c0,{text:d.title,query:n})})]},d.id)})]})}function c0({text:e,query:t}){const n=JC(e,t);return n?x.jsxs(x.Fragment,{children:[e.slice(0,n[0]),x.jsx("span",{className:"text-brand font-extrabold",children:e.slice(n[0],n[1])}),e.slice(n[1])]}):x.jsx(x.Fragment,{children:e})}const nN=268,dp=28,aN=20,_E=dp*2+aN,iN=_E+8,rN=104,sN=18,Zh=dp+6,oN=26,lN=22;function d0(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function uN(e,t=nN,n=""){const i=[],o=t/2,s=t/2-sN-dp;for(let d=0;d<e;d++){const h=Zh+d*rN,g=d0(`${n}:${d}`)/4294967295*2-1,b=o+g*s,y=d0(`${n}:${d}:y`)/4294967295*2-1,E=h+y*oN;i.push({x:b,y:E,index:d})}if(i.length>0){i[0].y<Zh&&(i[0].y=Zh);for(let d=1;d<i.length;d++){const h=i[d-1].y+iN;i[d].y<h&&(i[d].y=h)}}const l=[];for(let d=0;d<i.length-1;d++)l.push({from:i[d],to:i[d+1],index:d});const c=i.length===0?40:i[i.length-1].y+_E/2+10;return{nodes:i,segments:l,height:c}}function cN(e){const{from:t,to:n}=e,i=(t.y+n.y)/2+lN;return`M ${t.x} ${t.y} C ${t.x} ${i}, ${n.x} ${i}, ${n.x} ${n.y}`}var Cc={exports:{}};/*!
|
|
479
|
+
* matter-js 0.19.0 by @liabru
|
|
480
|
+
* http://brm.io/matter-js/
|
|
481
|
+
* License MIT
|
|
482
|
+
*
|
|
483
|
+
* The MIT License (MIT)
|
|
484
|
+
*
|
|
485
|
+
* Copyright (c) Liam Brummitt and contributors.
|
|
486
|
+
*
|
|
487
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
488
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
489
|
+
* in the Software without restriction, including without limitation the rights
|
|
490
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
491
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
492
|
+
* furnished to do so, subject to the following conditions:
|
|
493
|
+
*
|
|
494
|
+
* The above copyright notice and this permission notice shall be included in
|
|
495
|
+
* all copies or substantial portions of the Software.
|
|
496
|
+
*
|
|
497
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
498
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
499
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
500
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
501
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
502
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
503
|
+
* THE SOFTWARE.
|
|
504
|
+
*/var dN=Cc.exports,uy;function fN(){return uy||(uy=1,(function(e,t){(function(i,o){e.exports=o()})(dN,function(){return(function(n){var i={};function o(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return n[s].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=n,o.c=i,o.d=function(s,l,c){o.o(s,l)||Object.defineProperty(s,l,{enumerable:!0,get:c})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,l){if(l&1&&(s=o(s)),l&8||l&4&&typeof s=="object"&&s&&s.__esModule)return s;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:s}),l&2&&typeof s!="string")for(var d in s)o.d(c,d,(function(h){return s[h]}).bind(null,d));return c},o.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(l,"a",l),l},o.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},o.p="",o(o.s=20)})([(function(n,i){var o={};n.exports=o,(function(){o._baseDelta=1e3/60,o._nextId=0,o._seed=0,o._nowStartTime=+new Date,o._warnedOnce={},o._decomp=null,o.extend=function(l,c){var d,h;typeof c=="boolean"?(d=2,h=c):(d=1,h=!0);for(var m=d;m<arguments.length;m++){var g=arguments[m];if(g)for(var b in g)h&&g[b]&&g[b].constructor===Object&&(!l[b]||l[b].constructor===Object)?(l[b]=l[b]||{},o.extend(l[b],h,g[b])):l[b]=g[b]}return l},o.clone=function(l,c){return o.extend({},c,l)},o.keys=function(l){if(Object.keys)return Object.keys(l);var c=[];for(var d in l)c.push(d);return c},o.values=function(l){var c=[];if(Object.keys){for(var d=Object.keys(l),h=0;h<d.length;h++)c.push(l[d[h]]);return c}for(var m in l)c.push(l[m]);return c},o.get=function(l,c,d,h){c=c.split(".").slice(d,h);for(var m=0;m<c.length;m+=1)l=l[c[m]];return l},o.set=function(l,c,d,h,m){var g=c.split(".").slice(h,m);return o.get(l,c,0,-1)[g[g.length-1]]=d,d},o.shuffle=function(l){for(var c=l.length-1;c>0;c--){var d=Math.floor(o.random()*(c+1)),h=l[c];l[c]=l[d],l[d]=h}return l},o.choose=function(l){return l[Math.floor(o.random()*l.length)]},o.isElement=function(l){return typeof HTMLElement<"u"?l instanceof HTMLElement:!!(l&&l.nodeType&&l.nodeName)},o.isArray=function(l){return Object.prototype.toString.call(l)==="[object Array]"},o.isFunction=function(l){return typeof l=="function"},o.isPlainObject=function(l){return typeof l=="object"&&l.constructor===Object},o.isString=function(l){return toString.call(l)==="[object String]"},o.clamp=function(l,c,d){return l<c?c:l>d?d:l},o.sign=function(l){return l<0?-1:1},o.now=function(){if(typeof window<"u"&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-o._nowStartTime},o.random=function(l,c){return l=typeof l<"u"?l:0,c=typeof c<"u"?c:1,l+s()*(c-l)};var s=function(){return o._seed=(o._seed*9301+49297)%233280,o._seed/233280};o.colorToNumber=function(l){return l=l.replace("#",""),l.length==3&&(l=l.charAt(0)+l.charAt(0)+l.charAt(1)+l.charAt(1)+l.charAt(2)+l.charAt(2)),parseInt(l,16)},o.logLevel=1,o.log=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.info=function(){console&&o.logLevel>0&&o.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warn=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warnOnce=function(){var l=Array.prototype.slice.call(arguments).join(" ");o._warnedOnce[l]||(o.warn(l),o._warnedOnce[l]=!0)},o.deprecated=function(l,c,d){l[c]=o.chain(function(){o.warnOnce("🔅 deprecated 🔅",d)},l[c])},o.nextId=function(){return o._nextId++},o.indexOf=function(l,c){if(l.indexOf)return l.indexOf(c);for(var d=0;d<l.length;d++)if(l[d]===c)return d;return-1},o.map=function(l,c){if(l.map)return l.map(c);for(var d=[],h=0;h<l.length;h+=1)d.push(c(l[h]));return d},o.topologicalSort=function(l){var c=[],d=[],h=[];for(var m in l)!d[m]&&!h[m]&&o._topologicalSort(m,d,h,l,c);return c},o._topologicalSort=function(l,c,d,h,m){var g=h[l]||[];d[l]=!0;for(var b=0;b<g.length;b+=1){var p=g[b];d[p]||c[p]||o._topologicalSort(p,c,d,h,m)}d[l]=!1,c[l]=!0,m.push(l)},o.chain=function(){for(var l=[],c=0;c<arguments.length;c+=1){var d=arguments[c];d._chained?l.push.apply(l,d._chained):l.push(d)}var h=function(){for(var m,g=new Array(arguments.length),b=0,p=arguments.length;b<p;b++)g[b]=arguments[b];for(b=0;b<l.length;b+=1){var y=l[b].apply(m,g);typeof y<"u"&&(m=y)}return m};return h._chained=l,h},o.chainPathBefore=function(l,c,d){return o.set(l,c,o.chain(d,o.get(l,c)))},o.chainPathAfter=function(l,c,d){return o.set(l,c,o.chain(o.get(l,c),d))},o.setDecomp=function(l){o._decomp=l},o.getDecomp=function(){var l=o._decomp;try{!l&&typeof window<"u"&&(l=window.decomp),!l&&typeof Kb<"u"&&(l=Kb.decomp)}catch{l=null}return l}})()}),(function(n,i){var o={};n.exports=o,(function(){o.create=function(s){var l={min:{x:0,y:0},max:{x:0,y:0}};return s&&o.update(l,s),l},o.update=function(s,l,c){s.min.x=1/0,s.max.x=-1/0,s.min.y=1/0,s.max.y=-1/0;for(var d=0;d<l.length;d++){var h=l[d];h.x>s.max.x&&(s.max.x=h.x),h.x<s.min.x&&(s.min.x=h.x),h.y>s.max.y&&(s.max.y=h.y),h.y<s.min.y&&(s.min.y=h.y)}c&&(c.x>0?s.max.x+=c.x:s.min.x+=c.x,c.y>0?s.max.y+=c.y:s.min.y+=c.y)},o.contains=function(s,l){return l.x>=s.min.x&&l.x<=s.max.x&&l.y>=s.min.y&&l.y<=s.max.y},o.overlaps=function(s,l){return s.min.x<=l.max.x&&s.max.x>=l.min.x&&s.max.y>=l.min.y&&s.min.y<=l.max.y},o.translate=function(s,l){s.min.x+=l.x,s.max.x+=l.x,s.min.y+=l.y,s.max.y+=l.y},o.shift=function(s,l){var c=s.max.x-s.min.x,d=s.max.y-s.min.y;s.min.x=l.x,s.max.x=l.x+c,s.min.y=l.y,s.max.y=l.y+d}})()}),(function(n,i){var o={};n.exports=o,(function(){o.create=function(s,l){return{x:s||0,y:l||0}},o.clone=function(s){return{x:s.x,y:s.y}},o.magnitude=function(s){return Math.sqrt(s.x*s.x+s.y*s.y)},o.magnitudeSquared=function(s){return s.x*s.x+s.y*s.y},o.rotate=function(s,l,c){var d=Math.cos(l),h=Math.sin(l);c||(c={});var m=s.x*d-s.y*h;return c.y=s.x*h+s.y*d,c.x=m,c},o.rotateAbout=function(s,l,c,d){var h=Math.cos(l),m=Math.sin(l);d||(d={});var g=c.x+((s.x-c.x)*h-(s.y-c.y)*m);return d.y=c.y+((s.x-c.x)*m+(s.y-c.y)*h),d.x=g,d},o.normalise=function(s){var l=o.magnitude(s);return l===0?{x:0,y:0}:{x:s.x/l,y:s.y/l}},o.dot=function(s,l){return s.x*l.x+s.y*l.y},o.cross=function(s,l){return s.x*l.y-s.y*l.x},o.cross3=function(s,l,c){return(l.x-s.x)*(c.y-s.y)-(l.y-s.y)*(c.x-s.x)},o.add=function(s,l,c){return c||(c={}),c.x=s.x+l.x,c.y=s.y+l.y,c},o.sub=function(s,l,c){return c||(c={}),c.x=s.x-l.x,c.y=s.y-l.y,c},o.mult=function(s,l){return{x:s.x*l,y:s.y*l}},o.div=function(s,l){return{x:s.x/l,y:s.y/l}},o.perp=function(s,l){return l=l===!0?-1:1,{x:l*-s.y,y:l*s.x}},o.neg=function(s){return{x:-s.x,y:-s.y}},o.angle=function(s,l){return Math.atan2(l.y-s.y,l.x-s.x)},o._temp=[o.create(),o.create(),o.create(),o.create(),o.create(),o.create()]})()}),(function(n,i,o){var s={};n.exports=s;var l=o(2),c=o(0);(function(){s.create=function(d,h){for(var m=[],g=0;g<d.length;g++){var b=d[g],p={x:b.x,y:b.y,index:g,body:h,isInternal:!1};m.push(p)}return m},s.fromPath=function(d,h){var m=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,g=[];return d.replace(m,function(b,p,y){g.push({x:parseFloat(p),y:parseFloat(y)})}),s.create(g,h)},s.centre=function(d){for(var h=s.area(d,!0),m={x:0,y:0},g,b,p,y=0;y<d.length;y++)p=(y+1)%d.length,g=l.cross(d[y],d[p]),b=l.mult(l.add(d[y],d[p]),g),m=l.add(m,b);return l.div(m,6*h)},s.mean=function(d){for(var h={x:0,y:0},m=0;m<d.length;m++)h.x+=d[m].x,h.y+=d[m].y;return l.div(h,d.length)},s.area=function(d,h){for(var m=0,g=d.length-1,b=0;b<d.length;b++)m+=(d[g].x-d[b].x)*(d[g].y+d[b].y),g=b;return h?m/2:Math.abs(m)/2},s.inertia=function(d,h){for(var m=0,g=0,b=d,p,y,E=0;E<b.length;E++)y=(E+1)%b.length,p=Math.abs(l.cross(b[y],b[E])),m+=p*(l.dot(b[y],b[y])+l.dot(b[y],b[E])+l.dot(b[E],b[E])),g+=p;return h/6*(m/g)},s.translate=function(d,h,m){m=typeof m<"u"?m:1;var g=d.length,b=h.x*m,p=h.y*m,y;for(y=0;y<g;y++)d[y].x+=b,d[y].y+=p;return d},s.rotate=function(d,h,m){if(h!==0){var g=Math.cos(h),b=Math.sin(h),p=m.x,y=m.y,E=d.length,T,k,M,N;for(N=0;N<E;N++)T=d[N],k=T.x-p,M=T.y-y,T.x=p+(k*g-M*b),T.y=y+(k*b+M*g);return d}},s.contains=function(d,h){for(var m=h.x,g=h.y,b=d.length,p=d[b-1],y,E=0;E<b;E++){if(y=d[E],(m-p.x)*(y.y-p.y)+(g-p.y)*(p.x-y.x)>0)return!1;p=y}return!0},s.scale=function(d,h,m,g){if(h===1&&m===1)return d;g=g||s.centre(d);for(var b,p,y=0;y<d.length;y++)b=d[y],p=l.sub(b,g),d[y].x=g.x+p.x*h,d[y].y=g.y+p.y*m;return d},s.chamfer=function(d,h,m,g,b){typeof h=="number"?h=[h]:h=h||[8],m=typeof m<"u"?m:-1,g=g||2,b=b||14;for(var p=[],y=0;y<d.length;y++){var E=d[y-1>=0?y-1:d.length-1],T=d[y],k=d[(y+1)%d.length],M=h[y<h.length?y:h.length-1];if(M===0){p.push(T);continue}var N=l.normalise({x:T.y-E.y,y:E.x-T.x}),O=l.normalise({x:k.y-T.y,y:T.x-k.x}),A=Math.sqrt(2*Math.pow(M,2)),C=l.mult(c.clone(N),M),L=l.normalise(l.mult(l.add(N,O),.5)),_=l.sub(T,l.mult(L,A)),j=m;m===-1&&(j=Math.pow(M,.32)*1.75),j=c.clamp(j,g,b),j%2===1&&(j+=1);for(var D=Math.acos(l.dot(N,O)),P=D/j,U=0;U<j;U++)p.push(l.add(l.rotate(C,P*U),_))}return p},s.clockwiseSort=function(d){var h=s.mean(d);return d.sort(function(m,g){return l.angle(h,m)-l.angle(h,g)}),d},s.isConvex=function(d){var h=0,m=d.length,g,b,p,y;if(m<3)return null;for(g=0;g<m;g++)if(b=(g+1)%m,p=(g+2)%m,y=(d[b].x-d[g].x)*(d[p].y-d[b].y),y-=(d[b].y-d[g].y)*(d[p].x-d[b].x),y<0?h|=1:y>0&&(h|=2),h===3)return!1;return h!==0?!0:null},s.hull=function(d){var h=[],m=[],g,b;for(d=d.slice(0),d.sort(function(p,y){var E=p.x-y.x;return E!==0?E:p.y-y.y}),b=0;b<d.length;b+=1){for(g=d[b];m.length>=2&&l.cross3(m[m.length-2],m[m.length-1],g)<=0;)m.pop();m.push(g)}for(b=d.length-1;b>=0;b-=1){for(g=d[b];h.length>=2&&l.cross3(h[h.length-2],h[h.length-1],g)<=0;)h.pop();h.push(g)}return h.pop(),m.pop(),h.concat(m)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(2),d=o(7),h=o(0),m=o(1),g=o(11);(function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(p){var y={id:h.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:l.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,strokeStyle:null,fillStyle:null,lineWidth:null,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0}},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:16.666666666666668,_original:null},E=h.extend(y,p);return b(E,p),E},s.nextGroup=function(p){return p?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var b=function(p,y){y=y||{},s.set(p,{bounds:p.bounds||m.create(p.vertices),positionPrev:p.positionPrev||c.clone(p.position),anglePrev:p.anglePrev||p.angle,vertices:p.vertices,parts:p.parts||[p],isStatic:p.isStatic,isSleeping:p.isSleeping,parent:p.parent||p}),l.rotate(p.vertices,p.angle,p.position),g.rotate(p.axes,p.angle),m.update(p.bounds,p.vertices,p.velocity),s.set(p,{axes:y.axes||p.axes,area:y.area||p.area,mass:y.mass||p.mass,inertia:y.inertia||p.inertia});var E=p.isStatic?"#14151f":h.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),T=p.isStatic?"#555":"#ccc",k=p.isStatic&&p.render.fillStyle===null?1:0;p.render.fillStyle=p.render.fillStyle||E,p.render.strokeStyle=p.render.strokeStyle||T,p.render.lineWidth=p.render.lineWidth||k,p.render.sprite.xOffset+=-(p.bounds.min.x-p.position.x)/(p.bounds.max.x-p.bounds.min.x),p.render.sprite.yOffset+=-(p.bounds.min.y-p.position.y)/(p.bounds.max.y-p.bounds.min.y)};s.set=function(p,y,E){var T;typeof y=="string"&&(T=y,y={},y[T]=E);for(T in y)if(Object.prototype.hasOwnProperty.call(y,T))switch(E=y[T],T){case"isStatic":s.setStatic(p,E);break;case"isSleeping":d.set(p,E);break;case"mass":s.setMass(p,E);break;case"density":s.setDensity(p,E);break;case"inertia":s.setInertia(p,E);break;case"vertices":s.setVertices(p,E);break;case"position":s.setPosition(p,E);break;case"angle":s.setAngle(p,E);break;case"velocity":s.setVelocity(p,E);break;case"angularVelocity":s.setAngularVelocity(p,E);break;case"speed":s.setSpeed(p,E);break;case"angularSpeed":s.setAngularSpeed(p,E);break;case"parts":s.setParts(p,E);break;case"centre":s.setCentre(p,E);break;default:p[T]=E}},s.setStatic=function(p,y){for(var E=0;E<p.parts.length;E++){var T=p.parts[E];T.isStatic=y,y?(T._original={restitution:T.restitution,friction:T.friction,mass:T.mass,inertia:T.inertia,density:T.density,inverseMass:T.inverseMass,inverseInertia:T.inverseInertia},T.restitution=0,T.friction=1,T.mass=T.inertia=T.density=1/0,T.inverseMass=T.inverseInertia=0,T.positionPrev.x=T.position.x,T.positionPrev.y=T.position.y,T.anglePrev=T.angle,T.angularVelocity=0,T.speed=0,T.angularSpeed=0,T.motion=0):T._original&&(T.restitution=T._original.restitution,T.friction=T._original.friction,T.mass=T._original.mass,T.inertia=T._original.inertia,T.density=T._original.density,T.inverseMass=T._original.inverseMass,T.inverseInertia=T._original.inverseInertia,T._original=null)}},s.setMass=function(p,y){var E=p.inertia/(p.mass/6);p.inertia=E*(y/6),p.inverseInertia=1/p.inertia,p.mass=y,p.inverseMass=1/p.mass,p.density=p.mass/p.area},s.setDensity=function(p,y){s.setMass(p,y*p.area),p.density=y},s.setInertia=function(p,y){p.inertia=y,p.inverseInertia=1/p.inertia},s.setVertices=function(p,y){y[0].body===p?p.vertices=y:p.vertices=l.create(y,p),p.axes=g.fromVertices(p.vertices),p.area=l.area(p.vertices),s.setMass(p,p.density*p.area);var E=l.centre(p.vertices);l.translate(p.vertices,E,-1),s.setInertia(p,s._inertiaScale*l.inertia(p.vertices,p.mass)),l.translate(p.vertices,p.position),m.update(p.bounds,p.vertices,p.velocity)},s.setParts=function(p,y,E){var T;for(y=y.slice(0),p.parts.length=0,p.parts.push(p),p.parent=p,T=0;T<y.length;T++){var k=y[T];k!==p&&(k.parent=p,p.parts.push(k))}if(p.parts.length!==1){if(E=typeof E<"u"?E:!0,E){var M=[];for(T=0;T<y.length;T++)M=M.concat(y[T].vertices);l.clockwiseSort(M);var N=l.hull(M),O=l.centre(N);s.setVertices(p,N),l.translate(p.vertices,O)}var A=s._totalProperties(p);p.area=A.area,p.parent=p,p.position.x=A.centre.x,p.position.y=A.centre.y,p.positionPrev.x=A.centre.x,p.positionPrev.y=A.centre.y,s.setMass(p,A.mass),s.setInertia(p,A.inertia),s.setPosition(p,A.centre)}},s.setCentre=function(p,y,E){E?(p.positionPrev.x+=y.x,p.positionPrev.y+=y.y,p.position.x+=y.x,p.position.y+=y.y):(p.positionPrev.x=y.x-(p.position.x-p.positionPrev.x),p.positionPrev.y=y.y-(p.position.y-p.positionPrev.y),p.position.x=y.x,p.position.y=y.y)},s.setPosition=function(p,y,E){var T=c.sub(y,p.position);E?(p.positionPrev.x=p.position.x,p.positionPrev.y=p.position.y,p.velocity.x=T.x,p.velocity.y=T.y,p.speed=c.magnitude(T)):(p.positionPrev.x+=T.x,p.positionPrev.y+=T.y);for(var k=0;k<p.parts.length;k++){var M=p.parts[k];M.position.x+=T.x,M.position.y+=T.y,l.translate(M.vertices,T),m.update(M.bounds,M.vertices,p.velocity)}},s.setAngle=function(p,y,E){var T=y-p.angle;E?(p.anglePrev=p.angle,p.angularVelocity=T,p.angularSpeed=Math.abs(T)):p.anglePrev+=T;for(var k=0;k<p.parts.length;k++){var M=p.parts[k];M.angle+=T,l.rotate(M.vertices,T,p.position),g.rotate(M.axes,T),m.update(M.bounds,M.vertices,p.velocity),k>0&&c.rotateAbout(M.position,T,p.position,M.position)}},s.setVelocity=function(p,y){var E=p.deltaTime/s._baseDelta;p.positionPrev.x=p.position.x-y.x*E,p.positionPrev.y=p.position.y-y.y*E,p.velocity.x=(p.position.x-p.positionPrev.x)/E,p.velocity.y=(p.position.y-p.positionPrev.y)/E,p.speed=c.magnitude(p.velocity)},s.getVelocity=function(p){var y=s._baseDelta/p.deltaTime;return{x:(p.position.x-p.positionPrev.x)*y,y:(p.position.y-p.positionPrev.y)*y}},s.getSpeed=function(p){return c.magnitude(s.getVelocity(p))},s.setSpeed=function(p,y){s.setVelocity(p,c.mult(c.normalise(s.getVelocity(p)),y))},s.setAngularVelocity=function(p,y){var E=p.deltaTime/s._baseDelta;p.anglePrev=p.angle-y*E,p.angularVelocity=(p.angle-p.anglePrev)/E,p.angularSpeed=Math.abs(p.angularVelocity)},s.getAngularVelocity=function(p){return(p.angle-p.anglePrev)*s._baseDelta/p.deltaTime},s.getAngularSpeed=function(p){return Math.abs(s.getAngularVelocity(p))},s.setAngularSpeed=function(p,y){s.setAngularVelocity(p,h.sign(s.getAngularVelocity(p))*y)},s.translate=function(p,y,E){s.setPosition(p,c.add(p.position,y),E)},s.rotate=function(p,y,E,T){if(!E)s.setAngle(p,p.angle+y,T);else{var k=Math.cos(y),M=Math.sin(y),N=p.position.x-E.x,O=p.position.y-E.y;s.setPosition(p,{x:E.x+(N*k-O*M),y:E.y+(N*M+O*k)},T),s.setAngle(p,p.angle+y,T)}},s.scale=function(p,y,E,T){var k=0,M=0;T=T||p.position;for(var N=0;N<p.parts.length;N++){var O=p.parts[N];l.scale(O.vertices,y,E,T),O.axes=g.fromVertices(O.vertices),O.area=l.area(O.vertices),s.setMass(O,p.density*O.area),l.translate(O.vertices,{x:-O.position.x,y:-O.position.y}),s.setInertia(O,s._inertiaScale*l.inertia(O.vertices,O.mass)),l.translate(O.vertices,{x:O.position.x,y:O.position.y}),N>0&&(k+=O.area,M+=O.inertia),O.position.x=T.x+(O.position.x-T.x)*y,O.position.y=T.y+(O.position.y-T.y)*E,m.update(O.bounds,O.vertices,p.velocity)}p.parts.length>1&&(p.area=k,p.isStatic||(s.setMass(p,p.density*k),s.setInertia(p,M))),p.circleRadius&&(y===E?p.circleRadius*=y:p.circleRadius=null)},s.update=function(p,y){y=(typeof y<"u"?y:1e3/60)*p.timeScale;var E=y*y,T=s._timeCorrection?y/(p.deltaTime||y):1,k=1-p.frictionAir*(y/h._baseDelta),M=(p.position.x-p.positionPrev.x)*T,N=(p.position.y-p.positionPrev.y)*T;p.velocity.x=M*k+p.force.x/p.mass*E,p.velocity.y=N*k+p.force.y/p.mass*E,p.positionPrev.x=p.position.x,p.positionPrev.y=p.position.y,p.position.x+=p.velocity.x,p.position.y+=p.velocity.y,p.deltaTime=y,p.angularVelocity=(p.angle-p.anglePrev)*k*T+p.torque/p.inertia*E,p.anglePrev=p.angle,p.angle+=p.angularVelocity;for(var O=0;O<p.parts.length;O++){var A=p.parts[O];l.translate(A.vertices,p.velocity),O>0&&(A.position.x+=p.velocity.x,A.position.y+=p.velocity.y),p.angularVelocity!==0&&(l.rotate(A.vertices,p.angularVelocity,p.position),g.rotate(A.axes,p.angularVelocity),O>0&&c.rotateAbout(A.position,p.angularVelocity,p.position,A.position)),m.update(A.bounds,A.vertices,p.velocity)}},s.updateVelocities=function(p){var y=s._baseDelta/p.deltaTime,E=p.velocity;E.x=(p.position.x-p.positionPrev.x)*y,E.y=(p.position.y-p.positionPrev.y)*y,p.speed=Math.sqrt(E.x*E.x+E.y*E.y),p.angularVelocity=(p.angle-p.anglePrev)*y,p.angularSpeed=Math.abs(p.angularVelocity)},s.applyForce=function(p,y,E){var T={x:y.x-p.position.x,y:y.y-p.position.y};p.force.x+=E.x,p.force.y+=E.y,p.torque+=T.x*E.y-T.y*E.x},s._totalProperties=function(p){for(var y={mass:0,area:0,inertia:0,centre:{x:0,y:0}},E=p.parts.length===1?0:1;E<p.parts.length;E++){var T=p.parts[E],k=T.mass!==1/0?T.mass:1;y.mass+=k,y.area+=T.area,y.inertia+=T.inertia,y.centre=c.add(y.centre,c.mult(T.position,k))}return y.centre=c.div(y.centre,y.mass),y}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0);(function(){s.on=function(c,d,h){for(var m=d.split(" "),g,b=0;b<m.length;b++)g=m[b],c.events=c.events||{},c.events[g]=c.events[g]||[],c.events[g].push(h);return h},s.off=function(c,d,h){if(!d){c.events={};return}typeof d=="function"&&(h=d,d=l.keys(c.events).join(" "));for(var m=d.split(" "),g=0;g<m.length;g++){var b=c.events[m[g]],p=[];if(h&&b)for(var y=0;y<b.length;y++)b[y]!==h&&p.push(b[y]);c.events[m[g]]=p}},s.trigger=function(c,d,h){var m,g,b,p,y=c.events;if(y&&l.keys(y).length>0){h||(h={}),m=d.split(" ");for(var E=0;E<m.length;E++)if(g=m[E],b=y[g],b){p=l.clone(h,!1),p.name=g,p.source=c;for(var T=0;T<b.length;T++)b[T].apply(c,[p])}}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(5),c=o(0),d=o(1),h=o(4);(function(){s.create=function(m){return c.extend({id:c.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},m)},s.setModified=function(m,g,b,p){if(m.isModified=g,g&&m.cache&&(m.cache.allBodies=null,m.cache.allConstraints=null,m.cache.allComposites=null),b&&m.parent&&s.setModified(m.parent,g,b,p),p)for(var y=0;y<m.composites.length;y++){var E=m.composites[y];s.setModified(E,g,b,p)}},s.add=function(m,g){var b=[].concat(g);l.trigger(m,"beforeAdd",{object:g});for(var p=0;p<b.length;p++){var y=b[p];switch(y.type){case"body":if(y.parent!==y){c.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}s.addBody(m,y);break;case"constraint":s.addConstraint(m,y);break;case"composite":s.addComposite(m,y);break;case"mouseConstraint":s.addConstraint(m,y.constraint);break}}return l.trigger(m,"afterAdd",{object:g}),m},s.remove=function(m,g,b){var p=[].concat(g);l.trigger(m,"beforeRemove",{object:g});for(var y=0;y<p.length;y++){var E=p[y];switch(E.type){case"body":s.removeBody(m,E,b);break;case"constraint":s.removeConstraint(m,E,b);break;case"composite":s.removeComposite(m,E,b);break;case"mouseConstraint":s.removeConstraint(m,E.constraint);break}}return l.trigger(m,"afterRemove",{object:g}),m},s.addComposite=function(m,g){return m.composites.push(g),g.parent=m,s.setModified(m,!0,!0,!1),m},s.removeComposite=function(m,g,b){var p=c.indexOf(m.composites,g);if(p!==-1&&s.removeCompositeAt(m,p),b)for(var y=0;y<m.composites.length;y++)s.removeComposite(m.composites[y],g,!0);return m},s.removeCompositeAt=function(m,g){return m.composites.splice(g,1),s.setModified(m,!0,!0,!1),m},s.addBody=function(m,g){return m.bodies.push(g),s.setModified(m,!0,!0,!1),m},s.removeBody=function(m,g,b){var p=c.indexOf(m.bodies,g);if(p!==-1&&s.removeBodyAt(m,p),b)for(var y=0;y<m.composites.length;y++)s.removeBody(m.composites[y],g,!0);return m},s.removeBodyAt=function(m,g){return m.bodies.splice(g,1),s.setModified(m,!0,!0,!1),m},s.addConstraint=function(m,g){return m.constraints.push(g),s.setModified(m,!0,!0,!1),m},s.removeConstraint=function(m,g,b){var p=c.indexOf(m.constraints,g);if(p!==-1&&s.removeConstraintAt(m,p),b)for(var y=0;y<m.composites.length;y++)s.removeConstraint(m.composites[y],g,!0);return m},s.removeConstraintAt=function(m,g){return m.constraints.splice(g,1),s.setModified(m,!0,!0,!1),m},s.clear=function(m,g,b){if(b)for(var p=0;p<m.composites.length;p++)s.clear(m.composites[p],g,!0);return g?m.bodies=m.bodies.filter(function(y){return y.isStatic}):m.bodies.length=0,m.constraints.length=0,m.composites.length=0,s.setModified(m,!0,!0,!1),m},s.allBodies=function(m){if(m.cache&&m.cache.allBodies)return m.cache.allBodies;for(var g=[].concat(m.bodies),b=0;b<m.composites.length;b++)g=g.concat(s.allBodies(m.composites[b]));return m.cache&&(m.cache.allBodies=g),g},s.allConstraints=function(m){if(m.cache&&m.cache.allConstraints)return m.cache.allConstraints;for(var g=[].concat(m.constraints),b=0;b<m.composites.length;b++)g=g.concat(s.allConstraints(m.composites[b]));return m.cache&&(m.cache.allConstraints=g),g},s.allComposites=function(m){if(m.cache&&m.cache.allComposites)return m.cache.allComposites;for(var g=[].concat(m.composites),b=0;b<m.composites.length;b++)g=g.concat(s.allComposites(m.composites[b]));return m.cache&&(m.cache.allComposites=g),g},s.get=function(m,g,b){var p,y;switch(b){case"body":p=s.allBodies(m);break;case"constraint":p=s.allConstraints(m);break;case"composite":p=s.allComposites(m).concat(m);break}return p?(y=p.filter(function(E){return E.id.toString()===g.toString()}),y.length===0?null:y[0]):null},s.move=function(m,g,b){return s.remove(m,g),s.add(b,g),m},s.rebase=function(m){for(var g=s.allBodies(m).concat(s.allConstraints(m)).concat(s.allComposites(m)),b=0;b<g.length;b++)g[b].id=c.nextId();return m},s.translate=function(m,g,b){for(var p=b?s.allBodies(m):m.bodies,y=0;y<p.length;y++)h.translate(p[y],g);return m},s.rotate=function(m,g,b,p){for(var y=Math.cos(g),E=Math.sin(g),T=p?s.allBodies(m):m.bodies,k=0;k<T.length;k++){var M=T[k],N=M.position.x-b.x,O=M.position.y-b.y;h.setPosition(M,{x:b.x+(N*y-O*E),y:b.y+(N*E+O*y)}),h.rotate(M,g)}return m},s.scale=function(m,g,b,p,y){for(var E=y?s.allBodies(m):m.bodies,T=0;T<E.length;T++){var k=E[T],M=k.position.x-p.x,N=k.position.y-p.y;h.setPosition(k,{x:p.x+M*g,y:p.y+N*b}),h.scale(k,g,b)}return m},s.bounds=function(m){for(var g=s.allBodies(m),b=[],p=0;p<g.length;p+=1){var y=g[p];b.push(y.bounds.min,y.bounds.max)}return d.create(b)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(5),d=o(0);(function(){s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(h,m){for(var g=m/d._baseDelta,b=s._motionSleepThreshold,p=0;p<h.length;p++){var y=h[p],E=l.getSpeed(y),T=l.getAngularSpeed(y),k=E*E+T*T;if(y.force.x!==0||y.force.y!==0){s.set(y,!1);continue}var M=Math.min(y.motion,k),N=Math.max(y.motion,k);y.motion=s._minBias*M+(1-s._minBias)*N,y.sleepThreshold>0&&y.motion<b?(y.sleepCounter+=1,y.sleepCounter>=y.sleepThreshold/g&&s.set(y,!0)):y.sleepCounter>0&&(y.sleepCounter-=1)}},s.afterCollisions=function(h){for(var m=s._motionSleepThreshold,g=0;g<h.length;g++){var b=h[g];if(b.isActive){var p=b.collision,y=p.bodyA.parent,E=p.bodyB.parent;if(!(y.isSleeping&&E.isSleeping||y.isStatic||E.isStatic)&&(y.isSleeping||E.isSleeping)){var T=y.isSleeping&&!y.isStatic?y:E,k=T===y?E:y;!T.isStatic&&k.motion>m&&s.set(T,!1)}}}},s.set=function(h,m){var g=h.isSleeping;m?(h.isSleeping=!0,h.sleepCounter=h.sleepThreshold,h.positionImpulse.x=0,h.positionImpulse.y=0,h.positionPrev.x=h.position.x,h.positionPrev.y=h.position.y,h.anglePrev=h.angle,h.speed=0,h.angularSpeed=0,h.motion=0,g||c.trigger(h,"sleepStart")):(h.isSleeping=!1,h.sleepCounter=0,g&&c.trigger(h,"sleepEnd"))}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(9);(function(){var d=[],h={overlap:0,axis:null},m={overlap:0,axis:null};s.create=function(g,b){return{pair:null,collided:!1,bodyA:g,bodyB:b,parentA:g.parent,parentB:b.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},s.collides=function(g,b,p){if(s._overlapAxes(h,g.vertices,b.vertices,g.axes),h.overlap<=0||(s._overlapAxes(m,b.vertices,g.vertices,b.axes),m.overlap<=0))return null;var y=p&&p.table[c.id(g,b)],E;y?E=y.collision:(E=s.create(g,b),E.collided=!0,E.bodyA=g.id<b.id?g:b,E.bodyB=g.id<b.id?b:g,E.parentA=E.bodyA.parent,E.parentB=E.bodyB.parent),g=E.bodyA,b=E.bodyB;var T;h.overlap<m.overlap?T=h:T=m;var k=E.normal,M=E.supports,N=T.axis,O=N.x,A=N.y;O*(b.position.x-g.position.x)+A*(b.position.y-g.position.y)<0?(k.x=O,k.y=A):(k.x=-O,k.y=-A),E.tangent.x=-k.y,E.tangent.y=k.x,E.depth=T.overlap,E.penetration.x=k.x*E.depth,E.penetration.y=k.y*E.depth;var C=s._findSupports(g,b,k,1),L=0;if(l.contains(g.vertices,C[0])&&(M[L++]=C[0]),l.contains(g.vertices,C[1])&&(M[L++]=C[1]),L<2){var _=s._findSupports(b,g,k,-1);l.contains(b.vertices,_[0])&&(M[L++]=_[0]),L<2&&l.contains(b.vertices,_[1])&&(M[L++]=_[1])}return L===0&&(M[L++]=C[0]),M.length=L,E},s._overlapAxes=function(g,b,p,y){var E=b.length,T=p.length,k=b[0].x,M=b[0].y,N=p[0].x,O=p[0].y,A=y.length,C=Number.MAX_VALUE,L=0,_,j,D,P,U,J;for(U=0;U<A;U++){var q=y[U],z=q.x,H=q.y,X=k*z+M*H,Z=N*z+O*H,ie=X,V=Z;for(J=1;J<E;J+=1)P=b[J].x*z+b[J].y*H,P>ie?ie=P:P<X&&(X=P);for(J=1;J<T;J+=1)P=p[J].x*z+p[J].y*H,P>V?V=P:P<Z&&(Z=P);if(j=ie-Z,D=V-X,_=j<D?j:D,_<C&&(C=_,L=U,_<=0))break}g.axis=y[L],g.overlap=C},s._projectToAxis=function(g,b,p){for(var y=b[0].x*p.x+b[0].y*p.y,E=y,T=1;T<b.length;T+=1){var k=b[T].x*p.x+b[T].y*p.y;k>E?E=k:k<y&&(y=k)}g.min=y,g.max=E},s._findSupports=function(g,b,p,y){var E=b.vertices,T=E.length,k=g.position.x,M=g.position.y,N=p.x*y,O=p.y*y,A=Number.MAX_VALUE,C,L,_,j,D;for(D=0;D<T;D+=1)L=E[D],j=N*(k-L.x)+O*(M-L.y),j<A&&(A=j,C=L);return _=E[(T+C.index-1)%T],A=N*(k-_.x)+O*(M-_.y),L=E[(C.index+1)%T],N*(k-L.x)+O*(M-L.y)<A?(d[0]=C,d[1]=L,d):(d[0]=C,d[1]=_,d)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(16);(function(){s.create=function(c,d){var h=c.bodyA,m=c.bodyB,g={id:s.id(h,m),bodyA:h,bodyB:m,collision:c,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:h.isSensor||m.isSensor,timeCreated:d,timeUpdated:d,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(g,c,d),g},s.update=function(c,d,h){var m=c.contacts,g=d.supports,b=c.activeContacts,p=d.parentA,y=d.parentB,E=p.vertices.length;c.isActive=!0,c.timeUpdated=h,c.collision=d,c.separation=d.depth,c.inverseMass=p.inverseMass+y.inverseMass,c.friction=p.friction<y.friction?p.friction:y.friction,c.frictionStatic=p.frictionStatic>y.frictionStatic?p.frictionStatic:y.frictionStatic,c.restitution=p.restitution>y.restitution?p.restitution:y.restitution,c.slop=p.slop>y.slop?p.slop:y.slop,d.pair=c,b.length=0;for(var T=0;T<g.length;T++){var k=g[T],M=k.body===p?k.index:E+k.index,N=m[M];N?b.push(N):b.push(m[M]=l.create(k))}},s.setActive=function(c,d,h){d?(c.isActive=!0,c.timeUpdated=h):(c.isActive=!1,c.activeContacts.length=0)},s.id=function(c,d){return c.id<d.id?"A"+c.id+"B"+d.id:"A"+d.id+"B"+c.id}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(2),d=o(7),h=o(1),m=o(11),g=o(0);(function(){s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(b){var p=b;p.bodyA&&!p.pointA&&(p.pointA={x:0,y:0}),p.bodyB&&!p.pointB&&(p.pointB={x:0,y:0});var y=p.bodyA?c.add(p.bodyA.position,p.pointA):p.pointA,E=p.bodyB?c.add(p.bodyB.position,p.pointB):p.pointB,T=c.magnitude(c.sub(y,E));p.length=typeof p.length<"u"?p.length:T,p.id=p.id||g.nextId(),p.label=p.label||"Constraint",p.type="constraint",p.stiffness=p.stiffness||(p.length>0?1:.7),p.damping=p.damping||0,p.angularStiffness=p.angularStiffness||0,p.angleA=p.bodyA?p.bodyA.angle:p.angleA,p.angleB=p.bodyB?p.bodyB.angle:p.angleB,p.plugin={};var k={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return p.length===0&&p.stiffness>.1?(k.type="pin",k.anchors=!1):p.stiffness<.9&&(k.type="spring"),p.render=g.extend(k,p.render),p},s.preSolveAll=function(b){for(var p=0;p<b.length;p+=1){var y=b[p],E=y.constraintImpulse;y.isStatic||E.x===0&&E.y===0&&E.angle===0||(y.position.x+=E.x,y.position.y+=E.y,y.angle+=E.angle)}},s.solveAll=function(b,p){for(var y=g.clamp(p/g._baseDelta,0,1),E=0;E<b.length;E+=1){var T=b[E],k=!T.bodyA||T.bodyA&&T.bodyA.isStatic,M=!T.bodyB||T.bodyB&&T.bodyB.isStatic;(k||M)&&s.solve(b[E],y)}for(E=0;E<b.length;E+=1)T=b[E],k=!T.bodyA||T.bodyA&&T.bodyA.isStatic,M=!T.bodyB||T.bodyB&&T.bodyB.isStatic,!k&&!M&&s.solve(b[E],y)},s.solve=function(b,p){var y=b.bodyA,E=b.bodyB,T=b.pointA,k=b.pointB;if(!(!y&&!E)){y&&!y.isStatic&&(c.rotate(T,y.angle-b.angleA,T),b.angleA=y.angle),E&&!E.isStatic&&(c.rotate(k,E.angle-b.angleB,k),b.angleB=E.angle);var M=T,N=k;if(y&&(M=c.add(y.position,T)),E&&(N=c.add(E.position,k)),!(!M||!N)){var O=c.sub(M,N),A=c.magnitude(O);A<s._minLength&&(A=s._minLength);var C=(A-b.length)/A,L=b.stiffness>=1||b.length===0,_=L?b.stiffness*p:b.stiffness*p*p,j=b.damping*p,D=c.mult(O,C*_),P=(y?y.inverseMass:0)+(E?E.inverseMass:0),U=(y?y.inverseInertia:0)+(E?E.inverseInertia:0),J=P+U,q,z,H,X,Z;if(j>0){var ie=c.create();H=c.div(O,A),Z=c.sub(E&&c.sub(E.position,E.positionPrev)||ie,y&&c.sub(y.position,y.positionPrev)||ie),X=c.dot(H,Z)}y&&!y.isStatic&&(z=y.inverseMass/P,y.constraintImpulse.x-=D.x*z,y.constraintImpulse.y-=D.y*z,y.position.x-=D.x*z,y.position.y-=D.y*z,j>0&&(y.positionPrev.x-=j*H.x*X*z,y.positionPrev.y-=j*H.y*X*z),q=c.cross(T,D)/J*s._torqueDampen*y.inverseInertia*(1-b.angularStiffness),y.constraintImpulse.angle-=q,y.angle-=q),E&&!E.isStatic&&(z=E.inverseMass/P,E.constraintImpulse.x+=D.x*z,E.constraintImpulse.y+=D.y*z,E.position.x+=D.x*z,E.position.y+=D.y*z,j>0&&(E.positionPrev.x+=j*H.x*X*z,E.positionPrev.y+=j*H.y*X*z),q=c.cross(k,D)/J*s._torqueDampen*E.inverseInertia*(1-b.angularStiffness),E.constraintImpulse.angle+=q,E.angle+=q)}}},s.postSolveAll=function(b){for(var p=0;p<b.length;p++){var y=b[p],E=y.constraintImpulse;if(!(y.isStatic||E.x===0&&E.y===0&&E.angle===0)){d.set(y,!1);for(var T=0;T<y.parts.length;T++){var k=y.parts[T];l.translate(k.vertices,E),T>0&&(k.position.x+=E.x,k.position.y+=E.y),E.angle!==0&&(l.rotate(k.vertices,E.angle,y.position),m.rotate(k.axes,E.angle),T>0&&c.rotateAbout(k.position,E.angle,y.position,k.position)),h.update(k.bounds,k.vertices,y.velocity)}E.angle*=s._warming,E.x*=s._warming,E.y*=s._warming}}},s.pointAWorld=function(b){return{x:(b.bodyA?b.bodyA.position.x:0)+(b.pointA?b.pointA.x:0),y:(b.bodyA?b.bodyA.position.y:0)+(b.pointA?b.pointA.y:0)}},s.pointBWorld=function(b){return{x:(b.bodyB?b.bodyB.position.x:0)+(b.pointB?b.pointB.x:0),y:(b.bodyB?b.bodyB.position.y:0)+(b.pointB?b.pointB.y:0)}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(2),c=o(0);(function(){s.fromVertices=function(d){for(var h={},m=0;m<d.length;m++){var g=(m+1)%d.length,b=l.normalise({x:d[g].y-d[m].y,y:d[m].x-d[g].x}),p=b.y===0?1/0:b.x/b.y;p=p.toFixed(3).toString(),h[p]=b}return c.values(h)},s.rotate=function(d,h){if(h!==0)for(var m=Math.cos(h),g=Math.sin(h),b=0;b<d.length;b++){var p=d[b],y;y=p.x*m-p.y*g,p.y=p.x*g+p.y*m,p.x=y}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(0),d=o(4),h=o(1),m=o(2);(function(){s.rectangle=function(g,b,p,y,E){E=E||{};var T={label:"Rectangle Body",position:{x:g,y:b},vertices:l.fromPath("L 0 0 L "+p+" 0 L "+p+" "+y+" L 0 "+y)};if(E.chamfer){var k=E.chamfer;T.vertices=l.chamfer(T.vertices,k.radius,k.quality,k.qualityMin,k.qualityMax),delete E.chamfer}return d.create(c.extend({},T,E))},s.trapezoid=function(g,b,p,y,E,T){T=T||{},E*=.5;var k=(1-E*2)*p,M=p*E,N=M+k,O=N+M,A;E<.5?A="L 0 0 L "+M+" "+-y+" L "+N+" "+-y+" L "+O+" 0":A="L 0 0 L "+N+" "+-y+" L "+O+" 0";var C={label:"Trapezoid Body",position:{x:g,y:b},vertices:l.fromPath(A)};if(T.chamfer){var L=T.chamfer;C.vertices=l.chamfer(C.vertices,L.radius,L.quality,L.qualityMin,L.qualityMax),delete T.chamfer}return d.create(c.extend({},C,T))},s.circle=function(g,b,p,y,E){y=y||{};var T={label:"Circle Body",circleRadius:p};E=E||25;var k=Math.ceil(Math.max(10,Math.min(E,p)));return k%2===1&&(k+=1),s.polygon(g,b,k,p,c.extend({},T,y))},s.polygon=function(g,b,p,y,E){if(E=E||{},p<3)return s.circle(g,b,y,E);for(var T=2*Math.PI/p,k="",M=T*.5,N=0;N<p;N+=1){var O=M+N*T,A=Math.cos(O)*y,C=Math.sin(O)*y;k+="L "+A.toFixed(3)+" "+C.toFixed(3)+" "}var L={label:"Polygon Body",position:{x:g,y:b},vertices:l.fromPath(k)};if(E.chamfer){var _=E.chamfer;L.vertices=l.chamfer(L.vertices,_.radius,_.quality,_.qualityMin,_.qualityMax),delete E.chamfer}return d.create(c.extend({},L,E))},s.fromVertices=function(g,b,p,y,E,T,k,M){var N=c.getDecomp(),O,A,C,L,_,j,D,P,U,J,q;for(O=!!(N&&N.quickDecomp),y=y||{},C=[],E=typeof E<"u"?E:!1,T=typeof T<"u"?T:.01,k=typeof k<"u"?k:10,M=typeof M<"u"?M:.01,c.isArray(p[0])||(p=[p]),J=0;J<p.length;J+=1)if(j=p[J],L=l.isConvex(j),_=!L,_&&!O&&c.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),L||!O)L?j=l.clockwiseSort(j):j=l.hull(j),C.push({position:{x:g,y:b},vertices:j});else{var z=j.map(function($){return[$.x,$.y]});N.makeCCW(z),T!==!1&&N.removeCollinearPoints(z,T),M!==!1&&N.removeDuplicatePoints&&N.removeDuplicatePoints(z,M);var H=N.quickDecomp(z);for(D=0;D<H.length;D++){var X=H[D],Z=X.map(function($){return{x:$[0],y:$[1]}});k>0&&l.area(Z)<k||C.push({position:l.centre(Z),vertices:Z})}}for(D=0;D<C.length;D++)C[D]=d.create(c.extend(C[D],y));if(E){var ie=5;for(D=0;D<C.length;D++){var V=C[D];for(P=D+1;P<C.length;P++){var Y=C[P];if(h.overlaps(V.bounds,Y.bounds)){var G=V.vertices,B=Y.vertices;for(U=0;U<V.vertices.length;U++)for(q=0;q<Y.vertices.length;q++){var ne=m.magnitudeSquared(m.sub(G[(U+1)%G.length],B[q])),K=m.magnitudeSquared(m.sub(G[U],B[(q+1)%B.length]));ne<ie&&K<ie&&(G[U].isInternal=!0,B[q].isInternal=!0)}}}}}return C.length>1?(A=d.create(c.extend({parts:C.slice(0)},y)),d.setPosition(A,{x:g,y:b}),A):C[0]}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0),c=o(8);(function(){s.create=function(d){var h={bodies:[],pairs:null};return l.extend(h,d)},s.setBodies=function(d,h){d.bodies=h.slice(0)},s.clear=function(d){d.bodies=[]},s.collisions=function(d){var h=[],m=d.pairs,g=d.bodies,b=g.length,p=s.canCollide,y=c.collides,E,T;for(g.sort(s._compareBoundsX),E=0;E<b;E++){var k=g[E],M=k.bounds,N=k.bounds.max.x,O=k.bounds.max.y,A=k.bounds.min.y,C=k.isStatic||k.isSleeping,L=k.parts.length,_=L===1;for(T=E+1;T<b;T++){var j=g[T],D=j.bounds;if(D.min.x>N)break;if(!(O<D.min.y||A>D.max.y)&&!(C&&(j.isStatic||j.isSleeping))&&p(k.collisionFilter,j.collisionFilter)){var P=j.parts.length;if(_&&P===1){var U=y(k,j,m);U&&h.push(U)}else for(var J=L>1?1:0,q=P>1?1:0,z=J;z<L;z++)for(var H=k.parts[z],M=H.bounds,X=q;X<P;X++){var Z=j.parts[X],D=Z.bounds;if(!(M.min.x>D.max.x||M.max.x<D.min.x||M.max.y<D.min.y||M.min.y>D.max.y)){var U=y(H,Z,m);U&&h.push(U)}}}}}return h},s.canCollide=function(d,h){return d.group===h.group&&d.group!==0?d.group>0:(d.mask&h.category)!==0&&(h.mask&d.category)!==0},s._compareBoundsX=function(d,h){return d.bounds.min.x-h.bounds.min.x}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0);(function(){s.create=function(c){var d={};return c||l.log("Mouse.create: element was undefined, defaulting to document.body","warn"),d.element=c||document.body,d.absolute={x:0,y:0},d.position={x:0,y:0},d.mousedownPosition={x:0,y:0},d.mouseupPosition={x:0,y:0},d.offset={x:0,y:0},d.scale={x:1,y:1},d.wheelDelta=0,d.button=-1,d.pixelRatio=parseInt(d.element.getAttribute("data-pixel-ratio"),10)||1,d.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},d.mousemove=function(h){var m=s._getRelativeMousePosition(h,d.element,d.pixelRatio),g=h.changedTouches;g&&(d.button=0,h.preventDefault()),d.absolute.x=m.x,d.absolute.y=m.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.sourceEvents.mousemove=h},d.mousedown=function(h){var m=s._getRelativeMousePosition(h,d.element,d.pixelRatio),g=h.changedTouches;g?(d.button=0,h.preventDefault()):d.button=h.button,d.absolute.x=m.x,d.absolute.y=m.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.mousedownPosition.x=d.position.x,d.mousedownPosition.y=d.position.y,d.sourceEvents.mousedown=h},d.mouseup=function(h){var m=s._getRelativeMousePosition(h,d.element,d.pixelRatio),g=h.changedTouches;g&&h.preventDefault(),d.button=-1,d.absolute.x=m.x,d.absolute.y=m.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.mouseupPosition.x=d.position.x,d.mouseupPosition.y=d.position.y,d.sourceEvents.mouseup=h},d.mousewheel=function(h){d.wheelDelta=Math.max(-1,Math.min(1,h.wheelDelta||-h.detail)),h.preventDefault()},s.setElement(d,d.element),d},s.setElement=function(c,d){c.element=d,d.addEventListener("mousemove",c.mousemove),d.addEventListener("mousedown",c.mousedown),d.addEventListener("mouseup",c.mouseup),d.addEventListener("mousewheel",c.mousewheel),d.addEventListener("DOMMouseScroll",c.mousewheel),d.addEventListener("touchmove",c.mousemove),d.addEventListener("touchstart",c.mousedown),d.addEventListener("touchend",c.mouseup)},s.clearSourceEvents=function(c){c.sourceEvents.mousemove=null,c.sourceEvents.mousedown=null,c.sourceEvents.mouseup=null,c.sourceEvents.mousewheel=null,c.wheelDelta=0},s.setOffset=function(c,d){c.offset.x=d.x,c.offset.y=d.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y},s.setScale=function(c,d){c.scale.x=d.x,c.scale.y=d.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y},s._getRelativeMousePosition=function(c,d,h){var m=d.getBoundingClientRect(),g=document.documentElement||document.body.parentNode||document.body,b=window.pageXOffset!==void 0?window.pageXOffset:g.scrollLeft,p=window.pageYOffset!==void 0?window.pageYOffset:g.scrollTop,y=c.changedTouches,E,T;return y?(E=y[0].pageX-m.left-b,T=y[0].pageY-m.top-p):(E=c.pageX-m.left-b,T=c.pageY-m.top-p),{x:E/(d.clientWidth/(d.width||d.clientWidth)*h),y:T/(d.clientHeight/(d.height||d.clientHeight)*h)}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0);(function(){s._registry={},s.register=function(c){if(s.isPlugin(c)||l.warn("Plugin.register:",s.toString(c),"does not implement all required fields."),c.name in s._registry){var d=s._registry[c.name],h=s.versionParse(c.version).number,m=s.versionParse(d.version).number;h>m?(l.warn("Plugin.register:",s.toString(d),"was upgraded to",s.toString(c)),s._registry[c.name]=c):h<m?l.warn("Plugin.register:",s.toString(d),"can not be downgraded to",s.toString(c)):c!==d&&l.warn("Plugin.register:",s.toString(c),"is already registered to different plugin object")}else s._registry[c.name]=c;return c},s.resolve=function(c){return s._registry[s.dependencyParse(c).name]},s.toString=function(c){return typeof c=="string"?c:(c.name||"anonymous")+"@"+(c.version||c.range||"0.0.0")},s.isPlugin=function(c){return c&&c.name&&c.version&&c.install},s.isUsed=function(c,d){return c.used.indexOf(d)>-1},s.isFor=function(c,d){var h=c.for&&s.dependencyParse(c.for);return!c.for||d.name===h.name&&s.versionSatisfies(d.version,h.range)},s.use=function(c,d){if(c.uses=(c.uses||[]).concat(d||[]),c.uses.length===0){l.warn("Plugin.use:",s.toString(c),"does not specify any dependencies to install.");return}for(var h=s.dependencies(c),m=l.topologicalSort(h),g=[],b=0;b<m.length;b+=1)if(m[b]!==c.name){var p=s.resolve(m[b]);if(!p){g.push("❌ "+m[b]);continue}s.isUsed(c,p.name)||(s.isFor(p,c)||(l.warn("Plugin.use:",s.toString(p),"is for",p.for,"but installed on",s.toString(c)+"."),p._warned=!0),p.install?p.install(c):(l.warn("Plugin.use:",s.toString(p),"does not specify an install function."),p._warned=!0),p._warned?(g.push("🔶 "+s.toString(p)),delete p._warned):g.push("✅ "+s.toString(p)),c.used.push(p.name))}g.length>0&&l.info(g.join(" "))},s.dependencies=function(c,d){var h=s.dependencyParse(c),m=h.name;if(d=d||{},!(m in d)){c=s.resolve(c)||c,d[m]=l.map(c.uses||[],function(b){s.isPlugin(b)&&s.register(b);var p=s.dependencyParse(b),y=s.resolve(b);return y&&!s.versionSatisfies(y.version,p.range)?(l.warn("Plugin.dependencies:",s.toString(y),"does not satisfy",s.toString(p),"used by",s.toString(h)+"."),y._warned=!0,c._warned=!0):y||(l.warn("Plugin.dependencies:",s.toString(b),"used by",s.toString(h),"could not be resolved."),c._warned=!0),p.name});for(var g=0;g<d[m].length;g+=1)s.dependencies(d[m][g],d);return d}},s.dependencyParse=function(c){if(l.isString(c)){var d=/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/;return d.test(c)||l.warn("Plugin.dependencyParse:",c,"is not a valid dependency string."),{name:c.split("@")[0],range:c.split("@")[1]||"*"}}return{name:c.name,range:c.range||c.version}},s.versionParse=function(c){var d=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;d.test(c)||l.warn("Plugin.versionParse:",c,"is not a valid version or range.");var h=d.exec(c),m=Number(h[4]),g=Number(h[5]),b=Number(h[6]);return{isRange:!!(h[1]||h[2]),version:h[3],range:c,operator:h[1]||h[2]||"",major:m,minor:g,patch:b,parts:[m,g,b],prerelease:h[7],number:m*1e8+g*1e4+b}},s.versionSatisfies=function(c,d){d=d||"*";var h=s.versionParse(d),m=s.versionParse(c);if(h.isRange){if(h.operator==="*"||c==="*")return!0;if(h.operator===">")return m.number>h.number;if(h.operator===">=")return m.number>=h.number;if(h.operator==="~")return m.major===h.major&&m.minor===h.minor&&m.patch>=h.patch;if(h.operator==="^")return h.major>0?m.major===h.major&&m.number>=h.number:h.minor>0?m.minor===h.minor&&m.patch>=h.patch:m.patch===h.patch}return c===d||c==="*"}})()}),(function(n,i){var o={};n.exports=o,(function(){o.create=function(s){return{vertex:s,normalImpulse:0,tangentImpulse:0}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(7),c=o(18),d=o(13),h=o(19),m=o(5),g=o(6),b=o(10),p=o(0),y=o(4);(function(){s.create=function(E){E=E||{};var T={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},k=p.extend(T,E);return k.world=E.world||g.create({label:"World"}),k.pairs=E.pairs||h.create(),k.detector=E.detector||d.create(),k.grid={buckets:[]},k.world.gravity=k.gravity,k.broadphase=k.grid,k.metrics={},k},s.update=function(E,T){var k=p.now(),M=E.world,N=E.detector,O=E.pairs,A=E.timing,C=A.timestamp,L;T=typeof T<"u"?T:p._baseDelta,T*=A.timeScale,A.timestamp+=T,A.lastDelta=T;var _={timestamp:A.timestamp,delta:T};m.trigger(E,"beforeUpdate",_);var j=g.allBodies(M),D=g.allConstraints(M);for(M.isModified&&(d.setBodies(N,j),g.setModified(M,!1,!1,!0)),E.enableSleeping&&l.update(j,T),s._bodiesApplyGravity(j,E.gravity),T>0&&s._bodiesUpdate(j,T),b.preSolveAll(j),L=0;L<E.constraintIterations;L++)b.solveAll(D,T);b.postSolveAll(j),N.pairs=E.pairs;var P=d.collisions(N);h.update(O,P,C),E.enableSleeping&&l.afterCollisions(O.list),O.collisionStart.length>0&&m.trigger(E,"collisionStart",{pairs:O.collisionStart});var U=p.clamp(20/E.positionIterations,0,1);for(c.preSolvePosition(O.list),L=0;L<E.positionIterations;L++)c.solvePosition(O.list,T,U);for(c.postSolvePosition(j),b.preSolveAll(j),L=0;L<E.constraintIterations;L++)b.solveAll(D,T);for(b.postSolveAll(j),c.preSolveVelocity(O.list),L=0;L<E.velocityIterations;L++)c.solveVelocity(O.list,T);return s._bodiesUpdateVelocities(j),O.collisionActive.length>0&&m.trigger(E,"collisionActive",{pairs:O.collisionActive}),O.collisionEnd.length>0&&m.trigger(E,"collisionEnd",{pairs:O.collisionEnd}),s._bodiesClearForces(j),m.trigger(E,"afterUpdate",_),E.timing.lastElapsed=p.now()-k,E},s.merge=function(E,T){if(p.extend(E,T),T.world){E.world=T.world,s.clear(E);for(var k=g.allBodies(E.world),M=0;M<k.length;M++){var N=k[M];l.set(N,!1),N.id=p.nextId()}}},s.clear=function(E){h.clear(E.pairs),d.clear(E.detector)},s._bodiesClearForces=function(E){for(var T=E.length,k=0;k<T;k++){var M=E[k];M.force.x=0,M.force.y=0,M.torque=0}},s._bodiesApplyGravity=function(E,T){var k=typeof T.scale<"u"?T.scale:.001,M=E.length;if(!(T.x===0&&T.y===0||k===0))for(var N=0;N<M;N++){var O=E[N];O.isStatic||O.isSleeping||(O.force.y+=O.mass*T.y*k,O.force.x+=O.mass*T.x*k)}},s._bodiesUpdate=function(E,T){for(var k=E.length,M=0;M<k;M++){var N=E[M];N.isStatic||N.isSleeping||y.update(N,T)}},s._bodiesUpdateVelocities=function(E){for(var T=E.length,k=0;k<T;k++)y.updateVelocities(E[k])}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(0),d=o(1);(function(){s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(h){var m,g,b,p=h.length;for(m=0;m<p;m++)g=h[m],g.isActive&&(b=g.activeContacts.length,g.collision.parentA.totalContacts+=b,g.collision.parentB.totalContacts+=b)},s.solvePosition=function(h,m,g){var b,p,y,E,T,k,M,N,O=s._positionDampen*(g||1),A=c.clamp(m/c._baseDelta,0,1),C=h.length;for(b=0;b<C;b++)p=h[b],!(!p.isActive||p.isSensor)&&(y=p.collision,E=y.parentA,T=y.parentB,k=y.normal,p.separation=k.x*(T.positionImpulse.x+y.penetration.x-E.positionImpulse.x)+k.y*(T.positionImpulse.y+y.penetration.y-E.positionImpulse.y));for(b=0;b<C;b++)p=h[b],!(!p.isActive||p.isSensor)&&(y=p.collision,E=y.parentA,T=y.parentB,k=y.normal,N=p.separation-p.slop*A,(E.isStatic||T.isStatic)&&(N*=2),E.isStatic||E.isSleeping||(M=O/E.totalContacts,E.positionImpulse.x+=k.x*N*M,E.positionImpulse.y+=k.y*N*M),T.isStatic||T.isSleeping||(M=O/T.totalContacts,T.positionImpulse.x-=k.x*N*M,T.positionImpulse.y-=k.y*N*M))},s.postSolvePosition=function(h){for(var m=s._positionWarming,g=h.length,b=l.translate,p=d.update,y=0;y<g;y++){var E=h[y],T=E.positionImpulse,k=T.x,M=T.y,N=E.velocity;if(E.totalContacts=0,k!==0||M!==0){for(var O=0;O<E.parts.length;O++){var A=E.parts[O];b(A.vertices,T),p(A.bounds,A.vertices,N),A.position.x+=k,A.position.y+=M}E.positionPrev.x+=k,E.positionPrev.y+=M,k*N.x+M*N.y<0?(T.x=0,T.y=0):(T.x*=m,T.y*=m)}}},s.preSolveVelocity=function(h){var m=h.length,g,b;for(g=0;g<m;g++){var p=h[g];if(!(!p.isActive||p.isSensor)){var y=p.activeContacts,E=y.length,T=p.collision,k=T.parentA,M=T.parentB,N=T.normal,O=T.tangent;for(b=0;b<E;b++){var A=y[b],C=A.vertex,L=A.normalImpulse,_=A.tangentImpulse;if(L!==0||_!==0){var j=N.x*L+O.x*_,D=N.y*L+O.y*_;k.isStatic||k.isSleeping||(k.positionPrev.x+=j*k.inverseMass,k.positionPrev.y+=D*k.inverseMass,k.anglePrev+=k.inverseInertia*((C.x-k.position.x)*D-(C.y-k.position.y)*j)),M.isStatic||M.isSleeping||(M.positionPrev.x-=j*M.inverseMass,M.positionPrev.y-=D*M.inverseMass,M.anglePrev-=M.inverseInertia*((C.x-M.position.x)*D-(C.y-M.position.y)*j))}}}}},s.solveVelocity=function(h,m){var g=m/c._baseDelta,b=g*g,p=b*g,y=-s._restingThresh*g,E=s._restingThreshTangent,T=s._frictionNormalMultiplier*g,k=s._frictionMaxStatic,M=h.length,N,O,A,C;for(A=0;A<M;A++){var L=h[A];if(!(!L.isActive||L.isSensor)){var _=L.collision,j=_.parentA,D=_.parentB,P=j.velocity,U=D.velocity,J=_.normal.x,q=_.normal.y,z=_.tangent.x,H=_.tangent.y,X=L.activeContacts,Z=X.length,ie=1/Z,V=j.inverseMass+D.inverseMass,Y=L.friction*L.frictionStatic*T;for(P.x=j.position.x-j.positionPrev.x,P.y=j.position.y-j.positionPrev.y,U.x=D.position.x-D.positionPrev.x,U.y=D.position.y-D.positionPrev.y,j.angularVelocity=j.angle-j.anglePrev,D.angularVelocity=D.angle-D.anglePrev,C=0;C<Z;C++){var G=X[C],B=G.vertex,ne=B.x-j.position.x,K=B.y-j.position.y,$=B.x-D.position.x,se=B.y-D.position.y,de=P.x-K*j.angularVelocity,Ce=P.y+ne*j.angularVelocity,qe=U.x-se*D.angularVelocity,$e=U.y+$*D.angularVelocity,We=de-qe,Ct=Ce-$e,Rt=J*We+q*Ct,Nt=z*We+H*Ct,Kt=L.separation+Rt,mn=Math.min(Kt,1);mn=Kt<0?0:mn;var pn=mn*Y;Nt<-pn||Nt>pn?(O=Nt>0?Nt:-Nt,N=L.friction*(Nt>0?1:-1)*p,N<-O?N=-O:N>O&&(N=O)):(N=Nt,O=k);var Qt=ne*q-K*J,pt=$*q-se*J,gn=ie/(V+j.inverseInertia*Qt*Qt+D.inverseInertia*pt*pt),Ht=(1+L.restitution)*Rt*gn;if(N*=gn,Rt<y)G.normalImpulse=0;else{var ge=G.normalImpulse;G.normalImpulse+=Ht,G.normalImpulse>0&&(G.normalImpulse=0),Ht=G.normalImpulse-ge}if(Nt<-E||Nt>E)G.tangentImpulse=0;else{var Ue=G.tangentImpulse;G.tangentImpulse+=N,G.tangentImpulse<-O&&(G.tangentImpulse=-O),G.tangentImpulse>O&&(G.tangentImpulse=O),N=G.tangentImpulse-Ue}var Ie=J*Ht+z*N,he=q*Ht+H*N;j.isStatic||j.isSleeping||(j.positionPrev.x+=Ie*j.inverseMass,j.positionPrev.y+=he*j.inverseMass,j.anglePrev+=(ne*he-K*Ie)*j.inverseInertia),D.isStatic||D.isSleeping||(D.positionPrev.x-=Ie*D.inverseMass,D.positionPrev.y-=he*D.inverseMass,D.anglePrev-=($*he-se*Ie)*D.inverseInertia)}}}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(9),c=o(0);(function(){s.create=function(d){return c.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},d)},s.update=function(d,h,m){var g=d.list,b=g.length,p=d.table,y=h.length,E=d.collisionStart,T=d.collisionEnd,k=d.collisionActive,M,N,O,A;for(E.length=0,T.length=0,k.length=0,A=0;A<b;A++)g[A].confirmedActive=!1;for(A=0;A<y;A++)M=h[A],O=M.pair,O?(O.isActive?k.push(O):E.push(O),l.update(O,M,m),O.confirmedActive=!0):(O=l.create(M,m),p[O.id]=O,E.push(O),g.push(O));var C=[];for(b=g.length,A=0;A<b;A++)O=g[A],O.confirmedActive||(l.setActive(O,!1,m),T.push(O),!O.collision.bodyA.isSleeping&&!O.collision.bodyB.isSleeping&&C.push(A));for(A=0;A<C.length;A++)N=C[A]-A,O=g[N],g.splice(N,1),delete p[O.id]},s.clear=function(d){return d.table={},d.list.length=0,d.collisionStart.length=0,d.collisionActive.length=0,d.collisionEnd.length=0,d}})()}),(function(n,i,o){var s=n.exports=o(21);s.Axes=o(11),s.Bodies=o(12),s.Body=o(4),s.Bounds=o(1),s.Collision=o(8),s.Common=o(0),s.Composite=o(6),s.Composites=o(22),s.Constraint=o(10),s.Contact=o(16),s.Detector=o(13),s.Engine=o(17),s.Events=o(5),s.Grid=o(23),s.Mouse=o(14),s.MouseConstraint=o(24),s.Pair=o(9),s.Pairs=o(19),s.Plugin=o(15),s.Query=o(25),s.Render=o(26),s.Resolver=o(18),s.Runner=o(27),s.SAT=o(28),s.Sleeping=o(7),s.Svg=o(29),s.Vector=o(2),s.Vertices=o(3),s.World=o(30),s.Engine.run=s.Runner.run,s.Common.deprecated(s.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")}),(function(n,i,o){var s={};n.exports=s;var l=o(15),c=o(0);(function(){s.name="matter-js",s.version="0.19.0",s.uses=[],s.used=[],s.use=function(){l.use(s,Array.prototype.slice.call(arguments))},s.before=function(d,h){return d=d.replace(/^Matter./,""),c.chainPathBefore(s,d,h)},s.after=function(d,h){return d=d.replace(/^Matter./,""),c.chainPathAfter(s,d,h)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(6),c=o(10),d=o(0),h=o(4),m=o(12),g=d.deprecated;(function(){s.stack=function(b,p,y,E,T,k,M){for(var N=l.create({label:"Stack"}),O=b,A=p,C,L=0,_=0;_<E;_++){for(var j=0,D=0;D<y;D++){var P=M(O,A,D,_,C,L);if(P){var U=P.bounds.max.y-P.bounds.min.y,J=P.bounds.max.x-P.bounds.min.x;U>j&&(j=U),h.translate(P,{x:J*.5,y:U*.5}),O=P.bounds.max.x+T,l.addBody(N,P),C=P,L+=1}else O+=T}A+=j+k,O=b}return N},s.chain=function(b,p,y,E,T,k){for(var M=b.bodies,N=1;N<M.length;N++){var O=M[N-1],A=M[N],C=O.bounds.max.y-O.bounds.min.y,L=O.bounds.max.x-O.bounds.min.x,_=A.bounds.max.y-A.bounds.min.y,j=A.bounds.max.x-A.bounds.min.x,D={bodyA:O,pointA:{x:L*p,y:C*y},bodyB:A,pointB:{x:j*E,y:_*T}},P=d.extend(D,k);l.addConstraint(b,c.create(P))}return b.label+=" Chain",b},s.mesh=function(b,p,y,E,T){var k=b.bodies,M,N,O,A,C;for(M=0;M<y;M++){for(N=1;N<p;N++)O=k[N-1+M*p],A=k[N+M*p],l.addConstraint(b,c.create(d.extend({bodyA:O,bodyB:A},T)));if(M>0)for(N=0;N<p;N++)O=k[N+(M-1)*p],A=k[N+M*p],l.addConstraint(b,c.create(d.extend({bodyA:O,bodyB:A},T))),E&&N>0&&(C=k[N-1+(M-1)*p],l.addConstraint(b,c.create(d.extend({bodyA:C,bodyB:A},T)))),E&&N<p-1&&(C=k[N+1+(M-1)*p],l.addConstraint(b,c.create(d.extend({bodyA:C,bodyB:A},T))))}return b.label+=" Mesh",b},s.pyramid=function(b,p,y,E,T,k,M){return s.stack(b,p,y,E,T,k,function(N,O,A,C,L,_){var j=Math.min(E,Math.ceil(y/2)),D=L?L.bounds.max.x-L.bounds.min.x:0;if(!(C>j)){C=j-C;var P=C,U=y-1-C;if(!(A<P||A>U)){_===1&&h.translate(L,{x:(A+(y%2===1?1:-1))*D,y:0});var J=L?A*D:0;return M(b+J+A*T,O,A,C,L,_)}}})},s.newtonsCradle=function(b,p,y,E,T){for(var k=l.create({label:"Newtons Cradle"}),M=0;M<y;M++){var N=1.9,O=m.circle(b+M*(E*N),p+T,E,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),A=c.create({pointA:{x:b+M*(E*N),y:p},bodyB:O});l.addBody(k,O),l.addConstraint(k,A)}return k},g(s,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),s.car=function(b,p,y,E,T){var k=h.nextGroup(!0),M=20,N=-y*.5+M,O=y*.5-M,A=0,C=l.create({label:"Car"}),L=m.rectangle(b,p,y,E,{collisionFilter:{group:k},chamfer:{radius:E*.5},density:2e-4}),_=m.circle(b+N,p+A,T,{collisionFilter:{group:k},friction:.8}),j=m.circle(b+O,p+A,T,{collisionFilter:{group:k},friction:.8}),D=c.create({bodyB:L,pointB:{x:N,y:A},bodyA:_,stiffness:1,length:0}),P=c.create({bodyB:L,pointB:{x:O,y:A},bodyA:j,stiffness:1,length:0});return l.addBody(C,L),l.addBody(C,_),l.addBody(C,j),l.addConstraint(C,D),l.addConstraint(C,P),C},g(s,"car","Composites.car ➤ moved to car example"),s.softBody=function(b,p,y,E,T,k,M,N,O,A){O=d.extend({inertia:1/0},O),A=d.extend({stiffness:.2,render:{type:"line",anchors:!1}},A);var C=s.stack(b,p,y,E,T,k,function(L,_){return m.circle(L,_,N,O)});return s.mesh(C,y,E,M,A),C.label="Soft Body",C},g(s,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")})()}),(function(n,i,o){var s={};n.exports=s;var l=o(9),c=o(0),d=c.deprecated;(function(){s.create=function(h){var m={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return c.extend(m,h)},s.update=function(h,m,g,b){var p,y,E,T=g.world,k=h.buckets,M,N,O=!1;for(p=0;p<m.length;p++){var A=m[p];if(!(A.isSleeping&&!b)&&!(T.bounds&&(A.bounds.max.x<T.bounds.min.x||A.bounds.min.x>T.bounds.max.x||A.bounds.max.y<T.bounds.min.y||A.bounds.min.y>T.bounds.max.y))){var C=s._getRegion(h,A);if(!A.region||C.id!==A.region.id||b){(!A.region||b)&&(A.region=C);var L=s._regionUnion(C,A.region);for(y=L.startCol;y<=L.endCol;y++)for(E=L.startRow;E<=L.endRow;E++){N=s._getBucketId(y,E),M=k[N];var _=y>=C.startCol&&y<=C.endCol&&E>=C.startRow&&E<=C.endRow,j=y>=A.region.startCol&&y<=A.region.endCol&&E>=A.region.startRow&&E<=A.region.endRow;!_&&j&&j&&M&&s._bucketRemoveBody(h,M,A),(A.region===C||_&&!j||b)&&(M||(M=s._createBucket(k,N)),s._bucketAddBody(h,M,A))}A.region=C,O=!0}}}O&&(h.pairsList=s._createActivePairsList(h))},d(s,"update","Grid.update ➤ replaced by Matter.Detector"),s.clear=function(h){h.buckets={},h.pairs={},h.pairsList=[]},d(s,"clear","Grid.clear ➤ replaced by Matter.Detector"),s._regionUnion=function(h,m){var g=Math.min(h.startCol,m.startCol),b=Math.max(h.endCol,m.endCol),p=Math.min(h.startRow,m.startRow),y=Math.max(h.endRow,m.endRow);return s._createRegion(g,b,p,y)},s._getRegion=function(h,m){var g=m.bounds,b=Math.floor(g.min.x/h.bucketWidth),p=Math.floor(g.max.x/h.bucketWidth),y=Math.floor(g.min.y/h.bucketHeight),E=Math.floor(g.max.y/h.bucketHeight);return s._createRegion(b,p,y,E)},s._createRegion=function(h,m,g,b){return{id:h+","+m+","+g+","+b,startCol:h,endCol:m,startRow:g,endRow:b}},s._getBucketId=function(h,m){return"C"+h+"R"+m},s._createBucket=function(h,m){var g=h[m]=[];return g},s._bucketAddBody=function(h,m,g){var b=h.pairs,p=l.id,y=m.length,E;for(E=0;E<y;E++){var T=m[E];if(!(g.id===T.id||g.isStatic&&T.isStatic)){var k=p(g,T),M=b[k];M?M[2]+=1:b[k]=[g,T,1]}}m.push(g)},s._bucketRemoveBody=function(h,m,g){var b=h.pairs,p=l.id,y;m.splice(c.indexOf(m,g),1);var E=m.length;for(y=0;y<E;y++){var T=b[p(g,m[y])];T&&(T[2]-=1)}},s._createActivePairsList=function(h){var m,g=h.pairs,b=c.keys(g),p=b.length,y=[],E;for(E=0;E<p;E++)m=g[b[E]],m[2]>0?y.push(m):delete g[b[E]];return y}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(7),d=o(14),h=o(5),m=o(13),g=o(10),b=o(6),p=o(0),y=o(1);(function(){s.create=function(E,T){var k=(E?E.mouse:null)||(T?T.mouse:null);k||(E&&E.render&&E.render.canvas?k=d.create(E.render.canvas):T&&T.element?k=d.create(T.element):(k=d.create(),p.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var M=g.create({label:"Mouse Constraint",pointA:k.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),N={type:"mouseConstraint",mouse:k,element:null,body:null,constraint:M,collisionFilter:{category:1,mask:4294967295,group:0}},O=p.extend(N,T);return h.on(E,"beforeUpdate",function(){var A=b.allBodies(E.world);s.update(O,A),s._triggerEvents(O)}),O},s.update=function(E,T){var k=E.mouse,M=E.constraint,N=E.body;if(k.button===0){if(M.bodyB)c.set(M.bodyB,!1),M.pointA=k.position;else for(var O=0;O<T.length;O++)if(N=T[O],y.contains(N.bounds,k.position)&&m.canCollide(N.collisionFilter,E.collisionFilter))for(var A=N.parts.length>1?1:0;A<N.parts.length;A++){var C=N.parts[A];if(l.contains(C.vertices,k.position)){M.pointA=k.position,M.bodyB=E.body=N,M.pointB={x:k.position.x-N.position.x,y:k.position.y-N.position.y},M.angleB=N.angle,c.set(N,!1),h.trigger(E,"startdrag",{mouse:k,body:N});break}}}else M.bodyB=E.body=null,M.pointB=null,N&&h.trigger(E,"enddrag",{mouse:k,body:N})},s._triggerEvents=function(E){var T=E.mouse,k=T.sourceEvents;k.mousemove&&h.trigger(E,"mousemove",{mouse:T}),k.mousedown&&h.trigger(E,"mousedown",{mouse:T}),k.mouseup&&h.trigger(E,"mouseup",{mouse:T}),d.clearSourceEvents(T)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(2),c=o(8),d=o(1),h=o(12),m=o(3);(function(){s.collides=function(g,b){for(var p=[],y=b.length,E=g.bounds,T=c.collides,k=d.overlaps,M=0;M<y;M++){var N=b[M],O=N.parts.length,A=O===1?0:1;if(k(N.bounds,E))for(var C=A;C<O;C++){var L=N.parts[C];if(k(L.bounds,E)){var _=T(L,g);if(_){p.push(_);break}}}}return p},s.ray=function(g,b,p,y){y=y||1e-100;for(var E=l.angle(b,p),T=l.magnitude(l.sub(b,p)),k=(p.x+b.x)*.5,M=(p.y+b.y)*.5,N=h.rectangle(k,M,T,y,{angle:E}),O=s.collides(N,g),A=0;A<O.length;A+=1){var C=O[A];C.body=C.bodyB=C.bodyA}return O},s.region=function(g,b,p){for(var y=[],E=0;E<g.length;E++){var T=g[E],k=d.overlaps(T.bounds,b);(k&&!p||!k&&p)&&y.push(T)}return y},s.point=function(g,b){for(var p=[],y=0;y<g.length;y++){var E=g[y];if(d.contains(E.bounds,b))for(var T=E.parts.length===1?0:1;T<E.parts.length;T++){var k=E.parts[T];if(d.contains(k.bounds,b)&&m.contains(k.vertices,b)){p.push(E);break}}}return p}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(0),d=o(6),h=o(1),m=o(5),g=o(2),b=o(14);(function(){var p,y;typeof window<"u"&&(p=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(A){window.setTimeout(function(){A(c.now())},1e3/60)},y=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),s._goodFps=30,s._goodDelta=1e3/60,s.create=function(A){var C={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",hasBounds:!!A.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},L=c.extend(C,A);return L.canvas&&(L.canvas.width=L.options.width||L.canvas.width,L.canvas.height=L.options.height||L.canvas.height),L.mouse=A.mouse,L.engine=A.engine,L.canvas=L.canvas||k(L.options.width,L.options.height),L.context=L.canvas.getContext("2d"),L.textures={},L.bounds=L.bounds||{min:{x:0,y:0},max:{x:L.canvas.width,y:L.canvas.height}},L.controller=s,L.options.showBroadphase=!1,L.options.pixelRatio!==1&&s.setPixelRatio(L,L.options.pixelRatio),c.isElement(L.element)&&L.element.appendChild(L.canvas),L},s.run=function(A){(function C(L){A.frameRequestId=p(C),E(A,L),s.world(A,L),(A.options.showStats||A.options.showDebug)&&s.stats(A,A.context,L),(A.options.showPerformance||A.options.showDebug)&&s.performance(A,A.context,L)})()},s.stop=function(A){y(A.frameRequestId)},s.setPixelRatio=function(A,C){var L=A.options,_=A.canvas;C==="auto"&&(C=M(_)),L.pixelRatio=C,_.setAttribute("data-pixel-ratio",C),_.width=L.width*C,_.height=L.height*C,_.style.width=L.width+"px",_.style.height=L.height+"px"},s.lookAt=function(A,C,L,_){_=typeof _<"u"?_:!0,C=c.isArray(C)?C:[C],L=L||{x:0,y:0};for(var j={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},D=0;D<C.length;D+=1){var P=C[D],U=P.bounds?P.bounds.min:P.min||P.position||P,J=P.bounds?P.bounds.max:P.max||P.position||P;U&&J&&(U.x<j.min.x&&(j.min.x=U.x),J.x>j.max.x&&(j.max.x=J.x),U.y<j.min.y&&(j.min.y=U.y),J.y>j.max.y&&(j.max.y=J.y))}var q=j.max.x-j.min.x+2*L.x,z=j.max.y-j.min.y+2*L.y,H=A.canvas.height,X=A.canvas.width,Z=X/H,ie=q/z,V=1,Y=1;ie>Z?Y=ie/Z:V=Z/ie,A.options.hasBounds=!0,A.bounds.min.x=j.min.x,A.bounds.max.x=j.min.x+q*V,A.bounds.min.y=j.min.y,A.bounds.max.y=j.min.y+z*Y,_&&(A.bounds.min.x+=q*.5-q*V*.5,A.bounds.max.x+=q*.5-q*V*.5,A.bounds.min.y+=z*.5-z*Y*.5,A.bounds.max.y+=z*.5-z*Y*.5),A.bounds.min.x-=L.x,A.bounds.max.x-=L.x,A.bounds.min.y-=L.y,A.bounds.max.y-=L.y,A.mouse&&(b.setScale(A.mouse,{x:(A.bounds.max.x-A.bounds.min.x)/A.canvas.width,y:(A.bounds.max.y-A.bounds.min.y)/A.canvas.height}),b.setOffset(A.mouse,A.bounds.min))},s.startViewTransform=function(A){var C=A.bounds.max.x-A.bounds.min.x,L=A.bounds.max.y-A.bounds.min.y,_=C/A.options.width,j=L/A.options.height;A.context.setTransform(A.options.pixelRatio/_,0,0,A.options.pixelRatio/j,0,0),A.context.translate(-A.bounds.min.x,-A.bounds.min.y)},s.endViewTransform=function(A){A.context.setTransform(A.options.pixelRatio,0,0,A.options.pixelRatio,0,0)},s.world=function(A,C){var L=c.now(),_=A.engine,j=_.world,D=A.canvas,P=A.context,U=A.options,J=A.timing,q=d.allBodies(j),z=d.allConstraints(j),H=U.wireframes?U.wireframeBackground:U.background,X=[],Z=[],ie,V={timestamp:_.timing.timestamp};if(m.trigger(A,"beforeRender",V),A.currentBackground!==H&&O(A,H),P.globalCompositeOperation="source-in",P.fillStyle="transparent",P.fillRect(0,0,D.width,D.height),P.globalCompositeOperation="source-over",U.hasBounds){for(ie=0;ie<q.length;ie++){var Y=q[ie];h.overlaps(Y.bounds,A.bounds)&&X.push(Y)}for(ie=0;ie<z.length;ie++){var G=z[ie],B=G.bodyA,ne=G.bodyB,K=G.pointA,$=G.pointB;B&&(K=g.add(B.position,G.pointA)),ne&&($=g.add(ne.position,G.pointB)),!(!K||!$)&&(h.contains(A.bounds,K)||h.contains(A.bounds,$))&&Z.push(G)}s.startViewTransform(A),A.mouse&&(b.setScale(A.mouse,{x:(A.bounds.max.x-A.bounds.min.x)/A.options.width,y:(A.bounds.max.y-A.bounds.min.y)/A.options.height}),b.setOffset(A.mouse,A.bounds.min))}else Z=z,X=q,A.options.pixelRatio!==1&&A.context.setTransform(A.options.pixelRatio,0,0,A.options.pixelRatio,0,0);!U.wireframes||_.enableSleeping&&U.showSleeping?s.bodies(A,X,P):(U.showConvexHulls&&s.bodyConvexHulls(A,X,P),s.bodyWireframes(A,X,P)),U.showBounds&&s.bodyBounds(A,X,P),(U.showAxes||U.showAngleIndicator)&&s.bodyAxes(A,X,P),U.showPositions&&s.bodyPositions(A,X,P),U.showVelocity&&s.bodyVelocity(A,X,P),U.showIds&&s.bodyIds(A,X,P),U.showSeparations&&s.separations(A,_.pairs.list,P),U.showCollisions&&s.collisions(A,_.pairs.list,P),U.showVertexNumbers&&s.vertexNumbers(A,X,P),U.showMousePosition&&s.mousePosition(A,A.mouse,P),s.constraints(Z,P),U.hasBounds&&s.endViewTransform(A),m.trigger(A,"afterRender",V),J.lastElapsed=c.now()-L},s.stats=function(A,C,L){for(var _=A.engine,j=_.world,D=d.allBodies(j),P=0,U=55,J=44,q=0,z=0,H=0;H<D.length;H+=1)P+=D[H].parts.length;var X={Part:P,Body:D.length,Cons:d.allConstraints(j).length,Comp:d.allComposites(j).length,Pair:_.pairs.list.length};C.fillStyle="#0e0f19",C.fillRect(q,z,U*5.5,J),C.font="12px Arial",C.textBaseline="top",C.textAlign="right";for(var Z in X){var ie=X[Z];C.fillStyle="#aaa",C.fillText(Z,q+U,z+8),C.fillStyle="#eee",C.fillText(ie,q+U,z+26),q+=U}},s.performance=function(A,C){var L=A.engine,_=A.timing,j=_.deltaHistory,D=_.elapsedHistory,P=_.timestampElapsedHistory,U=_.engineDeltaHistory,J=_.engineElapsedHistory,q=L.timing.lastDelta,z=T(j),H=T(D),X=T(U),Z=T(J),ie=T(P),V=ie/z||0,Y=1e3/z||0,G=4,B=12,ne=60,K=34,$=10,se=69;C.fillStyle="#0e0f19",C.fillRect(0,50,B*4+ne*5+22,K),s.status(C,$,se,ne,G,j.length,Math.round(Y)+" fps",Y/s._goodFps,function(de){return j[de]/z-1}),s.status(C,$+B+ne,se,ne,G,U.length,q.toFixed(2)+" dt",s._goodDelta/q,function(de){return U[de]/X-1}),s.status(C,$+(B+ne)*2,se,ne,G,J.length,Z.toFixed(2)+" ut",1-Z/s._goodFps,function(de){return J[de]/Z-1}),s.status(C,$+(B+ne)*3,se,ne,G,D.length,H.toFixed(2)+" rt",1-H/s._goodFps,function(de){return D[de]/H-1}),s.status(C,$+(B+ne)*4,se,ne,G,P.length,V.toFixed(2)+" x",V*V*V,function(de){return(P[de]/j[de]/V||0)-1})},s.status=function(A,C,L,_,j,D,P,U,J){A.strokeStyle="#888",A.fillStyle="#444",A.lineWidth=1,A.fillRect(C,L+7,_,1),A.beginPath(),A.moveTo(C,L+7-j*c.clamp(.4*J(0),-2,2));for(var q=0;q<_;q+=1)A.lineTo(C+q,L+7-(q<D?j*c.clamp(.4*J(q),-2,2):0));A.stroke(),A.fillStyle="hsl("+c.clamp(25+95*U,0,120)+",100%,60%)",A.fillRect(C,L-7,4,4),A.font="12px Arial",A.textBaseline="middle",A.textAlign="right",A.fillStyle="#eee",A.fillText(P,C+_,L-5)},s.constraints=function(A,C){for(var L=C,_=0;_<A.length;_++){var j=A[_];if(!(!j.render.visible||!j.pointA||!j.pointB)){var D=j.bodyA,P=j.bodyB,U,J;if(D?U=g.add(D.position,j.pointA):U=j.pointA,j.render.type==="pin")L.beginPath(),L.arc(U.x,U.y,3,0,2*Math.PI),L.closePath();else{if(P?J=g.add(P.position,j.pointB):J=j.pointB,L.beginPath(),L.moveTo(U.x,U.y),j.render.type==="spring")for(var q=g.sub(J,U),z=g.perp(g.normalise(q)),H=Math.ceil(c.clamp(j.length/5,12,20)),X,Z=1;Z<H;Z+=1)X=Z%2===0?1:-1,L.lineTo(U.x+q.x*(Z/H)+z.x*X*4,U.y+q.y*(Z/H)+z.y*X*4);L.lineTo(J.x,J.y)}j.render.lineWidth&&(L.lineWidth=j.render.lineWidth,L.strokeStyle=j.render.strokeStyle,L.stroke()),j.render.anchors&&(L.fillStyle=j.render.strokeStyle,L.beginPath(),L.arc(U.x,U.y,3,0,2*Math.PI),L.arc(J.x,J.y,3,0,2*Math.PI),L.closePath(),L.fill())}}},s.bodies=function(A,C,L){var _=L;A.engine;var j=A.options,D=j.showInternalEdges||!j.wireframes,P,U,J,q;for(J=0;J<C.length;J++)if(P=C[J],!!P.render.visible){for(q=P.parts.length>1?1:0;q<P.parts.length;q++)if(U=P.parts[q],!!U.render.visible){if(j.showSleeping&&P.isSleeping?_.globalAlpha=.5*U.render.opacity:U.render.opacity!==1&&(_.globalAlpha=U.render.opacity),U.render.sprite&&U.render.sprite.texture&&!j.wireframes){var z=U.render.sprite,H=N(A,z.texture);_.translate(U.position.x,U.position.y),_.rotate(U.angle),_.drawImage(H,H.width*-z.xOffset*z.xScale,H.height*-z.yOffset*z.yScale,H.width*z.xScale,H.height*z.yScale),_.rotate(-U.angle),_.translate(-U.position.x,-U.position.y)}else{if(U.circleRadius)_.beginPath(),_.arc(U.position.x,U.position.y,U.circleRadius,0,2*Math.PI);else{_.beginPath(),_.moveTo(U.vertices[0].x,U.vertices[0].y);for(var X=1;X<U.vertices.length;X++)!U.vertices[X-1].isInternal||D?_.lineTo(U.vertices[X].x,U.vertices[X].y):_.moveTo(U.vertices[X].x,U.vertices[X].y),U.vertices[X].isInternal&&!D&&_.moveTo(U.vertices[(X+1)%U.vertices.length].x,U.vertices[(X+1)%U.vertices.length].y);_.lineTo(U.vertices[0].x,U.vertices[0].y),_.closePath()}j.wireframes?(_.lineWidth=1,_.strokeStyle="#bbb",_.stroke()):(_.fillStyle=U.render.fillStyle,U.render.lineWidth&&(_.lineWidth=U.render.lineWidth,_.strokeStyle=U.render.strokeStyle,_.stroke()),_.fill())}_.globalAlpha=1}}},s.bodyWireframes=function(A,C,L){var _=L,j=A.options.showInternalEdges,D,P,U,J,q;for(_.beginPath(),U=0;U<C.length;U++)if(D=C[U],!!D.render.visible)for(q=D.parts.length>1?1:0;q<D.parts.length;q++){for(P=D.parts[q],_.moveTo(P.vertices[0].x,P.vertices[0].y),J=1;J<P.vertices.length;J++)!P.vertices[J-1].isInternal||j?_.lineTo(P.vertices[J].x,P.vertices[J].y):_.moveTo(P.vertices[J].x,P.vertices[J].y),P.vertices[J].isInternal&&!j&&_.moveTo(P.vertices[(J+1)%P.vertices.length].x,P.vertices[(J+1)%P.vertices.length].y);_.lineTo(P.vertices[0].x,P.vertices[0].y)}_.lineWidth=1,_.strokeStyle="#bbb",_.stroke()},s.bodyConvexHulls=function(A,C,L){var _=L,j,D,P;for(_.beginPath(),D=0;D<C.length;D++)if(j=C[D],!(!j.render.visible||j.parts.length===1)){for(_.moveTo(j.vertices[0].x,j.vertices[0].y),P=1;P<j.vertices.length;P++)_.lineTo(j.vertices[P].x,j.vertices[P].y);_.lineTo(j.vertices[0].x,j.vertices[0].y)}_.lineWidth=1,_.strokeStyle="rgba(255,255,255,0.2)",_.stroke()},s.vertexNumbers=function(A,C,L){var _=L,j,D,P;for(j=0;j<C.length;j++){var U=C[j].parts;for(P=U.length>1?1:0;P<U.length;P++){var J=U[P];for(D=0;D<J.vertices.length;D++)_.fillStyle="rgba(255,255,255,0.2)",_.fillText(j+"_"+D,J.position.x+(J.vertices[D].x-J.position.x)*.8,J.position.y+(J.vertices[D].y-J.position.y)*.8)}}},s.mousePosition=function(A,C,L){var _=L;_.fillStyle="rgba(255,255,255,0.8)",_.fillText(C.position.x+" "+C.position.y,C.position.x+5,C.position.y-5)},s.bodyBounds=function(A,C,L){var _=L;A.engine;var j=A.options;_.beginPath();for(var D=0;D<C.length;D++){var P=C[D];if(P.render.visible)for(var U=C[D].parts,J=U.length>1?1:0;J<U.length;J++){var q=U[J];_.rect(q.bounds.min.x,q.bounds.min.y,q.bounds.max.x-q.bounds.min.x,q.bounds.max.y-q.bounds.min.y)}}j.wireframes?_.strokeStyle="rgba(255,255,255,0.08)":_.strokeStyle="rgba(0,0,0,0.1)",_.lineWidth=1,_.stroke()},s.bodyAxes=function(A,C,L){var _=L;A.engine;var j=A.options,D,P,U,J;for(_.beginPath(),P=0;P<C.length;P++){var q=C[P],z=q.parts;if(q.render.visible)if(j.showAxes)for(U=z.length>1?1:0;U<z.length;U++)for(D=z[U],J=0;J<D.axes.length;J++){var H=D.axes[J];_.moveTo(D.position.x,D.position.y),_.lineTo(D.position.x+H.x*20,D.position.y+H.y*20)}else for(U=z.length>1?1:0;U<z.length;U++)for(D=z[U],J=0;J<D.axes.length;J++)_.moveTo(D.position.x,D.position.y),_.lineTo((D.vertices[0].x+D.vertices[D.vertices.length-1].x)/2,(D.vertices[0].y+D.vertices[D.vertices.length-1].y)/2)}j.wireframes?(_.strokeStyle="indianred",_.lineWidth=1):(_.strokeStyle="rgba(255, 255, 255, 0.4)",_.globalCompositeOperation="overlay",_.lineWidth=2),_.stroke(),_.globalCompositeOperation="source-over"},s.bodyPositions=function(A,C,L){var _=L;A.engine;var j=A.options,D,P,U,J;for(_.beginPath(),U=0;U<C.length;U++)if(D=C[U],!!D.render.visible)for(J=0;J<D.parts.length;J++)P=D.parts[J],_.arc(P.position.x,P.position.y,3,0,2*Math.PI,!1),_.closePath();for(j.wireframes?_.fillStyle="indianred":_.fillStyle="rgba(0,0,0,0.5)",_.fill(),_.beginPath(),U=0;U<C.length;U++)D=C[U],D.render.visible&&(_.arc(D.positionPrev.x,D.positionPrev.y,2,0,2*Math.PI,!1),_.closePath());_.fillStyle="rgba(255,165,0,0.8)",_.fill()},s.bodyVelocity=function(A,C,L){var _=L;_.beginPath();for(var j=0;j<C.length;j++){var D=C[j];if(D.render.visible){var P=l.getVelocity(D);_.moveTo(D.position.x,D.position.y),_.lineTo(D.position.x+P.x,D.position.y+P.y)}}_.lineWidth=3,_.strokeStyle="cornflowerblue",_.stroke()},s.bodyIds=function(A,C,L){var _=L,j,D;for(j=0;j<C.length;j++)if(C[j].render.visible){var P=C[j].parts;for(D=P.length>1?1:0;D<P.length;D++){var U=P[D];_.font="12px Arial",_.fillStyle="rgba(255,255,255,0.5)",_.fillText(U.id,U.position.x+10,U.position.y-10)}}},s.collisions=function(A,C,L){var _=L,j=A.options,D,P,U,J;for(_.beginPath(),U=0;U<C.length;U++)if(D=C[U],!!D.isActive)for(P=D.collision,J=0;J<D.activeContacts.length;J++){var q=D.activeContacts[J],z=q.vertex;_.rect(z.x-1.5,z.y-1.5,3.5,3.5)}for(j.wireframes?_.fillStyle="rgba(255,255,255,0.7)":_.fillStyle="orange",_.fill(),_.beginPath(),U=0;U<C.length;U++)if(D=C[U],!!D.isActive&&(P=D.collision,D.activeContacts.length>0)){var H=D.activeContacts[0].vertex.x,X=D.activeContacts[0].vertex.y;D.activeContacts.length===2&&(H=(D.activeContacts[0].vertex.x+D.activeContacts[1].vertex.x)/2,X=(D.activeContacts[0].vertex.y+D.activeContacts[1].vertex.y)/2),P.bodyB===P.supports[0].body||P.bodyA.isStatic===!0?_.moveTo(H-P.normal.x*8,X-P.normal.y*8):_.moveTo(H+P.normal.x*8,X+P.normal.y*8),_.lineTo(H,X)}j.wireframes?_.strokeStyle="rgba(255,165,0,0.7)":_.strokeStyle="orange",_.lineWidth=1,_.stroke()},s.separations=function(A,C,L){var _=L,j=A.options,D,P,U,J,q;for(_.beginPath(),q=0;q<C.length;q++)if(D=C[q],!!D.isActive){P=D.collision,U=P.bodyA,J=P.bodyB;var z=1;!J.isStatic&&!U.isStatic&&(z=.5),J.isStatic&&(z=0),_.moveTo(J.position.x,J.position.y),_.lineTo(J.position.x-P.penetration.x*z,J.position.y-P.penetration.y*z),z=1,!J.isStatic&&!U.isStatic&&(z=.5),U.isStatic&&(z=0),_.moveTo(U.position.x,U.position.y),_.lineTo(U.position.x+P.penetration.x*z,U.position.y+P.penetration.y*z)}j.wireframes?_.strokeStyle="rgba(255,165,0,0.5)":_.strokeStyle="orange",_.stroke()},s.inspector=function(A,C){A.engine;var L=A.selected,_=A.render,j=_.options,D;if(j.hasBounds){var P=_.bounds.max.x-_.bounds.min.x,U=_.bounds.max.y-_.bounds.min.y,J=P/_.options.width,q=U/_.options.height;C.scale(1/J,1/q),C.translate(-_.bounds.min.x,-_.bounds.min.y)}for(var z=0;z<L.length;z++){var H=L[z].data;switch(C.translate(.5,.5),C.lineWidth=1,C.strokeStyle="rgba(255,165,0,0.9)",C.setLineDash([1,2]),H.type){case"body":D=H.bounds,C.beginPath(),C.rect(Math.floor(D.min.x-3),Math.floor(D.min.y-3),Math.floor(D.max.x-D.min.x+6),Math.floor(D.max.y-D.min.y+6)),C.closePath(),C.stroke();break;case"constraint":var X=H.pointA;H.bodyA&&(X=H.pointB),C.beginPath(),C.arc(X.x,X.y,10,0,2*Math.PI),C.closePath(),C.stroke();break}C.setLineDash([]),C.translate(-.5,-.5)}A.selectStart!==null&&(C.translate(.5,.5),C.lineWidth=1,C.strokeStyle="rgba(255,165,0,0.6)",C.fillStyle="rgba(255,165,0,0.1)",D=A.selectBounds,C.beginPath(),C.rect(Math.floor(D.min.x),Math.floor(D.min.y),Math.floor(D.max.x-D.min.x),Math.floor(D.max.y-D.min.y)),C.closePath(),C.stroke(),C.fill(),C.translate(-.5,-.5)),j.hasBounds&&C.setTransform(1,0,0,1,0,0)};var E=function(A,C){var L=A.engine,_=A.timing,j=_.historySize,D=L.timing.timestamp;_.delta=C-_.lastTime||s._goodDelta,_.lastTime=C,_.timestampElapsed=D-_.lastTimestamp||0,_.lastTimestamp=D,_.deltaHistory.unshift(_.delta),_.deltaHistory.length=Math.min(_.deltaHistory.length,j),_.engineDeltaHistory.unshift(L.timing.lastDelta),_.engineDeltaHistory.length=Math.min(_.engineDeltaHistory.length,j),_.timestampElapsedHistory.unshift(_.timestampElapsed),_.timestampElapsedHistory.length=Math.min(_.timestampElapsedHistory.length,j),_.engineElapsedHistory.unshift(L.timing.lastElapsed),_.engineElapsedHistory.length=Math.min(_.engineElapsedHistory.length,j),_.elapsedHistory.unshift(_.lastElapsed),_.elapsedHistory.length=Math.min(_.elapsedHistory.length,j)},T=function(A){for(var C=0,L=0;L<A.length;L+=1)C+=A[L];return C/A.length||0},k=function(A,C){var L=document.createElement("canvas");return L.width=A,L.height=C,L.oncontextmenu=function(){return!1},L.onselectstart=function(){return!1},L},M=function(A){var C=A.getContext("2d"),L=window.devicePixelRatio||1,_=C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1;return L/_},N=function(A,C){var L=A.textures[C];return L||(L=A.textures[C]=new Image,L.src=C,L)},O=function(A,C){var L=C;/(jpg|gif|png)$/.test(C)&&(L="url("+C+")"),A.canvas.style.background=L,A.canvas.style.backgroundSize="contain",A.currentBackground=C}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(5),c=o(17),d=o(0);(function(){var h,m;if(typeof window<"u"&&(h=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,m=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!h){var g;h=function(b){g=setTimeout(function(){b(d.now())},1e3/60)},m=function(){clearTimeout(g)}}s.create=function(b){var p={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},y=d.extend(p,b);return y.delta=y.delta||1e3/y.fps,y.deltaMin=y.deltaMin||1e3/y.fps,y.deltaMax=y.deltaMax||1e3/(y.fps*.5),y.fps=1e3/y.delta,y},s.run=function(b,p){return typeof b.positionIterations<"u"&&(p=b,b=s.create()),(function y(E){b.frameRequestId=h(y),E&&b.enabled&&s.tick(b,p,E)})(),b},s.tick=function(b,p,y){var E=p.timing,T;b.isFixed?T=b.delta:(T=y-b.timePrev||b.delta,b.timePrev=y,b.deltaHistory.push(T),b.deltaHistory=b.deltaHistory.slice(-b.deltaSampleSize),T=Math.min.apply(null,b.deltaHistory),T=T<b.deltaMin?b.deltaMin:T,T=T>b.deltaMax?b.deltaMax:T,b.delta=T);var k={timestamp:E.timestamp};l.trigger(b,"beforeTick",k),b.frameCounter+=1,y-b.counterTimestamp>=1e3&&(b.fps=b.frameCounter*((y-b.counterTimestamp)/1e3),b.counterTimestamp=y,b.frameCounter=0),l.trigger(b,"tick",k),l.trigger(b,"beforeUpdate",k),c.update(p,T),l.trigger(b,"afterUpdate",k),l.trigger(b,"afterTick",k)},s.stop=function(b){m(b.frameRequestId)},s.start=function(b,p){s.run(b,p)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(8),c=o(0),d=c.deprecated;(function(){s.collides=function(h,m){return l.collides(h,m)},d(s,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(n,i,o){var s={};n.exports=s,o(1);var l=o(0);(function(){s.pathToVertices=function(c,d){typeof window<"u"&&!("SVGPathSeg"in window)&&l.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var h,m,g,b,p,y,E,T,k,M,N=[],O,A,C=0,L=0,_=0;d=d||15;var j=function(P,U,J){var q=J%2===1&&J>1;if(!k||P!=k.x||U!=k.y){k&&q?(O=k.x,A=k.y):(O=0,A=0);var z={x:O+P,y:A+U};(q||!k)&&(k=z),N.push(z),L=O+P,_=A+U}},D=function(P){var U=P.pathSegTypeAsLetter.toUpperCase();if(U!=="Z"){switch(U){case"M":case"L":case"T":case"C":case"S":case"Q":L=P.x,_=P.y;break;case"H":L=P.x;break;case"V":_=P.y;break}j(L,_,P.pathSegType)}};for(s._svgPathToAbsolute(c),g=c.getTotalLength(),y=[],h=0;h<c.pathSegList.numberOfItems;h+=1)y.push(c.pathSegList.getItem(h));for(E=y.concat();C<g;){if(M=c.getPathSegAtLength(C),p=y[M],p!=T){for(;E.length&&E[0]!=p;)D(E.shift());T=p}switch(p.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":b=c.getPointAtLength(C),j(b.x,b.y,0);break}C+=d}for(h=0,m=E.length;h<m;++h)D(E[h]);return N},s._svgPathToAbsolute=function(c){for(var d,h,m,g,b,p,y=c.pathSegList,E=0,T=0,k=y.numberOfItems,M=0;M<k;++M){var N=y.getItem(M),O=N.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(O))"x"in N&&(E=N.x),"y"in N&&(T=N.y);else switch("x1"in N&&(m=E+N.x1),"x2"in N&&(b=E+N.x2),"y1"in N&&(g=T+N.y1),"y2"in N&&(p=T+N.y2),"x"in N&&(E+=N.x),"y"in N&&(T+=N.y),O){case"m":y.replaceItem(c.createSVGPathSegMovetoAbs(E,T),M);break;case"l":y.replaceItem(c.createSVGPathSegLinetoAbs(E,T),M);break;case"h":y.replaceItem(c.createSVGPathSegLinetoHorizontalAbs(E),M);break;case"v":y.replaceItem(c.createSVGPathSegLinetoVerticalAbs(T),M);break;case"c":y.replaceItem(c.createSVGPathSegCurvetoCubicAbs(E,T,m,g,b,p),M);break;case"s":y.replaceItem(c.createSVGPathSegCurvetoCubicSmoothAbs(E,T,b,p),M);break;case"q":y.replaceItem(c.createSVGPathSegCurvetoQuadraticAbs(E,T,m,g),M);break;case"t":y.replaceItem(c.createSVGPathSegCurvetoQuadraticSmoothAbs(E,T),M);break;case"a":y.replaceItem(c.createSVGPathSegArcAbs(E,T,N.r1,N.r2,N.angle,N.largeArcFlag,N.sweepFlag),M);break;case"z":case"Z":E=d,T=h;break}(O=="M"||O=="m")&&(d=E,h=T)}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(6);o(0),(function(){s.create=l.create,s.add=l.add,s.remove=l.remove,s.clear=l.clear,s.addComposite=l.addComposite,s.addBody=l.addBody,s.addConstraint=l.addConstraint})()})])})})(Cc)),Cc.exports}var hN=fN();const ME=Ml(hN);{const e=ME.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const mN=6,Ca=28,ti=.92,Jh=1.12,pN=34;function cy(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<mN?"click":"drag"}function gN(e){const t=e.length;if(t===0)return"";const n=o=>`${o.x.toFixed(1)} ${o.y.toFixed(1)}`;if(t===1)return`M ${n(e[0])}`;if(t===2)return`M ${n(e[0])} L ${n(e[1])}`;let i=`M ${n(e[0])}`;for(let o=1;o<t-1;o++){const s=e[o],l=e[o+1];i+=` Q ${n(s)} ${((s.x+l.x)/2).toFixed(1)} ${((s.y+l.y)/2).toFixed(1)}`}return`${i} L ${n(e[t-1])}`}function xN(e,t){return e*Math.exp(-t/90)}function bN(e,t,n,i){const o=`translate3d(${e.toFixed(1)}px, ${t.toFixed(1)}px, 0)`;if(n<.01)return o;const s=i*180/Math.PI,l=Math.min(.35,n);return`${o} rotate(${s.toFixed(1)}deg) scale(${(1+l).toFixed(3)}, ${(1-l).toFixed(3)}) rotate(${(-s).toFixed(1)}deg)`}const yN=4e-5,vN=5e-4;function EN(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function TN(e){switch(e){case"storm":return{wind:.95,gust:1,rainRate:.006,snowRate:0,airDrag:1.05};case"rain":return{wind:.6,gust:.25,rainRate:.004,snowRate:0,airDrag:1};case"snow":return{wind:.25,gust:0,rainRate:0,snowRate:4e-4,airDrag:1};case"fog":return{wind:.06,gust:0,rainRate:0,snowRate:0,airDrag:1.7};case"cloudy":return{wind:.4,gust:.1,rainRate:0,snowRate:0,airDrag:1};case"clear":default:return{wind:.3,gust:0,rainRate:0,snowRate:0,airDrag:1}}}function RE(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,(t>>>0)/4294967295}const qo=120,SN=.9,dy=.7,wN=.09,kN=2.2,AN=2,em=Ca*2.45,CN=.006,tm=22,nm=.06;function NN(e){var J;const t=e.ballRadius??Ca,n=TN(e.weather??"clear"),{Engine:i,Bodies:o,Body:s,Composite:l,Constraint:c,Events:d}=ME,h=i.create();h.gravity.y=1,h.positionIterations=8,h.velocityIterations=4;const m=e.nodes.map(q=>{var Z,ie;const z=((Z=q.spawn)==null?void 0:Z.x)??q.x,H=((ie=q.spawn)==null?void 0:ie.y)??q.y,X=o.circle(z,H,t,{restitution:.5,friction:.01,frictionAir:.03*n.airDrag,density:q.isExam?.0016:.001,inertia:1/0,isStatic:!!q.locked,collisionFilter:{group:0,category:2,mask:6}});return{nodeId:q.id,body:X,layoutX:q.x,layoutY:q.y,isExam:!!q.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const q of m){l.add(h.world,q.body);const z=(J=e.nodes.find(H=>H.id===q.nodeId))==null?void 0:J.spawn;z&&(z.vx!==void 0||z.vy!==void 0)&&s.setVelocity(q.body,{x:z.vx??0,y:z.vy??0})}const g=qo/2,b={isStatic:!0,restitution:.4,friction:.05,collisionFilter:{category:4,mask:2}},p=(q,z)=>({x:Math.min(e.width-t,Math.max(t,q)),y:Math.min(e.height-t,Math.max(t,z))});l.add(h.world,[o.rectangle(e.width/2,-g,e.width*3,qo,b),o.rectangle(e.width/2,e.height+g,e.width*3,qo,b),o.rectangle(-g,e.height/2,qo,e.height*3,b),o.rectangle(e.width+g,e.height/2,qo,e.height*3,b)]);const y=q=>({x:q.body.position.x,y:q.body.position.y+t*ti}),E=[];function T(q,z,H,X,Z){return"body"in q?c.create({bodyA:q.body,pointA:q.offset,bodyB:z,pointB:H,length:X,stiffness:Z,damping:.05}):c.create({pointA:q.point,bodyB:z,pointB:H,length:X,stiffness:Z,damping:.05})}function k(q,z,H,X){const Z={x:H.body.position.x,y:H.body.position.y+t*ti},ie=Z.x-q.x,V=Z.y-q.y,Y=Math.max(60,Math.hypot(ie,V)),G=Math.max(5,Math.min(14,Math.round(Y/pN))),B=Y*Jh/G,ne=[];let K=z?{body:z,offset:{x:q.x-z.position.x,y:q.y-z.position.y}}:{point:q},$=!0;for(let se=1;se<G;se++){const de=se/G,Ce=Math.sin(Math.PI*de)*Y*(Jh-1)*.85,qe=o.circle(q.x+ie*de,q.y+V*de+Ce,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});ne.push(qe),l.add(h.world,qe),l.add(h.world,T(K,qe,void 0,B,$?dy:SN)),$=!1,K={body:qe,offset:{x:0,y:0}}}l.add(h.world,T(K,H.body,{x:0,y:t*ti},B,dy)),E.push({from:X,to:H.nodeId,restLen:Y*Jh,particles:ne})}const M=m[0],N=M?{x:e.anchorKnotX??M.layoutX,y:qc}:{x:e.width/2,y:qc};M&&k(N,null,M,"__anchor");for(let q=0;q<m.length-1;q++){const z=m[q],H=m[q+1];k(y(z),z.body,H,z.nodeId)}const O=m[m.length-1],A=e.nextKnot&&(O!=null&&O.isExam)?e.nextKnot:void 0;A&&O&&k(A,null,O,"__next");const C=new Map;for(const q of m){let z=0;for(const X of E)if(X.from===q.nodeId||X.to===q.nodeId)for(const Z of X.particles)z+=Z.mass*.5;const H=Math.min(.25,z/q.body.mass);C.set(q.nodeId,(1+H)*(.96+RE(q.nodeId)*.08))}let L=0,_=1;d.on(h,"beforeUpdate",()=>{const q=h.timing.timestamp;L*=.97,n.gust>0&&Math.random()<.0025*n.gust&&(L=n.gust*(.6+Math.random()*.4),_=Math.random()<.5?-1:1);for(const z of m){const H=z.body.mass,X=h.gravity.y*h.gravity.scale,Z=EN(z.body.position.x,z.body.position.y,q)*n.wind*yN*H+_*L*vN*H;let ie=-H*X*(C.get(z.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(ie+=H*X*.35,s.applyForce(z.body,z.body.position,{x:(Math.random()-.5)*H*X*.3,y:0})),s.applyForce(z.body,z.body.position,{x:Z,y:ie})}});const j=[],D=(q,z,H,X)=>{if(q.snow<=nm)return;const Z=Math.max(1,Math.min(X,Math.round(q.snow*X)+1));for(let ie=0;ie<Z;ie++){const V=-(.35+Math.random()*1.9),Y=t*(.55+Math.random()*.45);j.push({x:q.body.position.x+Math.cos(V)*Y,y:q.body.position.y+Math.sin(V)*Y,vx:q.body.velocity.x*.75+z.x*(.5+Math.random()*1.8)+(Math.random()-.5)*1.2,vy:q.body.velocity.y*.75+z.y*(.5+Math.random()*1.8)-.6-Math.random()*.8,amount:.02+Math.min(.05,H*.004)})}q.snow=Math.max(nm*.5,q.snow-Z*(.03+Math.min(.07,H*.005))),j.length>96&&j.splice(0,j.length-96)},P=[];d.on(h,"collisionStart",q=>{var z;for(const H of q.pairs){const{bodyA:X,bodyB:Z}=H,ie=m.find($=>$.body===X),V=m.find($=>$.body===Z);if(!ie&&!V)continue;const Y={x:X.velocity.x-Z.velocity.x,y:X.velocity.y-Z.velocity.y},G=Math.hypot(Y.x,Y.y);if(G<kN)continue;const B=H.collision.normal,ne=(z=H.collision.supports)==null?void 0:z[0];P.push(ne?{x:ne.x,y:ne.y,speed:G}:{x:(X.position.x+Z.position.x)/2,y:(X.position.y+Z.position.y)/2,speed:G}),P.length>64&&P.shift();const K=Math.min(.32,G*.028);ie&&K>ie.squash&&(ie.squash=K,ie.squashAngle=Math.atan2(B.y,B.x)),V&&K>V.squash&&(V.squash=K,V.squashAngle=Math.atan2(-B.y,-B.x)),ie&&D(ie,{x:B.x,y:B.y},G,5),V&&D(V,{x:-B.x,y:-B.y},G,5)}}),d.on(h,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const q of m)q.snow=Math.min(1,q.snow+n.snowRate)});let U=null;return{balls:m,links:E,anchor:N,nextKnot:A,ball(q){return m.find(z=>z.nodeId===q)},step(q){i.update(h,Math.min(33,Math.max(8,q)));for(let z=0;z<m.length;z++){const H=m[z];for(let X=z+1;X<m.length;X++){const Z=m[X],ie=Z.body.position.x-H.body.position.x,V=Z.body.position.y-H.body.position.y,Y=ie*ie+V*V;if(Y>=em*em||Y<.01)continue;const G=Math.sqrt(Y),B=(G-2*t)/(em-2*t),ne=B<=0?1:B>=1?0:1-B,$=Math.hypot(H.body.velocity.x-Z.body.velocity.x,H.body.velocity.y-Z.body.velocity.y)<1.2?CN*ne*ne:0,se=ie/G,de=V/G;H.body.isStatic||s.applyForce(H.body,H.body.position,{x:-se*$*H.body.mass,y:-de*$*H.body.mass}),Z.body.isStatic||s.applyForce(Z.body,Z.body.position,{x:se*$*Z.body.mass,y:de*$*Z.body.mass}),H.field=Math.max(H.field,ne),Z.field=Math.max(Z.field,ne)}}for(const z of m)z.field*=.88;for(const z of m){if(z.body.isStatic)continue;const H=z.body.velocity,X=Math.hypot(H.x,H.y);X>tm&&s.setVelocity(z.body,{x:H.x/X*tm,y:H.y/X*tm})}for(let z=0;z<m.length;z++){const H=m[z];for(let X=z+1;X<m.length;X++){const Z=m[X];let ie=Z.body.position.x-H.body.position.x,V=Z.body.position.y-H.body.position.y,Y=Math.hypot(ie,V);if(Y>=t*2)continue;Y<.01&&(ie=1,V=0,Y=1);const G=t*2-Y+.05,B=ie/Y,ne=V/Y;H.body.isStatic&&Z.body.isStatic||(H.body.isStatic?s.setPosition(Z.body,{x:Z.body.position.x+B*G,y:Z.body.position.y+ne*G}):Z.body.isStatic?s.setPosition(H.body,{x:H.body.position.x-B*G,y:H.body.position.y-ne*G}):(s.setPosition(H.body,{x:H.body.position.x-B*G/2,y:H.body.position.y-ne*G/2}),s.setPosition(Z.body,{x:Z.body.position.x+B*G/2,y:Z.body.position.y+ne*G/2})))}}for(const z of m){const H=Math.hypot(z.body.velocity.x,z.body.velocity.y);z.snow>nm&&H>AN&&D(z,{x:z.body.velocity.x/H,y:z.body.velocity.y/H},H,2)}for(const z of m){if(z.body.isStatic)continue;const H=z.body.position.x,X=z.body.position.y,Z=Math.min(e.width-t,Math.max(t,H)),ie=Math.min(e.height-t,Math.max(t,X));(Z!==H||ie!==X)&&(s.setPosition(z.body,{x:Z,y:ie}),s.setVelocity(z.body,{x:H<t||H>e.width-t?0:z.body.velocity.x,y:X<t||X>e.height-t?0:z.body.velocity.y}))}},beginDrag(q,z,H){this.endDrag();const X=this.ball(q);if(!X)return;const Z=c.create({pointA:p(z,H),bodyB:X.body,length:0,stiffness:wN,damping:.12});l.add(h.world,Z),U={constraint:Z,nodeId:q}},moveDrag(q,z){if(!U)return;const H=p(q,z);U.constraint.pointA=H},endDrag(){U&&(l.remove(h.world,U.constraint),U=null)},isDragging(){return U!==null},drainImpacts(){const q=P.slice();return P.length=0,q},drainFlakes(){const q=j.slice();return j.length=0,q},dispose(){this.endDrag(),d.off(h,"beforeUpdate"),d.off(h,"afterUpdate"),d.off(h,"collisionStart"),l.clear(h.world,!1),i.clear(h)}}}const qc=-12;function sc(e,t,n=20){return t<=n*2?t/2:n+RE(e)*(t-n*2)}function _N(e,t,n,i=Ca){if(t<=0||Math.abs(t-n)<=1)return e;const o=n/t,s={x:Math.min(n-i,Math.max(i,e.x*o)),y:e.y,vy:e.vy};return e.vx!==void 0&&(s.vx=e.vx*o),s}const wr=(e,t,n)=>e+(t-e)*n,dd=(e,t,n)=>e<t?t:e>n?n:e,El=e=>e<0?0:e>1?1:e*e*(3-2*e);function kr(e,t,n){return[wr(e[0],t[0],n),wr(e[1],t[1],n),wr(e[2],t[2],n)]}const am=e=>`rgb(${e[0]|0},${e[1]|0},${e[2]|0})`,Ls=(e,t)=>`rgba(${e[0]|0},${e[1]|0},${e[2]|0},${t})`;function fd(){return[{t:0,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]},{t:.12,top:[30,32,72],mid:[78,56,104],hor:[158,100,116]},{t:.22,top:[124,156,214],mid:[232,152,120],hor:[250,196,128]},{t:.36,top:[80,142,196],mid:[132,186,226],hor:[188,214,232]},{t:.5,top:[60,120,178],mid:[108,168,212],hor:[168,200,226]},{t:.62,top:[120,132,152],mid:[150,150,160],hor:[180,178,182]},{t:.74,top:[70,60,88],mid:[108,78,110],hor:[180,110,100]},{t:.86,top:[40,30,60],mid:[88,44,76],hor:[168,72,72]},{t:1,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]}]}function hd(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const im=()=>hd(fd(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),oc=()=>hd(fd(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),rm=()=>hd(fd(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),fy=()=>hd(fd(),e=>{const t=(e[0]+e[1]+e[2])/3;return[t*.7+e[0]*.1,t*.7+e[1]*.1,t*.95+e[2]*.15]}),sm={far:[28,50,36],near:[56,110,52],snowy:!1},lc={far:[20,48,30],near:[34,82,40],snowy:!1},om={far:[54,36,24],near:[128,78,36],snowy:!1},hy={far:[60,66,82],near:[232,236,244],snowy:!0};function aa(e){return t=>{let n=e;return t>.3&&t<.5?n=wr(n,Math.min(1,n+.2),El((t-.3)/.2)):t>=.5&&t<.74?n=Math.min(1,n+.15):t>=.74&&t<.84&&(n=wr(n,Math.max(0,n-.3),El((t-.74)/.1))),dd(n,0,1)}}const DE={"spring|clear":{season:"spring",weather:"clear",sky:im(),cloudCover:aa(.1),particles:"none",lightning:!1,fogAlpha:0,ground:sm},"spring|cloudy":{season:"spring",weather:"cloudy",sky:im(),cloudCover:aa(.5),particles:"none",lightning:!1,fogAlpha:0,ground:sm},"spring|rain":{season:"spring",weather:"rain",sky:im(),cloudCover:aa(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:sm},"summer|clear":{season:"summer",weather:"clear",sky:oc(),cloudCover:aa(.1),particles:"none",lightning:!1,fogAlpha:0,ground:lc},"summer|cloudy":{season:"summer",weather:"cloudy",sky:oc(),cloudCover:aa(.5),particles:"none",lightning:!1,fogAlpha:0,ground:lc},"summer|rain":{season:"summer",weather:"rain",sky:oc(),cloudCover:aa(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:lc},"summer|storm":{season:"summer",weather:"storm",sky:oc(),cloudCover:aa(1),particles:"rain",lightning:!0,fogAlpha:0,ground:lc},"autumn|clear":{season:"autumn",weather:"clear",sky:rm(),cloudCover:aa(.15),particles:"none",lightning:!1,fogAlpha:0,ground:om,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:rm(),cloudCover:aa(.55),particles:"none",lightning:!1,fogAlpha:0,ground:om},"autumn|storm":{season:"autumn",weather:"storm",sky:rm(),cloudCover:aa(1),particles:"rain",lightning:!0,fogAlpha:0,ground:om},"winter|clear":{season:"winter",weather:"clear",sky:fy(),cloudCover:aa(.2),particles:"none",lightning:!1,fogAlpha:0,ground:hy,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:fy(),cloudCover:aa(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:hy}},my=Object.keys(DE);function MN(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function RN(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return my[MN(t)%my.length]}function DN(e,t){let n=0;for(;n<t.length-1&&e>t[n+1].t;)n++;const i=t[n],o=t[Math.min(n+1,t.length-1)],s=El(dd((e-i.t)/(o.t-i.t||1),0,1));return{top:kr(i.top,o.top,s),mid:kr(i.mid,o.mid,s),hor:kr(i.hor,o.hor,s)}}function LN(e,t,n,i,o){if(e<i||e>o)return null;const s=(e-i)/(o-i),l=wr(.1,.9,s),c=n*.26,d=n*.98,h=d-Math.sin(s*Math.PI)*(d-c);return{x:l*t,y:h,peakness:Math.sin(s*Math.PI)}}function ON(e,t,n,i,o){let s;if(e>=i)s=(e-i)/(1-i+o);else if(e<=o)s=(1-i+e)/(1-i+o);else return null;const l=wr(.12,.88,s),c=n*.26,d=n*.98,h=d-Math.sin(s*Math.PI)*(d-c);return{x:l*t,y:h,peakness:Math.sin(s*Math.PI)}}function LE(e){return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function py(e,t){const n=LE(20260809),i=Math.max(28,Math.round(e*t/7e3)),o=[];for(let s=0;s<i;s++)o.push({x:n(),y:n()*.7,r:n()*1.2+.3,tw:n()*Math.PI*2,sp:.6+n()*1.4,big:n()<.06});return o}function IN(){const e=LE(7),t=[];for(let n=0;n<6;n++)t.push({x:e(),y:.12+e()*.4,s:.55+e()*1.2,speed:18e-6+e()*35e-6,seed:e()*1e3,drift:e()*.035+.008});return t}function jN(e,t,n,i){const o=e.createLinearGradient(0,0,0,i);o.addColorStop(0,am(t.top)),o.addColorStop(.55,am(t.mid)),o.addColorStop(1,am(t.hor)),e.fillStyle=o,e.fillRect(0,0,n,i)}function PN(e,t,n,i,o,s){let l=0;if(t<.22?l=El(1-t/.22):t>.8&&(l=El((t-.8)/.2)),!(l<=.01))for(const c of n){const d=.55+.45*Math.sin(s*c.sp+c.tw),h=l*d;if(h<.02)continue;e.fillStyle=`rgba(255,248,228,${h})`;const m=c.big?c.r*1.8:c.r;e.beginPath(),e.arc(c.x*i,c.y*o,m,0,Math.PI*2),e.fill(),c.big&&(e.fillStyle=`rgba(255,240,210,${h*.35})`,e.fillRect(c.x*i-m*4,c.y*o-.4,m*8,.8),e.fillRect(c.x*i-.4,c.y*o-m*4,.8,m*8))}}function BN(e,t,n){if(!t)return;const{x:i,y:o,peakness:s}=t,l=28+s*8,c=e.createRadialGradient(i,o,l*.4,i,o,l*5);c.addColorStop(0,"rgba(255,236,190,0.55)"),c.addColorStop(.4,"rgba(255,210,150,0.16)"),c.addColorStop(1,"rgba(255,200,140,0)"),e.fillStyle=c,e.fillRect(i-l*5,o-l*5,l*10,l*10);const d=e.createRadialGradient(i,o,0,i,o,l),h=n??[255,236,180],m=n?kr(n,[255,214,150],.5):[255,214,150];d.addColorStop(0,"rgba(255,252,238,1)"),d.addColorStop(.7,Ls(h,1)),d.addColorStop(1,Ls(m,.9)),e.fillStyle=d,e.beginPath(),e.arc(i,o,l,0,Math.PI*2),e.fill()}function UN(e,t){if(!t)return;const{x:n,y:i}=t,o=24,s=e.createRadialGradient(n,i,o*.8,n,i,o*5);s.addColorStop(0,"rgba(220,232,255,0.38)"),s.addColorStop(.5,"rgba(220,232,255,0.1)"),s.addColorStop(1,"rgba(220,232,255,0)"),e.fillStyle=s,e.fillRect(n-o*5,i-o*5,o*10,o*10);const l=e.createRadialGradient(n-o*.25,i-o*.3,o*.2,n,i,o);l.addColorStop(0,"rgba(255,254,247,1)"),l.addColorStop(.7,"rgba(244,242,232,1)"),l.addColorStop(1,"rgba(214,222,236,1)"),e.fillStyle=l,e.beginPath(),e.arc(n,i,o,0,Math.PI*2),e.fill(),e.fillStyle="rgba(150,160,180,0.16)";const c=[[-10,-6,4],[5,3,5],[-3,9,3],[11,-8,3]];for(const[d,h,m]of c)e.beginPath(),e.arc(n+d,i+h,m,0,Math.PI*2),e.fill()}function zN(e,t,n,i,o,s){const l=18*i,c=[[0,0,1],[-1.1,.1,.8],[1.1,.1,.8],[-.5,-.5,.7],[.6,-.45,.75],[-1.8,.3,.6],[1.8,.3,.6]];e.save(),e.translate(t,n),e.fillStyle=Ls([o[0]*.7,o[1]*.7,o[2]*.78],s*.9);for(const[d,h,m]of c)e.beginPath(),e.arc(d*l,h*l*1.1+l*.45,l*m*1.05,0,Math.PI*2),e.fill();e.fillStyle=Ls(o,s);for(const[d,h,m]of c)e.beginPath(),e.arc(d*l,h*l,l*m,0,Math.PI*2),e.fill();e.restore()}function HN(e,t,n,i,o,s,l,c,d){const h=l(t);if(h<.02)return;const m=kr(c.hor,[255,255,255],.35),g=kr(c.mid,[20,20,30],.45),b=d?g:m;for(let p=0;p<n.length;p++){const y=n[p],E=(y.x+s*y.speed)%1.2-.1,T=y.y+Math.sin(s*1e-4+y.seed)*y.drift;p/n.length<h&&zN(e,E*i,T*o,y.s,b,dd(h*.92,0,.92))}}const Ss=[];let xr=[];const Jo=[];let br=[];const uc=[],Yo=[];let el=[];function FN(e,t,n,i,o,s){if(o<.04)return;const l=i*(.02+o*.07),c=.12+o*.73,d=t-i*c,h=t+i*c,m=n-Math.sqrt(Math.max(0,i*i-i*c*(i*c))),g=n-i-l,b=(m+g)/2;e.save(),e.beginPath(),e.moveTo(d,m),e.bezierCurveTo(d,b,t-i*.3,g,t,g),e.bezierCurveTo(t+i*.3,g,h,b,h,m),e.quadraticCurveTo(t,n-i*.78,d,m),e.closePath();const p=e.createLinearGradient(0,g,0,m);p.addColorStop(0,"rgba(255,255,255,0.98)"),p.addColorStop(.65,"rgba(245,250,255,0.95)"),p.addColorStop(1,"rgba(218,230,246,0.9)"),e.fillStyle=p,e.fill(),e.strokeStyle="rgba(168,192,225,0.28)",e.lineWidth=1.5,e.beginPath(),e.moveTo(d,m),e.quadraticCurveTo(t,n-i*.78,h,m),e.stroke(),e.restore()}function lm(e,t,n,i,o){const s=Math.sin(i),l=Math.cos(i);return{x:e+Math.sin(o)*s*n,y:t-l*n}}function VN(e,t,n,i){e.save(),e.beginPath(),e.arc(t,n,i*.99,0,Math.PI*2),e.clip();const o=e.createRadialGradient(t-i*.35,n-i*.4,0,t-i*.35,n-i*.4,i*.8);o.addColorStop(0,"rgba(255,255,255,0.4)"),o.addColorStop(.5,"rgba(255,255,255,0.12)"),o.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=o,e.fillRect(t-i,n-i,i*2,i*2),e.strokeStyle="rgba(255,255,255,0.55)",e.lineWidth=1.8,e.beginPath(),e.arc(t,n,i*.92,Math.PI*1.15,Math.PI*1.5),e.stroke(),e.restore()}function qN(e,t){if(t.length!==0){e.save();for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.x+=i.vx,i.y+=i.vy,i.vy+=.14,i.vx*=.985,i.vy*=.99,i.life--,i.life<=0){t.splice(n,1);continue}const o=i.life/i.maxLife;e.fillStyle=`rgba(248,250,255,${(.9*o).toFixed(3)})`,e.beginPath(),e.arc(i.x,i.y,i.r*(.5+.5*o),0,Math.PI*2),e.fill()}e.restore()}}function OE(e,t){e.save();for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.x+=i.vx,i.y+=i.vy,i.vy+=.18,i.life--,i.life<=0){t.splice(n,1);continue}const o=Math.min(1,i.life/20)*.8;e.fillStyle=`rgba(215,238,255,${o})`,e.beginPath(),e.arc(i.x,i.y,1.3,0,Math.PI*2),e.fill()}e.restore()}function YN(e,t,n,i,o,s){e.save(),e.beginPath(),e.arc(t,n,i*.99,0,Math.PI*2),e.clip();for(let l=o.length-1;l>=0;l--){const c=o[l];if(c.prog+=c.speed,c.life--,c.prog>Math.PI*1.05||c.life<=0){o.splice(l,1);continue}const d=7;for(let g=0;g<d;g++){const b=c.prog-c.len*(g/d),p=c.prog-c.len*((g+1)/d),y=lm(t,n,i,b,c.theta),E=lm(t,n,i,p,c.theta),T=(1-g/d)*.42;e.strokeStyle=`rgba(200,228,250,${T})`,e.lineWidth=c.thick*(1-g/d*.7),e.lineCap="round",e.beginPath(),e.moveTo(y.x,y.y),e.lineTo(E.x,E.y),e.stroke()}const h=lm(t,n,i,c.prog,c.theta),m=e.createRadialGradient(h.x-1.2,h.y-1.2,0,h.x,h.y,c.thick*1.3);m.addColorStop(0,"rgba(255,255,255,0.85)"),m.addColorStop(.4,"rgba(180,215,240,0.5)"),m.addColorStop(1,"rgba(120,165,205,0.25)"),e.fillStyle=m,e.beginPath(),e.arc(h.x,h.y,c.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function GN(e,t,n,i){for(;Ss.length<t.length;)Ss.push([]);for(;xr.length<t.length;)xr.push(0);for(;el.length<t.length;)el.push(.3);for(;Jo.length<t.length;)Jo.push([]);for(;br.length<t.length;)br.push(0);for(let o=0;o<t.length;o++){const s=t[o];if(n.particles==="snow"){const l=s.snow!==void 0?s.snow:Math.min(1,(el[o]??.3)+8e-4);el[o]=l,FN(e,s.x,s.y,s.r,l)}else if(n.particles==="rain"){if(VN(e,s.x,s.y,s.r),xr[o]=xr[o]-1,xr[o]<=0&&Ss[o].length<3){const l=Math.random()<.5?-1:1;Ss[o].push({theta:l*(.2+Math.random()*.3),prog:.1+Math.random()*.2,speed:.012+Math.random()*.012,len:.3+Math.random()*.3,thick:1.6+Math.random()*1.4,life:250+Math.random()*200}),xr[o]=40+Math.random()*60}if(YN(e,s.x,s.y,s.r,Ss[o]),br[o]=br[o]-1,br[o]<=0){const l=s.x+(Math.random()-.5)*s.r*1.2,c=l-s.x,d=s.y-Math.sqrt(Math.max(0,s.r*s.r-c*c)),h=4+Math.floor(Math.random()*3);for(let m=0;m<h;m++){const g=c<0?-1:1;Jo[o].push({x:l,y:d,vx:g*(.5+Math.random()*2)*(Math.random()<.5?-1:1),vy:-(1.5+Math.random()*2.5),life:18+Math.floor(Math.random()*14)})}br[o]=30+Math.floor(Math.random()*50)}OE(e,Jo[o])}}}function XN(e,t,n,i,o){e.save(),e.strokeStyle=o?"rgba(205,224,244,0.42)":"rgba(210,224,238,0.3)",e.lineWidth=o?1:.7,e.lineCap="round";const s=o?.013:.007;for(const l of i){l.y+=l.v*s,l.y>1&&(l.y-=1,l.x=Math.random());const c=l.x*t,d=l.y*n;e.beginPath(),e.moveTo(c,d),e.lineTo(c,d+l.len),e.stroke()}e.restore()}function KN(e,t,n,i,o){e.save(),e.fillStyle="rgba(250,250,255,0.85)";for(const s of i){s.y+=s.v*.004;const l=(s.x+Math.sin(o*5e-4+s.phase)*.02)*t,c=s.y*n;s.y>1&&(s.y-=1),e.beginPath(),e.arc(l,c,s.r,0,Math.PI*2),e.fill()}e.restore()}function QN(e,t,n,i,o){const s=e.createLinearGradient(0,n*.4,0,n),l=kr(o.hor,[255,255,255],.3);s.addColorStop(0,Ls(l,0)),s.addColorStop(1,Ls(l,i)),e.fillStyle=s,e.fillRect(0,n*.4,t,n*.6)}let ys=0,gy=0;function $N(e,t,n,i,o){if(o>gy&&(ys=1,gy=o+1400+Math.random()*2600),ys*=.86,ys<.02){ys=0;return}if(e.fillStyle=`rgba(255,255,255,${ys*.5})`,e.fillRect(0,0,t,n),ys>.6){e.save(),e.strokeStyle="rgba(255,255,255,0.95)",e.lineWidth=2.2,e.shadowColor="rgba(220,230,255,0.9)",e.shadowBlur=22;let s=t*(.3+Math.random()*.4),l=0;for(e.beginPath(),e.moveTo(s,l);l<n*.6;)s+=(Math.random()-.5)*60,l+=24+Math.random()*30,e.lineTo(s,l);e.stroke(),e.restore()}}function WN(e,t,n,i){const o=e.getContext("2d");if(!o)return()=>{};const s=o,l=n;let c=0,d=0,h=1,m=py(1,1);const g=IN();let b=[],p=[],y=0,E=0,T=!0;const k=performance.now(),M=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function N(){const j=l.getBoundingClientRect();if(h=Math.min(window.devicePixelRatio||1,2),c=Math.max(1,j.width),d=Math.max(1,j.height),e.width=Math.floor(c*h),e.height=Math.floor(d*h),e.style.width=c+"px",e.style.height=d+"px",s.setTransform(h,0,0,h,0,0),m=py(c,d),i.particles==="rain"&&b.length===0){const D=i.weather==="storm",P=D?140:70;for(let U=0;U<P;U++)b.push({x:Math.random(),y:Math.random(),len:D?12+Math.random()*14:6+Math.random()*8,v:D?.9+Math.random()*.4:.5+Math.random()*.3})}if(i.particles==="snow"&&p.length===0)for(let D=0;D<120;D++)p.push({x:Math.random(),y:Math.random(),r:.8+Math.random()*1.6,v:.5+Math.random()*.8,phase:Math.random()*Math.PI*2})}function O(){const j=t.scrollHeight-t.clientHeight;y=j>0?dd(t.scrollTop/j,0,1):0}function A(j){if(!T)return;const D=y,P=M?0:(j-k)/1e3,U=DN(D,i.sky);jN(s,U,c,d),PN(s,D,m,c,d,P),UN(s,ON(D,c,d,.92,.08)),BN(s,LN(D,c,d,.16,.88),i.sunTint),HN(s,D,g,c,d,j,i.cloudCover,U,i.weather==="storm"),i.particles==="rain"&&XN(s,c,d,b,i.weather==="storm"),i.particles==="snow"&&KN(s,c,d,p,j),i.fogAlpha>0&&QN(s,c,d,i.fogAlpha,U),i.lightning&&$N(s,c,d,!0,j),M||(E=requestAnimationFrame(A))}const C=()=>O(),L=new ResizeObserver(()=>{N(),O()});L.observe(l),N(),O();let _;if(M){let j=!1;_=()=>{O(),j||(j=!0,requestAnimationFrame(()=>{j=!1,A(performance.now())}))},t.addEventListener("scroll",_,{passive:!0}),A(performance.now())}else _=C,t.addEventListener("scroll",_,{passive:!0}),E=requestAnimationFrame(A);return()=>{T=!1,cancelAnimationFrame(E),L.disconnect(),t.removeEventListener("scroll",_)}}function ZN(e,t,n,i,o,s){const l=()=>{Ss.length=0,el.length=0,xr.length=0,Jo.length=0,br.length=0,uc.length=0,Yo.length=0;const M=e.getContext("2d");M&&M.clearRect(0,0,e.width,e.height)};if(l(),window.matchMedia("(prefers-reduced-motion: reduce)").matches)return()=>{};if(n.particles!=="rain"&&n.particles!=="snow")return()=>{};const d=e.getContext("2d");if(!d)return()=>{};const h=d;let m=0,g=0,b=1,p=0,y=!0;function E(){const M=t.getBoundingClientRect();b=Math.min(window.devicePixelRatio||1,2),m=Math.max(1,M.width),g=Math.max(1,M.height),e.width=Math.floor(m*b),e.height=Math.floor(g*b),e.style.width=m+"px",e.style.height=g+"px",h.setTransform(b,0,0,b,0,0)}function T(M){if(!y)return;h.clearRect(0,0,m,g);const N=i();if(GN(h,N,n),o){for(const O of o()){const A=3+Math.min(5,Math.floor(O.speed/3));for(let C=0;C<A;C++)uc.push({x:O.x,y:O.y,vx:(Math.random()-.5)*3.2,vy:-(1.5+Math.random()*2.5),life:16+Math.floor(Math.random()*12)})}uc.length>0&&OE(h,uc)}if(s){for(const O of s()){const A=1+Math.min(2,Math.round(O.amount*40));for(let C=0;C<A;C++){const L=55+Math.floor(Math.random()*40);Yo.push({x:O.x+(Math.random()-.5)*8,y:O.y+(Math.random()-.5)*6,vx:O.vx*.6+(Math.random()-.5)*.8,vy:O.vy*.6-Math.random()*.5,life:L,maxLife:L,r:1.2+Math.random()*2.2})}}for(;Yo.length>240;)Yo.shift();qN(h,Yo)}p=requestAnimationFrame(T)}const k=new ResizeObserver(E);return k.observe(t),E(),p=requestAnimationFrame(T),()=>{y=!1,cancelAnimationFrame(p),k.disconnect(),l()}}const f0=new Set;function Ar(e,t){const n={kind:e,intensity:t==null?void 0:t.intensity,origin:t==null?void 0:t.origin,ts:performance.now()};for(const i of f0)i(n)}function xy(e){return f0.add(e),()=>{f0.delete(e)}}function JN(e){switch(e){case"correct":return{particles:28,durationMs:700,colors:["#58cc02","#7ed957","#ffc800"]};case"mastery":case"level-up":return{particles:48,durationMs:1100,colors:["#ffc800","#ffe680","#fff7c2"]};case"unlock":return{particles:32,durationMs:800,colors:["#58cc02","#1cb0f6","#ffffff"]};case"exam-pass":return{particles:56,durationMs:1200,colors:["#a855f7","#c084fc","#ffc800"]};case"lesson-complete":return{particles:40,durationMs:1e3,colors:["#58cc02","#ffc800","#1cb0f6"]};case"energy-full":return{particles:36,durationMs:900,colors:["#58cc02","#7ed957","#ffffff"]};case"streak":return{particles:24,durationMs:700,colors:["#ff7a1a","#ffc800","#ffffff"]};case"wrong":return{particles:12,durationMs:450,colors:["#ff4b4b","#ff7a7a"]};default:return{particles:20,durationMs:600,colors:["#58cc02","#ffffff"]}}}const IE="(prefers-reduced-motion: reduce)";function e5(e){const t=window.matchMedia(IE);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function t5(){return window.matchMedia(IE).matches}function n5(){return!1}function jE(){return R.useSyncExternalStore(e5,t5,n5)}function a5(e){const t=He(),[n,i]=R.useState("import"),[o,s]=R.useState("study"),l=R.useRef(null),c=R.useRef(null),d=Math.round(e.overallMastery*100),m=!jE(),g=R.useRef([]),b=R.useRef(P=>{g.current.push(...P),g.current.length>64&&g.current.splice(0,g.current.length-64)}).current,p=R.useRef([]),y=R.useRef(new Map),E=R.useRef(P=>{p.current.push(...P),p.current.length>96&&p.current.splice(0,p.current.length-96)}).current,T=e.sections.filter(P=>(P.world??"study")===o),k=e.sections.some(P=>P.world==="practice"),[M,N]=R.useState(null);R.useEffect(()=>{N(RN(e.courseId))},[e.courseId]);const O=M?DE[M]??null:null,[A,C]=R.useState(!1);R.useEffect(()=>{if(!e.selectedNodeId)return;const P=c.current;if(!P)return;const U=P.querySelector(`[data-node-id="${CSS.escape(e.selectedNodeId)}"]`);if(!U)return;const J=P.getBoundingClientRect(),q=U.getBoundingClientRect();(q.top<J.top+60||q.bottom>J.bottom-60)&&U.scrollIntoView({behavior:"smooth",block:"center"})},[e.selectedNodeId]);const L=R.useRef(null);R.useEffect(()=>{C(!1),e.courseId&&(L.current===null||L.current!==e.courseId)&&(i("map"),s("study")),!e.courseId&&L.current!==null&&(i("import"),s("study")),L.current=e.courseId},[e.courseId]);const[_,j]=R.useState(null),D=R.useRef({});return R.useEffect(()=>{var q;const P=D.current,U={};let J=!1;for(const z of e.tree){const H=((q=e.progressMap[z.id])==null?void 0:q.status)??"locked";U[z.id]=H,P[z.id]==="locked"&&H!=="locked"&&(J=!0)}J&&Object.keys(P).length>0&&Ar("unlock"),D.current=U},[e.tree,e.progressMap]),x.jsxs("nav",{ref:l,className:`map-rail-scope relative h-full flex flex-col bg-surface-rail shrink-0 overflow-hidden ${e.fullWidth?"w-full":"w-[300px]"}`,"data-testid":"map-rail",children:[O&&x.jsxs(x.Fragment,{children:[x.jsx(r5,{scrollRef:c,navRef:l,preset:O}),x.jsx(s5,{scrollRef:c,navRef:l,preset:O,getImpacts:()=>g.current.splice(0),getFlakes:()=>p.current.splice(0),orbSnowRef:y})]}),x.jsxs("div",{className:"absolute top-0 left-0 right-0 z-40 px-2 pt-2 pb-2 pointer-events-none [&_button]:pointer-events-auto",children:[x.jsxs("div",{className:"flex p-1 rounded-lg gap-1 mb-2",style:{background:"rgb(var(--surface-rail-rgb) / 0.55)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[x.jsxs("button",{onClick:()=>i("map"),"data-testid":"map-tab-map",className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n==="map"?"bg-brand/20 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(rp,{className:"w-3 h-3"})," ",t("map.tab.map")]}),x.jsxs("button",{onClick:()=>i("import"),"data-testid":"map-tab-import",className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n==="import"?"bg-brand/20 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(Rl,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&x.jsxs("div",{className:"px-3 py-2 rounded-lg pointer-events-auto",style:{background:"rgb(var(--surface-rail-rgb) / 0.55)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("h2",{className:"text-body font-extrabold text-white truncate flex-1","data-tooltip":e.courseTitle??"",children:e.courseTitle??t("map.course.none")}),e.availableLanguages.length>0&&x.jsx(f5,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&x.jsx("button",{onClick:P=>{const U=P.currentTarget.getBoundingClientRect();j({id:e.courseId,title:e.courseTitle??"",rect:U})},"data-testid":"course-delete-btn","aria-label":t("import.delete.current"),"data-tooltip":t("import.delete.current"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/40 hover:text-warning hover:bg-white/10 transition-colors",children:x.jsx(SE,{className:"w-3 h-3"})})]}),x.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[x.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:x.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,d)}%`}})}),x.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[d,"%"]})]}),x.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[x.jsxs("button",{onClick:()=>C(!0),"data-testid":"map-search-btn",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-white/5 ring-1 ring-white/10 hover:bg-white/10 transition-colors",children:[x.jsx(sp,{className:"w-3 h-3 text-white/50"}),x.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),x.jsxs("button",{onClick:e.onOpenReview,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full transition-colors ${e.dueCount>0?"bg-review/20 ring-1 ring-review/30 hover:bg-review/30":"bg-white/5 ring-1 ring-white/10 hover:bg-white/10"}`,"data-testid":"map-review-badge",children:[x.jsx(ii,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),x.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&x.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),k&&x.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[x.jsxs("button",{onClick:()=>s("study"),"data-testid":"world-tab-study",className:`flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-caption font-bold transition-colors ${o==="study"?"bg-brand/30 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(ii,{className:"w-3 h-3"})," ",t("map.world.study")]}),x.jsxs("button",{onClick:()=>s("practice"),"data-testid":"world-tab-practice",className:`flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-caption font-bold transition-colors ${o==="practice"?"bg-accent/30 text-accent":"text-white/50 hover:text-white/80"}`,children:[x.jsx(lp,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),x.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:x.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[x.jsx("div",{className:"w-1/2 h-full relative",children:x.jsx("div",{ref:c,className:"map-path h-full overflow-y-auto overflow-x-hidden px-2 pt-48 pb-4","data-testid":"map-path",children:x.jsxs("div",{className:`map-sky-content ${O?`env-${O.season} env-${O.weather}`:""}`,children:[e.streaming&&x.jsxs("div",{className:"mb-3 mx-1 px-3 py-2 rounded-xl bg-brand/10 border border-brand/30 flex items-center gap-2 text-label text-brand font-medium backdrop-blur-sm","data-testid":"streaming-notice",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.streaming.notice")]}),e.sections.length===0?e.courseTitle?x.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):x.jsxs("button",{onClick:()=>i("import"),className:"block w-full mt-8 mx-auto p-4 rounded-2xl border-2 border-dashed border-brand/40 hover:border-brand hover:bg-brand/5 transition-all text-center group","data-testid":"map-empty-cta",children:[x.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),x.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),x.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),x.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):T.length===0?x.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(o==="practice"?"map.empty.practice":"map.generating")}):x.jsx("div",{className:"space-y-6 pt-2",children:T.map((P,U)=>x.jsx(o5,{section:P,sectionIndex:U,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,onJumpNode:e.onJumpNode,physics:m,physicsWeather:(O==null?void 0:O.weather)??"clear",scrollRef:c,navRef:l,onImpacts:b,onFlakes:E,orbSnowRef:y},P.id))})]})})}),x.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:x.jsx(i5,{courses:e.courses,selectedCourseId:e.courseId,onSelectCourse:P=>{e.onSelectCourse(P),i("map")},onDeleteCourse:(P,U,J)=>j({id:P,title:U,rect:J}),onCoursesChanged:e.onCoursesChanged})})]})}),A&&e.courseId&&x.jsx(eN,{sections:e.sections,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onJump:P=>{s(P.world??"study"),C(!1),e.onJumpNode(P.id)},onClose:()=>C(!1)}),_&&x.jsx(cd,{anchorRect:_.rect,message:`${_.title} — ${t("import.delete.confirm")}`,danger:!0,confirmLabel:t("import.delete"),testid:"course-delete-confirm",onConfirm:()=>{e.onDeleteCourse(_.id),j(null)},onCancel:()=>j(null)})]})}function i5({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:i,onCoursesChanged:o}){const s=He(),[l,c]=R.useState("url"),[d,h]=R.useState(!1),[m,g]=R.useState(""),[b,p]=R.useState(""),y=R.useRef(null),[E,T]=R.useState(""),[k,M]=R.useState(""),[N,O]=R.useState(!1),[A,C]=R.useState(null),[L,_]=R.useState(null),[j,D]=R.useState(null),[P,U]=R.useState(null),[J,q]=R.useState([]),[,z]=R.useState(0),H=R.useRef(null);R.useEffect(()=>{const K=be.on("import:progress",se=>{q(de=>{const Ce=/\d+\/\d+/.test(se),qe=de[de.length-1];if(Ce&&qe&&qe.status==="working"){const We=[...de];return We[We.length-1]={...qe,msg:se},We}const $e=de.map(We=>We.status==="working"?{...We,status:"done"}:We);return $e.push({msg:se,status:"working",ts:Date.now()}),$e})}),$=setInterval(()=>z(se=>se+1),1e3);return()=>{K(),clearInterval($)}},[]),R.useEffect(()=>be.on("import:done",$=>{O(!1),D($.ok?null:$.planId??null),$.ok?(_(`${s("import.success.folder")}: ${$.title??""}${$.reused?`(${s("import.success.reused")})`:""}`),U($.courseId?{courseId:$.courseId,packable:$.packable??!1}:null),o()):$.cancelled?(q([]),C(null),_(s("import.cancelled"))):C($.error??"导入失败")}),[o,s]),R.useEffect(()=>{const K=H.current;K&&(K.scrollTop=K.scrollHeight)},[J]);const X=async()=>{if(!(!m.trim()||N)){C(null),_(null),q([]);try{await be.importGithub(m.trim()),O(!0)}catch(K){C(K instanceof Error?`${K.message}${s("import.error.network")}`:String(K))}}},Z=async()=>{if(!(!E.trim()||!k.trim()||N)){O(!0),C(null),_(null);try{const K=await be.generateCourseFromMarkdown(E.trim(),k.trim());_(`${s("import.success.md")}: ${K.title}`),setTimeout(()=>{o(),n(K.id)},800)}catch(K){C(K instanceof Error?K.message:String(K))}finally{O(!1)}}},ie=async()=>{if(N)return;if(C(null),_(null),q([]),!Vo){const $=b.trim();if(!$){C(s("import.folder.pathRequired"));return}try{await be.importLocalFolder($)&&O(!0)}catch(se){C(se instanceof Error?se.message:String(se))}return}await be.importLocalFolder()&&O(!0)},V=async()=>{var $;if(N)return;if(C(null),_(null),q([]),!Vo){($=y.current)==null||$.click();return}await be.importPack().catch(se=>(C(se instanceof Error?se.message:String(se)),null))&&O(!0)},Y=async K=>{if(!(!K||N)){C(null),_(null),q([]);try{const $=await K.text();await be.importPack({fileName:K.name,content:$})&&O(!0)}catch($){C($ instanceof Error?$.message:String($))}}},G=async K=>{if(!N){C(null),q([]);try{await be.importResume(K),O(!0)}catch($){C($ instanceof Error?$.message:String($))}}},B=async K=>{try{const $=await be.exportPack(K);$!=null&&$.content&&$.fileName?(ne($.fileName,$.content),_(s("import.pack.exported",{path:$.fileName}))):$!=null&&$.path&&_(s("import.pack.exported",{path:$.path}))}catch($){C($ instanceof Error?$.message:String($))}},ne=(K,$)=>{const se=new Blob([$],{type:"application/json"}),de=URL.createObjectURL(se),Ce=document.createElement("a");Ce.href=de,Ce.download=K,Ce.click(),setTimeout(()=>URL.revokeObjectURL(de),5e3)};return x.jsxs(x.Fragment,{children:[e.length===0?x.jsxs("div",{className:"text-center py-10",children:[x.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),x.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:s("import.empty")})]}):x.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(K=>{const $=K.id===t;return x.jsxs("div",{"data-testid":"course-row",className:`relative rounded-xl transition-all duration-150 group ${$?"bg-brand/12 ring-1 ring-brand/40":"bg-white/5 hover:bg-white/10 hover:-translate-y-0.5"}`,children:[x.jsx("button",{onClick:()=>n(K.id),className:"w-full text-left p-3",children:x.jsxs("div",{className:"flex items-start justify-between gap-2",children:[x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:`text-body font-bold truncate ${$?"text-brand":"text-white/90"}`,children:K.title}),x.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:K.repoName})]}),$&&x.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:x.jsx(Fn,{className:"w-3 h-3 text-white"})})]})}),x.jsxs("div",{className:"absolute bottom-1.5 right-2 flex items-center gap-2.5 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 focus-within:opacity-100 transition-opacity",children:[x.jsxs("button",{onClick:se=>{se.stopPropagation(),C(null),_(null),be.exportPack(K.id).then(de=>{de!=null&&de.content&&de.fileName?(ne(de.fileName,de.content),_(s("import.pack.exported",{path:de.fileName}))):de!=null&&de.path&&_(s("import.pack.exported",{path:de.path}))}).catch(de=>{C(de instanceof Error?de.message:String(de))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[x.jsx(ry,{className:"w-2.5 h-2.5"})," ",s("import.export")]}),x.jsxs("button",{onClick:se=>{se.stopPropagation();const de=se.currentTarget.getBoundingClientRect();i(K.id,K.title,de)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[x.jsx(SE,{className:"w-2.5 h-2.5"})," ",s("import.delete")]})]})]},K.id)})}),x.jsxs("div",{className:e.length>0?"mt-6":"",children:[x.jsxs("button",{onClick:()=>h(!d),className:`w-full flex items-center justify-center gap-1.5 py-3 rounded-xl border-2 border-dashed transition-all text-body font-bold ${d?"border-brand/40 bg-brand/8 text-brand":"border-white/20 hover:border-brand/50 hover:bg-brand/8 text-white/70 hover:text-brand"}`,children:[x.jsx(ud,{className:`w-4 h-4 transition-transform ${d?"rotate-45":""}`})," ",s("import.cta")]}),d&&x.jsxs("div",{className:"mt-3 space-y-3",children:[N?x.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[x.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),x.jsx("span",{className:"text-body font-bold text-white/90",children:s("import.progress.title")}),x.jsx("button",{onClick:()=>{be.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:s("import.progress.cancel")})]}),x.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:s("import.progress.note")}),(l==="url"?m.trim():l==="markdown"&&k.trim())?x.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:l==="url"?m.trim():k.trim()}):null,x.jsx("div",{ref:H,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:J.length===0?x.jsx("div",{className:"text-caption text-white/50 py-1",children:s("import.progress.starting")}):J.map((K,$)=>x.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[K.status==="done"?x.jsx(Fn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):x.jsx("span",{className:"inline-block w-2.5 h-2.5 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0 mt-px"}),x.jsxs("span",{className:K.status==="done"?"text-white/40":"text-white/90",children:[K.msg,K.status==="working"&&x.jsxs("span",{className:"text-white/35 ml-1",children:["(",s("import.progress.elapsed",{s:Math.floor((Date.now()-K.ts)/1e3)}),")"]})]})]},$))})]}):x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"@container flex gap-1 p-1 bg-white/5 rounded-lg",children:[{k:"url",label:s("import.tab.url"),icon:EC},{k:"markdown",label:s("import.tab.md"),icon:Rl},{k:"folder",label:s("import.tab.folder"),icon:pC},{k:"pack",label:s("import.tab.pack"),icon:ry}].map(({k:K,label:$,icon:se})=>x.jsxs("button",{onClick:()=>c(K),className:`min-w-0 flex-1 flex items-center justify-center gap-1 py-1.5 px-0.5 rounded-md font-bold transition-colors ${l===K?"bg-brand/15 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(se,{className:"w-3 h-3 shrink-0"}),x.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4.4cqi, 0.875rem)"},children:$})]},K))}),l==="url"?x.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[x.jsx("input",{type:"text",value:m,onChange:K=>g(K.target.value),placeholder:"https://github.com/owner/repo","data-testid":"repo-url-input",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),x.jsx("button",{onClick:X,disabled:!m.trim()||N,"data-testid":"import-url-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.url")})]}):l==="markdown"?x.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[x.jsx("input",{type:"text",value:k,onChange:K=>M(K.target.value),placeholder:s("import.placeholder.name"),"data-testid":"md-name-input",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),x.jsx("textarea",{value:E,onChange:K=>T(K.target.value),placeholder:s("import.placeholder.md"),"data-testid":"md-text-input",rows:4,className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors resize-none"}),x.jsx("button",{onClick:Z,disabled:!E.trim()||!k.trim()||N,"data-testid":"import-md-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.md")})]}):l==="folder"?x.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[x.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.folder.desc")}),!Vo&&x.jsx("input",{type:"text",value:b,onChange:K=>p(K.target.value),placeholder:s("import.folder.pathPlaceholder"),"data-testid":"import-folder-path",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),x.jsx("button",{onClick:ie,disabled:N||!Vo&&!b.trim(),"data-testid":"import-folder-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.folder")})]}):x.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[x.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.pack.desc")}),!Vo&&x.jsx("input",{ref:y,type:"file",accept:".json,application/json",className:"hidden","data-testid":"import-pack-file",onChange:K=>{var $;Y(($=K.target.files)==null?void 0:$[0]),K.currentTarget.value=""}}),x.jsx("button",{onClick:V,disabled:N,"data-testid":"import-pack-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.pack")})]})]}),A&&x.jsxs("div",{className:"border border-warning/40 text-warning-light text-label rounded-lg p-2 whitespace-pre-wrap","data-testid":"import-error",children:[A,j&&x.jsx("button",{onClick:()=>void G(j),disabled:N,"data-testid":"import-resume-btn",className:"block mt-1.5 text-label font-bold text-warning-light hover:text-warning underline underline-offset-2 disabled:opacity-40",children:s("import.error.resume")})]}),L&&x.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[x.jsx(Fn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),L,(P==null?void 0:P.packable)&&x.jsx("button",{onClick:()=>void B(P.courseId),disabled:N,"data-testid":"import-export-pack-btn",className:"block mt-1.5 text-label font-bold hover:underline underline-offset-2 disabled:opacity-40",children:s("import.pack.export")})]})]})]})]})}function r5({scrollRef:e,navRef:t,preset:n}){const i=R.useRef(null);return R.useEffect(()=>{const o=i.current,s=e.current,l=t.current;return!o||!s||!l?void 0:WN(o,s,l,n)},[e,t,n]),x.jsx("canvas",{ref:i,className:"map-sky-canvas","aria-hidden":"true"})}function s5({scrollRef:e,navRef:t,preset:n,getImpacts:i,getFlakes:o,orbSnowRef:s}){const l=R.useRef(null);return R.useEffect(()=>{const c=l.current,d=t.current,h=e.current;if(!c||!d||!h)return;let m=null,g=null;const b=()=>{m=null,g=null},p=new MutationObserver(b);p.observe(h,{childList:!0,subtree:!0}),window.addEventListener("resize",b);const E=ZN(c,d,n,()=>{var M,N;m||(m=Array.from(h.querySelectorAll(".lesson-bubble")));const T=g??d.getBoundingClientRect();g=T;const k=[];for(const O of m){const A=O.getBoundingClientRect();if(A.bottom<T.top||A.top>T.bottom)continue;const C=(M=O.closest("[data-node-id]"))==null?void 0:M.getAttribute("data-node-id"),L=C?(N=s==null?void 0:s.current)==null?void 0:N.get(C):void 0;k.push({x:A.left-T.left+A.width/2,y:A.top-T.top+A.height/2,r:A.width/2,...L!==void 0?{snow:L}:{}})}return k},i,o);return()=>{E(),p.disconnect(),window.removeEventListener("resize",b)}},[e,t,n,i,o]),x.jsx("canvas",{ref:l,className:"map-orb-weather-canvas","aria-hidden":"true"})}function o5({section:e,sectionIndex:t,tree:n,progressMap:i,selectedNodeId:o,dueNodeIds:s,onJumpNode:l,physics:c,physicsWeather:d,scrollRef:h,navRef:m,onImpacts:g,onFlakes:b,orbSnowRef:p}){const y=n.filter(K=>K.parentId===e.id).sort((K,$)=>K.orderIdx-$.orderIdx),E=y.filter(K=>K.type==="lesson"),T=E.length>0&&E.every(K=>{var $;return((($=i[K.id])==null?void 0:$.mastery)??0)>=kE}),k=R.useRef(null),[M,N]=R.useState(268);R.useEffect(()=>{if(!k.current)return;const K=()=>{var de;const se=((de=k.current)==null?void 0:de.clientWidth)??268;N(se>0?se:268)};K();const $=new ResizeObserver(K);return $.observe(k.current),()=>$.disconnect()},[]);const O=uN(y.length,M,e.id),A=O.height,C=110,L=76,_=R.useRef(null),j=R.useRef(new Map),D=R.useRef(0),P=R.useRef(null),U=R.useRef(0),J=y.map(K=>K.id).join(","),q=y.map(K=>{var $;return(K.type==="exam"?!T:((($=i[K.id])==null?void 0:$.status)??"locked")==="locked")?1:0}).join("");R.useEffect(()=>{var ge,Ue;if(!c||y.length===0||M<=0)return;const K=k.current,$=h.current;if(!K||!$)return;let se;const de=y[y.length-1];if((de==null?void 0:de.type)==="exam"){const Ie=(Ue=(ge=K.closest("section"))==null?void 0:ge.nextElementSibling)==null?void 0:Ue.querySelector(".map-signpost");Ie&&(se={x:sc(`${e.id}:next`,M),y:Ie.getBoundingClientRect().top-K.getBoundingClientRect().top})}const Ce=NN({nodes:O.nodes.map((Ie,he)=>{const Te=y[he];return{id:Te.id,x:Ie.x,y:Ie.y,isExam:Te.type==="exam",locked:z(Te),spawn:(()=>{const Re=j.current.get(Te.id);return Re?_N(Re,D.current,M):void 0})()}}),width:M,height:O.height+40,weather:d,anchorKnotX:sc(`${e.id}:knot`,M),nextKnot:se});_.current=Ce;const qe=K.querySelector("[data-next-knot]");qe&&(Ce.nextKnot?(qe.setAttribute("cx",String(Ce.nextKnot.x)),qe.setAttribute("cy",String(Ce.nextKnot.y))):qe.setAttribute("opacity","0"));const $e=K.querySelector("[data-exam-rope]");$e&&!Ce.nextKnot&&$e.setAttribute("opacity","0");const We=new Map;for(const Ie of K.querySelectorAll("[data-node-id]"))Ie.dataset.nodeId&&We.set(Ie.dataset.nodeId,Ie);const Ct=Array.from(K.querySelectorAll("[data-rope]")),Rt=Array.from(K.querySelectorAll("[data-pulse]")),Nt=Array.from(K.querySelectorAll("[data-field]"));let Kt=!0;const mn=new IntersectionObserver(Ie=>{for(const he of Ie)Kt=he.isIntersecting},{root:$,rootMargin:"200px 0px 200px 0px"});mn.observe(K);const pn=520,Qt=[];let pt=0,gn=performance.now();const Ht=Ie=>{var Ye;pt=requestAnimationFrame(Ht);const he=Math.min(50,Ie-gn);if(gn=Ie,!Kt)return;Ce.step(he);for(const Ae of Ce.balls){const Ze=We.get(Ae.nodeId);Ze&&(Ze.style.transform=bN(Ae.body.position.x-Ae.layoutX,Ae.body.position.y-Ae.layoutY,Ae.squash,Ae.squashAngle)),Ae.squash=xN(Ae.squash,he),(Ye=p.current)==null||Ye.set(Ae.nodeId,Ae.snow)}const Te=Ae=>{if(Ae==="__anchor")return Ce.anchor;if(Ae==="__next")return Ce.nextKnot??Ce.anchor;const Ze=Ce.ball(Ae);if(Ze)return{x:Ze.body.position.x,y:Ze.body.position.y+Ca*ti};const Qe=y.findIndex(Jt=>Jt.id===Ae),Ge=Qe>=0?O.nodes[Qe]:void 0;return Ge?{x:Ge.x,y:Ge.y+Ca*ti}:{x:0,y:0}};for(let Ae=0;Ae<Ce.links.length&&Ae<Ct.length;Ae++){const Ze=Ce.links[Ae],Qe=[Te(Ze.from)];for(const Ge of Ze.particles)Qe.push({x:Ge.position.x,y:Ge.position.y});Qe.push(Te(Ze.to)),Ct[Ae].setAttribute("d",gN(Qe))}for(let Ae=0;Ae<Ce.balls.length&&Ae<Nt.length;Ae++){const Ze=Ce.balls[Ae],Qe=Nt[Ae];Ze.field>.03?(Qe.setAttribute("cx",String(Ze.body.position.x)),Qe.setAttribute("cy",String(Ze.body.position.y)),Qe.setAttribute("r",String(Ca+4+Ze.field*5)),Qe.setAttribute("opacity",String((.3*Ze.field).toFixed(3)))):Qe.setAttribute("opacity","0")}const Re=Ce.drainImpacts();for(const Ae of Re)Qt.push({x:Ae.x,y:Ae.y,t0:Ie,s:Math.min(1,Ae.speed/14)});for(let Ae=Qt.length-1;Ae>=0;Ae--)Ie-Qt[Ae].t0>pn&&Qt.splice(Ae,1);for(let Ae=0;Ae<Rt.length;Ae++){const Ze=Qt[Ae],Qe=Rt[Ae];if(!Ze){Qe.setAttribute("opacity","0");continue}const Ge=(Ie-Ze.t0)/pn;Qe.setAttribute("cx",String(Ze.x)),Qe.setAttribute("cy",String(Ze.y)),Qe.setAttribute("r",String(6+Ge*(14+Ze.s*14))),Qe.setAttribute("opacity",String(.55*(1-Ge))),Qe.setAttribute("stroke-width",String(2+Ze.s*1.5))}const _e=Ce.drainFlakes();if((Re.length>0||_e.length>0)&&m.current){const Ae=K.getBoundingClientRect(),Ze=m.current.getBoundingClientRect(),Qe=Ge=>({x:Ge.x+Ae.left-Ze.left,y:Ge.y+Ae.top-Ze.top});Re.length>0&&g(Re.map(Ge=>({...Qe(Ge),speed:Ge.speed}))),_e.length>0&&b(_e.map(Ge=>({...Qe(Ge),vx:Ge.vx,vy:Ge.vy,amount:Ge.amount})))}};return pt=requestAnimationFrame(Ht),()=>{cancelAnimationFrame(pt),mn.disconnect();for(const Ie of Ce.balls)j.current.set(Ie.nodeId,{x:Ie.body.position.x,y:Ie.body.position.y,vx:Ie.body.velocity.x,vy:Ie.body.velocity.y});D.current=M,Ce.dispose(),_.current=null;for(const Ie of We.values())Ie.style.transform=""}},[c,M,J,q,e.id,d]);const z=K=>{var $;return K?K.type==="exam"?!T:((($=i[K.id])==null?void 0:$.status)??"locked")==="locked":!0},H=(K,$)=>{if(!(!_.current||K.button!==0||z(y.find(Ce=>Ce.id===$))||!k.current)){try{K.currentTarget.setPointerCapture(K.pointerId)}catch{}U.current=0,P.current={track:{startX:K.clientX,startY:K.clientY},id:K.pointerId,dragging:!1,nodeId:$}}},X=K=>{const $=P.current,se=_.current;if(!$||!se||K.pointerId!==$.id)return;const de=k.current;if(!de||(!$.dragging&&cy($.track,K.clientX,K.clientY)==="drag"&&($.dragging=!0,K.currentTarget.style.zIndex="40",se.beginDrag($.nodeId,K.clientX-de.getBoundingClientRect().left,K.clientY-de.getBoundingClientRect().top)),!$.dragging))return;const Ce=de.getBoundingClientRect();se.moveDrag(K.clientX-Ce.left,K.clientY-Ce.top)},Z=K=>{var se;const $=P.current;if(!(!$||K.pointerId!==$.id)){if((se=_.current)==null||se.endDrag(),K.currentTarget.style.zIndex="",cy($.track,K.clientX,K.clientY)==="drag")U.current=Date.now()+300;else{const de=y.find(Ce=>Ce.id===$.nodeId);de&&Date.now()>=U.current&&!z(de)&&l(de.id)}P.current=null}},ie=K=>{const $=y[K],se=$?i[$.id]:void 0,de=(se==null?void 0:se.status)==="mastered"||(se==null?void 0:se.status)==="in_progress"||(se==null?void 0:se.status)==="available";return{stroke:de?"var(--brand)":"var(--ink-faint)",strokeWidth:de?4:2.5,strokeOpacity:de?.6:.5,strokeDasharray:de?"none":"3 7"}},V=O.nodes[0]?{x:sc(`${e.id}:knot`,M),y:qc}:{x:M/2,y:qc},Y=y[y.length-1],G=(Y==null?void 0:Y.type)==="exam",B=O.nodes[O.nodes.length-1],ne=G&&B?{x:sc(`${e.id}:next`,M),y:A+24}:void 0;return x.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[x.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[x.jsx("span",{className:"w-6 h-6 rounded-full bg-gold text-neutral-900 text-caption font-extrabold flex items-center justify-center shrink-0 ring-2 ring-gold/40 shadow-sm",children:t+1}),x.jsx("span",{className:"text-label font-bold text-white truncate flex-1 drop-shadow-[0_1px_2px_rgba(0,0,0,0.7)]",children:e.title})]}),x.jsxs("div",{ref:k,className:"relative",style:{minHeight:A},children:[x.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:A,overflow:"visible"},children:c?x.jsxs(x.Fragment,{children:[O.nodes[0]&&x.jsx("circle",{cx:V.x,cy:V.y,r:3.5,fill:"#ffc800",opacity:.9}),O.nodes[0]&&x.jsx("path",{"data-rope":0,d:`M ${V.x} ${V.y} L ${O.nodes[0].x} ${O.nodes[0].y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ie(0)}),O.segments.map((K,$)=>x.jsx("path",{"data-rope":$+1,d:`M ${K.from.x} ${K.from.y+Ca*ti} L ${K.to.x} ${K.to.y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ie(K.index)},K.index)),ne&&B&&x.jsxs(x.Fragment,{children:[x.jsx("path",{"data-rope":O.segments.length+1,"data-exam-rope":!0,d:`M ${ne.x} ${ne.y} L ${B.x} ${B.y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ie(y.length-1)}),x.jsx("circle",{"data-next-knot":!0,cx:ne.x,cy:ne.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(K,$)=>x.jsx("circle",{"data-pulse":$,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},$)),y.map((K,$)=>x.jsx("circle",{"data-field":$,cx:0,cy:0,r:0,fill:"none",stroke:"#1cb0f6",strokeWidth:2,opacity:0},`f-${K.id}`))]}):O.segments.map(K=>{const $=l5(y[K.index],i);return x.jsx("path",{d:cN(K),stroke:$?"var(--brand)":"var(--ink-faint)",strokeWidth:$?4:2.5,strokeOpacity:$?.6:.5,fill:"none",strokeLinecap:"round",strokeDasharray:$?"none":"3 7",style:$?{pathLength:1,animation:"path-draw 600ms var(--ease-out-expo)"}:void 0},K.index)})}),y.map((K,$)=>{const se=O.nodes[$];if(!se)return null;const de=d0(K.id),Ce=`${de%40/10}s`,qe=`${5+de%30/10}s`;return x.jsx("div",{"data-node-id":K.id,"data-noswipe":"",className:c?`absolute hover:z-30 will-change-transform ${z(K)?"cursor-not-allowed":"cursor-grab active:cursor-grabbing"}`:"absolute balloon-bob hover:z-30",style:{left:se.x-C/2,top:se.y-L/2+10,width:C,...c?{touchAction:"pan-y"}:{"--bob-delay":Ce,"--bob-duration":qe}},onPointerDown:c?$e=>H($e,K.id):void 0,onPointerMove:c?X:void 0,onPointerUp:c?Z:void 0,onPointerCancel:c?Z:void 0,children:x.jsx(u5,{lesson:K,progress:i[K.id],isSelected:K.id===o,isDue:s.has(K.id),chapterLessonsMastered:T,onClick:()=>{Date.now()<U.current||l(K.id)}})},K.id)})]})]})}function l5(e,t){const n=e?t[e.id]:void 0;return(n==null?void 0:n.status)==="mastered"||(n==null?void 0:n.status)==="in_progress"||(n==null?void 0:n.status)==="available"}function u5({lesson:e,progress:t,isSelected:n,isDue:i,chapterLessonsMastered:o,onClick:s}){const l=He(),c=(t==null?void 0:t.status)??"locked",d=(t==null?void 0:t.crownLevel)??0,h=e.type==="exam",m=Math.min(3,d),g=h?!o:c==="locked",b=h&&g,p=!h&&(c==="in_progress"||c==="mastered"),y=c==="mastered"?100:c==="in_progress"?Math.round(((t==null?void 0:t.mastery)??0)*100):0;return x.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[x.jsxs("button",{onClick:()=>!g&&s(),disabled:g,"data-testid":`${h?"exam-node":"map-node"}-${e.id.slice(0,8)}`,className:`group relative w-14 h-14 flex items-center justify-center text-2xl rounded-full transition-all duration-200 ${h?b?"lesson-bubble exam-bubble-locked":d5(d>0):c5(c)} ${g?"cursor-not-allowed":"cursor-pointer hover:scale-105"} ${n?"ring-4 ring-accent ring-offset-2 ring-offset-neutral-50 dark:ring-offset-neutral-950":""}`,title:void 0,"data-tooltip":b?`🔒 ${e.title}${l("node.locked.chapterHint")}`:h?`🎯 ${e.title}`:g?`🔒 ${e.title}`:i?`📖 ${e.title}${l("node.due.hint")}`:e.title,children:[p&&x.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[x.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),x.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:c==="mastered"?"#ffc800":"white",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${y/100*157} 157`,className:"transition-all duration-500"})]}),h?b?x.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):x.jsx(Rs,{"aria-label":"exam",className:"relative z-10 w-6 h-6 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.4)]",strokeWidth:2.5}):g?x.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):c==="mastered"?x.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):c==="in_progress"?x.jsx(ii,{"aria-label":"in-progress",className:"relative z-10 w-6 h-6 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.4)]",strokeWidth:2.5}):x.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),i&&!g&&!h&&x.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-review text-white text-caption flex items-center justify-center font-bold border-2 border-neutral-50 dark:border-neutral-950",children:"!"})]}),h&&x.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(E=>x.jsx("span",{className:`text-caption ${E<m?"text-gold":"text-white/25"}`,children:"★"},E))}),n&&x.jsx("div",{className:"mt-1 text-caption text-center leading-tight max-w-[120px] font-bold px-1.5 py-0.5 rounded-md bg-brand/90 text-white shadow-sm",children:e.title})]})}function c5(e){switch(e){case"locked":return"lesson-bubble lesson-bubble-locked";case"available":return"lesson-bubble lesson-bubble-available";case"in_progress":return"lesson-bubble lesson-bubble-in-progress";case"mastered":return"lesson-bubble lesson-bubble-mastered";default:return"lesson-bubble lesson-bubble-locked"}}function d5(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function f5({available:e,current:t,onChange:n}){const i=He(),[o,s]=R.useState(!1),l={en:"English","zh-CN":"中文","zh-TW":"繁體",ja:"日本語",ko:"한국어",fr:"Français",de:"Deutsch",es:"Español","pt-BR":"Português",ru:"Русский",it:"Italiano",ar:"العربية",hi:"हिन्दी",tr:"Türkçe",pl:"Polski",nl:"Nederlands",id:"Indonesia",vi:"Tiếng Việt",th:"ไทย",sv:"Svenska",fi:"Suomi"},c=t?l[t]??t:i("lang.original");return x.jsxs("div",{className:"relative shrink-0",children:[x.jsxs("button",{onClick:()=>s(!o),className:"flex items-center gap-1 px-1.5 py-0.5 rounded-md text-caption font-bold text-white/80 hover:text-white hover:bg-white/10 transition-colors","data-testid":"lang-switcher-btn",children:[x.jsx(xC,{className:"w-3 h-3"}),c]}),o&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>s(!1)}),x.jsxs("div",{className:"absolute top-full right-0 mt-1 z-50 bg-surface-0 rounded-lg shadow-elevated p-1 min-w-[100px] max-h-48 overflow-y-auto",children:[x.jsx("button",{"data-testid":"lang-option-original",onClick:()=>{n(null),s(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===null?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:i("lang.original")}),e.map(d=>x.jsx("button",{"data-testid":`lang-option-${d}`,onClick:()=>{n(d),s(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===d?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:l[d]??d},d))]})]})]})}const h5=500,hr=8;function m5(){const[e,t]=R.useState(null),[n,i]=R.useState({mode:"cursor",x:0,y:0}),[o,s]=R.useState({w:0,h:0}),l=R.useRef(null),c=R.useCallback(()=>window.matchMedia("(pointer: coarse)").matches,[]),d=R.useCallback(T=>{c()||i(k=>k.mode==="cursor"?{...k,x:T.clientX,y:T.clientY}:k)},[c]),h=R.useCallback(T=>{var N;if(c())return;const k=(N=T.target)==null?void 0:N.closest("[data-tooltip]"),M=k==null?void 0:k.getAttribute("data-tooltip");if(M){t(M),i({mode:"cursor",x:T.clientX,y:T.clientY});return}t(null)},[c]),m=R.useCallback(T=>{var M,N;if(c())return;((N=(M=T.target)==null?void 0:M.closest)==null?void 0:N.call(M,"[data-tooltip]"))&&t(null)},[c]);if(R.useEffect(()=>(document.addEventListener("mousemove",d,{passive:!0}),document.addEventListener("mouseover",h,{passive:!0}),document.addEventListener("mouseout",m,{passive:!0}),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseover",h),document.removeEventListener("mouseout",m)}),[d,h,m]),R.useEffect(()=>{let T=null;const k=()=>{T&&(clearTimeout(T),T=null)},M=C=>{var D;if(!c()||C.touches.length!==1)return k();const L=(D=C.target)==null?void 0:D.closest("[data-tooltip]"),_=L==null?void 0:L.getAttribute("data-tooltip");if(!_||!L)return k();const j=L;k(),T=setTimeout(()=>{j.isConnected&&(t(_),i({mode:"rect",x:0,y:0,rect:j.getBoundingClientRect()}))},h5)},N=()=>{k(),t(C=>C&&null)},O=()=>k(),A=()=>{k(),t(null)};return document.addEventListener("touchstart",M,{passive:!0}),document.addEventListener("touchend",N,{passive:!0}),document.addEventListener("touchmove",O,{passive:!0}),document.addEventListener("touchcancel",A,{passive:!0}),()=>{k(),document.removeEventListener("touchstart",M),document.removeEventListener("touchend",N),document.removeEventListener("touchmove",O),document.removeEventListener("touchcancel",A)}},[c]),R.useLayoutEffect(()=>{l.current&&e&&s({w:l.current.offsetWidth,h:l.current.offsetHeight})},[e]),!e)return null;const g=window.innerWidth,b=window.innerHeight;let p,y,E;if(n.mode==="rect"&&n.rect){const T=n.rect;p=T.left+T.width/2-o.w/2,y=T.top-o.h-6,E="none",y<hr&&(y=T.bottom+6)}else p=n.x,y=n.y-6,E="translate(0, -100%)";return p=Math.min(Math.max(p,hr),Math.max(hr,g-o.w-hr)),y=Math.min(Math.max(y,hr),Math.max(hr,b-o.h-hr)),up.createPortal(x.jsx("div",{ref:l,style:{position:"fixed",left:p,top:y,transform:E,zIndex:99999,pointerEvents:"none",visibility:o.w?"visible":"hidden",background:"rgb(var(--surface-0-rgb) / 0.92)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:"var(--ink)",border:"1px solid rgb(var(--border-rgb) / 0.5)",fontSize:"0.875rem",fontWeight:600,lineHeight:1.4,padding:"4px 10px",borderRadius:"8px",maxWidth:"260px",wordBreak:"break-word",boxShadow:"0 4px 12px rgb(var(--shadow-rgb) / 0.15)",whiteSpace:"normal"},children:e}),document.body)}function by(e){const t=[],n=String(e||"");let i=n.indexOf(","),o=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const l=n.slice(o,i).trim();(l||!s)&&t.push(l),o=i+1,i=n.indexOf(",",o)}return t}function PE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const p5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x5={};function yy(e,t){return(x5.jsx?g5:p5).test(e)}const b5=/[ \t\n\f\r]/g;function y5(e){return typeof e=="object"?e.type==="text"?vy(e.value):!1:vy(e)}function vy(e){return e.replace(b5,"")===""}class Ll{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ll.prototype.normal={};Ll.prototype.property={};Ll.prototype.space=void 0;function BE(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Ll(n,i,t)}function Tl(e){return e.toLowerCase()}class Mn{constructor(t,n){this.attribute=n,this.property=t}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let v5=0;const Fe=Lr(),Gt=Lr(),h0=Lr(),ke=Lr(),Et=Lr(),Cr=Lr(),zn=Lr();function Lr(){return 2**++v5}const m0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:Gt,commaOrSpaceSeparated:zn,commaSeparated:Cr,number:ke,overloadedBoolean:h0,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),um=Object.keys(m0);class fp extends Mn{constructor(t,n,i,o){let s=-1;if(super(t,n),Ey(this,"space",o),typeof i=="number")for(;++s<um.length;){const l=um[s];Ey(this,um[s],(i&m0[l])===m0[l])}}}fp.prototype.defined=!0;function Ey(e,t,n){n&&(e[t]=n)}function Us(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const s=new fp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Tl(i)]=i,n[Tl(s.attribute)]=i}return new Ll(t,n,e.space)}const UE=Us({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:Et,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:ke,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:Et,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Gt,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zE(e,t){return t in e?e[t]:t}function HE(e,t){return zE(e,t.toLowerCase())}const E5=Us({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cr,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alpha:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:Et,autoFocus:Fe,autoPlay:Fe,blocking:Et,capture:null,charSet:null,checked:Fe,cite:null,className:Et,closedBy:null,colorSpace:null,cols:ke,colSpan:ke,command:null,commandFor:null,content:null,contentEditable:Gt,controls:Fe,controlsList:Et,coords:ke|Cr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:h0,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:Et,height:ke,hidden:h0,high:ke,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:Et,itemRef:Et,itemScope:Fe,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Fe,optimum:ke,pattern:null,ping:Et,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:Et,required:Fe,reversed:Fe,rows:ke,rowSpan:ke,sandbox:Et,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootCustomElementRegistry:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shadowRootSerializable:Fe,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:Gt,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Fe,disablePictureInPicture:Fe,disableRemotePlayback:Fe,exportParts:Cr,part:Et,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:HE}),T5=Us({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zn,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Cr,g2:Cr,glyphName:Cr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zn,rev:zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zn,requiredFeatures:zn,requiredFonts:zn,requiredFormats:zn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zn,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zE}),FE=Us({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),VE=Us({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:HE}),qE=Us({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),S5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},w5=/[A-Z]/g,Ty=/-[a-z]/g,k5=/^data[-\w.:]+$/i;function md(e,t){const n=Tl(t);let i=t,o=Mn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&k5.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Ty,C5);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Ty.test(s)){let l=s.replace(w5,A5);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=fp}return new o(i,t)}function A5(e){return"-"+e.toLowerCase()}function C5(e){return e.charAt(1).toUpperCase()}const Ol=BE([UE,E5,FE,VE,qE],"html"),Hi=BE([UE,T5,FE,VE,qE],"svg");function Sy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function YE(e){return e.join(" ").trim()}var vs={},cm,wy;function N5(){if(wy)return cm;wy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
505
|
+
`,h="/",m="*",g="",b="comment",p="declaration";function y(T,k){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];k=k||{};var M=1,N=1;function O(q){var z=q.match(t);z&&(M+=z.length);var H=q.lastIndexOf(d);N=~H?q.length-H:N+q.length}function A(){var q={line:M,column:N};return function(z){return z.position=new C(q),j(),z}}function C(q){this.start=q,this.end={line:M,column:N},this.source=k.source}C.prototype.content=T;function L(q){var z=new Error(k.source+":"+M+":"+N+": "+q);if(z.reason=q,z.filename=k.source,z.line=M,z.column=N,z.source=T,!k.silent)throw z}function _(q){var z=q.exec(T);if(z){var H=z[0];return O(H),T=T.slice(H.length),z}}function j(){_(n)}function D(q){var z;for(q=q||[];z=P();)z!==!1&&q.push(z);return q}function P(){var q=A();if(!(h!=T.charAt(0)||m!=T.charAt(1))){for(var z=2;g!=T.charAt(z)&&(m!=T.charAt(z)||h!=T.charAt(z+1));)++z;if(z+=2,g===T.charAt(z-1))return L("End of comment missing");var H=T.slice(2,z-2);return N+=2,O(H),T=T.slice(z),N+=2,q({type:b,comment:H})}}function U(){var q=A(),z=_(i);if(z){if(P(),!_(o))return L("property missing ':'");var H=_(s),X=q({type:p,property:E(z[0].replace(e,g)),value:H?E(H[0].replace(e,g)):g});return _(l),X}}function J(){var q=[];D(q);for(var z;z=U();)z!==!1&&(q.push(z),D(q));return q}return j(),J()}function E(T){return T?T.replace(c,g):g}return cm=y,cm}var ky;function _5(){if(ky)return vs;ky=1;var e=vs&&vs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(vs,"__esModule",{value:!0}),vs.default=n;const t=e(N5());function n(i,o){let s=null;if(!i||typeof i!="string")return s;const l=(0,t.default)(i),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;c?o(h,m,d):m&&(s=s||{},s[h]=m)}),s}return vs}var Go={},Ay;function M5(){if(Ay)return Go;Ay=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),s(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(o,c):h=h.replace(i,c),h.replace(t,l))};return Go.camelCase=d,Go}var Xo,Cy;function R5(){if(Cy)return Xo;Cy=1;var e=Xo&&Xo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(_5()),n=M5();function i(o,s){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,s)]=d)}),l}return i.default=i,Xo=i,Xo}var D5=R5();const L5=Ml(D5),pd=GE("end"),Da=GE("start");function GE(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function XE(e){const t=Da(e),n=pd(e);if(t&&n)return{start:t,end:n}}function sl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ny(e.position):"start"in e||"end"in e?Ny(e):"line"in e||"column"in e?p0(e):""}function p0(e){return _y(e&&e.line)+":"+_y(e&&e.column)}function Ny(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function _y(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(l=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=sl(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const hp={}.hasOwnProperty,O5=new Map,I5=/[A-Z]/g,j5=new Set(["table","tbody","thead","tfoot","tr"]),P5=new Set(["td","th"]),KE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function B5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=G5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Y5(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hi:Ol,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=QE(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function QE(e,t,n){if(t.type==="element")return U5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return z5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return F5(e,t,n);if(t.type==="mdxjsEsm")return H5(e,t);if(t.type==="root")return V5(e,t,n);if(t.type==="text")return q5(e,t)}function U5(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Hi,e.schema=o),e.ancestors.push(t);const s=WE(e,t.tagName,!1),l=X5(e,t);let c=pp(e,t);return j5.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!y5(d):!0})),$E(e,l,s,t),mp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function z5(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Sl(e,t.position)}function H5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Sl(e,t.position)}function F5(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Hi,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:WE(e,t.name,!0),l=K5(e,t),c=pp(e,t);return $E(e,l,s,t),mp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function V5(e,t,n){const i={};return mp(i,pp(e,t)),e.create(t,e.Fragment,i,n)}function q5(e,t){return t.value}function $E(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function mp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Y5(e,t,n){return i;function i(o,s,l,c){const h=Array.isArray(l.children)?n:t;return c?h(s,l,c):h(s,l)}}function G5(e,t){return n;function n(i,o,s,l){const c=Array.isArray(s.children),d=Da(i);return t(o,s,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function X5(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&hp.call(t.properties,o)){const s=Q5(e,o,t.properties[o]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&P5.has(t.tagName)?i=c:n[l]=c}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function K5(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Sl(e,t.position);else{const o=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else Sl(e,t.position);else s=i.value===null?!0:i.value;n[o]=s}return n}function pp(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:O5;for(;++i<t.children.length;){const s=t.children[i];let l;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const h=o.get(d)||0;l=d+"-"+h,o.set(d,h+1)}}const c=QE(e,s,l);c!==void 0&&n.push(c)}return n}function Q5(e,t,n){const i=md(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?PE(n):YE(n)),i.property==="style"){let o=typeof n=="object"?n:$5(e,String(n));return e.stylePropertyNameCase==="css"&&(o=W5(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?S5[i.property]||i.property:i.attribute,n]}}function $5(e,t){try{return L5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=KE+"#cannot-parse-style-attribute",o}}function WE(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,l;for(;++s<o.length;){const c=yy(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=l}else i=yy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return hp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Sl(e)}function Sl(e,t){const n=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=KE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function W5(e){const t={};let n;for(n in e)hp.call(e,n)&&(t[Z5(n)]=e[n]);return t}function Z5(e){let t=e.replace(I5,J5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function J5(e){return"-"+e.toLowerCase()}const dm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},e4={};function gp(e,t){const n=e4,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ZE(e,i,o)}function ZE(e,t,n){if(t4(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return My(e.children,t,n)}return Array.isArray(e)?My(e,t,n):""}function My(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=ZE(e[o],t,n);return i.join("")}function t4(e){return!!(e&&typeof e=="object")}const Ry=document.createElement("i");function xp(e){const t="&"+e+";";Ry.innerHTML=t;const n=Ry.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vn(e,t,n,i){const o=e.length;let s=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<i.length;)l=i.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function ia(e,t){return e.length>0?(Vn(e,e.length,0,t),e):t}const Dy={}.hasOwnProperty;function JE(e){const t={};let n=-1;for(;++n<e.length;)n4(t,e[n]);return t}function n4(e,t){let n;for(n in t){const o=(Dy.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){Dy.call(o,l)||(o[l]=[]);const c=s[l];a4(o[l],Array.isArray(c)?c:c?[c]:[])}}}function a4(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Vn(e,0,0,i)}function eT(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function xa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=Fi(/[A-Za-z]/),dn=Fi(/[\dA-Za-z]/),i4=Fi(/[#-'*+\--9=?A-Z^-~]/);function Yc(e){return e!==null&&(e<32||e===127)}const g0=Fi(/\d/),r4=Fi(/[\dA-Fa-f]/),s4=Fi(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function nt(e){return e===-2||e===-1||e===32}const gd=Fi(new RegExp("\\p{P}|\\p{S}","u")),Rr=Fi(/\s/);function Fi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zs(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&dn(e.charCodeAt(n+1))&&dn(e.charCodeAt(n+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),o=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(i,n),encodeURIComponent(l)),i=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}function ot(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return nt(d)?(e.enter(n),c(d)):t(d)}function c(d){return nt(d)&&s++<o?(e.consume(d),c):(e.exit(n),t(d))}}const o4={tokenize:l4};function l4(e){const t=e.attempt(this.parser.constructs.contentInitial,i,o);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ot(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),s(c)}function s(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Be(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const u4={tokenize:c4},Ly={tokenize:d4};function c4(e){const t=this,n=[];let i=0,o,s,l;return c;function c(N){if(i<n.length){const O=n[i];return t.containerState=O[1],e.attempt(O[0].continuation,d,h)(N)}return h(N)}function d(N){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&M();const O=t.events.length;let A=O,C;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){C=t.events[A][1].end;break}k(i);let L=O;for(;L<t.events.length;)t.events[L][1].end={...C},L++;return Vn(t.events,A+1,0,t.events.slice(O)),t.events.length=L,h(N)}return c(N)}function h(N){if(i===n.length){if(!o)return b(N);if(o.currentConstruct&&o.currentConstruct.concrete)return y(N);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ly,m,g)(N)}function m(N){return o&&M(),k(i),b(N)}function g(N){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,y(N)}function b(N){return t.containerState={},e.attempt(Ly,p,y)(N)}function p(N){return i++,n.push([t.currentConstruct,t.containerState]),b(N)}function y(N){if(N===null){o&&M(),k(0),e.consume(N);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),E(N)}function E(N){if(N===null){T(e.exit("chunkFlow"),!0),k(0),e.consume(N);return}return Be(N)?(e.consume(N),T(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(N),E)}function T(N,O){const A=t.sliceStream(N);if(O&&A.push(null),N.previous=s,s&&(s.next=N),s=N,o.defineSkip(N.start),o.write(A),t.parser.lazy[N.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<l&&(!o.events[C][1].end||o.events[C][1].end.offset>l))return;const L=t.events.length;let _=L,j,D;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(j){D=t.events[_][1].end;break}j=!0}for(k(i),C=L;C<t.events.length;)t.events[C][1].end={...D},C++;Vn(t.events,_+1,0,t.events.slice(L)),t.events.length=C}}function k(N){let O=n.length;for(;O-- >N;){const A=n[O];t.containerState=A[1],A[0].exit.call(t,e)}n.length=N}function M(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function d4(e,t,n){return ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Os(e){if(e===null||wt(e)||Rr(e))return 1;if(gd(e))return 2}function xd(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!i.includes(s)&&(t=s(t,n),i.push(s))}return t}const x0={name:"attention",resolveAll:f4,tokenize:h4};function f4(e,t){let n=-1,i,o,s,l,c,d,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[i][1].end},b={...e[n][1].start};Oy(g,-d),Oy(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},s={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=ia(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=ia(h,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",s,t]]),h=ia(h,xd(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=ia(h,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=ia(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Vn(e,i-1,n-i+3,h),n=i+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function h4(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Os(i);let s;return l;function l(d){return s=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===s)return e.consume(d),c;const h=e.exit("attentionSequence"),m=Os(d),g=!m||m===2&&o||n.includes(d),b=!o||o===2&&m||n.includes(i);return h._open=!!(s===42?g:g&&(o||!b)),h._close=!!(s===42?b:b&&(m||!g)),t(d)}}function Oy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const m4={name:"autolink",tokenize:p4};function p4(e,t,n){let i=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return bn(p)?(e.consume(p),l):p===64?n(p):h(p)}function l(p){return p===43||p===45||p===46||dn(p)?(i=1,c(p)):h(p)}function c(p){return p===58?(e.consume(p),i=0,d):(p===43||p===45||p===46||dn(p))&&i++<32?(e.consume(p),c):(i=0,h(p))}function d(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Yc(p)?n(p):(e.consume(p),d)}function h(p){return p===64?(e.consume(p),m):i4(p)?(e.consume(p),h):n(p)}function m(p){return dn(p)?g(p):n(p)}function g(p){return p===46?(e.consume(p),i=0,m):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):b(p)}function b(p){if((p===45||dn(p))&&i++<63){const y=p===45?b:g;return e.consume(p),y}return n(p)}}const Il={partial:!0,tokenize:g4};function g4(e,t,n){return i;function i(s){return nt(s)?ot(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Be(s)?t(s):n(s)}}const tT={continuation:{tokenize:b4},exit:y4,name:"blockQuote",tokenize:x4};function x4(e,t,n){const i=this;return o;function o(l){if(l===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return nt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function b4(e,t,n){const i=this;return o;function o(l){return nt(l)?ot(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(tT,t,n)(l)}}function y4(e){e.exit("blockQuote")}const nT={name:"characterEscape",tokenize:v4};function v4(e,t,n){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return s4(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const aT={name:"characterReference",tokenize:E4};function E4(e,t,n){const i=this;let o=0,s,l;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),s=31,l=dn,m(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=r4,m):(e.enter("characterReferenceValue"),s=7,l=g0,m(g))}function m(g){if(g===59&&o){const b=e.exit("characterReferenceValue");return l===dn&&!xp(i.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&o++<s?(e.consume(g),m):n(g)}}const Iy={partial:!0,tokenize:S4},jy={concrete:!0,name:"codeFenced",tokenize:T4};function T4(e,t,n){const i=this,o={partial:!0,tokenize:A};let s=0,l=0,c;return d;function d(C){return h(C)}function h(C){const L=i.events[i.events.length-1];return s=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,c=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(C)}function m(C){return C===c?(l++,e.consume(C),m):l<3?n(C):(e.exit("codeFencedFenceSequence"),nt(C)?ot(e,g,"whitespace")(C):g(C))}function g(C){return C===null||Be(C)?(e.exit("codeFencedFence"),i.interrupt?t(C):e.check(Iy,E,O)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===null||Be(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(C)):nt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ot(e,p,"whitespace")(C)):C===96&&C===c?n(C):(e.consume(C),b)}function p(C){return C===null||Be(C)?g(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||Be(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(C)):C===96&&C===c?n(C):(e.consume(C),y)}function E(C){return e.attempt(o,O,T)(C)}function T(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),k}function k(C){return s>0&&nt(C)?ot(e,M,"linePrefix",s+1)(C):M(C)}function M(C){return C===null||Be(C)?e.check(Iy,E,O)(C):(e.enter("codeFlowValue"),N(C))}function N(C){return C===null||Be(C)?(e.exit("codeFlowValue"),M(C)):(e.consume(C),N)}function O(C){return e.exit("codeFenced"),t(C)}function A(C,L,_){let j=0;return D;function D(z){return C.enter("lineEnding"),C.consume(z),C.exit("lineEnding"),P}function P(z){return C.enter("codeFencedFence"),nt(z)?ot(C,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):U(z)}function U(z){return z===c?(C.enter("codeFencedFenceSequence"),J(z)):_(z)}function J(z){return z===c?(j++,C.consume(z),J):j>=l?(C.exit("codeFencedFenceSequence"),nt(z)?ot(C,q,"whitespace")(z):q(z)):_(z)}function q(z){return z===null||Be(z)?(C.exit("codeFencedFence"),L(z)):_(z)}}}function S4(e,t,n){const i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const fm={name:"codeIndented",tokenize:k4},w4={partial:!0,tokenize:A4};function k4(e,t,n){const i=this;return o;function o(h){return e.enter("codeIndented"),ot(e,s,"linePrefix",5)(h)}function s(h){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):Be(h)?e.attempt(w4,l,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Be(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function A4(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ot(e,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Be(l)?o(l):n(l)}}const C4={name:"codeText",previous:_4,resolve:N4,tokenize:M4};function N4(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)o===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(o=i):(i===t||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),t-=i-o-2,i=o+2),o=void 0);return e}function _4(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M4(e,t,n){let i=0,o,s;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),i++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(s=e.enter("codeTextSequence"),o=0,m(g)):Be(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Be(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),h)}function m(g){return g===96?(e.consume(g),o++,m):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(s.type="codeTextData",h(g))}}class R4{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Ko(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ko(this.left,n.reverse())}}}function Ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function iT(e){const t={};let n=-1,i,o,s,l,c,d,h;const m=new R4(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,D4(m,n)),n=t[n],h=!0);else if(i[1]._container){for(s=n,o=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(i[1].end={...m.get(o)[1].start},c=m.slice(o,n),c.unshift(i),m.splice(o,n-o+1,c))}}return Vn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function D4(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],h={};let m,g,b=-1,p=n,y=0,E=0;const T=[E];for(;p;){for(;e.get(++o)[1]!==p;);s.push(o),p._tokenizer||(m=i.sliceStream(p),p.next||m.push(null),g&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=p,p=p.next}for(p=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(E=b+1,T.push(E),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):T.pop(),b=T.length;b--;){const k=c.slice(T[b],T[b+1]),M=s.pop();d.push([M,M+k.length-1]),e.splice(M,2,k)}for(d.reverse(),b=-1;++b<d.length;)h[y+d[b][0]]=y+d[b][1],y+=d[b][1]-d[b][0]-1;return h}const L4={resolve:I4,tokenize:j4},O4={partial:!0,tokenize:P4};function I4(e){return iT(e),e}function j4(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?s(c):Be(c)?e.check(O4,l,s)(c):(e.consume(c),o)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function P4(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ot(e,s,"linePrefix")}function s(l){if(l===null||Be(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function rT(e,t,n,i,o,s,l,c,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(k){return k===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(k),e.exit(s),b):k===null||k===32||k===41||Yc(k)?n(k):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),E(k))}function b(k){return k===62?(e.enter(s),e.consume(k),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===62?(e.exit("chunkString"),e.exit(c),b(k)):k===null||k===60||Be(k)?n(k):(e.consume(k),k===92?y:p)}function y(k){return k===60||k===62||k===92?(e.consume(k),p):p(k)}function E(k){return!m&&(k===null||k===41||wt(k))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(k)):m<h&&k===40?(e.consume(k),m++,E):k===41?(e.consume(k),m--,E):k===null||k===32||k===40||Yc(k)?n(k):(e.consume(k),k===92?T:E)}function T(k){return k===40||k===41||k===92?(e.consume(k),E):E(k)}}function sT(e,t,n,i,o,s){const l=this;let c=0,d;return h;function h(p){return e.enter(i),e.enter(o),e.consume(p),e.exit(o),e.enter(s),m}function m(p){return c>999||p===null||p===91||p===93&&!d||p===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(s),e.enter(o),e.consume(p),e.exit(o),e.exit(i),t):Be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(p))}function g(p){return p===null||p===91||p===93||Be(p)||c++>999?(e.exit("chunkString"),m(p)):(e.consume(p),d||(d=!nt(p)),p===92?b:g)}function b(p){return p===91||p===92||p===93?(e.consume(p),c++,g):g(p)}}function oT(e,t,n,i,o,s){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(i),e.enter(o),e.consume(b),e.exit(o),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),t):(e.enter(s),h(b))}function h(b){return b===l?(e.exit(s),d(l)):b===null?n(b):Be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ot(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||Be(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:m)}function g(b){return b===l||b===92?(e.consume(b),m):m(b)}}function ol(e,t){let n;return i;function i(o){return Be(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):nt(o)?ot(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const B4={name:"definition",tokenize:z4},U4={partial:!0,tokenize:H4};function z4(e,t,n){const i=this;let o;return s;function s(p){return e.enter("definition"),l(p)}function l(p){return sT.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function c(p){return o=xa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),d):n(p)}function d(p){return wt(p)?ol(e,h)(p):h(p)}function h(p){return rT(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function m(p){return e.attempt(U4,g,g)(p)}function g(p){return nt(p)?ot(e,b,"whitespace")(p):b(p)}function b(p){return p===null||Be(p)?(e.exit("definition"),i.parser.defined.push(o),t(p)):n(p)}}function H4(e,t,n){return i;function i(c){return wt(c)?ol(e,o)(c):n(c)}function o(c){return oT(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return nt(c)?ot(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Be(c)?t(c):n(c)}}const F4={name:"hardBreakEscape",tokenize:V4};function V4(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Be(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const q4={name:"headingAtx",resolve:Y4,tokenize:G4};function Y4(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Vn(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function G4(e,t,n){let i=0;return o;function o(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&i++<6?(e.consume(m),l):m===null||wt(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Be(m)?(e.exit("atxHeading"),t(m)):nt(m)?ot(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||wt(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const X4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Py=["pre","script","style","textarea"],K4={concrete:!0,name:"htmlFlow",resolveTo:W4,tokenize:Z4},Q4={partial:!0,tokenize:e6},$4={partial:!0,tokenize:J4};function W4(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Z4(e,t,n){const i=this;let o,s,l,c,d;return h;function h(B){return m(B)}function m(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),g}function g(B){return B===33?(e.consume(B),b):B===47?(e.consume(B),s=!0,E):B===63?(e.consume(B),o=3,i.interrupt?t:V):bn(B)?(e.consume(B),l=String.fromCharCode(B),T):n(B)}function b(B){return B===45?(e.consume(B),o=2,p):B===91?(e.consume(B),o=5,c=0,y):bn(B)?(e.consume(B),o=4,i.interrupt?t:V):n(B)}function p(B){return B===45?(e.consume(B),i.interrupt?t:V):n(B)}function y(B){const ne="CDATA[";return B===ne.charCodeAt(c++)?(e.consume(B),c===ne.length?i.interrupt?t:U:y):n(B)}function E(B){return bn(B)?(e.consume(B),l=String.fromCharCode(B),T):n(B)}function T(B){if(B===null||B===47||B===62||wt(B)){const ne=B===47,K=l.toLowerCase();return!ne&&!s&&Py.includes(K)?(o=1,i.interrupt?t(B):U(B)):X4.includes(l.toLowerCase())?(o=6,ne?(e.consume(B),k):i.interrupt?t(B):U(B)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(B):s?M(B):N(B))}return B===45||dn(B)?(e.consume(B),l+=String.fromCharCode(B),T):n(B)}function k(B){return B===62?(e.consume(B),i.interrupt?t:U):n(B)}function M(B){return nt(B)?(e.consume(B),M):D(B)}function N(B){return B===47?(e.consume(B),D):B===58||B===95||bn(B)?(e.consume(B),O):nt(B)?(e.consume(B),N):D(B)}function O(B){return B===45||B===46||B===58||B===95||dn(B)?(e.consume(B),O):A(B)}function A(B){return B===61?(e.consume(B),C):nt(B)?(e.consume(B),A):N(B)}function C(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),d=B,L):nt(B)?(e.consume(B),C):_(B)}function L(B){return B===d?(e.consume(B),d=null,j):B===null||Be(B)?n(B):(e.consume(B),L)}function _(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||wt(B)?A(B):(e.consume(B),_)}function j(B){return B===47||B===62||nt(B)?N(B):n(B)}function D(B){return B===62?(e.consume(B),P):n(B)}function P(B){return B===null||Be(B)?U(B):nt(B)?(e.consume(B),P):n(B)}function U(B){return B===45&&o===2?(e.consume(B),H):B===60&&o===1?(e.consume(B),X):B===62&&o===4?(e.consume(B),Y):B===63&&o===3?(e.consume(B),V):B===93&&o===5?(e.consume(B),ie):Be(B)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Q4,G,J)(B)):B===null||Be(B)?(e.exit("htmlFlowData"),J(B)):(e.consume(B),U)}function J(B){return e.check($4,q,G)(B)}function q(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),z}function z(B){return B===null||Be(B)?J(B):(e.enter("htmlFlowData"),U(B))}function H(B){return B===45?(e.consume(B),V):U(B)}function X(B){return B===47?(e.consume(B),l="",Z):U(B)}function Z(B){if(B===62){const ne=l.toLowerCase();return Py.includes(ne)?(e.consume(B),Y):U(B)}return bn(B)&&l.length<8?(e.consume(B),l+=String.fromCharCode(B),Z):U(B)}function ie(B){return B===93?(e.consume(B),V):U(B)}function V(B){return B===62?(e.consume(B),Y):B===45&&o===2?(e.consume(B),V):U(B)}function Y(B){return B===null||Be(B)?(e.exit("htmlFlowData"),G(B)):(e.consume(B),Y)}function G(B){return e.exit("htmlFlow"),t(B)}}function J4(e,t,n){const i=this;return o;function o(l){return Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function e6(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Il,t,n)}}const t6={name:"htmlText",tokenize:n6};function n6(e,t,n){const i=this;let o,s,l;return c;function c(V){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(V),d}function d(V){return V===33?(e.consume(V),h):V===47?(e.consume(V),A):V===63?(e.consume(V),N):bn(V)?(e.consume(V),_):n(V)}function h(V){return V===45?(e.consume(V),m):V===91?(e.consume(V),s=0,y):bn(V)?(e.consume(V),M):n(V)}function m(V){return V===45?(e.consume(V),p):n(V)}function g(V){return V===null?n(V):V===45?(e.consume(V),b):Be(V)?(l=g,X(V)):(e.consume(V),g)}function b(V){return V===45?(e.consume(V),p):g(V)}function p(V){return V===62?H(V):V===45?b(V):g(V)}function y(V){const Y="CDATA[";return V===Y.charCodeAt(s++)?(e.consume(V),s===Y.length?E:y):n(V)}function E(V){return V===null?n(V):V===93?(e.consume(V),T):Be(V)?(l=E,X(V)):(e.consume(V),E)}function T(V){return V===93?(e.consume(V),k):E(V)}function k(V){return V===62?H(V):V===93?(e.consume(V),k):E(V)}function M(V){return V===null||V===62?H(V):Be(V)?(l=M,X(V)):(e.consume(V),M)}function N(V){return V===null?n(V):V===63?(e.consume(V),O):Be(V)?(l=N,X(V)):(e.consume(V),N)}function O(V){return V===62?H(V):N(V)}function A(V){return bn(V)?(e.consume(V),C):n(V)}function C(V){return V===45||dn(V)?(e.consume(V),C):L(V)}function L(V){return Be(V)?(l=L,X(V)):nt(V)?(e.consume(V),L):H(V)}function _(V){return V===45||dn(V)?(e.consume(V),_):V===47||V===62||wt(V)?j(V):n(V)}function j(V){return V===47?(e.consume(V),H):V===58||V===95||bn(V)?(e.consume(V),D):Be(V)?(l=j,X(V)):nt(V)?(e.consume(V),j):H(V)}function D(V){return V===45||V===46||V===58||V===95||dn(V)?(e.consume(V),D):P(V)}function P(V){return V===61?(e.consume(V),U):Be(V)?(l=P,X(V)):nt(V)?(e.consume(V),P):j(V)}function U(V){return V===null||V===60||V===61||V===62||V===96?n(V):V===34||V===39?(e.consume(V),o=V,J):Be(V)?(l=U,X(V)):nt(V)?(e.consume(V),U):(e.consume(V),q)}function J(V){return V===o?(e.consume(V),o=void 0,z):V===null?n(V):Be(V)?(l=J,X(V)):(e.consume(V),J)}function q(V){return V===null||V===34||V===39||V===60||V===61||V===96?n(V):V===47||V===62||wt(V)?j(V):(e.consume(V),q)}function z(V){return V===47||V===62||wt(V)?j(V):n(V)}function H(V){return V===62?(e.consume(V),e.exit("htmlTextData"),e.exit("htmlText"),t):n(V)}function X(V){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),Z}function Z(V){return nt(V)?ot(e,ie,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):ie(V)}function ie(V){return e.enter("htmlTextData"),l(V)}}const bp={name:"labelEnd",resolveAll:s6,resolveTo:o6,tokenize:l6},a6={tokenize:u6},i6={tokenize:c6},r6={tokenize:d6};function s6(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",t+=o}}return e.length!==n.length&&Vn(e,0,e.length,n),e}function o6(e,t){let n=e.length,i=0,o,s,l,c;for(;n--;)if(o=e[n][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=n,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=ia(c,e.slice(s+1,s+i+3)),c=ia(c,[["enter",m,t]]),c=ia(c,xd(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=ia(c,[["exit",m,t],e[l-2],e[l-1],["exit",h,t]]),c=ia(c,e.slice(l+1)),c=ia(c,[["exit",d,t]]),Vn(e,s,e.length,c),e}function l6(e,t,n){const i=this;let o=i.events.length,s,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){s=i.events[o][1];break}return c;function c(b){return s?s._inactive?g(b):(l=i.parser.defined.includes(xa(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(a6,m,l?m:g)(b):b===91?e.attempt(i6,m,l?h:g)(b):l?m(b):g(b)}function h(b){return e.attempt(r6,m,g)(b)}function m(b){return t(b)}function g(b){return s._balanced=!0,n(b)}}function u6(e,t,n){return i;function i(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return wt(g)?ol(e,s)(g):s(g)}function s(g){return g===41?m(g):rT(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return wt(g)?ol(e,d)(g):m(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?oT(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function h(g){return wt(g)?ol(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function c6(e,t,n){const i=this;return o;function o(c){return sT.call(i,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(xa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function d6(e,t,n){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const f6={name:"labelStartImage",resolveAll:bp.resolveAll,tokenize:h6};function h6(e,t,n){const i=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const m6={name:"labelStartLink",resolveAll:bp.resolveAll,tokenize:p6};function p6(e,t,n){const i=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const hm={name:"lineEnding",tokenize:g6};function g6(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ot(e,t,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:x6};function x6(e,t,n){let i=0,o;return s;function s(h){return e.enter("thematicBreak"),l(h)}function l(h){return o=h,c(h)}function c(h){return h===o?(e.enter("thematicBreakSequence"),d(h)):i>=3&&(h===null||Be(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===o?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),nt(h)?ot(e,c,"whitespace")(h):c(h))}}const _n={continuation:{tokenize:E6},exit:S6,name:"list",tokenize:v6},b6={partial:!0,tokenize:w6},y6={partial:!0,tokenize:T6};function v6(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(p){const y=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:g0(p)){if(i.containerState.type||(i.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Nc,n,h)(p):h(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(p)}return n(p)}function d(p){return g0(p)&&++l<10?(e.consume(p),d):(!i.interrupt||l<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),h(p)):n(p)}function h(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(Il,i.interrupt?n:m,e.attempt(b6,b,g))}function m(p){return i.containerState.initialBlankLine=!0,s++,b(p)}function g(p){return nt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),b):n(p)}function b(p){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function E6(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Il,o,s);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ot(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!nt(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(y6,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,ot(e,e.attempt(_n,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function T6(e,t,n){const i=this;return ot(e,o,"listItemIndent",i.containerState.size+1);function o(s){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(s):n(s)}}function S6(e){e.exit(this.containerState.type)}function w6(e,t,n){const i=this;return ot(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const l=i.events[i.events.length-1];return!nt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const By={name:"setextUnderline",resolveTo:k6,tokenize:A6};function k6(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",l,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function A6(e,t,n){const i=this;let o;return s;function s(h){let m=i.events.length,g;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){g=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),o=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===o?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),nt(h)?ot(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Be(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const C6={tokenize:N6};function N6(e){const t=this,n=e.attempt(Il,i,e.attempt(this.parser.constructs.flowInitial,o,ot(e,e.attempt(this.parser.constructs.flow,o,e.attempt(L4,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _6={resolveAll:uT()},M6=lT("string"),R6=lT("text");function lT(e){return{resolveAll:uT(e==="text"?D6:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,l,c);return l;function l(m){return h(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const g=o[m];let b=-1;if(g)for(;++b<g.length;){const p=g[b];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function uT(e){return t;function t(n,i){let o=-1,s;for(;++o<=n.length;)s===void 0?n[o]&&n[o][1].type==="data"&&(s=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==s+2&&(n[s][1].end=n[o-1][1].end,n.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(n,i):n}}function D6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],o=t.sliceStream(i);let s=o.length,l=-1,c=0,d;for(;s--;){const h=o[s];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)d=!0,c++;else if(h!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const L6={42:_n,43:_n,45:_n,48:_n,49:_n,50:_n,51:_n,52:_n,53:_n,54:_n,55:_n,56:_n,57:_n,62:tT},O6={91:B4},I6={[-2]:fm,[-1]:fm,32:fm},j6={35:q4,42:Nc,45:[By,Nc],60:K4,61:By,95:Nc,96:jy,126:jy},P6={38:aT,92:nT},B6={[-5]:hm,[-4]:hm,[-3]:hm,33:f6,38:aT,42:x0,60:[m4,t6],91:m6,92:[F4,nT],93:bp,95:x0,96:C4},U6={null:[x0,_6]},z6={null:[42,95]},H6={null:[]},F6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:z6,contentInitial:O6,disable:H6,document:L6,flow:j6,flowInitial:I6,insideSpan:U6,string:P6,text:B6},Symbol.toStringTag,{value:"Module"}));function V6(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},s=[];let l=[],c=[];const d={attempt:L(A),check:L(C),consume:M,enter:N,exit:O,interrupt:L(C,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:y,parser:e,previous:null,sliceSerialize:b,sliceStream:p,write:g};let m=t.tokenize.call(h,d);return t.resolveAll&&s.push(t),h;function g(P){return l=ia(l,P),T(),l[l.length-1]!==null?[]:(_(t,0),h.events=xd(s,h.events,h),h.events)}function b(P,U){return Y6(p(P),U)}function p(P){return q6(l,P)}function y(){const{_bufferIndex:P,_index:U,line:J,column:q,offset:z}=i;return{_bufferIndex:P,_index:U,line:J,column:q,offset:z}}function E(P){o[P.line]=P.column,D()}function T(){let P;for(;i._index<l.length;){const U=l[i._index];if(typeof U=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<U.length;)k(U.charCodeAt(i._bufferIndex));else k(U)}}function k(P){m=m(P)}function M(P){Be(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,D()):P!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=P}function N(P,U){const J=U||{};return J.type=P,J.start=y(),h.events.push(["enter",J,h]),c.push(J),J}function O(P){const U=c.pop();return U.end=y(),h.events.push(["exit",U,h]),U}function A(P,U){_(P,U.from)}function C(P,U){U.restore()}function L(P,U){return J;function J(q,z,H){let X,Z,ie,V;return Array.isArray(q)?G(q):"tokenize"in q?G([q]):Y(q);function Y($){return se;function se(de){const Ce=de!==null&&$[de],qe=de!==null&&$.null,$e=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(qe)?qe:qe?[qe]:[]];return G($e)(de)}}function G($){return X=$,Z=0,$.length===0?H:B($[Z])}function B($){return se;function se(de){return V=j(),ie=$,$.partial||(h.currentConstruct=$),$.name&&h.parser.constructs.disable.null.includes($.name)?K():$.tokenize.call(U?Object.assign(Object.create(h),U):h,d,ne,K)(de)}}function ne($){return P(ie,V),z}function K($){return V.restore(),++Z<X.length?B(X[Z]):H}}}function _(P,U){P.resolveAll&&!s.includes(P)&&s.push(P),P.resolve&&Vn(h.events,U,h.events.length-U,P.resolve(h.events.slice(U),h)),P.resolveTo&&(h.events=P.resolveTo(h.events,h))}function j(){const P=y(),U=h.previous,J=h.currentConstruct,q=h.events.length,z=Array.from(c);return{from:q,restore:H};function H(){i=P,h.previous=U,h.currentConstruct=J,h.events.length=q,c=z,D()}}function D(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function q6(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,s)];else{if(l=e.slice(n,o),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}s>0&&l.push(e[o].slice(0,s))}return l}function Y6(e,t){let n=-1;const i=[];let o;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
506
|
+
`;break}case-3:{l=`\r
|
|
507
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(s)}o=s===-2,i.push(l)}return i.join("")}function G6(e){const i={constructs:JE([F6,...(e||{}).extensions||[]]),content:o(o4),defined:[],document:o(u4),flow:o(C6),lazy:{},string:o(M6),text:o(R6)};return i;function o(s){return l;function l(c){return V6(i,s,c)}}}function X6(e){for(;!iT(e););return e}const Uy=/[\0\t\n\r]/g;function K6(){let e=1,t="",n=!0,i;return o;function o(s,l,c){const d=[];let h,m,g,b,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),g=0,t="",n&&(s.charCodeAt(0)===65279&&g++,n=void 0);g<s.length;){if(Uy.lastIndex=g,h=Uy.exec(s),b=h&&h.index!==void 0?h.index:s.length,p=s.charCodeAt(b),!h){t=s.slice(g);break}if(p===10&&g===b&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),g<b&&(d.push(s.slice(g,b)),e+=b-g),p){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}g=b+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Q6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $6(e){return e.replace(Q6,W6)}function W6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return eT(n.slice(s?2:1),s?16:10)}return xp(n)||e}const cT={}.hasOwnProperty;function Z6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),J6(n)(X6(G6(n).document().write(K6()(e,t,!0))))}function J6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Qt),autolinkProtocol:j,autolinkEmail:j,atxHeading:s(Nt),blockQuote:s(qe),characterEscape:j,characterReference:j,codeFenced:s($e),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s($e,l),codeText:s(We,l),codeTextData:j,data:j,codeFlowValue:j,definition:s(Ct),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Rt),hardBreakEscape:s(Kt),hardBreakTrailing:s(Kt),htmlFlow:s(mn,l),htmlFlowData:j,htmlText:s(mn,l),htmlTextData:j,image:s(pn),label:l,link:s(Qt),listItem:s(gn),listItemValue:b,listOrdered:s(pt,g),listUnordered:s(pt),paragraph:s(Ht),reference:B,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Nt),strong:s(ge),thematicBreak:s(Ie)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:Ce,autolinkProtocol:de,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:$,characterReference:se,codeFenced:d(T),codeFencedFence:E,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:D,codeIndented:d(k),codeText:d(z),codeTextData:D,data:D,definition:d(),definitionDestinationString:O,definitionLabelString:M,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(U),hardBreakTrailing:d(U),htmlFlow:d(J),htmlFlowData:D,htmlText:d(q),htmlTextData:D,image:d(X),label:ie,labelText:Z,lineEnding:P,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ne,resourceDestinationString:V,resourceTitleString:Y,resource:G,setextHeading:d(_),setextHeadingLineSequence:L,setextHeadingText:C,strong:d(),thematicBreak:d()}};dT(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(he){let Te={type:"root",children:[]};const Re={stack:[Te],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:m,data:n},_e=[];let Ye=-1;for(;++Ye<he.length;)if(he[Ye][1].type==="listOrdered"||he[Ye][1].type==="listUnordered")if(he[Ye][0]==="enter")_e.push(Ye);else{const Ae=_e.pop();Ye=o(he,Ae,Ye)}for(Ye=-1;++Ye<he.length;){const Ae=t[he[Ye][0]];cT.call(Ae,he[Ye][1].type)&&Ae[he[Ye][1].type].call(Object.assign({sliceSerialize:he[Ye][2].sliceSerialize},Re),he[Ye][1])}if(Re.tokenStack.length>0){const Ae=Re.tokenStack[Re.tokenStack.length-1];(Ae[1]||zy).call(Re,void 0,Ae[0])}for(Te.position={start:Di(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Di(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)Te=t.transforms[Ye](Te)||Te;return Te}function o(he,Te,Re){let _e=Te-1,Ye=-1,Ae=!1,Ze,Qe,Ge,Jt;for(;++_e<=Re;){const ft=he[_e];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?Ye++:Ye--,Jt=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(Ze&&!Jt&&!Ye&&!Ge&&(Ge=_e),Jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jt=void 0}if(!Ye&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||Ye===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(Ze){let Yn=_e;for(Qe=void 0;Yn--;){const rt=he[Yn];if(rt[1].type==="lineEnding"||rt[1].type==="lineEndingBlank"){if(rt[0]==="exit")continue;Qe&&(he[Qe][1].type="lineEndingBlank",Ae=!0),rt[1].type="lineEnding",Qe=Yn}else if(!(rt[1].type==="linePrefix"||rt[1].type==="blockQuotePrefix"||rt[1].type==="blockQuotePrefixWhitespace"||rt[1].type==="blockQuoteMarker"||rt[1].type==="listItemIndent"))break}Ge&&(!Qe||Ge<Qe)&&(Ze._spread=!0),Ze.end=Object.assign({},Qe?he[Qe][1].start:ft[1].end),he.splice(Qe||_e,0,["exit",Ze,ft[2]]),_e++,Re++}if(ft[1].type==="listItemPrefix"){const Yn={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};Ze=Yn,he.splice(_e,0,["enter",Yn,ft[2]]),_e++,Re++,Ge=void 0,Jt=!0}}}return he[Te][1]._spread=Ae,Re}function s(he,Te){return Re;function Re(_e){c.call(this,he(_e),_e),Te&&Te.call(this,_e)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(he,Te,Re){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Te,Re||void 0]),he.position={start:Di(Te.start),end:void 0}}function d(he){return Te;function Te(Re){he&&he.call(this,Re),h.call(this,Re)}}function h(he,Te){const Re=this.stack.pop(),_e=this.tokenStack.pop();if(_e)_e[0].type!==he.type&&(Te?Te.call(this,he,_e[0]):(_e[1]||zy).call(this,he,_e[0]));else throw new Error("Cannot close `"+he.type+"` ("+sl({start:he.start,end:he.end})+"): it’s not open");Re.position.end=Di(he.end)}function m(){return gp(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(he){if(this.data.expectingFirstListItemValue){const Te=this.stack[this.stack.length-2];Te.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function p(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.lang=he}function y(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.meta=he}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.value=he.replace(/(\r?\n|\r)$/g,"")}function M(he){const Te=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Te,Re.identifier=xa(this.sliceSerialize(he)).toLowerCase()}function N(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.title=he}function O(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.url=he}function A(he){const Te=this.stack[this.stack.length-1];if(!Te.depth){const Re=this.sliceSerialize(he).length;Te.depth=Re}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function L(he){const Te=this.stack[this.stack.length-1];Te.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function j(he){const Re=this.stack[this.stack.length-1].children;let _e=Re[Re.length-1];(!_e||_e.type!=="text")&&(_e=Ue(),_e.position={start:Di(he.start),end:void 0},Re.push(_e)),this.stack.push(_e)}function D(he){const Te=this.stack.pop();Te.value+=this.sliceSerialize(he),Te.position.end=Di(he.end)}function P(he){const Te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=Te.children[Te.children.length-1];Re.position.end=Di(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Te.type)&&(j.call(this,he),D.call(this,he))}function U(){this.data.atHardBreak=!0}function J(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.value=he}function q(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.value=he}function z(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.value=he}function H(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Te,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function X(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Te,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Z(he){const Te=this.sliceSerialize(he),Re=this.stack[this.stack.length-2];Re.label=$6(Te),Re.identifier=xa(Te).toLowerCase()}function ie(){const he=this.stack[this.stack.length-1],Te=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const _e=he.children;Re.children=_e}else Re.alt=Te}function V(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.url=he}function Y(){const he=this.resume(),Te=this.stack[this.stack.length-1];Te.title=he}function G(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function ne(he){const Te=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Te,Re.identifier=xa(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function K(he){this.data.characterReferenceType=he.type}function $(he){const Te=this.sliceSerialize(he),Re=this.data.characterReferenceType;let _e;Re?(_e=eT(Te,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_e=xp(Te);const Ye=this.stack[this.stack.length-1];Ye.value+=_e}function se(he){const Te=this.stack.pop();Te.position.end=Di(he.end)}function de(he){D.call(this,he);const Te=this.stack[this.stack.length-1];Te.url=this.sliceSerialize(he)}function Ce(he){D.call(this,he);const Te=this.stack[this.stack.length-1];Te.url="mailto:"+this.sliceSerialize(he)}function qe(){return{type:"blockquote",children:[]}}function $e(){return{type:"code",lang:null,meta:null,value:""}}function We(){return{type:"inlineCode",value:""}}function Ct(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Rt(){return{type:"emphasis",children:[]}}function Nt(){return{type:"heading",depth:0,children:[]}}function Kt(){return{type:"break"}}function mn(){return{type:"html",value:""}}function pn(){return{type:"image",title:null,url:"",alt:null}}function Qt(){return{type:"link",title:null,url:"",children:[]}}function pt(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function gn(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Ht(){return{type:"paragraph",children:[]}}function ge(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function Ie(){return{type:"thematicBreak"}}}function Di(e){return{line:e.line,column:e.column,offset:e.offset}}function dT(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?dT(e,i):e_(e,i)}}function e_(e,t){let n;for(n in t)if(cT.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function zy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sl({start:t.start,end:t.end})+") is still open")}function t_(e){const t=this;t.parser=n;function n(i){return Z6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function n_(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function a_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
508
|
+
`}]}function i_(e,t){const n=t.value?t.value+`
|
|
509
|
+
`:"",i={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function r_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function s_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function o_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=zs(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let l,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=s+1,c+=1,e.footnoteCounts.set(i,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function l_(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u_(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fT(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=i:o.push({type:"text",value:i}),o}function c_(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return fT(e,t);const o={src:zs(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function d_(e,t){const n={src:zs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function f_(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function h_(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return fT(e,t);const o={href:zs(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function m_(e,t){const n={href:zs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function p_(e,t,n){const i=e.all(t),o=n?g_(n):hT(t),s={},l=[];if(typeof t.checked=="boolean"){const m=i[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(o||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
510
|
+
`}),m.type==="element"&&m.tagName==="p"&&!o?l.push(...m.children):l.push(m)}const d=i[i.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
511
|
+
`});const h={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,h),e.applyData(t,h)}function g_(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=hT(n[i])}return t}function hT(e){const t=e.spread;return t??e.children.length>1}function x_(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<i.length;){const l=i[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function b_(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y_(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function v_(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E_(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Da(t.children[1]),d=pd(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),o.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function T_(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const g=t.children[d],b={},p=l?l[d]:void 0;p&&(b.align=p);let y={type:"element",tagName:s,properties:b,children:[]};g&&(y.children=e.all(g),e.patch(g,y),y=e.applyData(g,y)),h.push(y)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function S_(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Hy=9,Fy=32;function w_(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const s=[];for(;i;)s.push(Vy(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return s.push(Vy(t.slice(o),o>0,!1)),s.join("")}function Vy(e,t,n){let i=0,o=e.length;if(t){let s=e.codePointAt(i);for(;s===Hy||s===Fy;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(o-1);for(;s===Hy||s===Fy;)o--,s=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function k_(e,t){const n={type:"text",value:w_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function A_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const C_={blockquote:n_,break:a_,code:i_,delete:r_,emphasis:s_,footnoteReference:o_,heading:l_,html:u_,imageReference:c_,image:d_,inlineCode:f_,linkReference:h_,link:m_,listItem:p_,list:x_,paragraph:b_,root:y_,strong:v_,table:E_,tableCell:S_,tableRow:T_,text:k_,thematicBreak:A_,toml:cc,yaml:cc,definition:cc,footnoteDefinition:cc};function cc(){}const mT=-1,bd=0,ll=1,Gc=2,yp=3,vp=4,Ep=5,Tp=6,pT=7,gT=8,xT=typeof self=="object"?self:globalThis,qy=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new xT[e](t)},N_=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),i=o=>{if(e.has(o))return e.get(o);const[s,l]=t[o];switch(s){case bd:case mT:return n(l,o);case ll:{const c=n([],o);for(const d of l)c.push(i(d));return c}case Gc:{const c=n({},o);for(const[d,h]of l)c[i(d)]=i(h);return c}case yp:return n(new Date(l),o);case vp:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case Ep:{const c=n(new Map,o);for(const[d,h]of l)c.set(i(d),i(h));return c}case Tp:{const c=n(new Set,o);for(const d of l)c.add(i(d));return c}case pT:{const{name:c,message:d}=l;return n(typeof xT[c]=="function"?qy(c,d):new Error(d),o)}case gT:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(qy(s,l),o)};return i},Yy=e=>N_(new Map,e)(0),yr="",{toString:__}={},{keys:M_}=Object,Qo=e=>{const t=typeof e;if(t!=="object"||!e)return[bd,t];const n=__.call(e).slice(8,-1);switch(n){case"Array":return[ll,yr];case"Object":return[Gc,yr];case"Date":return[yp,yr];case"RegExp":return[vp,yr];case"Map":return[Ep,yr];case"Set":return[Tp,yr];case"DataView":return[ll,n]}return n.includes("Array")?[ll,n]:e instanceof Error?[pT,e.name||"Error"]:[Gc,n]},dc=([e,t])=>e===bd&&(t==="function"||t==="symbol"),R_=(e,t,n,i)=>{const o=(l,c)=>{const d=i.push(l)-1;return n.set(c,d),d},s=l=>{if(n.has(l))return n.get(l);let[c,d]=Qo(l);switch(c){case bd:{let m=l;switch(d){case"bigint":c=gT,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return o([mT],l)}return o([c,m],l)}case ll:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),o([d,[...b]],l)}const m=[],g=o([c,m],l);for(const b of l)m.push(s(b));return g}case Gc:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const m=[],g=o([c,m],l);for(const b of M_(l))(e||!dc(Qo(l[b])))&&m.push([s(b),s(l[b])]);return g}case yp:return o([c,isNaN(l.getTime())?yr:l.toISOString()],l);case vp:{const{source:m,flags:g}=l;return o([c,{source:m,flags:g}],l)}case Ep:{const m=[],g=o([c,m],l);for(const[b,p]of l)(e||!(dc(Qo(b))||dc(Qo(p))))&&m.push([s(b),s(p)]);return g}case Tp:{const m=[],g=o([c,m],l);for(const b of l)(e||!dc(Qo(b)))&&m.push(s(b));return g}}const{message:h}=l;return o([c,{name:d,message:h}],l)};return s},Gy=(e,{json:t,lossy:n}={})=>{const i=[];return R_(!(t||n),!!t,new Map,i)(e),i},Dr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Yy(Gy(e,t)):structuredClone(e):(e,t)=>Yy(Gy(e,t));function D_(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function L_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function O_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||D_,i=e.options.footnoteBackLabel||L_,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const m=e.all(h),g=String(h.identifier).toUpperCase(),b=zs(g.toLowerCase());let p=0;const y=[],E=e.footnoteCounts.get(g);for(;E!==void 0&&++p<=E;){y.length>0&&y.push({type:"text",value:" "});let M=typeof n=="string"?n:n(d,p);typeof M=="string"&&(M={type:"text",value:M}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,p),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const M=T.children[T.children.length-1];M&&M.type==="text"?M.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...y)}else m.push(...y);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(m,!0)};e.patch(h,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Dr(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
512
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
513
|
+
`}]}}const yd=(function(e){if(e==null)return B_;if(typeof e=="function")return vd(e);if(typeof e=="object")return Array.isArray(e)?I_(e):j_(e);if(typeof e=="string")return P_(e);throw new Error("Expected function, string, or object as test")});function I_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=yd(e[n]);return vd(i);function i(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function j_(e){const t=e;return vd(n);function n(i){const o=i;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function P_(e){return vd(t);function t(n){return n&&n.type===e}}function vd(e){return t;function t(n,i,o){return!!(U_(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function B_(){return!0}function U_(e){return e!==null&&typeof e=="object"&&"type"in e}const bT=[],z_=!0,b0=!1,H_="skip";function yT(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const s=yd(o),l=i?-1:1;c(e,void 0,[])();function c(d,h,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const p=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(p?"<"+p+">":""))+")"})}return b;function b(){let p=bT,y,E,T;if((!t||s(d,h,m[m.length-1]||void 0))&&(p=F_(n(d,m)),p[0]===b0))return p;if("children"in d&&d.children){const k=d;if(k.children&&p[0]!==H_)for(E=(i?k.children.length:-1)+l,T=m.concat(k);E>-1&&E<k.children.length;){const M=k.children[E];if(y=c(M,E,T)(),y[0]===b0)return y;E=typeof y[1]=="number"?y[1]:E+l}}return p}}}function F_(e){return Array.isArray(e)?e:typeof e=="number"?[z_,e]:e==null?bT:[e]}function Ed(e,t,n,i){let o,s,l;typeof t=="function"&&typeof n!="function"?(s=void 0,l=t,o=n):(s=t,l=n,o=i),yT(e,s,c,o);function c(d,h){const m=h[h.length-1],g=m?m.children.indexOf(d):void 0;return l(d,g,m)}}const y0={}.hasOwnProperty,V_={};function q_(e,t){const n=t||V_,i=new Map,o=new Map,s=new Map,l={...C_,...n.handlers},c={all:h,applyData:G_,definitionById:i,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:Y_,wrap:K_};return Ed(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?i:o,b=String(m.identifier).toUpperCase();g.has(b)||g.set(b,m)}}),c;function d(m,g){const b=m.type,p=c.handlers[b];if(y0.call(c.handlers,b)&&p)return p(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in m){const{children:E,...T}=m,k=Dr(T);return k.children=c.all(m),k}return Dr(m)}return(c.options.unknownHandler||X_)(c,m,g)}function h(m){const g=[];if("children"in m){const b=m.children;let p=-1;for(;++p<b.length;){const y=c.one(b[p],m);if(y){if(p&&b[p-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=Xy(y.value)),!Array.isArray(y)&&y.type==="element")){const E=y.children[0];E&&E.type==="text"&&(E.value=Xy(E.value))}Array.isArray(y)?g.push(...y):g.push(y)}}}return g}}function Y_(e,t){e.position&&(t.position=XE(e))}function G_(e,t){let n=t;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,Dr(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function X_(e,t){const n=t.data||{},i="value"in t&&!(y0.call(n,"hProperties")||y0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function K_(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
514
|
+
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
515
|
+
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
516
|
+
`}),n}function Xy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ky(e,t){const n=q_(e,t),i=n.one(e,void 0),o=O_(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
517
|
+
`},o),s}function Q_(e,t){return e&&"run"in e?async function(n,i){const o=Ky(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Ky(n,{file:i,...e||t})}}function Qy(e){if(e)throw e}var mm,$y;function $_(){if($y)return mm;$y=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},s=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(i)return i(h,m).value}else return;return h[m]};return mm=function d(){var h,m,g,b,p,y,E=arguments[0],T=1,k=arguments.length,M=!1;for(typeof E=="boolean"&&(M=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<k;++T)if(h=arguments[T],h!=null)for(m in h)g=c(E,m),b=c(h,m),E!==b&&(M&&b&&(s(b)||(p=o(b)))?(p?(p=!1,y=g&&o(g)?g:[]):y=g&&s(g)?g:{},l(E,{name:m,newValue:d(M,y,b)})):typeof b<"u"&&l(E,{name:m,newValue:b}));return E},mm}var W_=$_();const pm=Ml(W_);function v0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Z_(){const e=[],t={run:n,use:i};return t;function n(...o){let s=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...h){const m=e[++s];let g=-1;if(d){l(d);return}for(;++g<o.length;)(h[g]===null||h[g]===void 0)&&(h[g]=o[g]);o=h,m?J_(m,c)(...h):l(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function J_(e,t){let n;return i;function i(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(h){const m=h;if(c&&n)throw m;return o(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,o):d instanceof Error?o(d):s(d))}function o(l,...c){n||(n=!0,t(l,...c))}function s(l){o(null,l)}}const ka={basename:eM,dirname:tM,extname:nM,join:aM,sep:"/"};function eM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jl(e);let n=0,i=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else l<0&&(s=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function tM(e){if(jl(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function nM(e){jl(e);let t=e.length,n=-1,i=0,o=-1,s=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function aM(...e){let t=-1,n;for(;++t<e.length;)jl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":iM(n)}function iM(e){jl(e);const t=e.codePointAt(0)===47;let n=rM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rM(e,t){let n="",i=0,o=-1,s=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||s===1))if(o!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=l,s=0;continue}}else if(n.length>0){n="",i=0,o=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const sM={cwd:oM};function oM(){return"/"}function E0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lM(e){if(typeof e=="string")e=new URL(e);else if(!E0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return uM(e)}function uM(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const gm=["history","path","basename","stem","extname","dirname"];class vT{constructor(t){let n;t?E0(t)?n={path:t}:typeof t=="string"||cM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":sM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<gm.length;){const s=gm[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)gm.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?ka.basename(this.path):void 0}set basename(t){bm(t,"basename"),xm(t,"basename"),this.path=ka.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ka.dirname(this.path):void 0}set dirname(t){Wy(this.basename,"dirname"),this.path=ka.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ka.extname(this.path):void 0}set extname(t){if(xm(t,"extname"),Wy(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ka.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){E0(t)&&(t=lM(t)),bm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ka.basename(this.path,this.extname):void 0}set stem(t){bm(t,"stem"),xm(t,"stem"),this.path=ka.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const o=this.message(t,n,i);throw o.fatal=!0,o}info(t,n,i){const o=this.message(t,n,i);return o.fatal=void 0,o}message(t,n,i){const o=new fn(t,n,i);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xm(e,t){if(e&&e.includes(ka.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ka.sep+"`")}function bm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wy(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function cM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dM=(function(e){const i=this.constructor.prototype,o=i[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),fM={}.hasOwnProperty;class Sp extends dM{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Z_()}copy(){const t=new Sp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(pm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Em("data",this.frozen),this.namespace[t]=n,this):fM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Em("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=fc(t),i=this.parser||this.Parser;return ym("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),ym("process",this.parser||this.Parser),vm("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,l){const c=fc(t),d=i.parse(c);i.run(d,c,function(m,g,b){if(m||!g||!b)return h(m);const p=g,y=i.stringify(p,b);pM(y)?b.value=y:b.result=y,h(m,b)});function h(m,g){m||!g?l(m):s?s(g):n(void 0,g)}}}processSync(t){let n=!1,i;return this.freeze(),ym("processSync",this.parser||this.Parser),vm("processSync",this.compiler||this.Compiler),this.process(t,o),Jy("processSync","process",n),i;function o(s,l){n=!0,Qy(s),i=l}}run(t,n,i){Zy(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const d=fc(n);o.run(t,d,h);function h(m,g,b){const p=g||t;m?c(m):l?l(p):i(void 0,p,b)}}}runSync(t,n){let i=!1,o;return this.run(t,n,s),Jy("runSync","run",i),o;function s(l,c){Qy(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=fc(n),o=this.compiler||this.Compiler;return vm("stringify",o),Zy(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(Em("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...g]=h;d(m,g)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(o.settings=pm(!0,o.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const g=h[m];s(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let g=-1,b=-1;for(;++g<i.length;)if(i[g][0]===h){b=g;break}if(b===-1)i.push([h,...m]);else if(m.length>0){let[p,...y]=m;const E=i[b][1];v0(E)&&v0(p)&&(p=pm(!0,E,p)),i[b]=[h,p,...y]}}}}const hM=new Sp().freeze();function ym(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Em(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zy(e){if(!v0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fc(e){return mM(e)?e:new vT(e)}function mM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pM(e){return typeof e=="string"||gM(e)}function gM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",e2=[],t2={allowDangerousHtml:!0},bM=/^(https?|ircs?|mailto|xmpp)$/i,yM=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ET(e){const t=vM(e),n=EM(e);return TM(t.runSync(t.parse(n),n),e)}function vM(e){const t=e.rehypePlugins||e2,n=e.remarkPlugins||e2,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...t2}:t2;return hM().use(t_).use(n).use(Q_,i).use(t)}function EM(e){const t=e.children||"",n=new vT;return typeof t=="string"&&(n.value=t),n}function TM(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||SM;for(const m of yM)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+xM+m.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ed(e,h),B5(e,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(m,g,b){if(m.type==="raw"&&b&&typeof g=="number")return l?b.children.splice(g,1):b.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let p;for(p in dm)if(Object.hasOwn(dm,p)&&Object.hasOwn(m.properties,p)){const y=m.properties[p],E=dm[p];(E===null||E.includes(m.tagName))&&(m.properties[p]=d(String(y||""),p,m))}}if(m.type==="element"){let p=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!p&&i&&typeof g=="number"&&(p=!i(m,g,b)),p&&b&&typeof g=="number")return c&&m.children?b.children.splice(g,1,...m.children):b.children.splice(g,1),g}}}function SM(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||bM.test(e.slice(0,t))?e:""}function n2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=n.indexOf(t);for(;o!==-1;)i++,o=n.indexOf(t,o+t.length);return i}function wM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kM(e,t,n){const o=yd((n||{}).ignore||[]),s=AM(t);let l=-1;for(;++l<s.length;)yT(e,"text",c);function c(h,m){let g=-1,b;for(;++g<m.length;){const p=m[g],y=b?b.children:void 0;if(o(p,y?y.indexOf(p):void 0,b))return;b=p}if(b)return d(h,m)}function d(h,m){const g=m[m.length-1],b=s[l][0],p=s[l][1];let y=0;const T=g.children.indexOf(h);let k=!1,M=[];b.lastIndex=0;let N=b.exec(h.value);for(;N;){const O=N.index,A={index:N.index,input:N.input,stack:[...m,h]};let C=p(...N,A);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?b.lastIndex=O+1:(y!==O&&M.push({type:"text",value:h.value.slice(y,O)}),Array.isArray(C)?M.push(...C):C&&M.push(C),y=O+N[0].length,k=!0),!b.global)break;N=b.exec(h.value)}return k?(y<h.value.length&&M.push({type:"text",value:h.value.slice(y)}),g.children.splice(T,1,...M)):M=[h],T+M.length}}function AM(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const o=n[i];t.push([CM(o[0]),NM(o[1])])}return t}function CM(e){return typeof e=="string"?new RegExp(wM(e),"g"):e}function NM(e){return typeof e=="function"?e:function(){return e}}const Tm="phrasing",Sm=["autolink","link","image","label"];function _M(){return{transforms:[jM],enter:{literalAutolink:RM,literalAutolinkEmail:wm,literalAutolinkHttp:wm,literalAutolinkWww:wm},exit:{literalAutolink:IM,literalAutolinkEmail:OM,literalAutolinkHttp:DM,literalAutolinkWww:LM}}}function MM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Tm,notInConstruct:Sm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Tm,notInConstruct:Sm},{character:":",before:"[ps]",after:"\\/",inConstruct:Tm,notInConstruct:Sm}]}}function RM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wm(e){this.config.enter.autolinkProtocol.call(this,e)}function DM(e){this.config.exit.autolinkProtocol.call(this,e)}function LM(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function OM(e){this.config.exit.autolinkEmail.call(this,e)}function IM(e){this.exit(e)}function jM(e){kM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,PM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),BM]],{ignore:["link","linkReference"]})}function PM(e,t,n,i,o){let s="";if(!TT(o)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!UM(n)))return!1;const l=zM(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function BM(e,t,n,i){return!TT(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function UM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const o=n2(e,"(");let s=n2(e,")");for(;i!==-1&&o>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function TT(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Rr(n)||gd(n))&&(!t||n!==47)}ST.peek=QM;function HM(){this.buffer()}function FM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VM(){this.buffer()}function qM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function YM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GM(e){this.exit(e)}function XM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function KM(e){this.exit(e)}function QM(){return"["}function ST(e,t,n,i){const o=n.createTracker(i);let s=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=o.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),l(),s+=o.move("]"),s}function $M(){return{enter:{gfmFootnoteCallString:HM,gfmFootnoteCall:FM,gfmFootnoteDefinitionLabelString:VM,gfmFootnoteDefinition:qM},exit:{gfmFootnoteCallString:YM,gfmFootnoteCall:GM,gfmFootnoteDefinitionLabelString:XM,gfmFootnoteDefinition:KM}}}function WM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ST},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,o,s,l){const c=s.createTracker(l);let d=c.move("[^");const h=s.enter("footnoteDefinition"),m=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),m(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
518
|
+
`:" ")+s.indentLines(s.containerFlow(i,c.current()),t?wT:ZM))),h(),d}}function ZM(e,t,n){return t===0?e:wT(e,t,n)}function wT(e,t,n){return(n?"":" ")+e}const JM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];kT.peek=iR;function eR(){return{canContainEols:["delete"],enter:{strikethrough:nR},exit:{strikethrough:aR}}}function tR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:JM}],handlers:{delete:kT}}}function nR(e){this.enter({type:"delete",children:[]},e)}function aR(e){this.exit(e)}function kT(e,t,n,i){const o=n.createTracker(i),s=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),s(),l}function iR(){return"~"}function rR(e){return e.length}function sR(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||rR,s=[],l=[],c=[],d=[];let h=0,m=-1;for(;++m<e.length;){const E=[],T=[];let k=-1;for(e[m].length>h&&(h=e[m].length);++k<e[m].length;){const M=oR(e[m][k]);if(n.alignDelimiters!==!1){const N=o(M);T[k]=N,(d[k]===void 0||N>d[k])&&(d[k]=N)}E.push(M)}l[m]=E,c[m]=T}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<h;)s[g]=a2(i[g]);else{const E=a2(i);for(;++g<h;)s[g]=E}g=-1;const b=[],p=[];for(;++g<h;){const E=s[g];let T="",k="";E===99?(T=":",k=":"):E===108?T=":":E===114&&(k=":");let M=n.alignDelimiters===!1?1:Math.max(1,d[g]-T.length-k.length);const N=T+"-".repeat(M)+k;n.alignDelimiters!==!1&&(M=T.length+M+k.length,M>d[g]&&(d[g]=M),p[g]=M),b[g]=N}l.splice(1,0,b),c.splice(1,0,p),m=-1;const y=[];for(;++m<l.length;){const E=l[m],T=c[m];g=-1;const k=[];for(;++g<h;){const M=E[g]||"";let N="",O="";if(n.alignDelimiters!==!1){const A=d[g]-(T[g]||0),C=s[g];C===114?N=" ".repeat(A):C===99?A%2?(N=" ".repeat(A/2+.5),O=" ".repeat(A/2-.5)):(N=" ".repeat(A/2),O=N):O=" ".repeat(A)}n.delimiterStart!==!1&&!g&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||g)&&k.push(" "),n.alignDelimiters!==!1&&k.push(N),k.push(M),n.alignDelimiters!==!1&&k.push(O),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&k.push("|")}y.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return y.join(`
|
|
519
|
+
`)}function oR(e){return e==null?"":String(e)}function a2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const i2={}.hasOwnProperty;function AT(e,t){const n=t||{};function i(o,...s){let l=i.invalid;const c=i.handlers;if(o&&i2.call(o,e)){const d=String(o[e]);l=i2.call(c,d)?c[d]:i.unknown}if(l)return l.call(this,o,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}function lR(e,t,n,i){const o=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(e,s.current()),uR);return o(),l}function uR(e,t,n){return">"+(n?"":" ")+e}function cR(e,t){return r2(e,t.inConstruct,!0)&&!r2(e,t.notInConstruct,!1)}function r2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function s2(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
520
|
+
`&&cR(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
521
|
+
`}function dR(e,t){const n=String(e);let i=n.indexOf(t),o=i,s=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++s>l&&(l=s):s=1,o=i+t.length,i=n.indexOf(t,o);return l}function fR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function hR(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function mR(e,t,n,i){const o=hR(n),s=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(fR(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(s,pR);return g(),b}const c=n.createTracker(i),d=o.repeat(Math.max(dR(s,o)+1,3)),h=n.enter("codeFenced");let m=c.move(d);if(e.lang){const g=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
|
|
522
|
+
`,encode:["`"],...c.current()})),g()}return m+=c.move(`
|
|
523
|
+
`),s&&(m+=c.move(s+`
|
|
524
|
+
`)),m+=c.move(d),h(),m}function pR(e,t,n){return(n?"":" ")+e}function wp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function gR(e,t,n,i){const o=wp(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
525
|
+
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),h+=d.move(" "+o),h+=d.move(n.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),c()),l(),h}function xR(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function wl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xc(e,t,n){const i=Os(e),o=Os(t);return i===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}CT.peek=bR;function CT(e,t,n,i){const o=xR(n),s=n.enter("emphasis"),l=n.createTracker(i),c=l.move(o);let d=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const h=d.charCodeAt(0),m=Xc(i.before.charCodeAt(i.before.length-1),h,o);m.inside&&(d=wl(h)+d.slice(1));const g=d.charCodeAt(d.length-1),b=Xc(i.after.charCodeAt(0),g,o);b.inside&&(d=d.slice(0,-1)+wl(g));const p=l.move(o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+d+p}function bR(e,t,n){return n.options.emphasis||"*"}function yR(e,t){let n=!1;return Ed(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,b0}),!!((!e.depth||e.depth<3)&&gp(e)&&(t.options.setext||n))}function vR(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(yR(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...s.current(),before:`
|
|
526
|
+
`,after:`
|
|
527
|
+
`});return g(),m(),b+`
|
|
528
|
+
`+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
529
|
+
`))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
530
|
+
`,...s.current()});return/^[\t ]/.test(h)&&(h=wl(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),c(),h}NT.peek=ER;function NT(e){return e.value||""}function ER(){return"<"}_T.peek=TR;function _T(e,t,n,i){const o=wp(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),h+=d.move(" "+o),h+=d.move(n.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),c()),h+=d.move(")"),l(),h}function TR(){return"!"}MT.peek=SR;function MT(e,t,n,i){const o=e.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("![");const h=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),o==="full"||!h||h!==g?d+=c.move(g+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function SR(){return"!"}RT.peek=wR;function RT(e,t,n){let i=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(i);){let h=d.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(d.index+1)}}return o+i+o}function wR(){return"`"}function DT(e,t){const n=gp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}LT.peek=kR;function LT(e,t,n,i){const o=wp(n),s=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,d;if(DT(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),c(),n.stack=m,g}c=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${s}`),h+=l.move(" "+o),h+=l.move(n.safe(e.title,{before:h,after:o,...l.current()})),h+=l.move(o),d()),h+=l.move(")"),c(),h}function kR(e,t,n){return DT(e,n)?"<":"["}OT.peek=AR;function OT(e,t,n,i){const o=e.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),o==="full"||!h||h!==g?d+=c.move(g+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function AR(){return"["}function kp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function CR(e){const t=kp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function NR(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function IT(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _R(e,t,n,i){const o=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?NR(n):kp(n);const c=e.ordered?l==="."?")":".":CR(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),IT(n)===l&&m){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const h=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=s,o(),h}function MR(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function RR(e,t,n,i){const o=MR(n);let s=n.bulletCurrent||kp(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(l-s.length)),c.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),m);return d(),h;function m(g,b,p){return b?(p?"":" ".repeat(l))+g:(p?s:s+" ".repeat(l-s.length))+g}}function DR(e,t,n,i){const o=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),o(),l}const LR=yd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function OR(e,t,n,i){return(e.children.some(function(l){return LR(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function IR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jT.peek=jR;function jT(e,t,n,i){const o=IR(n),s=n.enter("strong"),l=n.createTracker(i),c=l.move(o+o);let d=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const h=d.charCodeAt(0),m=Xc(i.before.charCodeAt(i.before.length-1),h,o);m.inside&&(d=wl(h)+d.slice(1));const g=d.charCodeAt(d.length-1),b=Xc(i.after.charCodeAt(0),g,o);b.inside&&(d=d.slice(0,-1)+wl(g));const p=l.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+d+p}function jR(e,t,n){return n.options.strong||"*"}function PR(e,t,n,i){return n.safe(e.value,i)}function BR(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function UR(e,t,n){const i=(IT(n)+(n.options.ruleSpaces?" ":"")).repeat(BR(n));return n.options.ruleSpaces?i.slice(0,-1):i}const PT={blockquote:lR,break:s2,code:mR,definition:gR,emphasis:CT,hardBreak:s2,heading:vR,html:NT,image:_T,imageReference:MT,inlineCode:RT,link:LT,linkReference:OT,list:_R,listItem:RR,paragraph:DR,root:OR,strong:jT,text:PR,thematicBreak:UR};function zR(){return{enter:{table:HR,tableData:o2,tableHeader:o2,tableRow:VR},exit:{codeText:qR,table:FR,tableData:km,tableHeader:km,tableRow:km}}}function HR(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function FR(e){this.exit(e),this.data.inTable=void 0}function VR(e){this.enter({type:"tableRow",children:[]},e)}function km(e){this.exit(e)}function o2(e){this.enter({type:"tableCell",children:[]},e)}function qR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,YR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function YR(e,t){return t==="|"?t:e}function GR(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
531
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:c}};function l(p,y,E,T){return h(m(p,E,T),p.align)}function c(p,y,E,T){const k=g(p,E,T),M=h([k]);return M.slice(0,M.indexOf(`
|
|
532
|
+
`))}function d(p,y,E,T){const k=E.enter("tableCell"),M=E.enter("phrasing"),N=E.containerPhrasing(p,{...T,before:s,after:s});return M(),k(),N}function h(p,y){return sR(p,{align:y,alignDelimiters:i,padding:n,stringLength:o})}function m(p,y,E){const T=p.children;let k=-1;const M=[],N=y.enter("table");for(;++k<T.length;)M[k]=g(T[k],y,E);return N(),M}function g(p,y,E){const T=p.children;let k=-1;const M=[],N=y.enter("tableRow");for(;++k<T.length;)M[k]=d(T[k],p,y,E);return N(),M}function b(p,y,E){let T=PT.inlineCode(p,y,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function XR(){return{exit:{taskListCheckValueChecked:l2,taskListCheckValueUnchecked:l2,paragraph:QR}}}function KR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$R}}}function l2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function QR(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const o=t.children;let s=-1,l;for(;++s<o.length;){const c=o[s];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function $R(e,t,n,i){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(l);let d=PT.listItem(e,t,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+l}}function WR(){return[_M(),$M(),eR(),zR(),XR()]}function ZR(e){return{extensions:[MM(),WM(e),tR(),GR(e),KR()]}}const JR={tokenize:rD,partial:!0},BT={tokenize:sD,partial:!0},UT={tokenize:oD,partial:!0},zT={tokenize:lD,partial:!0},eD={tokenize:uD,partial:!0},HT={name:"wwwAutolink",tokenize:aD,previous:VT},FT={name:"protocolAutolink",tokenize:iD,previous:qT},si={name:"emailAutolink",tokenize:nD,previous:YT},La={};function tD(){return{text:La}}let mr=48;for(;mr<123;)La[mr]=si,mr++,mr===58?mr=65:mr===91&&(mr=97);La[43]=si;La[45]=si;La[46]=si;La[95]=si;La[72]=[si,FT];La[104]=[si,FT];La[87]=[si,HT];La[119]=[si,HT];function nD(e,t,n){const i=this;let o,s;return l;function l(g){return!T0(g)||!YT.call(i,i.previous)||Ap(i.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return T0(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(eD,m,h)(g):g===45||g===95||dn(g)?(s=!0,e.consume(g),d):m(g)}function h(g){return e.consume(g),o=!0,d}function m(g){return s&&o&&bn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function aD(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!VT.call(i,i.previous)||Ap(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(JR,e.attempt(BT,e.attempt(UT,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function iD(e,t,n){const i=this;let o="",s=!1;return l;function l(g){return(g===72||g===104)&&qT.call(i,i.previous)&&!Ap(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(bn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),s?h:(s=!0,d)):n(g)}function h(g){return g===null||Yc(g)||wt(g)||Rr(g)||gd(g)?n(g):e.attempt(BT,e.attempt(UT,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function rD(e,t,n){let i=0;return o;function o(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),o):l===46&&i===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function sD(e,t,n){let i,o,s;return l;function l(h){return h===46||h===95?e.check(zT,d,c)(h):h===null||wt(h)||Rr(h)||h!==45&&gd(h)?d(h):(s=!0,e.consume(h),l)}function c(h){return h===95?i=!0:(o=i,i=void 0),e.consume(h),l}function d(h){return o||i||!s?n(h):t(h)}}function oD(e,t){let n=0,i=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&i<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(zT,t,s)(l):l===null||wt(l)||Rr(l)?t(l):(e.consume(l),o)}function s(l){return l===41&&i++,e.consume(l),o}}function lD(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),s):c===93?(e.consume(c),o):c===60||c===null||wt(c)||Rr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||wt(c)||Rr(c)?t(c):i(c)}function s(c){return bn(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):bn(c)?(e.consume(c),l):n(c)}}function uD(e,t,n){return i;function i(s){return e.consume(s),o}function o(s){return dn(s)?n(s):t(s)}}function VT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wt(e)}function qT(e){return!bn(e)}function YT(e){return!(e===47||T0(e))}function T0(e){return e===43||e===45||e===46||e===95||dn(e)}function Ap(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const cD={tokenize:bD,partial:!0};function dD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pD,continuation:{tokenize:gD},exit:xD}},text:{91:{name:"gfmFootnoteCall",tokenize:mD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:fD,resolveTo:hD}}}}function fD(e,t,n){const i=this;let o=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;o--;){const d=i.events[o][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const h=xa(i.sliceSerialize({start:l.end,end:i.now()}));return h.codePointAt(0)!==94||!s.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function hD(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function mD(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(s>999||g===93&&!l||g===null||g===91||wt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(xa(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return wt(g)||(l=!0),s++,e.consume(g),g===92?m:h}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,h):h(g)}}function pD(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,l=0,c;return d;function d(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(y)}function m(y){if(l>999||y===93&&!c||y===null||y===91||wt(y))return n(y);if(y===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return s=xa(i.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return wt(y)||(c=!0),l++,e.consume(y),y===92?g:m}function g(y){return y===91||y===92||y===93?(e.consume(y),l++,m):m(y)}function b(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),o.includes(s)||o.push(s),ot(e,p,"gfmFootnoteDefinitionWhitespace")):n(y)}function p(y){return t(y)}}function gD(e,t,n){return e.check(Il,t,e.attempt(cD,t,n))}function xD(e){e.exit("gfmFootnoteDefinition")}function bD(e,t,n){const i=this;return ot(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function yD(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:o};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},g={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",m,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",g,c]],p=c.parser.constructs.insideSpan.null;p&&Vn(b,b.length,0,xd(p,l.slice(h+1,d),c)),Vn(b,b.length,0,[["exit",g,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",m,c]]),Vn(l,h-1,d-h+3,b),d=h+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function s(l,c,d){const h=this.previous,m=this.events;let g=0;return b;function b(y){return h===126&&m[m.length-1][1].type!=="characterEscape"?d(y):(l.enter("strikethroughSequenceTemporary"),p(y))}function p(y){const E=Os(h);if(y===126)return g>1?d(y):(l.consume(y),g++,p);if(g<2&&!n)return d(y);const T=l.exit("strikethroughSequenceTemporary"),k=Os(y);return T._open=!k||k===2&&!!E,T._close=!E||E===2&&!!k,c(y)}}}class vD{constructor(){this.map=[]}add(t,n,i){ED(this,t,n,i)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const s of o)t.push(s);o=i.pop()}this.map.length=0}}function ED(e,t,n,i){let o=0;if(!(n===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...i);return}o+=1}e.map.push([t,n,i])}}function TD(e,t){let n=!1;const i=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function SD(){return{flow:{null:{name:"table",tokenize:wD,resolveAll:kD}}}}function wD(e,t,n){const i=this;let o=0,s=0,l;return c;function c(D){let P=i.events.length-1;for(;P>-1;){const q=i.events[P][1].type;if(q==="lineEnding"||q==="linePrefix")P--;else break}const U=P>-1?i.events[P][1].type:null,J=U==="tableHead"||U==="tableRow"?C:d;return J===C&&i.parser.lazy[i.now().line]?n(D):J(D)}function d(D){return e.enter("tableHead"),e.enter("tableRow"),h(D)}function h(D){return D===124||(l=!0,s+=1),m(D)}function m(D){return D===null?n(D):Be(D)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),p):n(D):nt(D)?ot(e,m,"whitespace")(D):(s+=1,l&&(l=!1,o+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(D)))}function g(D){return D===null||D===124||wt(D)?(e.exit("data"),m(D)):(e.consume(D),D===92?b:g)}function b(D){return D===92||D===124?(e.consume(D),g):g(D)}function p(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,nt(D)?ot(e,y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):y(D))}function y(D){return D===45||D===58?T(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),E):A(D)}function E(D){return nt(D)?ot(e,T,"whitespace")(D):T(D)}function T(D){return D===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),k):D===45?(s+=1,k(D)):D===null||Be(D)?O(D):A(D)}function k(D){return D===45?(e.enter("tableDelimiterFiller"),M(D)):A(D)}function M(D){return D===45?(e.consume(D),M):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(D))}function N(D){return nt(D)?ot(e,O,"whitespace")(D):O(D)}function O(D){return D===124?y(D):D===null||Be(D)?!l||o!==s?A(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):A(D)}function A(D){return n(D)}function C(D){return e.enter("tableRow"),L(D)}function L(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),L):D===null||Be(D)?(e.exit("tableRow"),t(D)):nt(D)?ot(e,L,"whitespace")(D):(e.enter("data"),_(D))}function _(D){return D===null||D===124||wt(D)?(e.exit("data"),L(D)):(e.consume(D),D===92?j:_)}function j(D){return D===92||D===124?(e.consume(D),_):_(D)}}function kD(e,t){let n=-1,i=!0,o=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,h,m,g;const b=new vD;for(;++n<e.length;){const p=e[n],y=p[1];p[0]==="enter"?y.type==="tableHead"?(c=!1,d!==0&&(u2(b,t,d,h,m),m=void 0,d=0),h={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",h,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(i=!0,g=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",m,t]])),o=y.type==="tableDelimiterRow"?2:m?3:1):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],g=hc(b,t,s,o,void 0,g),s=[0,0,0,0]),l[2]=n)):y.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],g=hc(b,t,s,o,void 0,g)),s=l,l=[s[1],n,0,0])):y.type==="tableHead"?(c=!0,d=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(d=n,s[1]!==0?(l[0]=l[1],g=hc(b,t,s,o,n,g)):l[1]!==0&&(g=hc(b,t,l,o,n,g)),o=0):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&u2(b,t,d,h,m),b.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=TD(t.events,n))}return e}function hc(e,t,n,i,o,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},ws(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const d=ws(t.events,n[1]);if(s={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const h=ws(t.events,n[2]),m=ws(t.events,n[3]),g={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",g,t]]),i!==2){const b=t.events[n[2]],p=t.events[n[3]];if(b[1].end=Object.assign({},p[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,E=n[3]-n[2]-1;e.add(y,E,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return o!==void 0&&(s.end=Object.assign({},ws(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function u2(e,t,n,i,o){const s=[],l=ws(t.events,n);o&&(o.end=Object.assign({},l),s.push(["exit",o,t])),i.end=Object.assign({},l),s.push(["exit",i,t]),e.add(n+1,0,s)}function ws(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const AD={name:"tasklistCheck",tokenize:ND};function CD(){return{text:{91:AD}}}function ND(e,t,n){const i=this;return o;function o(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),s)}function s(d){return wt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Be(d)?t(d):nt(d)?e.check({tokenize:_D},t,n)(d):n(d)}}function _D(e,t,n){return ot(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function MD(e){return JE([tD(),dD(),yD(e),SD(),CD()])}const RD={};function GT(e){const t=this,n=e||RD,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(MD(n)),s.push(WR()),l.push(ZR(n))}const c2=/[#.]/g;function DD(e,t){const n=e||"",i={};let o=0,s,l;for(;o<n.length;){c2.lastIndex=o;const c=c2.exec(n),d=n.slice(o,c?c.index:n.length);d&&(s?s==="#"?i.id=d:Array.isArray(i.className)?i.className.push(d):i.className=[d]:l=d,o+=d.length),c&&(s=c[0],o++)}return{type:"element",tagName:l||t||"div",properties:i,children:[]}}function XT(e,t,n){const i=n?jD(n):void 0;function o(s,l,...c){let d;if(s==null){d={type:"root",children:[]};const h=l;c.unshift(h)}else{d=DD(s,t);const h=d.tagName.toLowerCase(),m=i?i.get(h):void 0;if(d.tagName=m||h,LD(l))c.unshift(l);else for(const[g,b]of Object.entries(l))OD(e,d.properties,g,b)}for(const h of c)S0(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function LD(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const i of n){const o=t[i];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const s=o;for(const l of s)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function OD(e,t,n,i){const o=md(e,n);let s;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;s=i}else typeof i=="boolean"?s=i:typeof i=="string"?o.spaceSeparated?s=Sy(i):o.commaSeparated?s=by(i):o.commaOrSpaceSeparated?s=Sy(by(i).join(" ")):s=d2(o,o.property,i):Array.isArray(i)?s=[...i]:s=o.property==="style"?ID(i):String(i);if(Array.isArray(s)){const l=[];for(const c of s)l.push(d2(o,o.property,c));s=l}o.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[o.property]=s}}function S0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)S0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?S0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function d2(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Tl(n)===Tl(t)))return!0}return n}function ID(e){const t=[];for(const[n,i]of Object.entries(e))t.push([n,i].join(": "));return t.join("; ")}function jD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const PD=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],BD=XT(Ol,"div"),UD=XT(Hi,"g",PD);function zD(e){const t=String(e),n=[];return{toOffset:o,toPoint:i};function i(s){if(typeof s=="number"&&s>-1&&s<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=f2(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>s)return{line:l+1,column:s-(l>0?n[l-1]:0)+1,offset:s};l++}}}function o(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const c=n[n.length-1],d=f2(t,c),h=d===-1?t.length+1:d+1;if(c===h)break;n.push(h)}const l=(s.line>1?n[s.line-2]:0)+s.column-1;if(l<n[s.line-1])return l}}}function f2(e,t){const n=e.indexOf("\r",t),i=e.indexOf(`
|
|
533
|
+
`,t);return i===-1?n:n===-1||n+1===i?i:n<i?n:i}const Er={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},KT={}.hasOwnProperty,HD=Object.prototype;function FD(e,t){const n=t||{};return Cp({file:n.file||void 0,location:!1,schema:n.space==="svg"?Hi:Ol,verbose:n.verbose||!1},e)}function Cp(e,t){let n;switch(t.nodeName){case"#comment":{const i=t;return n={type:"comment",value:i.data},_c(e,i,n),n}case"#document":case"#document-fragment":{const i=t,o="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(n={type:"root",children:QT(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const s=String(e.file),l=zD(s),c=l.toPoint(0),d=l.toPoint(s.length);n.position={start:c,end:d}}return n}case"#documentType":{const i=t;return n={type:"doctype"},_c(e,i,n),n}case"#text":{const i=t;return n={type:"text",value:i.value},_c(e,i,n),n}default:return n=VD(e,t),n}}function QT(e,t){let n=-1;const i=[];for(;++n<t.length;){const o=Cp(e,t[n]);i.push(o)}return i}function VD(e,t){const n=e.schema;e.schema=t.namespaceURI===Er.svg?Hi:Ol;let i=-1;const o={};for(;++i<t.attrs.length;){const c=t.attrs[i],d=(c.prefix?c.prefix+":":"")+c.name;KT.call(HD,d)||(o[d]=c.value)}const l=(e.schema.space==="svg"?UD:BD)(t.tagName,o,QT(e,t.childNodes));if(_c(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,h=d&&d.startTag&&As(d.startTag),m=d&&d.endTag&&As(d.endTag),g=Cp(e,c.content);h&&m&&e.file&&(g.position={start:h.end,end:m.start}),l.content=g}return e.schema=n,l}function _c(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const i=qD(e,n,t.sourceCodeLocation);i&&(e.location=!0,n.position=i)}}function qD(e,t,n){const i=As(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(i&&!n.endTag&&o&&o.position&&o.position.end&&(i.end=Object.assign({},o.position.end)),e.verbose){const s={};let l;if(n.attrs)for(l in n.attrs)KT.call(n.attrs,l)&&(s[md(e.schema,l).property]=As(n.attrs[l]));n.startTag;const c=As(n.startTag),d=n.endTag?As(n.endTag):void 0,h={opening:c};d&&(h.closing=d),h.properties=s,t.data={position:h}}}return i}function As(e){const t=h2({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=h2({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function h2(e){return e.line&&e.column?e:void 0}const YD={},GD={}.hasOwnProperty,$T=AT("type",{handlers:{root:KD,element:JD,text:WD,comment:ZD,doctype:$D}});function XD(e,t){const i=(t||YD).space;return $T(e,i==="svg"?Hi:Ol)}function KD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Np(e.children,n,t),Hs(e,n),n}function QD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Np(e.children,n,t),Hs(e,n),n}function $D(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Hs(e,t),t}function WD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Hs(e,t),t}function ZD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Hs(e,t),t}function JD(e,t){const n=t;let i=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Hi);const o=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&GD.call(e.properties,s)){const d=e8(i,s,e.properties[s]);d&&o.push(d)}}const l=i.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:Er[l],childNodes:[],parentNode:null};return c.childNodes=Np(e.children,c,i),Hs(e,c),e.tagName==="template"&&e.content&&(c.content=QD(e.content,i)),c}function e8(e,t,n){const i=md(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&i.boolean)return;Array.isArray(n)&&(n=i.commaSeparated?PE(n):YE(n));const o={name:i.attribute,value:n===!0?"":String(n)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const s=o.name.indexOf(":");s<0?o.prefix="":(o.name=o.name.slice(s+1),o.prefix=i.attribute.slice(0,s)),o.namespace=Er[i.space]}return o}function Np(e,t,n){let i=-1;const o=[];if(e)for(;++i<e.length;){const s=$T(e[i],n);s.parentNode=t,o.push(s)}return o}function Hs(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const t8=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],n8=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Mt="�";var Q;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(Q||(Q={}));const Nn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function WT(e){return e>=55296&&e<=57343}function a8(e){return e>=56320&&e<=57343}function i8(e,t){return(e-55296)*1024+9216+t}function ZT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function JT(e){return e>=64976&&e<=65007||n8.has(e)}var pe;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(pe||(pe={}));const r8=65536;class s8{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=r8,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:o,offset:s}=this,l=o+n,c=s+n;return{code:t,startLine:i,endLine:i,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(a8(n))return this.pos++,this._addGap(),i8(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Q.EOF;return this._err(pe.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i<t.length;i++)if((this.html.charCodeAt(this.pos+i)|32)!==t.charCodeAt(i))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Q.EOF;const i=this.html.charCodeAt(n);return i===Q.CARRIAGE_RETURN?Q.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Q.EOF;let t=this.html.charCodeAt(this.pos);return t===Q.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Q.LINE_FEED):t===Q.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,WT(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===Q.LINE_FEED||t===Q.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){ZT(t)?this._err(pe.controlCharacterInInputStream):JT(t)&&this._err(pe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Je;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Je||(Je={}));function eS(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const o8=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),l8=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function u8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=l8.get(e))!==null&&t!==void 0?t:e}var nn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(nn||(nn={}));const c8=32;var Pi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Pi||(Pi={}));function w0(e){return e>=nn.ZERO&&e<=nn.NINE}function d8(e){return e>=nn.UPPER_A&&e<=nn.UPPER_F||e>=nn.LOWER_A&&e<=nn.LOWER_F}function f8(e){return e>=nn.UPPER_A&&e<=nn.UPPER_Z||e>=nn.LOWER_A&&e<=nn.LOWER_Z||w0(e)}function h8(e){return e===nn.EQUALS||f8(e)}var tn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(tn||(tn={}));var ni;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ni||(ni={}));class m8{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=tn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ni.Strict}startEntity(t){this.decodeMode=t,this.state=tn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case tn.EntityStart:return t.charCodeAt(n)===nn.NUM?(this.state=tn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=tn.NamedEntity,this.stateNamedEntity(t,n));case tn.NumericStart:return this.stateNumericStart(t,n);case tn.NumericDecimal:return this.stateNumericDecimal(t,n);case tn.NumericHex:return this.stateNumericHex(t,n);case tn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|c8)===nn.LOWER_X?(this.state=tn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=tn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,o){if(n!==i){const s=i-n;this.result=this.result*Math.pow(o,s)+Number.parseInt(t.substr(n,s),o),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const o=t.charCodeAt(n);if(w0(o)||d8(o))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const o=t.charCodeAt(n);if(w0(o))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===nn.SEMI)this.consumed+=1;else if(this.decodeMode===ni.Strict)return 0;return this.emitCodePoint(u8(this.result),this.consumed),this.errors&&(t!==nn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let o=i[this.treeIndex],s=(o&Pi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=p8(i,o,this.treeIndex+Math.max(1,s),l),this.treeIndex<0)return this.result===0||this.decodeMode===ni.Attribute&&(s===0||h8(l))?0:this.emitNotTerminatedNamedEntity();if(o=i[this.treeIndex],s=(o&Pi.VALUE_LENGTH)>>14,s!==0){if(l===nn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ni.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,o=(i[n]&Pi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Pi.VALUE_LENGTH:o[t+1],i),n===3&&this.emitCodePoint(o[t+2],i),i}end(){var t;switch(this.state){case tn.NamedEntity:return this.result!==0&&(this.decodeMode!==ni.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tn.NumericDecimal:return this.emitNumericEntity(0,2);case tn.NumericHex:return this.emitNumericEntity(0,3);case tn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tn.EntityStart:return 0}}}function p8(e,t,n,i){const o=(t&Pi.BRANCH_LENGTH)>>7,s=t&Pi.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const d=i-s;return d<0||d>=o?-1:e[n+d]-1}let l=n,c=l+o-1;for(;l<=c;){const d=l+c>>>1,h=e[d];if(h<i)l=d+1;else if(h>i)c=d-1;else return e[d+o]}return-1}var Se;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Se||(Se={}));var Nr;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Nr||(Nr={}));var ra;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(ra||(ra={}));var le;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(le||(le={}));var w;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(w||(w={}));const g8=new Map([[le.A,w.A],[le.ADDRESS,w.ADDRESS],[le.ANNOTATION_XML,w.ANNOTATION_XML],[le.APPLET,w.APPLET],[le.AREA,w.AREA],[le.ARTICLE,w.ARTICLE],[le.ASIDE,w.ASIDE],[le.B,w.B],[le.BASE,w.BASE],[le.BASEFONT,w.BASEFONT],[le.BGSOUND,w.BGSOUND],[le.BIG,w.BIG],[le.BLOCKQUOTE,w.BLOCKQUOTE],[le.BODY,w.BODY],[le.BR,w.BR],[le.BUTTON,w.BUTTON],[le.CAPTION,w.CAPTION],[le.CENTER,w.CENTER],[le.CODE,w.CODE],[le.COL,w.COL],[le.COLGROUP,w.COLGROUP],[le.DD,w.DD],[le.DESC,w.DESC],[le.DETAILS,w.DETAILS],[le.DIALOG,w.DIALOG],[le.DIR,w.DIR],[le.DIV,w.DIV],[le.DL,w.DL],[le.DT,w.DT],[le.EM,w.EM],[le.EMBED,w.EMBED],[le.FIELDSET,w.FIELDSET],[le.FIGCAPTION,w.FIGCAPTION],[le.FIGURE,w.FIGURE],[le.FONT,w.FONT],[le.FOOTER,w.FOOTER],[le.FOREIGN_OBJECT,w.FOREIGN_OBJECT],[le.FORM,w.FORM],[le.FRAME,w.FRAME],[le.FRAMESET,w.FRAMESET],[le.H1,w.H1],[le.H2,w.H2],[le.H3,w.H3],[le.H4,w.H4],[le.H5,w.H5],[le.H6,w.H6],[le.HEAD,w.HEAD],[le.HEADER,w.HEADER],[le.HGROUP,w.HGROUP],[le.HR,w.HR],[le.HTML,w.HTML],[le.I,w.I],[le.IMG,w.IMG],[le.IMAGE,w.IMAGE],[le.INPUT,w.INPUT],[le.IFRAME,w.IFRAME],[le.KEYGEN,w.KEYGEN],[le.LABEL,w.LABEL],[le.LI,w.LI],[le.LINK,w.LINK],[le.LISTING,w.LISTING],[le.MAIN,w.MAIN],[le.MALIGNMARK,w.MALIGNMARK],[le.MARQUEE,w.MARQUEE],[le.MATH,w.MATH],[le.MENU,w.MENU],[le.META,w.META],[le.MGLYPH,w.MGLYPH],[le.MI,w.MI],[le.MO,w.MO],[le.MN,w.MN],[le.MS,w.MS],[le.MTEXT,w.MTEXT],[le.NAV,w.NAV],[le.NOBR,w.NOBR],[le.NOFRAMES,w.NOFRAMES],[le.NOEMBED,w.NOEMBED],[le.NOSCRIPT,w.NOSCRIPT],[le.OBJECT,w.OBJECT],[le.OL,w.OL],[le.OPTGROUP,w.OPTGROUP],[le.OPTION,w.OPTION],[le.P,w.P],[le.PARAM,w.PARAM],[le.PLAINTEXT,w.PLAINTEXT],[le.PRE,w.PRE],[le.RB,w.RB],[le.RP,w.RP],[le.RT,w.RT],[le.RTC,w.RTC],[le.RUBY,w.RUBY],[le.S,w.S],[le.SCRIPT,w.SCRIPT],[le.SEARCH,w.SEARCH],[le.SECTION,w.SECTION],[le.SELECT,w.SELECT],[le.SOURCE,w.SOURCE],[le.SMALL,w.SMALL],[le.SPAN,w.SPAN],[le.STRIKE,w.STRIKE],[le.STRONG,w.STRONG],[le.STYLE,w.STYLE],[le.SUB,w.SUB],[le.SUMMARY,w.SUMMARY],[le.SUP,w.SUP],[le.TABLE,w.TABLE],[le.TBODY,w.TBODY],[le.TEMPLATE,w.TEMPLATE],[le.TEXTAREA,w.TEXTAREA],[le.TFOOT,w.TFOOT],[le.TD,w.TD],[le.TH,w.TH],[le.THEAD,w.THEAD],[le.TITLE,w.TITLE],[le.TR,w.TR],[le.TRACK,w.TRACK],[le.TT,w.TT],[le.U,w.U],[le.UL,w.UL],[le.SVG,w.SVG],[le.VAR,w.VAR],[le.WBR,w.WBR],[le.XMP,w.XMP]]);function Fs(e){var t;return(t=g8.get(e))!==null&&t!==void 0?t:w.UNKNOWN}const we=w,x8={[Se.HTML]:new Set([we.ADDRESS,we.APPLET,we.AREA,we.ARTICLE,we.ASIDE,we.BASE,we.BASEFONT,we.BGSOUND,we.BLOCKQUOTE,we.BODY,we.BR,we.BUTTON,we.CAPTION,we.CENTER,we.COL,we.COLGROUP,we.DD,we.DETAILS,we.DIR,we.DIV,we.DL,we.DT,we.EMBED,we.FIELDSET,we.FIGCAPTION,we.FIGURE,we.FOOTER,we.FORM,we.FRAME,we.FRAMESET,we.H1,we.H2,we.H3,we.H4,we.H5,we.H6,we.HEAD,we.HEADER,we.HGROUP,we.HR,we.HTML,we.IFRAME,we.IMG,we.INPUT,we.LI,we.LINK,we.LISTING,we.MAIN,we.MARQUEE,we.MENU,we.META,we.NAV,we.NOEMBED,we.NOFRAMES,we.NOSCRIPT,we.OBJECT,we.OL,we.P,we.PARAM,we.PLAINTEXT,we.PRE,we.SCRIPT,we.SECTION,we.SELECT,we.SOURCE,we.STYLE,we.SUMMARY,we.TABLE,we.TBODY,we.TD,we.TEMPLATE,we.TEXTAREA,we.TFOOT,we.TH,we.THEAD,we.TITLE,we.TR,we.TRACK,we.UL,we.WBR,we.XMP]),[Se.MATHML]:new Set([we.MI,we.MO,we.MN,we.MS,we.MTEXT,we.ANNOTATION_XML]),[Se.SVG]:new Set([we.TITLE,we.FOREIGN_OBJECT,we.DESC]),[Se.XLINK]:new Set,[Se.XML]:new Set,[Se.XMLNS]:new Set},k0=new Set([we.H1,we.H2,we.H3,we.H4,we.H5,we.H6]);le.STYLE,le.SCRIPT,le.XMP,le.IFRAME,le.NOEMBED,le.NOFRAMES,le.PLAINTEXT;var W;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(W||(W={}));const zt={DATA:W.DATA,RCDATA:W.RCDATA,RAWTEXT:W.RAWTEXT,SCRIPT_DATA:W.SCRIPT_DATA,PLAINTEXT:W.PLAINTEXT,CDATA_SECTION:W.CDATA_SECTION};function b8(e){return e>=Q.DIGIT_0&&e<=Q.DIGIT_9}function tl(e){return e>=Q.LATIN_CAPITAL_A&&e<=Q.LATIN_CAPITAL_Z}function y8(e){return e>=Q.LATIN_SMALL_A&&e<=Q.LATIN_SMALL_Z}function Li(e){return y8(e)||tl(e)}function m2(e){return Li(e)||b8(e)}function mc(e){return e+32}function tS(e){return e===Q.SPACE||e===Q.LINE_FEED||e===Q.TABULATION||e===Q.FORM_FEED}function p2(e){return tS(e)||e===Q.SOLIDUS||e===Q.GREATER_THAN_SIGN}function v8(e){return e===Q.NULL?pe.nullCharacterReference:e>1114111?pe.characterReferenceOutsideUnicodeRange:WT(e)?pe.surrogateCharacterReference:JT(e)?pe.noncharacterCharacterReference:ZT(e)||e===Q.CARRIAGE_RETURN?pe.controlCharacterReference:null}class E8{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=W.DATA,this.returnState=W.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new s8(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new m8(o8,(i,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(pe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(pe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const o=v8(i);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var i,o;(o=(i=this.handler).onParseError)===null||o===void 0||o.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Je.START_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Je.END_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Je.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Je.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const i=this.currentToken;if(eS(i,this.currentAttr.name)===null){if(i.attrs.push(this.currentAttr),i.location&&this.currentLocation){const o=(t=(n=i.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(pe.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Fs(t.tagName),t.type===Je.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(pe.endTagWithAttributes),t.selfClosing&&this._err(pe.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Je.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Je.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Je.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Je.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=tS(t)?Je.WHITESPACE_CHARACTER:t===Q.NULL?Je.NULL_CHARACTER:Je.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Je.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=W.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ni.Attribute:ni.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===W.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===W.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===W.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case W.DATA:{this._stateData(t);break}case W.RCDATA:{this._stateRcdata(t);break}case W.RAWTEXT:{this._stateRawtext(t);break}case W.SCRIPT_DATA:{this._stateScriptData(t);break}case W.PLAINTEXT:{this._statePlaintext(t);break}case W.TAG_OPEN:{this._stateTagOpen(t);break}case W.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case W.TAG_NAME:{this._stateTagName(t);break}case W.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case W.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case W.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case W.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case W.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case W.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case W.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case W.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case W.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case W.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case W.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case W.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case W.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case W.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case W.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case W.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case W.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case W.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case W.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case W.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case W.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case W.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case W.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case W.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case W.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case W.BOGUS_COMMENT:{this._stateBogusComment(t);break}case W.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case W.COMMENT_START:{this._stateCommentStart(t);break}case W.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case W.COMMENT:{this._stateComment(t);break}case W.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case W.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case W.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case W.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case W.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case W.COMMENT_END:{this._stateCommentEnd(t);break}case W.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case W.DOCTYPE:{this._stateDoctype(t);break}case W.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case W.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case W.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case W.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case W.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case W.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case W.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case W.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case W.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case W.CDATA_SECTION:{this._stateCdataSection(t);break}case W.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case W.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case W.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case W.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case Q.LESS_THAN_SIGN:{this.state=W.TAG_OPEN;break}case Q.AMPERSAND:{this._startCharacterReference();break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitCodePoint(t);break}case Q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case Q.AMPERSAND:{this._startCharacterReference();break}case Q.LESS_THAN_SIGN:{this.state=W.RCDATA_LESS_THAN_SIGN;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Mt);break}case Q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case Q.LESS_THAN_SIGN:{this.state=W.RAWTEXT_LESS_THAN_SIGN;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Mt);break}case Q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_LESS_THAN_SIGN;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Mt);break}case Q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Mt);break}case Q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Li(t))this._createStartTagToken(),this.state=W.TAG_NAME,this._stateTagName(t);else switch(t){case Q.EXCLAMATION_MARK:{this.state=W.MARKUP_DECLARATION_OPEN;break}case Q.SOLIDUS:{this.state=W.END_TAG_OPEN;break}case Q.QUESTION_MARK:{this._err(pe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t);break}case Q.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=W.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Li(t))this._createEndTagToken(),this.state=W.TAG_NAME,this._stateTagName(t);else switch(t){case Q.GREATER_THAN_SIGN:{this._err(pe.missingEndTagName),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this.state=W.BEFORE_ATTRIBUTE_NAME;break}case Q.SOLIDUS:{this.state=W.SELF_CLOSING_START_TAG;break}case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentTagToken();break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.tagName+=Mt;break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(tl(t)?mc(t):t)}}_stateRcdataLessThanSign(t){t===Q.SOLIDUS?this.state=W.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=W.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Li(t)?(this.state=W.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=W.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=W.BEFORE_ATTRIBUTE_NAME,!1;case Q.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=W.SELF_CLOSING_START_TAG,!1;case Q.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=W.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===Q.SOLIDUS?this.state=W.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=W.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Li(t)?(this.state=W.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=W.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case Q.SOLIDUS:{this.state=W.SCRIPT_DATA_END_TAG_OPEN;break}case Q.EXCLAMATION_MARK:{this.state=W.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=W.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Li(t)?(this.state=W.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===Q.HYPHEN_MINUS?(this.state=W.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===Q.HYPHEN_MINUS?(this.state=W.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case Q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Mt);break}case Q.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case Q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_ESCAPED,this._emitChars(Mt);break}case Q.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case Q.HYPHEN_MINUS:{this._emitChars("-");break}case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Q.GREATER_THAN_SIGN:{this.state=W.SCRIPT_DATA,this._emitChars(">");break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_ESCAPED,this._emitChars(Mt);break}case Q.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===Q.SOLIDUS?this.state=W.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Li(t)?(this._emitChars("<"),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Li(t)?(this.state=W.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Nn.SCRIPT,!1)&&p2(this.preprocessor.peek(Nn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case Q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Mt);break}case Q.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case Q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Mt);break}case Q.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case Q.HYPHEN_MINUS:{this._emitChars("-");break}case Q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Q.GREATER_THAN_SIGN:{this.state=W.SCRIPT_DATA,this._emitChars(">");break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Mt);break}case Q.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===Q.SOLIDUS?(this.state=W.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Nn.SCRIPT,!1)&&p2(this.preprocessor.peek(Nn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=W.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.SOLIDUS:case Q.GREATER_THAN_SIGN:case Q.EOF:{this.state=W.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Q.EQUALS_SIGN:{this._err(pe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=W.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=W.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:case Q.SOLIDUS:case Q.GREATER_THAN_SIGN:case Q.EOF:{this._leaveAttrName(),this.state=W.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Q.EQUALS_SIGN:{this._leaveAttrName(),this.state=W.BEFORE_ATTRIBUTE_VALUE;break}case Q.QUOTATION_MARK:case Q.APOSTROPHE:case Q.LESS_THAN_SIGN:{this._err(pe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.name+=Mt;break}default:this.currentAttr.name+=String.fromCodePoint(tl(t)?mc(t):t)}}_stateAfterAttributeName(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.SOLIDUS:{this.state=W.SELF_CLOSING_START_TAG;break}case Q.EQUALS_SIGN:{this.state=W.BEFORE_ATTRIBUTE_VALUE;break}case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentTagToken();break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=W.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.QUOTATION_MARK:{this.state=W.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{this.state=W.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Q.GREATER_THAN_SIGN:{this._err(pe.missingAttributeValue),this.state=W.DATA,this.emitCurrentTagToken();break}default:this.state=W.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case Q.QUOTATION_MARK:{this.state=W.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Q.AMPERSAND:{this._startCharacterReference();break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case Q.APOSTROPHE:{this.state=W.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Q.AMPERSAND:{this._startCharacterReference();break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this._leaveAttrValue(),this.state=W.BEFORE_ATTRIBUTE_NAME;break}case Q.AMPERSAND:{this._startCharacterReference();break}case Q.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=W.DATA,this.emitCurrentTagToken();break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case Q.QUOTATION_MARK:case Q.APOSTROPHE:case Q.LESS_THAN_SIGN:case Q.EQUALS_SIGN:case Q.GRAVE_ACCENT:{this._err(pe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this._leaveAttrValue(),this.state=W.BEFORE_ATTRIBUTE_NAME;break}case Q.SOLIDUS:{this._leaveAttrValue(),this.state=W.SELF_CLOSING_START_TAG;break}case Q.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=W.DATA,this.emitCurrentTagToken();break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBetweenAttributes),this.state=W.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case Q.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=W.DATA,this.emitCurrentTagToken();break}case Q.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.unexpectedSolidusInTag),this.state=W.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentComment(n);break}case Q.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Mt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Nn.DASH_DASH,!0)?(this._createCommentToken(Nn.DASH_DASH.length+1),this.state=W.COMMENT_START):this._consumeSequenceIfMatch(Nn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Nn.DOCTYPE.length+1),this.state=W.DOCTYPE):this._consumeSequenceIfMatch(Nn.CDATA_START,!0)?this.inForeignNode?this.state=W.CDATA_SECTION:(this._err(pe.cdataInHtmlContent),this._createCommentToken(Nn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=W.BOGUS_COMMENT):this._ensureHibernation()||(this._err(pe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case Q.HYPHEN_MINUS:{this.state=W.COMMENT_START_DASH;break}case Q.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=W.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=W.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case Q.HYPHEN_MINUS:{this.state=W.COMMENT_END;break}case Q.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=W.DATA,this.emitCurrentComment(n);break}case Q.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=W.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case Q.HYPHEN_MINUS:{this.state=W.COMMENT_END_DASH;break}case Q.LESS_THAN_SIGN:{n.data+="<",this.state=W.COMMENT_LESS_THAN_SIGN;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Mt;break}case Q.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case Q.EXCLAMATION_MARK:{n.data+="!",this.state=W.COMMENT_LESS_THAN_SIGN_BANG;break}case Q.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=W.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===Q.HYPHEN_MINUS?this.state=W.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=W.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===Q.HYPHEN_MINUS?this.state=W.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=W.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==Q.GREATER_THAN_SIGN&&t!==Q.EOF&&this._err(pe.nestedComment),this.state=W.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case Q.HYPHEN_MINUS:{this.state=W.COMMENT_END;break}case Q.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=W.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentComment(n);break}case Q.EXCLAMATION_MARK:{this.state=W.COMMENT_END_BANG;break}case Q.HYPHEN_MINUS:{n.data+="-";break}case Q.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=W.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case Q.HYPHEN_MINUS:{n.data+="--!",this.state=W.COMMENT_END_DASH;break}case Q.GREATER_THAN_SIGN:{this._err(pe.incorrectlyClosedComment),this.state=W.DATA,this.emitCurrentComment(n);break}case Q.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=W.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_NAME;break}case Q.GREATER_THAN_SIGN:{this.state=W.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case Q.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBeforeDoctypeName),this.state=W.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(tl(t))this._createDoctypeToken(String.fromCharCode(mc(t))),this.state=W.DOCTYPE_NAME;else switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.NULL:{this._err(pe.unexpectedNullCharacter),this._createDoctypeToken(Mt),this.state=W.DOCTYPE_NAME;break}case Q.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=W.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this.state=W.AFTER_DOCTYPE_NAME;break}case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.name+=Mt;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(tl(t)?mc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Nn.PUBLIC,!1)?this.state=W.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Nn.SYSTEM,!1)?this.state=W.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(pe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Q.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Q.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.QUOTATION_MARK:{n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Q.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Q.QUOTATION_MARK:{this.state=W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Mt;break}case Q.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case Q.APOSTROPHE:{this.state=W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Mt;break}case Q.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this.state=W.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.QUOTATION_MARK:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.QUOTATION_MARK:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Q.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Q.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.QUOTATION_MARK:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Q.APOSTROPHE:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Q.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Q.QUOTATION_MARK:{this.state=W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Mt;break}case Q.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case Q.APOSTROPHE:{this.state=W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Mt;break}case Q.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case Q.SPACE:case Q.LINE_FEED:case Q.TABULATION:case Q.FORM_FEED:break;case Q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case Q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case Q.NULL:{this._err(pe.unexpectedNullCharacter);break}case Q.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case Q.RIGHT_SQUARE_BRACKET:{this.state=W.CDATA_SECTION_BRACKET;break}case Q.EOF:{this._err(pe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===Q.RIGHT_SQUARE_BRACKET?this.state=W.CDATA_SECTION_END:(this._emitChars("]"),this.state=W.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case Q.GREATER_THAN_SIGN:{this.state=W.DATA;break}case Q.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=W.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(Q.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&m2(this.preprocessor.peek(1))?W.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){m2(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===Q.SEMICOLON&&this._err(pe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const nS=new Set([w.DD,w.DT,w.LI,w.OPTGROUP,w.OPTION,w.P,w.RB,w.RP,w.RT,w.RTC]),g2=new Set([...nS,w.CAPTION,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]),Kc=new Set([w.APPLET,w.CAPTION,w.HTML,w.MARQUEE,w.OBJECT,w.TABLE,w.TD,w.TEMPLATE,w.TH]),T8=new Set([...Kc,w.OL,w.UL]),S8=new Set([...Kc,w.BUTTON]),x2=new Set([w.ANNOTATION_XML,w.MI,w.MN,w.MO,w.MS,w.MTEXT]),b2=new Set([w.DESC,w.FOREIGN_OBJECT,w.TITLE]),w8=new Set([w.TR,w.TEMPLATE,w.HTML]),k8=new Set([w.TBODY,w.TFOOT,w.THEAD,w.TEMPLATE,w.HTML]),A8=new Set([w.TABLE,w.TEMPLATE,w.HTML]),C8=new Set([w.TD,w.TH]);class N8{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,i){this.treeAdapter=n,this.handler=i,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=w.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===w.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Se.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,i),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Se.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(i,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(k0,Se.HTML)}popUntilTableCellPopped(){this.popUntilPopped(C8,Se.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let i=this.stackTop;i>=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(A8,Se.HTML)}clearBackToTableBodyContext(){this.clearBackTo(k8,Se.HTML)}clearBackToTableRowContext(){this.clearBackTo(w8,Se.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===w.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===w.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const o=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Se.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case Se.SVG:{if(b2.has(o))return!1;break}case Se.MATHML:{if(x2.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Kc)}hasInListItemScope(t){return this.hasInDynamicScope(t,T8)}hasInButtonScope(t){return this.hasInDynamicScope(t,S8)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Se.HTML:{if(k0.has(n))return!0;if(Kc.has(n))return!1;break}case Se.SVG:{if(b2.has(n))return!1;break}case Se.MATHML:{if(x2.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Se.HTML)switch(this.tagIDs[n]){case t:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Se.HTML)switch(this.tagIDs[t]){case w.TBODY:case w.THEAD:case w.TFOOT:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Se.HTML)switch(this.tagIDs[n]){case t:return!0;case w.OPTION:case w.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&nS.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&g2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&g2.has(this.currentTagId);)this.pop()}}const Am=3;var Na;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Na||(Na={}));const y2={type:Na.Marker};class _8{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],o=n.length,s=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Na.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===s&&this.treeAdapter.getNamespaceURI(h)===l){const m=this.treeAdapter.getAttrList(h);m.length===o&&i.push({idx:c,attrs:m})}}return i}_ensureNoahArkCondition(t){if(this.entries.length<Am)return;const n=this.treeAdapter.getAttrList(t),i=this._getNoahArkConditionCandidates(t,n);if(i.length<Am)return;const o=new Map(n.map(l=>[l.name,l.value]));let s=0;for(let l=0;l<i.length;l++){const c=i[l];c.attrs.every(d=>o.get(d.name)===d.value)&&(s+=1,s>=Am&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(y2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Na.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Na.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(y2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Na.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Na.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Na.Element&&n.element===t)}}const Oi={createDocument(){return{nodeName:"#document",mode:ra.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const o=e.childNodes.find(s=>s.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};Oi.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Oi.isTextNode(n)){n.value+=t;return}}Oi.appendChild(e,Oi.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Oi.isTextNode(i)?i.value+=t:Oi.insertBefore(e,Oi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;i<t.length;i++)n.has(t[i].name)||e.attrs.push(t[i])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},aS="html",M8="about:legacy-compat",R8="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",iS=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],D8=[...iS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],L8=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),rS=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],O8=[...rS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function v2(e,t){return t.some(n=>e.startsWith(n))}function I8(e){return e.name===aS&&e.publicId===null&&(e.systemId===null||e.systemId===M8)}function j8(e){if(e.name!==aS)return ra.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===R8)return ra.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),L8.has(n))return ra.QUIRKS;let i=t===null?D8:iS;if(v2(n,i))return ra.QUIRKS;if(i=t===null?rS:O8,v2(n,i))return ra.LIMITED_QUIRKS}return ra.NO_QUIRKS}const E2={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},P8="definitionurl",B8="definitionURL",U8=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),z8=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Se.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Se.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Se.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Se.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Se.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Se.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Se.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Se.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Se.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Se.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Se.XMLNS}]]),H8=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),F8=new Set([w.B,w.BIG,w.BLOCKQUOTE,w.BODY,w.BR,w.CENTER,w.CODE,w.DD,w.DIV,w.DL,w.DT,w.EM,w.EMBED,w.H1,w.H2,w.H3,w.H4,w.H5,w.H6,w.HEAD,w.HR,w.I,w.IMG,w.LI,w.LISTING,w.MENU,w.META,w.NOBR,w.OL,w.P,w.PRE,w.RUBY,w.S,w.SMALL,w.SPAN,w.STRONG,w.STRIKE,w.SUB,w.SUP,w.TABLE,w.TT,w.U,w.UL,w.VAR]);function V8(e){const t=e.tagID;return t===w.FONT&&e.attrs.some(({name:i})=>i===Nr.COLOR||i===Nr.SIZE||i===Nr.FACE)||F8.has(t)}function sS(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===P8){e.attrs[t].name=B8;break}}function oS(e){for(let t=0;t<e.attrs.length;t++){const n=U8.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function _p(e){for(let t=0;t<e.attrs.length;t++){const n=z8.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function q8(e){const t=H8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Fs(e.tagName))}function Y8(e,t){return t===Se.MATHML&&(e===w.MI||e===w.MO||e===w.MN||e===w.MS||e===w.MTEXT)}function G8(e,t,n){if(t===Se.MATHML&&e===w.ANNOTATION_XML){for(let i=0;i<n.length;i++)if(n[i].name===Nr.ENCODING){const o=n[i].value.toLowerCase();return o===E2.TEXT_HTML||o===E2.APPLICATION_XML}}return t===Se.SVG&&(e===w.FOREIGN_OBJECT||e===w.DESC||e===w.TITLE)}function X8(e,t,n,i){return(!i||i===Se.HTML)&&G8(e,t,n)||(!i||i===Se.MATHML)&&Y8(e,t)}const K8="hidden",Q8=8,$8=3;var ee;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(ee||(ee={}));const W8={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},lS=new Set([w.TABLE,w.TBODY,w.TFOOT,w.THEAD,w.TR]),T2={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Oi,onParseError:null};class S2{constructor(t,n,i=null,o=null){this.fragmentContext=i,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=ee.INITIAL,this.originalInsertionMode=ee.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...T2,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new E8(this.options,this),this.activeFormattingElements=new _8(this.treeAdapter),this.fragmentContextID=i?Fs(this.treeAdapter.getTagName(i)):w.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new N8(this.document,this.treeAdapter,this)}static parse(t,n){const i=new this(n);return i.tokenizer.write(t,!0),i.document}static getFragmentParser(t,n){const i={...T2,...n};t??(t=i.treeAdapter.createElement(le.TEMPLATE,Se.HTML,[]));const o=i.treeAdapter.createElement("documentmock",Se.HTML,[]),s=new this(i,o,t);return s.fragmentContextID===w.TEMPLATE&&s.tmplInsertionModeStack.unshift(ee.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,i){var o;if(!this.onParseError)return;const s=(o=t.location)!==null&&o!==void 0?o:W8,l={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:i?s.startLine:s.endLine,endCol:i?s.startCol:s.endCol,endOffset:i?s.startOffset:s.endOffset};this.onParseError(l)}onItemPush(t,n,i){var o,s;(s=(o=this.treeAdapter).onItemPush)===null||s===void 0||s.call(o,t),i&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var i,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(i=this.treeAdapter).onItemPop)===null||o===void 0||o.call(i,t,this.openElements.current),n){let s,l;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,l=this.fragmentContextID):{current:s,currentTagId:l}=this.openElements,this._setContextModes(s,l)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Se.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Se.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=ee.TEXT}switchToPlaintextParsing(){this.insertionMode=ee.TEXT,this.originalInsertionMode=ee.IN_BODY,this.tokenizer.state=zt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===le.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Se.HTML))switch(this.fragmentContextID){case w.TITLE:case w.TEXTAREA:{this.tokenizer.state=zt.RCDATA;break}case w.STYLE:case w.XMP:case w.IFRAME:case w.NOEMBED:case w.NOFRAMES:case w.NOSCRIPT:{this.tokenizer.state=zt.RAWTEXT;break}case w.SCRIPT:{this.tokenizer.state=zt.SCRIPT_DATA;break}case w.PLAINTEXT:{this.tokenizer.state=zt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,o),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Se.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Se.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(le.HTML,Se.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,w.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const o=this.treeAdapter.getChildNodes(n),s=i?o.lastIndexOf(i):o.length,l=o[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:h,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:h,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,o=this.treeAdapter.getTagName(t),s=n.type===Je.END_TAG&&o===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===w.SVG&&this.treeAdapter.getTagName(n)===le.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Se.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===w.MGLYPH||t.tagID===w.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Se.HTML)}_processToken(t){switch(t.type){case Je.CHARACTER:{this.onCharacter(t);break}case Je.NULL_CHARACTER:{this.onNullCharacter(t);break}case Je.COMMENT:{this.onComment(t);break}case Je.DOCTYPE:{this.onDoctype(t);break}case Je.START_TAG:{this._processStartTag(t);break}case Je.END_TAG:{this.onEndTag(t);break}case Je.EOF:{this.onEof(t);break}case Je.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const o=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return X8(t,o,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===Na.Marker||this.openElements.contains(o.element)),i=n===-1?t-1:n-1;for(let o=i;o>=0;o--){const s=this.activeFormattingElements.entries[o];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=ee.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(w.P),this.openElements.popUntilTagNamePopped(w.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case w.TR:{this.insertionMode=ee.IN_ROW;return}case w.TBODY:case w.THEAD:case w.TFOOT:{this.insertionMode=ee.IN_TABLE_BODY;return}case w.CAPTION:{this.insertionMode=ee.IN_CAPTION;return}case w.COLGROUP:{this.insertionMode=ee.IN_COLUMN_GROUP;return}case w.TABLE:{this.insertionMode=ee.IN_TABLE;return}case w.BODY:{this.insertionMode=ee.IN_BODY;return}case w.FRAMESET:{this.insertionMode=ee.IN_FRAMESET;return}case w.SELECT:{this._resetInsertionModeForSelect(t);return}case w.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case w.HTML:{this.insertionMode=this.headElement?ee.AFTER_HEAD:ee.BEFORE_HEAD;return}case w.TD:case w.TH:{if(t>0){this.insertionMode=ee.IN_CELL;return}break}case w.HEAD:{if(t>0){this.insertionMode=ee.IN_HEAD;return}break}}this.insertionMode=ee.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===w.TEMPLATE)break;if(i===w.TABLE){this.insertionMode=ee.IN_SELECT_IN_TABLE;return}}this.insertionMode=ee.IN_SELECT}_isElementCausesFosterParenting(t){return lS.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case w.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Se.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case w.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return x8[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{$o(this,t);break}case ee.BEFORE_HTML:{ul(this,t);break}case ee.BEFORE_HEAD:{cl(this,t);break}case ee.IN_HEAD:{dl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fl(this,t);break}case ee.AFTER_HEAD:{hl(this,t);break}case ee.IN_BODY:case ee.IN_CAPTION:case ee.IN_CELL:case ee.IN_TEMPLATE:{cS(this,t);break}case ee.TEXT:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Cm(this,t);break}case ee.IN_TABLE_TEXT:{gS(this,t);break}case ee.IN_COLUMN_GROUP:{Qc(this,t);break}case ee.AFTER_BODY:{$c(this,t);break}case ee.AFTER_AFTER_BODY:{Mc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){AO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{$o(this,t);break}case ee.BEFORE_HTML:{ul(this,t);break}case ee.BEFORE_HEAD:{cl(this,t);break}case ee.IN_HEAD:{dl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fl(this,t);break}case ee.AFTER_HEAD:{hl(this,t);break}case ee.TEXT:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Cm(this,t);break}case ee.IN_COLUMN_GROUP:{Qc(this,t);break}case ee.AFTER_BODY:{$c(this,t);break}case ee.AFTER_AFTER_BODY:{Mc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){A0(this,t);return}switch(this.insertionMode){case ee.INITIAL:case ee.BEFORE_HTML:case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:case ee.IN_BODY:case ee.IN_TABLE:case ee.IN_CAPTION:case ee.IN_COLUMN_GROUP:case ee.IN_TABLE_BODY:case ee.IN_ROW:case ee.IN_CELL:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:case ee.IN_TEMPLATE:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:{A0(this,t);break}case ee.IN_TABLE_TEXT:{Wo(this,t);break}case ee.AFTER_BODY:{iL(this,t);break}case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{rL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ee.INITIAL:{sL(this,t);break}case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:{this._err(t,pe.misplacedDoctype);break}case ee.IN_TABLE_TEXT:{Wo(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,pe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?NO(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{$o(this,t);break}case ee.BEFORE_HTML:{oL(this,t);break}case ee.BEFORE_HEAD:{uL(this,t);break}case ee.IN_HEAD:{ya(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fL(this,t);break}case ee.AFTER_HEAD:{mL(this,t);break}case ee.IN_BODY:{hn(this,t);break}case ee.IN_TABLE:{Is(this,t);break}case ee.IN_TABLE_TEXT:{Wo(this,t);break}case ee.IN_CAPTION:{cO(this,t);break}case ee.IN_COLUMN_GROUP:{Dp(this,t);break}case ee.IN_TABLE_BODY:{wd(this,t);break}case ee.IN_ROW:{kd(this,t);break}case ee.IN_CELL:{hO(this,t);break}case ee.IN_SELECT:{yS(this,t);break}case ee.IN_SELECT_IN_TABLE:{pO(this,t);break}case ee.IN_TEMPLATE:{xO(this,t);break}case ee.AFTER_BODY:{yO(this,t);break}case ee.IN_FRAMESET:{vO(this,t);break}case ee.AFTER_FRAMESET:{TO(this,t);break}case ee.AFTER_AFTER_BODY:{wO(this,t);break}case ee.AFTER_AFTER_FRAMESET:{kO(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?_O(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{$o(this,t);break}case ee.BEFORE_HTML:{lL(this,t);break}case ee.BEFORE_HEAD:{cL(this,t);break}case ee.IN_HEAD:{dL(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{hL(this,t);break}case ee.AFTER_HEAD:{pL(this,t);break}case ee.IN_BODY:{Sd(this,t);break}case ee.TEXT:{eO(this,t);break}case ee.IN_TABLE:{kl(this,t);break}case ee.IN_TABLE_TEXT:{Wo(this,t);break}case ee.IN_CAPTION:{dO(this,t);break}case ee.IN_COLUMN_GROUP:{fO(this,t);break}case ee.IN_TABLE_BODY:{C0(this,t);break}case ee.IN_ROW:{bS(this,t);break}case ee.IN_CELL:{mO(this,t);break}case ee.IN_SELECT:{vS(this,t);break}case ee.IN_SELECT_IN_TABLE:{gO(this,t);break}case ee.IN_TEMPLATE:{bO(this,t);break}case ee.AFTER_BODY:{TS(this,t);break}case ee.IN_FRAMESET:{EO(this,t);break}case ee.AFTER_FRAMESET:{SO(this,t);break}case ee.AFTER_AFTER_BODY:{Mc(this,t);break}}}onEof(t){switch(this.insertionMode){case ee.INITIAL:{$o(this,t);break}case ee.BEFORE_HTML:{ul(this,t);break}case ee.BEFORE_HEAD:{cl(this,t);break}case ee.IN_HEAD:{dl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fl(this,t);break}case ee.AFTER_HEAD:{hl(this,t);break}case ee.IN_BODY:case ee.IN_TABLE:case ee.IN_CAPTION:case ee.IN_COLUMN_GROUP:case ee.IN_TABLE_BODY:case ee.IN_ROW:case ee.IN_CELL:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:{mS(this,t);break}case ee.TEXT:{tO(this,t);break}case ee.IN_TABLE_TEXT:{Wo(this,t);break}case ee.IN_TEMPLATE:{ES(this,t);break}case ee.AFTER_BODY:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{Rp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Q.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:case ee.TEXT:case ee.IN_COLUMN_GROUP:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:{this._insertCharacters(t);break}case ee.IN_BODY:case ee.IN_CAPTION:case ee.IN_CELL:case ee.IN_TEMPLATE:case ee.AFTER_BODY:case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{uS(this,t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Cm(this,t);break}case ee.IN_TABLE_TEXT:{pS(this,t);break}}}}function Z8(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hS(e,t),n}function J8(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const o=e.openElements.items[i];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[i])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function eL(e,t,n){let i=t,o=e.openElements.getCommonAncestor(t);for(let s=0,l=o;l!==n;s++,l=o){o=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&s>=$8;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=tL(e,c),i===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(l,i),i=l)}return i}function tL(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function nL(e,t,n){const i=e.treeAdapter.getTagName(t),o=Fs(i);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);o===w.TEMPLATE&&s===Se.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function aL(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,s=e.treeAdapter.createElement(o.tagName,i,o.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,o.tagID)}function Mp(e,t){for(let n=0;n<Q8;n++){const i=Z8(e,t);if(!i)break;const o=J8(e,i);if(!o)break;e.activeFormattingElements.bookmark=i;const s=eL(e,o,i.element),l=e.openElements.getCommonAncestor(i.element);e.treeAdapter.detachNode(s),l&&nL(e,l,s),aL(e,o,i)}}function A0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function iL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function rL(e,t){e._appendCommentNode(t,e.document)}function Rp(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let i=e.openElements.stackTop;i>=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(i);if(o&&!o.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(s);l&&!l.endTag&&e._setEndLocation(s,t)}}}}function sL(e,t){e._setDocumentType(t);const n=t.forceQuirks?ra.QUIRKS:j8(t);I8(t)||e._err(t,pe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ee.BEFORE_HTML}function $o(e,t){e._err(t,pe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ra.QUIRKS),e.insertionMode=ee.BEFORE_HTML,e._processToken(t)}function oL(e,t){t.tagID===w.HTML?(e._insertElement(t,Se.HTML),e.insertionMode=ee.BEFORE_HEAD):ul(e,t)}function lL(e,t){const n=t.tagID;(n===w.HTML||n===w.HEAD||n===w.BODY||n===w.BR)&&ul(e,t)}function ul(e,t){e._insertFakeRootElement(),e.insertionMode=ee.BEFORE_HEAD,e._processToken(t)}function uL(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.HEAD:{e._insertElement(t,Se.HTML),e.headElement=e.openElements.current,e.insertionMode=ee.IN_HEAD;break}default:cl(e,t)}}function cL(e,t){const n=t.tagID;n===w.HEAD||n===w.BODY||n===w.HTML||n===w.BR?cl(e,t):e._err(t,pe.endTagWithoutMatchingOpenElement)}function cl(e,t){e._insertFakeElement(le.HEAD,w.HEAD),e.headElement=e.openElements.current,e.insertionMode=ee.IN_HEAD,e._processToken(t)}function ya(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case w.TITLE:{e._switchToTextParsing(t,zt.RCDATA);break}case w.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,zt.RAWTEXT):(e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_HEAD_NO_SCRIPT);break}case w.NOFRAMES:case w.STYLE:{e._switchToTextParsing(t,zt.RAWTEXT);break}case w.SCRIPT:{e._switchToTextParsing(t,zt.SCRIPT_DATA);break}case w.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=ee.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(ee.IN_TEMPLATE);break}case w.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:dl(e,t)}}function dL(e,t){switch(t.tagID){case w.HEAD:{e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD;break}case w.BODY:case w.BR:case w.HTML:{dl(e,t);break}case w.TEMPLATE:{Or(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Or(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==w.TEMPLATE&&e._err(t,pe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,pe.endTagWithoutMatchingOpenElement)}function dl(e,t){e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD,e._processToken(t)}function fL(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.BASEFONT:case w.BGSOUND:case w.HEAD:case w.LINK:case w.META:case w.NOFRAMES:case w.STYLE:{ya(e,t);break}case w.NOSCRIPT:{e._err(t,pe.nestedNoscriptInHead);break}default:fl(e,t)}}function hL(e,t){switch(t.tagID){case w.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ee.IN_HEAD;break}case w.BR:{fl(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function fl(e,t){const n=t.type===Je.EOF?pe.openElementsLeftAfterEof:pe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=ee.IN_HEAD,e._processToken(t)}function mL(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.BODY:{e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=ee.IN_BODY;break}case w.FRAMESET:{e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_FRAMESET;break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{e._err(t,pe.abandonedHeadElementChild),e.openElements.push(e.headElement,w.HEAD),ya(e,t),e.openElements.remove(e.headElement);break}case w.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:hl(e,t)}}function pL(e,t){switch(t.tagID){case w.BODY:case w.HTML:case w.BR:{hl(e,t);break}case w.TEMPLATE:{Or(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function hl(e,t){e._insertFakeElement(le.BODY,w.BODY),e.insertionMode=ee.IN_BODY,Td(e,t)}function Td(e,t){switch(t.type){case Je.CHARACTER:{cS(e,t);break}case Je.WHITESPACE_CHARACTER:{uS(e,t);break}case Je.COMMENT:{A0(e,t);break}case Je.START_TAG:{hn(e,t);break}case Je.END_TAG:{Sd(e,t);break}case Je.EOF:{mS(e,t);break}}}function uS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function cS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function gL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function xL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function bL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_FRAMESET)}function yL(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Se.HTML)}function vL(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&k0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Se.HTML)}function EL(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function TL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Se.HTML),n||(e.formElement=e.openElements.current))}function SL(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const o=e.openElements.tagIDs[i];if(n===w.LI&&o===w.LI||(n===w.DD||n===w.DT)&&(o===w.DD||o===w.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==w.ADDRESS&&o!==w.DIV&&o!==w.P&&e._isSpecialElement(e.openElements.items[i],o))break}e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Se.HTML)}function wL(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.tokenizer.state=zt.PLAINTEXT}function kL(e,t){e.openElements.hasInScope(w.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.framesetOk=!1}function AL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(le.A);n&&(Mp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function NL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(w.NOBR)&&(Mp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function _L(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function ML(e,t){e.treeAdapter.getDocumentMode(e.document)!==ra.QUIRKS&&e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=ee.IN_TABLE}function dS(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function fS(e){const t=eS(e,Nr.TYPE);return t!=null&&t.toLowerCase()===K8}function RL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Se.HTML),fS(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function DL(e,t){e._appendElement(t,Se.HTML),t.ackSelfClosing=!0}function LL(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._appendElement(t,Se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function OL(e,t){t.tagName=le.IMG,t.tagID=w.IMG,dS(e,t)}function IL(e,t){e._insertElement(t,Se.HTML),e.skipNextNewLine=!0,e.tokenizer.state=zt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=ee.TEXT}function jL(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,zt.RAWTEXT)}function PL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,zt.RAWTEXT)}function w2(e,t){e._switchToTextParsing(t,zt.RAWTEXT)}function BL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===ee.IN_TABLE||e.insertionMode===ee.IN_CAPTION||e.insertionMode===ee.IN_TABLE_BODY||e.insertionMode===ee.IN_ROW||e.insertionMode===ee.IN_CELL?ee.IN_SELECT_IN_TABLE:ee.IN_SELECT}function UL(e,t){e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML)}function zL(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Se.HTML)}function HL(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(w.RTC),e._insertElement(t,Se.HTML)}function FL(e,t){e._reconstructActiveFormattingElements(),sS(t),_p(t),t.selfClosing?e._appendElement(t,Se.MATHML):e._insertElement(t,Se.MATHML),t.ackSelfClosing=!0}function VL(e,t){e._reconstructActiveFormattingElements(),oS(t),_p(t),t.selfClosing?e._appendElement(t,Se.SVG):e._insertElement(t,Se.SVG),t.ackSelfClosing=!0}function k2(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML)}function hn(e,t){switch(t.tagID){case w.I:case w.S:case w.B:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.SMALL:case w.STRIKE:case w.STRONG:{CL(e,t);break}case w.A:{AL(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{vL(e,t);break}case w.P:case w.DL:case w.OL:case w.UL:case w.DIV:case w.DIR:case w.NAV:case w.MAIN:case w.MENU:case w.ASIDE:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.DETAILS:case w.ADDRESS:case w.ARTICLE:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{yL(e,t);break}case w.LI:case w.DD:case w.DT:{SL(e,t);break}case w.BR:case w.IMG:case w.WBR:case w.AREA:case w.EMBED:case w.KEYGEN:{dS(e,t);break}case w.HR:{LL(e,t);break}case w.RB:case w.RTC:{zL(e,t);break}case w.RT:case w.RP:{HL(e,t);break}case w.PRE:case w.LISTING:{EL(e,t);break}case w.XMP:{jL(e,t);break}case w.SVG:{VL(e,t);break}case w.HTML:{gL(e,t);break}case w.BASE:case w.LINK:case w.META:case w.STYLE:case w.TITLE:case w.SCRIPT:case w.BGSOUND:case w.BASEFONT:case w.TEMPLATE:{ya(e,t);break}case w.BODY:{xL(e,t);break}case w.FORM:{TL(e,t);break}case w.NOBR:{NL(e,t);break}case w.MATH:{FL(e,t);break}case w.TABLE:{ML(e,t);break}case w.INPUT:{RL(e,t);break}case w.PARAM:case w.TRACK:case w.SOURCE:{DL(e,t);break}case w.IMAGE:{OL(e,t);break}case w.BUTTON:{kL(e,t);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{_L(e,t);break}case w.IFRAME:{PL(e,t);break}case w.SELECT:{BL(e,t);break}case w.OPTION:case w.OPTGROUP:{UL(e,t);break}case w.NOEMBED:case w.NOFRAMES:{w2(e,t);break}case w.FRAMESET:{bL(e,t);break}case w.TEXTAREA:{IL(e,t);break}case w.NOSCRIPT:{e.options.scriptingEnabled?w2(e,t):k2(e,t);break}case w.PLAINTEXT:{wL(e,t);break}case w.COL:case w.TH:case w.TD:case w.TR:case w.HEAD:case w.FRAME:case w.TBODY:case w.TFOOT:case w.THEAD:case w.CAPTION:case w.COLGROUP:break;default:k2(e,t)}}function qL(e,t){if(e.openElements.hasInScope(w.BODY)&&(e.insertionMode=ee.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function YL(e,t){e.openElements.hasInScope(w.BODY)&&(e.insertionMode=ee.AFTER_BODY,TS(e,t))}function GL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function XL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(w.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(w.FORM):n&&e.openElements.remove(n))}function KL(e){e.openElements.hasInButtonScope(w.P)||e._insertFakeElement(le.P,w.P),e._closePElement()}function QL(e){e.openElements.hasInListItemScope(w.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(w.LI),e.openElements.popUntilTagNamePopped(w.LI))}function $L(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function WL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ZL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function JL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(le.BR,w.BR),e.openElements.pop(),e.framesetOk=!1}function hS(e,t){const n=t.tagName,i=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const s=e.openElements.items[o],l=e.openElements.tagIDs[o];if(i===l&&(i!==w.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(s,l))break}}function Sd(e,t){switch(t.tagID){case w.A:case w.B:case w.I:case w.S:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.NOBR:case w.SMALL:case w.STRIKE:case w.STRONG:{Mp(e,t);break}case w.P:{KL(e);break}case w.DL:case w.UL:case w.OL:case w.DIR:case w.DIV:case w.NAV:case w.PRE:case w.MAIN:case w.MENU:case w.ASIDE:case w.BUTTON:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.ADDRESS:case w.ARTICLE:case w.DETAILS:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.LISTING:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{GL(e,t);break}case w.LI:{QL(e);break}case w.DD:case w.DT:{$L(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{WL(e);break}case w.BR:{JL(e);break}case w.BODY:{qL(e,t);break}case w.HTML:{YL(e,t);break}case w.FORM:{XL(e);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{ZL(e,t);break}case w.TEMPLATE:{Or(e,t);break}default:hS(e,t)}}function mS(e,t){e.tmplInsertionModeStack.length>0?ES(e,t):Rp(e,t)}function eO(e,t){var n;t.tagID===w.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function tO(e,t){e._err(t,pe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Cm(e,t){if(e.openElements.currentTagId!==void 0&&lS.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=ee.IN_TABLE_TEXT,t.type){case Je.CHARACTER:{gS(e,t);break}case Je.WHITESPACE_CHARACTER:{pS(e,t);break}}else Pl(e,t)}function nO(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_CAPTION}function aO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_COLUMN_GROUP}function iO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(le.COLGROUP,w.COLGROUP),e.insertionMode=ee.IN_COLUMN_GROUP,Dp(e,t)}function rO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_TABLE_BODY}function sO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(le.TBODY,w.TBODY),e.insertionMode=ee.IN_TABLE_BODY,wd(e,t)}function oO(e,t){e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function lO(e,t){fS(t)?e._appendElement(t,Se.HTML):Pl(e,t),t.ackSelfClosing=!0}function uO(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Se.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Is(e,t){switch(t.tagID){case w.TD:case w.TH:case w.TR:{sO(e,t);break}case w.STYLE:case w.SCRIPT:case w.TEMPLATE:{ya(e,t);break}case w.COL:{iO(e,t);break}case w.FORM:{uO(e,t);break}case w.TABLE:{oO(e,t);break}case w.TBODY:case w.TFOOT:case w.THEAD:{rO(e,t);break}case w.INPUT:{lO(e,t);break}case w.CAPTION:{nO(e,t);break}case w.COLGROUP:{aO(e,t);break}default:Pl(e,t)}}function kl(e,t){switch(t.tagID){case w.TABLE:{e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode());break}case w.TEMPLATE:{Or(e,t);break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:Pl(e,t)}}function Pl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Td(e,t),e.fosterParentingEnabled=n}function pS(e,t){e.pendingCharacterTokens.push(t)}function gS(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Wo(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Pl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const xS=new Set([w.CAPTION,w.COL,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]);function cO(e,t){const n=t.tagID;xS.has(n)?e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_TABLE,Is(e,t)):hn(e,t)}function dO(e,t){const n=t.tagID;switch(n){case w.CAPTION:case w.TABLE:{e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_TABLE,n===w.TABLE&&kl(e,t));break}case w.BODY:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:Sd(e,t)}}function Dp(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.COL:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case w.TEMPLATE:{ya(e,t);break}default:Qc(e,t)}}function fO(e,t){switch(t.tagID){case w.COLGROUP:{e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=ee.IN_TABLE);break}case w.TEMPLATE:{Or(e,t);break}case w.COL:break;default:Qc(e,t)}}function Qc(e,t){e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=ee.IN_TABLE,e._processToken(t))}function wd(e,t){switch(t.tagID){case w.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_ROW;break}case w.TH:case w.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(le.TR,w.TR),e.insertionMode=ee.IN_ROW,kd(e,t);break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE,Is(e,t));break}default:Is(e,t)}}function C0(e,t){const n=t.tagID;switch(t.tagID){case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE);break}case w.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE,kl(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:case w.TR:break;default:kl(e,t)}}function kd(e,t){switch(t.tagID){case w.TH:case w.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Se.HTML),e.insertionMode=ee.IN_CELL,e.activeFormattingElements.insertMarker();break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,wd(e,t));break}default:Is(e,t)}}function bS(e,t){switch(t.tagID){case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY);break}case w.TABLE:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,C0(e,t));break}case w.TBODY:case w.TFOOT:case w.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(w.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,C0(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:break;default:kl(e,t)}}function hO(e,t){const n=t.tagID;xS.has(n)?(e.openElements.hasInTableScope(w.TD)||e.openElements.hasInTableScope(w.TH))&&(e._closeTableCell(),kd(e,t)):hn(e,t)}function mO(e,t){const n=t.tagID;switch(n){case w.TD:case w.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_ROW);break}case w.TABLE:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),bS(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:break;default:Sd(e,t)}}function yS(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._insertElement(t,Se.HTML);break}case w.OPTGROUP:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Se.HTML);break}case w.HR:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case w.INPUT:case w.KEYGEN:case w.TEXTAREA:case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),t.tagID!==w.SELECT&&e._processStartTag(t));break}case w.SCRIPT:case w.TEMPLATE:{ya(e,t);break}}}function vS(e,t){switch(t.tagID){case w.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===w.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===w.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop();break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop();break}case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode());break}case w.TEMPLATE:{Or(e,t);break}}}function pO(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e._processStartTag(t)):yS(e,t)}function gO(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e.onEndTag(t)):vS(e,t)}function xO(e,t){switch(t.tagID){case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{ya(e,t);break}case w.CAPTION:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.tmplInsertionModeStack[0]=ee.IN_TABLE,e.insertionMode=ee.IN_TABLE,Is(e,t);break}case w.COL:{e.tmplInsertionModeStack[0]=ee.IN_COLUMN_GROUP,e.insertionMode=ee.IN_COLUMN_GROUP,Dp(e,t);break}case w.TR:{e.tmplInsertionModeStack[0]=ee.IN_TABLE_BODY,e.insertionMode=ee.IN_TABLE_BODY,wd(e,t);break}case w.TD:case w.TH:{e.tmplInsertionModeStack[0]=ee.IN_ROW,e.insertionMode=ee.IN_ROW,kd(e,t);break}default:e.tmplInsertionModeStack[0]=ee.IN_BODY,e.insertionMode=ee.IN_BODY,hn(e,t)}}function bO(e,t){t.tagID===w.TEMPLATE&&Or(e,t)}function ES(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Rp(e,t)}function yO(e,t){t.tagID===w.HTML?hn(e,t):$c(e,t)}function TS(e,t){var n;if(t.tagID===w.HTML){if(e.fragmentContext||(e.insertionMode=ee.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===w.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else $c(e,t)}function $c(e,t){e.insertionMode=ee.IN_BODY,Td(e,t)}function vO(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.FRAMESET:{e._insertElement(t,Se.HTML);break}case w.FRAME:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case w.NOFRAMES:{ya(e,t);break}}}function EO(e,t){t.tagID===w.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==w.FRAMESET&&(e.insertionMode=ee.AFTER_FRAMESET))}function TO(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.NOFRAMES:{ya(e,t);break}}}function SO(e,t){t.tagID===w.HTML&&(e.insertionMode=ee.AFTER_AFTER_FRAMESET)}function wO(e,t){t.tagID===w.HTML?hn(e,t):Mc(e,t)}function Mc(e,t){e.insertionMode=ee.IN_BODY,Td(e,t)}function kO(e,t){switch(t.tagID){case w.HTML:{hn(e,t);break}case w.NOFRAMES:{ya(e,t);break}}}function AO(e,t){t.chars=Mt,e._insertCharacters(t)}function CO(e,t){e._insertCharacters(t),e.framesetOk=!1}function SS(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Se.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function NO(e,t){if(V8(t))SS(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Se.MATHML?sS(t):i===Se.SVG&&(q8(t),oS(t)),_p(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function _O(e,t){if(t.tagID===w.P||t.tagID===w.BR){SS(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Se.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(i);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}le.AREA,le.BASE,le.BASEFONT,le.BGSOUND,le.BR,le.COL,le.EMBED,le.FRAME,le.HR,le.IMG,le.INPUT,le.KEYGEN,le.LINK,le.META,le.PARAM,le.SOURCE,le.TRACK,le.WBR;const MO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,RO=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),A2={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function wS(e,t){const n=HO(e),i=AT("type",{handlers:{root:DO,element:LO,text:OO,comment:AS,doctype:IO,raw:PO},unknown:BO}),o={parser:n?new S2(A2):S2.getFragmentParser(void 0,A2),handle(c){i(c,o)},stitches:!1,options:t||{}};i(e,o),Vs(o,Da());const s=n?o.parser.document:o.parser.getFragment(),l=FD(s,{file:o.options.file});return o.stitches&&Ed(l,"comment",function(c,d,h){const m=c;if(m.value.stitch&&h&&d!==void 0){const g=h.children;return g[d]=m.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function kS(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function DO(e,t){kS(e.children,t)}function LO(e,t){UO(e,t),kS(e.children,t),zO(e,t)}function OO(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Je.CHARACTER,chars:e.value,location:Bl(e)};Vs(t,Da(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function IO(e,t){const n={type:Je.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Bl(e)};Vs(t,Da(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function jO(e,t){t.stitches=!0;const n=FO(e);if("children"in e&&"children"in n){const i=wS({type:"root",children:e.children},t.options);n.children=i.children}AS({type:"comment",value:{stitch:n}},t)}function AS(e,t){const n=e.value,i={type:Je.COMMENT,data:n,location:Bl(e)};Vs(t,Da(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function PO(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,CS(t,Da(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(MO,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function BO(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))jO(n,t);else{let i="";throw RO.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function Vs(e,t){CS(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=zt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function CS(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function UO(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===zt.PLAINTEXT)return;Vs(t,Da(e));const i=t.parser.openElements.current;let o="namespaceURI"in i?i.namespaceURI:Er.html;o===Er.html&&n==="svg"&&(o=Er.svg);const s=XD({...e,children:[]},{space:o===Er.svg?"svg":"html"}),l={type:Je.START_TAG,tagName:n,tagID:Fs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Bl(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function zO(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&t8.includes(n)||t.parser.tokenizer.state===zt.PLAINTEXT)return;Vs(t,pd(e));const i={type:Je.END_TAG,tagName:n,tagID:Fs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Bl(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===zt.RCDATA||t.parser.tokenizer.state===zt.RAWTEXT||t.parser.tokenizer.state===zt.SCRIPT_DATA)&&(t.parser.tokenizer.state=zt.DATA)}function HO(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Bl(e){const t=Da(e)||{line:void 0,column:void 0,offset:void 0},n=pd(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function FO(e){return"children"in e?Dr({...e,children:[]}):Dr(e)}function NS(e){return function(t,n){return wS(t,{...e,file:n})}}const pr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ml={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...pr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...pr],h2:[["className","sr-only"]],img:[...pr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...pr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...pr],table:[...pr],ul:[...pr,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ji={}.hasOwnProperty;function VO(e,t){let n={type:"root",children:[]};const i={schema:t?{...ml,...t}:ml,stack:[]},o=_S(i,e);return o&&(Array.isArray(o)?o.length===1?n=o[0]:n.children=o:n=o),n}function _S(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return qO(e,n);case"doctype":return YO(e,n);case"element":return GO(e,n);case"root":return XO(e,n);case"text":return KO(e,n)}}}function qO(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",i=n.indexOf("-->"),s={type:"comment",value:i<0?n:n.slice(0,i)};return Ul(s,t),s}}function YO(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Ul(n,t),n}}function GO(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const i=MS(e,t.children),o=QO(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&ji.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(s=!1;++d<c.length;)e.stack.includes(c[d])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?i:void 0;const l={type:"element",tagName:n,properties:o,children:i};return Ul(l,t),l}function XO(e,t){const i={type:"root",children:MS(e,t.children)};return Ul(i,t),i}function KO(e,t){const i={type:"text",value:typeof t.value=="string"?t.value:""};return Ul(i,t),i}function MS(e,t){const n=[];if(Array.isArray(t)){const i=t;let o=-1;for(;++o<i.length;){const s=_S(e,i[o]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function QO(e,t){const n=e.stack[e.stack.length-1],i=e.schema.attributes,o=e.schema.required,s=i&&ji.call(i,n)?i[n]:void 0,l=i&&ji.call(i,"*")?i["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let h;for(h in c)if(ji.call(c,h)){const m=c[h];let g=C2(e,N2(s,h),h,m);g==null&&(g=C2(e,N2(l,h),h,m)),g!=null&&(d[h]=g)}if(o&&ji.call(o,n)){const m=o[n];for(h in m)ji.call(m,h)&&!ji.call(d,h)&&(d[h]=m[h])}return d}function C2(e,t,n,i){return t?Array.isArray(i)?$O(e,t,n,i):RS(e,t,n,i):void 0}function $O(e,t,n,i){let o=-1;const s=[];for(;++o<i.length;){const l=RS(e,t,n,i[o]);(typeof l=="number"||typeof l=="string")&&s.push(l)}return s}function RS(e,t,n,i){if(!(typeof i!="boolean"&&typeof i!="number"&&typeof i!="string")&&WO(e,n,i)){if(typeof t=="object"&&t.length>1){let o=!1,s=0;for(;++s<t.length;){const l=t[s];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(i))){o=!0;break}}else if(l===i){o=!0;break}}if(!o)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+i:i}}function WO(e,t,n){const i=e.schema.protocols&&ji.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!i||i.length===0)return!0;const o=String(n),s=o.indexOf(":"),l=o.indexOf("?"),c=o.indexOf("#"),d=o.indexOf("/");if(s<0||d>-1&&s>d||l>-1&&s>l||c>-1&&s>c)return!0;let h=-1;for(;++h<i.length;){const m=i[h];if(s===m.length&&o.slice(0,m.length)===m)return!0}return!1}function Ul(e,t){const n=XE(t);t.data&&(e.data=Dr(t.data)),n&&(e.position=n)}function N2(e,t){let n,i=-1;if(e)for(;++i<e.length;){const o=e[i],s=typeof o=="string"?o:o[0];if(s===t)return o;s==="data*"&&(n=o)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function DS(e){return function(t){return VO(t,e)}}var cE;const LS={...ml,protocols:{...ml.protocols,src:[...((cE=ml.protocols)==null?void 0:cE.src)??["http","https","mailto"],"data"]}};function ZO({retry:e}){const t=He();return x.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[x.jsx(ri,{className:"w-4 h-4 shrink-0 mt-0.5"}),x.jsxs("span",{children:[t("error.renderFailed")," ",x.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class JO extends R.Component{constructor(){super(...arguments);qh(this,"state",{error:null});qh(this,"retry",()=>this.setState({error:null}))}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary caught]",n,i.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.retry):x.jsx(ZO,{error:this.state.error,retry:this.retry}):this.props.children}}function eI({nodeId:e,onRated:t}){const n=He(),[i,o]=R.useState(!1),[s,l]=R.useState(!1),c=async d=>{if(!(i||s)){o(!0);try{await be.recordReview(e,d),l(!0),t==null||t(),Ar(d>=4?"correct":"wrong")}catch{}finally{o(!1)}}};return s?x.jsx("div",{className:"text-center text-body text-brand py-2","data-testid":"self-rated",children:n("review.selfrated")}):x.jsxs("div",{className:"border-t border-[var(--border-faint)] pt-3 mt-3","data-testid":"self-rating",children:[x.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2 text-center",children:n("review.selfrate.title")}),x.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[x.jsxs("button",{onClick:()=>c(1),disabled:i,"data-testid":"rate-again",className:"py-2 rounded-lg border border-warning/40 text-warning hover:bg-warning/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[x.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.again")}),x.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.again.hint")})]}),x.jsxs("button",{onClick:()=>c(4),disabled:i,"data-testid":"rate-remembered",className:"py-2 rounded-lg border border-accent/40 text-accent hover:bg-accent/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[x.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.remembered")}),x.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.remembered.hint")})]}),x.jsxs("button",{onClick:()=>c(5),disabled:i,"data-testid":"rate-mastered",className:"py-2 rounded-lg border border-brand/40 text-brand hover:bg-brand/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[x.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.mastered")}),x.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.mastered.hint")})]})]})]})}function Wc(e){const t=[];let n="";const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(s){const l=s.parentElement;if(!l)return NodeFilter.FILTER_REJECT;const c=l.tagName;return c==="SCRIPT"||c==="STYLE"||l.closest("mark.lookatstudy-underline")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let o;for(;o=i.nextNode();){const s=o,l=s.textContent??"",c=n.length;n+=l,t.push({node:s,start:c,end:n.length})}return{text:n,nodes:t}}function OS(e,t){const n=_2(e.startContainer,e.startOffset,t,"start"),i=_2(e.endContainer,e.endOffset,t,"end");return n==null||i==null||i<=n?null:{start:n,end:i}}function _2(e,t,n,i){var o,s,l;if(e.nodeType===Node.TEXT_NODE){for(const c of n.nodes)if(c.node===e)return c.start+Math.min(t,((o=c.node.textContent)==null?void 0:o.length)??0);return i==="start"?((s=n.nodes[0])==null?void 0:s.start)??null:((l=n.nodes[n.nodes.length-1])==null?void 0:l.end)??null}if(e instanceof Element){const c=Array.from(e.childNodes);if(i==="end"){for(let h=t;h<c.length;h++){const m=IS(c[h],n);if(m!=null)return m}const d=n.nodes[n.nodes.length-1];return d?d.end:null}else{for(let h=t;h>=0;h--){const m=jS(c[h],n);if(m!=null)return m}const d=n.nodes[0];return d?d.start:null}}return null}function IS(e,t){if(e.nodeType===Node.TEXT_NODE){for(const n of t.nodes)if(n.node===e)return n.start;return null}if(e instanceof Element)for(const n of e.childNodes){const i=IS(n,t);if(i!=null)return i}return null}function jS(e,t){if(e.nodeType===Node.TEXT_NODE){for(const n of t.nodes)if(n.node===e)return n.end;return null}if(e instanceof Element){let n=null;for(const i of e.childNodes){const o=jS(i,t);o!=null&&(n=o)}return n}return null}function tI(e,t,n){var c,d,h,m;if(n<=t)return null;let i=null,o=0,s=null,l=0;for(const g of e.nodes)if(!i&&t>=g.start&&t<g.end&&(i=g.node,o=t-g.start),!s&&n>g.start&&n<=g.end&&(s=g.node,l=n-g.start),i&&s)break;if(!i&&e.nodes.length>0){const g=e.nodes[e.nodes.length-1];i=g.node,o=((c=g.node.textContent)==null?void 0:c.length)??0}if(!s&&e.nodes.length>0){const g=e.nodes[e.nodes.length-1];s=g.node,l=((d=g.node.textContent)==null?void 0:d.length)??0}if(!i||!s)return null;try{const g=document.createRange();return g.setStart(i,Math.min(o,((h=i.textContent)==null?void 0:h.length)??0)),g.setEnd(s,Math.min(l,((m=s.textContent)==null?void 0:m.length)??0)),g}catch{return null}}function PS(e,t){e.querySelectorAll("mark.lookatstudy-underline").forEach(s=>{const l=s.parentNode;if(l){for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}),e.normalize();const n=new Map;if(t.length===0)return n;const i=Wc(e),o=[];for(const s of t){const l=nI(i.text,s.text,s.surrounding);l>=0&&o.push({noteId:s.noteId,start:l,end:l+s.text.length})}o.sort((s,l)=>l.start-s.start);for(const s of o){const l=tI(i,s.start,s.end);if(!l)continue;const c=aI(l,s.noteId);c&&n.set(s.noteId,c)}return n}function nI(e,t,n){if(!t)return-1;let i=e.indexOf(t);if(i<0){const o=t.replace(/\s+/g," ").trim();if(i=e.replace(/\s+/g," ").indexOf(o),i<0)return-1;const l=t.slice(0,Math.min(15,t.length));return e.indexOf(l)}if(n&&n.length>5){const o=e.indexOf(n.slice(0,20));if(o>=0){let s=i,l=Math.abs(i-o),c=i+1;for(;;){const d=e.indexOf(t,c);if(d<0)break;const h=Math.abs(d-o);h<l&&(s=d,l=h),c=d+1}return s}}return i}function aI(e,t){var i;const n="color: inherit; background: transparent; border-bottom: 2px solid rgb(34, 197, 94); padding-bottom: 1px;";if(e.startContainer===e.endContainer&&e.startContainer.nodeType===Node.TEXT_NODE)try{const o=document.createElement("mark");return o.className="lookatstudy-underline",o.dataset.noteId=t,o.style.cssText=n,e.surroundContents(o),o}catch{}try{const o=[],s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode(d){return e.intersectsNode(d)&&(d===e.startContainer||d===e.endContainer||e.intersectsNode(d))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let l;for(;l=s.nextNode();)o.push(l);if(o.length===0)return null;let c=null;for(const d of o){let h=d;if(d===e.startContainer&&e.startOffset>0&&(h=d.splitText(e.startOffset)),d===e.endContainer||h===e.endContainer){const g=h===e.endContainer?e.endOffset:e.endOffset-(d===e.startContainer?e.startOffset:0);g<h.textContent.length&&h.splitText(g)}if(!h.textContent)continue;const m=document.createElement("mark");m.className="lookatstudy-underline",m.dataset.noteId=t,m.style.cssText=n,(i=h.parentNode)==null||i.insertBefore(m,h),m.appendChild(h),c||(c=m)}return c}catch{return null}}function BS(e){e.scrollIntoView({behavior:"smooth",block:"center"}),e.style.transition="background 0.3s, border-bottom-color 0.3s, border-bottom-width 0.3s",e.style.background="rgba(250, 204, 21, 0.35)",e.style.borderBottom="4px solid rgb(34, 197, 94)",setTimeout(()=>{e.style.color="inherit",e.style.background="transparent",e.style.borderBottom="2px solid rgb(34, 197, 94)"},1500)}function US(e,t,n){const o=e.top+e.height/2;return e.right+8+n<=t?{left:e.right+8,top:o,transform:"translate(0, -50%)"}:e.left-8-n>=0?{left:e.left-8,top:o,transform:"translate(-100%, -50%)"}:{left:e.left,top:e.bottom+8,transform:"translate(0, 0)"}}function Ad({title:e,onClose:t,children:n}){const i=He(),o=R.useRef(null);return Bs(o,!0),R.useEffect(()=>{const s=l=>{l.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t]),up.createPortal(x.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/80","data-testid":"diagram-viewer-modal","data-noswipe":"",role:"dialog","aria-modal":"true","aria-label":e,children:[x.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:s=>s.stopPropagation(),children:[x.jsx("h3",{className:"text-body font-bold text-white truncate",children:e}),x.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[x.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:i("artifact.viewer.hint")}),x.jsx("button",{onClick:t,"data-testid":"diagram-viewer-close","aria-label":i("action.close"),"data-tooltip":i("action.close"),className:"text-white/70 hover:text-white w-9 h-9 flex items-center justify-center rounded-lg hover:bg-white/10 transition-colors",children:x.jsx(la,{className:"w-5 h-5"})})]})]}),x.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:t,children:x.jsx("div",{ref:o,className:"h-full w-full",onClick:s=>s.stopPropagation(),children:n})})]}),document.body)}function iI(e,t,n,i,o=24){if(e<=0||t<=0||n<=0||i<=0)return 1;const s=Math.min((n-o*2)/e,(i-o*2)/t,1);return Math.max(.02,s)}function rI(e,t,n,i,o=24){const s=iI(e,t,n,i,o);return{scale:s,x:(n-e*s)/2,y:(i-t*s)/2}}function sI(e,t,n,i){return{scale:e.scale*t,x:n-(n-e.x)*t,y:i-(i-e.y)*t}}function nl(e,t,n,i,o,s=64){const l=t*e.scale,c=n*e.scale;let{x:d,y:h}=e;return l<=i?d=(i-l)/2:d=Math.min(Math.max(d,i-l-s),s),c<=o?h=(o-c)/2:h=Math.min(Math.max(h,o-c-s),s),{x:d,y:h,scale:e.scale}}function oI(e,t,n,i,o){const s=e.scale*t,l=Math.min(Math.max(s,o.min),o.max)/e.scale;return l===1?e:nl(sI(e,l,n,i),o.contentW,o.contentH,o.viewW,o.viewH)}const M2=.05,R2=4,pc=1.25;function zl({children:e,grid:t=!0,testid:n}){const i=He(),o=R.useRef(null),s=R.useRef(null),[l,c]=R.useState({x:0,y:0,scale:1}),[d,h]=R.useState(null),[m,g]=R.useState(!1),b=R.useRef("mouse"),p=R.useRef(!0),y=R.useRef({pointers:new Map,pinchBase:null,lastMid:null,panning:!1,moved:!1}),E=R.useRef(null),T=R.useCallback(()=>{const _=o.current,j=s.current;return{min:M2,max:R2,contentW:(j==null?void 0:j.offsetWidth)??0,contentH:(j==null?void 0:j.offsetHeight)??0,viewW:(_==null?void 0:_.clientWidth)??0,viewH:(_==null?void 0:_.clientHeight)??0}},[]),k=R.useCallback(()=>{const _=T();!_.contentW||!_.viewW||(c(rI(_.contentW,_.contentH,_.viewW,_.viewH)),p.current=!0)},[T]);R.useEffect(()=>{const _=o.current,j=s.current;if(!_||!j)return;const D=()=>{h({w:j.offsetWidth,h:j.offsetHeight}),k()};D();const P=new ResizeObserver(D);return P.observe(j),P.observe(_),()=>P.disconnect()},[k]);const M=R.useCallback((_,j,D)=>{const P=T(),U=j??P.viewW/2,J=D??P.viewH/2;c(q=>oI(q,_,U,J,P)),p.current=!1},[T]),N=R.useCallback(_=>{var P,U;if((U=(P=_.target).closest)!=null&&U.call(P,"[data-testid=canvas-zoom-controls]"))return;const j=_.currentTarget;try{j.setPointerCapture(_.pointerId)}catch{}const D=y.current;if(b.current=_.pointerType,D.pointers.size===0&&g(!0),D.pointers.set(_.pointerId,{x:_.clientX,y:_.clientY}),D.pointers.size===2){const[J,q]=[...D.pointers.values()];D.pinchBase={dist:Math.hypot(J.x-q.x,J.y-q.y),factorAcc:1},D.lastMid={x:(J.x+q.x)/2,y:(J.y+q.y)/2},D.panning=!1}else D.pointers.size===1&&(D.panning=!0,D.moved=!1,D.lastMid={x:_.clientX,y:_.clientY})},[]),O=R.useCallback(_=>{const j=y.current;if(!j.pointers.has(_.pointerId))return;j.pointers.set(_.pointerId,{x:_.clientX,y:_.clientY});const D=o.current;if(!D)return;const P=D.getBoundingClientRect();if(j.pointers.size>=2&&j.pinchBase){const[U,J]=[...j.pointers.values()],q=Math.hypot(U.x-J.x,U.y-J.y),z={x:(U.x+J.x)/2,y:(U.y+J.y)/2};if(j.pinchBase.dist>0){const H=q/j.pinchBase.dist/j.pinchBase.factorAcc;j.pinchBase.factorAcc*=H,M(H,z.x-P.left,z.y-P.top)}if(j.lastMid){const H=z.x-j.lastMid.x,X=z.y-j.lastMid.y,Z=T();c(ie=>nl({...ie,x:ie.x+H,y:ie.y+X},Z.contentW,Z.contentH,Z.viewW,Z.viewH))}j.lastMid=z;return}if(j.panning&&j.lastMid){const U=_.clientX-j.lastMid.x,J=_.clientY-j.lastMid.y;Math.abs(U)+Math.abs(J)>2&&(j.moved=!0);const q=T();c(z=>nl({...z,x:z.x+U,y:z.y+J},q.contentW,q.contentH,q.viewW,q.viewH)),j.lastMid={x:_.clientX,y:_.clientY}}},[T,M]),A=R.useCallback(_=>{const j=y.current,D=j.pointers.size===1;if(j.pointers.delete(_.pointerId),j.pointers.size<2&&(j.pinchBase=null),j.pointers.size===0){if(j.panning=!1,j.lastMid=null,g(!1),D&&!j.moved&&_.pointerType!=="mouse"){const P=performance.now(),U=E.current;if(U&&P-U.t<320&&Math.hypot(_.clientX-U.x,_.clientY-U.y)<32){const J=T();p.current?(c(nl({x:(J.viewW-J.contentW)/2,y:Math.max(24,(J.viewH-J.contentH)/2),scale:1},J.contentW,J.contentH,J.viewW,J.viewH)),p.current=!1):k(),E.current=null}else E.current={t:P,x:_.clientX,y:_.clientY}}}else if(j.pointers.size===1){const P=[...j.pointers.values()][0];j.lastMid={x:P.x,y:P.y},j.panning=!0}},[T,k]),C=R.useCallback(_=>{var D;_.preventDefault();const j=(D=o.current)==null?void 0:D.getBoundingClientRect();j&&M(_.deltaY<0?pc:1/pc,_.clientX-j.left,_.clientY-j.top)},[M]),L=R.useCallback(()=>{if(b.current!=="mouse")return;const _=T();p.current?(c(nl({x:(_.viewW-_.contentW)/2,y:Math.max(24,(_.viewH-_.contentH)/2),scale:1},_.contentW,_.contentH,_.viewW,_.viewH)),p.current=!1):k()},[T,k]);return x.jsxs("div",{ref:o,"data-testid":n,"data-noswipe":"",className:`relative h-full w-full overflow-hidden select-none touch-none ${t?"canvas-grid":""}`,style:{touchAction:"none"},onPointerDown:N,onPointerMove:O,onPointerUp:A,onPointerCancel:A,onWheel:C,onDoubleClick:L,children:[x.jsx("div",{ref:s,className:`absolute top-0 left-0 canvas-stage-gesture ${m?"":"motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out"}`,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`,transformOrigin:"0 0"},children:e}),x.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-0.5 p-1 rounded-xl bg-surface-0/90 backdrop-blur border border-[var(--border)] shadow-elevated","data-testid":"canvas-zoom-controls",children:[x.jsx("button",{onClick:()=>M(1/pc),disabled:l.scale<=M2+1e-6,"aria-label":i("artifact.zoomOut"),"data-tooltip":i("artifact.zoomOut"),"data-testid":"canvas-zoom-out",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong disabled:opacity-30 disabled:pointer-events-none transition-colors",children:x.jsx(kC,{className:"w-4 h-4"})}),x.jsxs("span",{className:"text-label font-bold tabular-nums text-ink-muted min-w-[3.25rem] text-center select-none","data-testid":"canvas-zoom-pct",children:[Math.round(l.scale*100),"%"]}),x.jsx("button",{onClick:()=>M(pc),disabled:l.scale>=R2-1e-6,"aria-label":i("artifact.zoomIn"),"data-tooltip":i("artifact.zoomIn"),"data-testid":"canvas-zoom-in",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong disabled:opacity-30 disabled:pointer-events-none transition-colors",children:x.jsx(ud,{className:"w-4 h-4"})}),x.jsx("button",{onClick:k,"aria-label":i("artifact.canvas.fit"),"data-tooltip":i("artifact.canvas.fit"),"data-testid":"canvas-zoom-fit",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong transition-colors",children:x.jsx(Dl,{className:"w-4 h-4"})})]}),x.jsx("span",{"data-testid":"canvas-natural-size",className:"hidden",children:d?`${d.w}x${d.h}`:""})]})}function ga(e,t=13){let n=0;for(const i of e)n+=/[\u2e80-\u9fff\uf900-\ufaff\uff00-\uffef\u3000-\u303f]/.test(i)?t:t*.58;return n}const Es=118;function lI(e){if(ga(e)<=Es)return[e];const t=[];for(let d=0;d<e.length;d++)/[\s/\-—·]/.test(e[d]??"")&&t.push(d);const n=e.length/2;let i=-1,o=1/0;for(const d of t){const h=Math.abs(d+1-n);h<o&&(o=h,i=d)}let s,l;if(i>=0)s=e.slice(0,i+1).trim(),l=e.slice(i+1).trim();else{let d=0,h=0;for(const m of e)if(d+=ga(m),h++,d>=ga(e)/2)break;s=e.slice(0,h),l=e.slice(h)}if(ga(s)<=Es&&ga(l)<=Es)return[s,l];const c=d=>{let h="";for(const m of d){if(ga(h+m+"…")>Es)break;h+=m}return h+"…"};return[ga(s)>Es?c(s):s,ga(l)>Es?c(l):l]}function uI(e,t){const n=lI(e),i=t?14:13,o=Math.max(...n.map(d=>ga(d,i))),s=t?32:24,l=17,c=t?20:16;return{width:Math.min(t?196:170,Math.max(t?92:76,o+s)),height:c+n.length*l,lines:n,hub:t}}const cI=28,dI=52,D2=34;function zS(e,t){var U,J,q;const n=e.map(z=>z.id),i=new Set(n),o=new Map;for(const z of e)o.set(z.id,new Set);const s=new Set,l=[];for(const z of t){if(!i.has(z.from)||!i.has(z.to)||z.from===z.to)continue;l.push(z);const H=[z.from,z.to].sort().join("→");s.has(H)||(s.add(H),o.get(z.from).add(z.to),o.get(z.to).add(z.from))}const c=z=>{var H;return((H=o.get(z))==null?void 0:H.size)??0};let d=((U=e[0])==null?void 0:U.id)??"";for(const z of e)c(z.id)>c(d)&&(d=z.id);const h=new Map(n.map((z,H)=>[z,H])),m=new Map,g=new Map;for(const z of e)g.set(z.id,[]);const b=new Map;if(d){b.set(d,0);const z=[d];for(;z.length;){const H=z.shift();for(const X of[...o.get(H)??[]].sort((Z,ie)=>(h.get(Z)??0)-(h.get(ie)??0)))b.has(X)||(b.set(X,(b.get(H)??0)+1),m.set(X,H),g.get(H).push(X),z.push(X))}}let p=0;for(const z of b.values())p=Math.max(p,z);const y=e.filter(z=>!b.has(z.id)).map(z=>z.id);for(const z of y)b.set(z,p+1),m.set(z,d),g.get(d).push(z);for(const z of b.values())p=Math.max(p,z);const E=new Map,T=z=>{const H=E.get(z);if(H!=null)return H;const X=g.get(z)??[],Z=X.length===0?1:X.reduce((ie,V)=>ie+T(V),0);return E.set(z,Z),Z};d&&T(d);const k=new Map,M=(z,H,X)=>{const Z=g.get(z)??[];if(Z.length===0)return;const ie=Z.reduce((Y,G)=>Y+(E.get(G)??1),0);let V=H;for(const Y of Z){const G=(E.get(Y)??1)/ie*X;k.set(Y,V+G/2),M(Y,V,G),V+=G}};d&&M(d,-Math.PI/2,Math.PI*2);const N=new Map;for(const z of e)N.set(z.id,uI(z.label,z.id===d||c(z.id)>=4));const O=new Map;for(const z of e){const H=b.get(z.id)??0;O.has(H)||O.set(H,[]),O.get(H).push(z.id)}const A=new Map;A.set(0,0);for(let z=1;z<=p;z++){const H=O.get(z)??[];if(H.length===0){A.set(z,A.get(z-1)??0);continue}const Z=H.reduce((K,$)=>{var se;return K+(((se=N.get($))==null?void 0:se.width)??0)+D2},0)/(Math.PI*2),ie=H.map(K=>({id:K,a:k.get(K)??0})).sort((K,$)=>K.a-$.a);let V=0;if(ie.length>1)for(let K=0;K<ie.length;K++){const $=ie[K],se=ie[(K+1)%ie.length];let de=se.a-$.a;if(K===ie.length-1&&(de+=Math.PI*2),de<=.01)continue;const Ce=((((J=N.get($.id))==null?void 0:J.width)??0)+(((q=N.get(se.id))==null?void 0:q.width)??0))/2+D2;V=Math.max(V,Ce/(2*Math.sin(Math.min(Math.PI,de)/2)))}const Y=A.get(z-1)??0,G=Math.max(...(O.get(z-1)??[]).map(K=>{var $;return((($=N.get(K))==null?void 0:$.height)??0)/2}),0),B=Math.max(...H.map(K=>{var $;return((($=N.get(K))==null?void 0:$.height)??0)/2})),ne=H.length===1?60:0;A.set(z,Math.max(Y+G+B+dI,Z,V+ne))}const C=new Map;for(const z of e){const H=b.get(z.id)??0,X=A.get(H)??0,Z=H===0?0:k.get(z.id)??0;C.set(z.id,{id:z.id,center:{x:X*Math.cos(Z),y:X*Math.sin(Z)},box:N.get(z.id),degree:c(z.id),depth:H})}let L=0;for(const z of C.values())L=Math.max(L,Math.abs(z.center.x)+z.box.width/2,Math.abs(z.center.y)+z.box.height/2);const _=Math.ceil(2*(L+cI)),j=_/2;for(const z of C.values())z.center={x:z.center.x+j,y:z.center.y+j};const D=[],P=[];for(const z of l){const H=C.get(z.from),X=C.get(z.to);if(!H||!X)continue;const Z=L2(H,X.center),ie=L2(X,H.center),V={x:(Z.x+ie.x)/2,y:(Z.y+ie.y)/2},Y=ie.x-Z.x,G=ie.y-Z.y,B=Math.hypot(Y,G)||1,ne=Math.min(34,Math.max(10,B*.16)),K={x:V.x+G/B*ne,y:V.y-Y/B*ne};let $={x:(Z.x+2*K.x+ie.x)/4,y:(Z.y+2*K.y+ie.y)/4};if(z.label){const se=ga(z.label,12)+14;for(const de of P)if(Math.hypot($.x-de.pt.x,$.y-de.pt.y)<(se+de.w)/2+6){$={x:$.x+G/B*22,y:$.y-Y/B*22};break}P.push({pt:$,w:se})}D.push({edge:z,d:`M ${Z.x.toFixed(1)} ${Z.y.toFixed(1)} Q ${K.x.toFixed(1)} ${K.y.toFixed(1)} ${ie.x.toFixed(1)} ${ie.y.toFixed(1)}`,labelPt:$})}return{nodes:C,edges:D,rootId:d,width:Math.ceil(_),height:Math.ceil(_)}}function L2(e,t){const n=t.x-e.center.x,i=t.y-e.center.y,o=e.box.width/2+3,s=e.box.height/2+3;if(n===0&&i===0)return{x:e.center.x,y:e.center.y-s};const l=n===0?1/0:o/Math.abs(n),c=i===0?1/0:s/Math.abs(i),d=Math.min(l,c);return{x:e.center.x+n*d,y:e.center.y+i*d}}function fI(e){return{width:ga(e,12)+16,height:19}}const gc=.4,Nm=2.5,xc=.2;function O2({data:e}){const t=R.useMemo(()=>zS(e.nodes,e.edges),[e.nodes,e.edges]);return x.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[x.jsx("defs",{children:x.jsx("marker",{id:"cm-arrow",viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6.5,markerHeight:6.5,orient:"auto-start-reverse",children:x.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-ink-faint"})})}),t.edges.map(({edge:n,d:i,labelPt:o},s)=>{const l=n.label?fI(n.label):null;return x.jsxs("g",{children:[x.jsx("path",{d:i,className:"fill-none stroke-ink-faint/70",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),n.label&&l&&x.jsxs("g",{children:[x.jsx("rect",{x:o.x-l.width/2,y:o.y-l.height/2,width:l.width,height:l.height,rx:l.height/2,className:"fill-surface-0 stroke-[var(--border-faint)]",strokeWidth:1}),x.jsx("text",{x:o.x,y:o.y+3.5,textAnchor:"middle",className:"fill-ink-muted text-caption font-medium",children:n.label})]})]},`e-${s}`)}),[...t.nodes.values()].map(n=>{const i=n.center.x-n.box.width/2,o=n.center.y-n.box.height/2,s=n.box.hub?14:13;return x.jsxs("g",{children:[x.jsx("rect",{x:i,y:o,width:n.box.width,height:n.box.height,rx:n.box.hub?13:11,className:n.box.hub?"fill-accent/10 stroke-accent/80":"fill-surface-3 stroke-[var(--border)]",strokeWidth:n.box.hub?1.6:1.1}),n.box.lines.map((l,c)=>x.jsx("text",{x:n.center.x,y:n.center.y+(c-(n.box.lines.length-1)/2)*17+4.5,textAnchor:"middle",fontSize:s,className:n.box.hub?"fill-ink-strong font-bold":"fill-ink",children:l},c))]},n.id)})]})}function HS({data:e,variant:t="card"}){const n=e,i=He(),o=R.useMemo(()=>zS(n.nodes,n.edges),[n.nodes,n.edges]),[s,l]=R.useState(1),[c,d]=R.useState(!1),h=R.useRef(null);R.useEffect(()=>{const y=h.current;if(!y)return;const E=()=>{const k=(y.clientWidth-16)/o.width;k<1&&l(Math.max(gc,+k.toFixed(2)))};E();const T=new ResizeObserver(E);return T.observe(y),()=>T.disconnect()},[o.width]);const m=R.useCallback(()=>l(y=>Math.min(Nm,+(y+xc).toFixed(2))),[]),g=R.useCallback(()=>l(y=>Math.max(gc,+(y-xc).toFixed(2))),[]),b=R.useCallback(()=>l(1),[]),p=R.useCallback(y=>{if(!y.ctrlKey&&!y.metaKey)return;y.preventDefault();const E=y.deltaY>0?-xc:xc;l(T=>Math.min(Nm,Math.max(gc,+(T+E).toFixed(2))))},[]);return t==="canvas"?x.jsx("div",{"data-testid":"conceptmap-canvas-content",children:x.jsx(O2,{data:n})}):x.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[x.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[x.jsx(op,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),x.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[x.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[x.jsx("button",{onClick:g,disabled:s<=gc,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomOut"),children:"−"}),x.jsxs("button",{onClick:b,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 text-caption font-bold tabular-nums",title:i("artifact.zoomReset"),children:[Math.round(s*100),"%"]}),x.jsx("button",{onClick:m,disabled:s>=Nm,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomIn"),children:"+"})]}),x.jsx("button",{onClick:()=>d(!0),"data-testid":"conceptmap-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:x.jsx(Dl,{className:"w-3.5 h-3.5"})})]})]}),x.jsx("div",{ref:h,onClick:()=>d(!0),onWheel:p,className:"bg-surface-0/40 rounded-lg p-2 overflow-auto min-h-[160px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"conceptmap-render-area","data-noswipe":"",children:x.jsx("div",{style:{width:o.width*s,height:o.height*s,margin:"0 auto"},children:x.jsx("div",{style:{transform:`scale(${s})`,transformOrigin:"top left",width:o.width,height:o.height},children:x.jsx(O2,{data:n})})})}),x.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:x.jsx("span",{children:i("artifact.conceptmap.stats",{nodes:n.nodes.length,edges:n.edges.length})})}),n.warnings&&n.warnings.length>0&&x.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[x.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),x.jsx("span",{children:n.warnings.join("; ")})]}),c&&x.jsx(Ad,{title:n.title,onClose:()=>d(!1),children:x.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:x.jsx(zl,{testid:"conceptmap-modal-stage",children:x.jsx(HS,{data:e,variant:"canvas"})})})})]})}function hI(e,t){const{correct:n,total:i}=e,o=i>0&&n===i,s=i>0&&n<i,l=t!=null&&t>=XC,c=t!=null&&t>=KC;return s?[{id:"explain-wrong"},{id:"retry"}]:o&&l?[{id:"next-topic"},{id:"go-deeper"}]:o&&c?[{id:"mark-mastered",advancesMastery:!0},{id:"next-topic"},{id:"go-deeper"}]:[{id:"go-deeper"},{id:"retry"}]}const mI="ls-quiz-progress:";function pI(e){const t=e.questions.map(i=>`${i.prompt}|${(i.options??[]).join("/")}#${i.answer??""}`).join(`
|
|
534
|
+
`);let n=2166136261;for(let i=0;i<t.length;i++)n^=t.charCodeAt(i),n=Math.imul(n,16777619);return`${mI}${(n>>>0).toString(36)}`}function gI(e){var t,n;try{const i=localStorage.getItem(e);if(!i)return null;const o=JSON.parse(i);return typeof(o==null?void 0:o.current)=="number"&&o.current>=0&&typeof((t=o==null?void 0:o.score)==null?void 0:t.correct)=="number"&&typeof((n=o==null?void 0:o.score)==null?void 0:n.total)=="number"?o:null}catch{return null}}function xI(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const bI={"explain-wrong":{icon:cC,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:Ac,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:r0,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:ai,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:a0,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function yI({data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o}){const s=e,l=He(),c=R.useMemo(()=>pI(s),[s]),d=R.useMemo(()=>gI(c),[c]),[h,m]=R.useState((d==null?void 0:d.current)??0),[g,b]=R.useState(null),[p,y]=R.useState(!1),[E,T]=R.useState((d==null?void 0:d.score)??{correct:0,total:0}),k=R.useRef([]);R.useEffect(()=>{xI(c,{current:h,score:E})},[c,h,E]);const[M,N]=R.useState(!1);if(h>=s.questions.length){const _=!!i&&!o;if(o)return x.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[x.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),x.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),M?x.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:l("quiz.hook.sent")}):x.jsx("button",{onClick:()=>{N(!0),o({title:s.title??"",correct:E.correct,total:E.total,detail:[...k.current]})},"data-testid":"quiz-hook-finish",className:"btn-3d-brand mt-3 px-5 py-2 text-body",children:l("quiz.hook.finish")})]});const j=_?hI(E,n??null):[];return x.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[x.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),x.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),x.jsx("div",{className:"text-label text-ink-muted mt-1",children:E.correct===E.total?l("quiz.allCorrectHint"):l("quiz.tryAgainHint")}),j.length>0&&x.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[x.jsx("div",{className:"text-label text-ink-muted",children:l("quiz.action.nextPrompt")}),j.map((D,P)=>{const U=bI[D.id],J=U.icon;return x.jsxs("button",{onClick:()=>i==null?void 0:i(U.message),"data-testid":`quiz-action-${D.id}`,className:`${P===0?"btn-3d-brand":"btn-3d-neutral"} w-full py-2 text-body flex items-center justify-center gap-1.5`,children:[x.jsx(J,{className:"w-4 h-4"}),l(U.labelKey)]},D.id)})]})]})}const O=s.questions[h],A=p&&g===O.answer,C=()=>{if(g===null)return;y(!0);const _=g===O.answer;T(j=>({correct:j.correct+(_?1:0),total:j.total+1})),t==null||t(O,g,_),k.current.push({prompt:O.prompt,chosen:O.options[g]??"?",answerText:O.options[O.answer]??"?",correct:_}),Ar(_?"correct":"wrong")},L=()=>{h===s.questions.length-1&&o&&!M&&(N(!0),o({title:s.title??"",correct:E.correct,total:E.total,detail:[...k.current]})),m(_=>_+1),b(null),y(!1)};return x.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(ip,{className:"w-4 h-4 text-brand"}),x.jsx("span",{className:"text-label font-bold text-brand",children:l("quiz.questionProgress",{cur:h+1,total:s.questions.length})})]}),x.jsx("span",{className:"text-label text-ink-muted",children:l("quiz.answeredCorrect",{n:E.correct})})]}),x.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:O.prompt}),x.jsx("div",{className:"space-y-2 mb-3",children:O.options.map((_,j)=>{const D=g===j,P=p&&j===O.answer,U=p&&D&&!P;return x.jsxs("button",{onClick:()=>!p&&b(j),disabled:p,"data-testid":`quiz-option-${j}`,className:`w-full text-left text-body p-2.5 rounded-lg border-2 font-medium transition-colors ${P?"border-brand bg-brand/10 text-brand animate-answer-correct":U?"border-warning bg-warning/10 text-warning animate-answer-wrong":D?"border-accent bg-accent/10 text-accent":"border-[var(--border)] text-ink-muted hover:border-[var(--border)]"} ${p?"cursor-default":"cursor-pointer"}`,children:[x.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+j)}),_,P&&x.jsx("span",{className:"float-right",children:x.jsx(Fn,{className:"w-4 h-4 inline-block"})}),U&&x.jsx("span",{className:"float-right",children:x.jsx(la,{className:"w-4 h-4 inline-block"})})]},j)})}),p&&x.jsxs("div",{className:`rounded-lg p-3 mb-3 text-body leading-relaxed animate-artifact-render ${A?"bg-brand/10 border border-brand/30 text-brand":"bg-warning/10 border border-warning/30 text-warning"}`,"data-testid":"quiz-explanation",children:[x.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[A?x.jsx(Fn,{className:"w-4 h-4"}):x.jsx(la,{className:"w-4 h-4"}),x.jsx("span",{children:l(A?"quiz.correct":"quiz.wrong")})]}),x.jsx("div",{className:"text-ink-muted",children:O.explanation})]}),p?x.jsx("button",{onClick:L,"data-testid":"quiz-next",className:"btn-3d-brand w-full py-2 text-body",children:h+1<s.questions.length?l("exercise.next"):l("quiz.finish")}):x.jsx("button",{onClick:C,disabled:g===null,"data-testid":"quiz-submit",className:"btn-3d-brand w-full py-2 text-body disabled:opacity-40",children:l("exercise.submit")}),s.warnings&&s.warnings.length>0&&x.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[x.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),x.jsx("span",{children:s.warnings.join("; ")})]})]})}function FS({data:e,variant:t="card"}){const n=e,i=He(),[o,s]=R.useState(!1),l=x.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[x.jsx("thead",{children:x.jsx("tr",{className:"bg-surface-3/60",children:n.headers.map((c,d)=>x.jsx("th",{className:`px-3 py-2.5 text-left font-bold border-b border-[var(--border)] ${d===0?"text-ink-strong":"text-ink"}`,children:c},d))})}),x.jsx("tbody",{children:n.rows.map((c,d)=>x.jsx("tr",{className:d%2===0?"bg-surface-0/40":"",children:c.map((h,m)=>x.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${m===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:m===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:h},m))},d))})]});return t==="canvas"?x.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:l}):x.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[x.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x.jsx(TE,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),x.jsx("button",{onClick:()=>s(!0),"data-testid":"comparetable-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:x.jsx(Dl,{className:"w-3.5 h-3.5"})})]}),x.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--border-faint)]",onClick:()=>s(!0),style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:l}),n.warnings&&n.warnings.length>0&&x.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[x.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),x.jsx("span",{children:n.warnings.join("; ")})]}),o&&x.jsx(Ad,{title:n.title,onClose:()=>s(!1),children:x.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:x.jsx(zl,{testid:"comparetable-modal-stage",children:x.jsx("div",{className:"p-2 surface-card",children:x.jsx(FS,{data:e,variant:"canvas"})})})})})]})}let Rc=null;function vI(){return Rc||(Rc=zc(()=>import("./mermaid.core-DntY_Zhl.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:EI(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),t})),Rc}function EI(){const e=(n,i)=>{if(typeof document>"u")return i;const o=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return o?`rgb(${o})`:i};return{background:"transparent",fontFamily:typeof document<"u"&&getComputedStyle(document.body).fontFamily||"ui-sans-serif, system-ui, sans-serif",fontSize:"14px",primaryColor:e("--surface-3-rgb","rgb(42 43 46)"),primaryBorderColor:e("--border-rgb","rgb(37 38 41)"),primaryTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),secondaryColor:e("--surface-2-rgb","rgb(32 33 36)"),secondaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),secondaryTextColor:e("--ink-rgb","rgb(245 245 250)"),tertiaryColor:e("--surface-1-rgb","rgb(24 25 27)"),tertiaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),tertiaryTextColor:e("--ink-rgb","rgb(245 245 250)"),lineColor:e("--ink-faint-rgb","rgb(117 117 126)"),textColor:e("--ink-rgb","rgb(245 245 250)"),edgeLabelBackground:e("--surface-0-rgb","rgb(12 13 15)"),clusterBkg:e("--surface-1-rgb","rgb(24 25 27)"),clusterBorder:e("--border-faint-rgb","rgb(26 26 29)"),nodeBorder:e("--border-rgb","rgb(37 38 41)"),mainBkg:e("--surface-3-rgb","rgb(42 43 46)"),nodeTextColor:e("--ink-rgb","rgb(245 245 250)"),arrowheadColor:e("--ink-faint-rgb","rgb(117 117 126)"),actorBkg:e("--surface-3-rgb","rgb(42 43 46)"),actorBorder:e("--border-rgb","rgb(37 38 41)"),actorTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),activationBkgColor:e("--surface-3-rgb","rgb(42 43 46)"),activationBorderColor:e("--border-rgb","rgb(37 38 41)"),signalColor:e("--ink-rgb","rgb(245 245 250)"),signalTextColor:e("--ink-rgb","rgb(245 245 250)"),labelBoxBkgColor:e("--surface-2-rgb","rgb(32 33 36)"),labelBoxBorderColor:e("--border-rgb","rgb(37 38 41)"),labelTextColor:e("--ink-rgb","rgb(245 245 250)"),loopTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),noteBkgColor:"rgb(255 200 0 / 0.12)",noteBorderColor:"rgb(255 200 0 / 0.4)",noteTextColor:e("--ink-rgb","rgb(245 245 250)")}}typeof window<"u"&&window.addEventListener("theme-changed",()=>{Rc=null});async function TI(e,t){const n=await vI();try{await n.parse(t)}catch(o){throw new Error(`mermaid 语法校验失败: ${o instanceof Error?o.message:String(o)}`)}const{svg:i}=await n.render(e,t);if(i.includes('aria-roledescription="error"')||i.includes('class="error-text"')||i.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return i}const _m=.3,Mm=3,bc=.2;function VS({data:e,variant:t="card"}){const n=e,i=He(),o={flowchart:i("artifact.diagram.flowchart"),sequence:i("artifact.diagram.sequence"),state:i("artifact.diagram.state")},s=R.useId().replace(/[:]/g,"_"),[l,c]=R.useState({status:"loading"}),[d,h]=R.useState(0);R.useEffect(()=>{const C=()=>h(L=>L+1);return window.addEventListener("theme-changed",C),()=>window.removeEventListener("theme-changed",C)},[]);const[m,g]=R.useState(null),[b,p]=R.useState(1),[y,E]=R.useState(!1);R.useEffect(()=>{let C=!1;return c({status:"loading"}),g(null),TI(`mmd-${s}`,n.mermaid).then(L=>{C||c({status:"rendered",svg:L})}).catch(L=>{C||(console.error("[MermaidArtifact] render failed:",L),c({status:"error",message:L instanceof Error?L.message:String(L)}))}),()=>{C=!0}},[n.mermaid,s,d]);const T=`https://mermaid.live/edit#${encodeURIComponent(n.mermaid)}`,k=R.useCallback(()=>p(C=>Math.min(Mm,+(C+bc).toFixed(2))),[]),M=R.useCallback(()=>p(C=>Math.max(_m,+(C-bc).toFixed(2))),[]),N=R.useCallback(()=>p(1),[]),O=R.useCallback(C=>{if(!C.ctrlKey&&!C.metaKey)return;C.preventDefault();const L=C.deltaY>0?-bc:bc;p(_=>Math.min(Mm,Math.max(_m,+(_+L).toFixed(2))))},[]),A=l.status==="rendered"?x.jsx("div",{ref:C=>{var L;if(C&&!m){const _=C.querySelector("svg");if(_){const j=_.getBoundingClientRect(),D=(L=_.viewBox)==null?void 0:L.baseVal,P=D&&D.width?D.width:j.width,U=D&&D.height?D.height:j.height;P>0&&U>0&&g({width:P,height:U})}}},style:{width:(m==null?void 0:m.width)??void 0,height:(m==null?void 0:m.height)??void 0},dangerouslySetInnerHTML:{__html:l.svg},"data-testid":"mermaid-svg"}):null;return t==="canvas"?x.jsx("div",{"data-testid":"mermaid-canvas-content",children:A}):x.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[x.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[x.jsx(VC,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),x.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-accent/15 text-accent shrink-0",children:o[n.diagramType]??n.diagramType})]}),x.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.status==="rendered"&&x.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[x.jsx("button",{onClick:M,disabled:b<=_m,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),x.jsxs("button",{onClick:N,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 text-caption font-bold tabular-nums",title:i("artifact.zoomReset"),"data-testid":"mermaid-zoom-reset",children:[Math.round(b*100),"%"]}),x.jsx("button",{onClick:k,disabled:b>=Mm,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),l.status==="rendered"&&x.jsx("button",{onClick:()=>E(!0),"data-testid":"mermaid-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:x.jsx(Dl,{className:"w-3.5 h-3.5"})})]}),x.jsx("button",{onClick:()=>window.open(T,"_blank"),className:"text-caption text-accent hover:underline font-bold shrink-0","data-testid":"mermaid-open-live",title:i("artifact.mermaid.openLive"),children:"mermaid.live ↗"})]}),x.jsxs("div",{onClick:()=>{l.status==="rendered"&&E(!0)},onWheel:O,className:"bg-surface-0/40 rounded-lg p-3 overflow-auto min-h-[120px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"mermaid-render-area","data-noswipe":"",children:[l.status==="loading"&&x.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),x.jsx("span",{children:i("artifact.mermaid.rendering")})]}),l.status==="rendered"&&x.jsx("div",{style:{width:m?m.width*b:"auto",height:m?m.height*b:"auto",margin:"0 auto"},children:x.jsx("div",{style:{transform:`scale(${b})`,transformOrigin:"top left"},children:A})}),l.status==="error"&&x.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[x.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[x.jsx(ri,{className:"w-4 h-4 shrink-0"}),x.jsx("span",{children:i("artifact.mermaid.renderFailed")})]}),x.jsx("pre",{className:"text-label bg-surface-1/60 rounded p-2 overflow-x-auto text-ink-muted font-mono text-left",children:n.mermaid}),x.jsx("div",{className:"text-caption text-ink-muted mt-2",children:i("artifact.mermaid.errorPrefix",{msg:l.message})})]})]}),l.status==="rendered"&&x.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:x.jsx("span",{children:i("artifact.mermaid.hint")})}),y&&l.status==="rendered"&&x.jsx(Ad,{title:n.title,onClose:()=>E(!1),children:x.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:x.jsx(zl,{testid:"mermaid-modal-stage",children:x.jsx(VS,{data:e,variant:"canvas"})})})}),n.warnings&&n.warnings.length>0&&x.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[x.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),x.jsx("span",{children:n.warnings.join("; ")})]})]})}function qS({data:e,variant:t="card"}){const n=e,i=He(),[o,s]=R.useState(null),[l,c]=R.useState(!1),d=R.useRef([]),h=R.useRef([]),m=n.code.split(`
|
|
535
|
+
`),g=E=>{if(o===null)return!1;const T=n.annotations[o];return T&&E>=T.lineStart&&E<=T.lineEnd},b=E=>{const T=o===E?null:E;if(s(T),T!==null){const k=n.annotations[T],M=(l?h:d).current[k.lineStart-1];M==null||M.scrollIntoView({behavior:"smooth",block:"center"})}},p=E=>x.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:x.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:x.jsx("code",{children:m.map((T,k)=>{const M=k+1;return x.jsxs("div",{ref:N=>{E.current[k]=N},className:`flex ${g(M)?"bg-brand/15":""}`,children:[x.jsx("span",{className:"select-none text-neutral-600 pr-3 pl-3 text-right w-10 shrink-0 border-r border-neutral-800 tabular-nums",children:M}),x.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:T||" "})]},k)})})})}),y=x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"text-caption font-bold text-ink-muted",children:i("artifact.codewalk.sectionLabel")}),n.annotations.map((E,T)=>x.jsxs("button",{onClick:()=>b(T),"data-testid":`annotation-${T}`,className:`w-full text-left p-2.5 rounded-lg border transition-colors ${o===T?"border-brand bg-brand/10":"border-[var(--border-faint)] hover:border-[var(--border)]"}`,children:[x.jsx("div",{className:"text-caption font-bold text-brand mb-0.5",children:E.lineEnd!==E.lineStart?i("artifact.codewalk.lineRange",{a:E.lineStart,b:E.lineEnd}):i("artifact.codewalk.lineSingle",{n:E.lineStart})}),x.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:E.note})]},T))]});return t==="canvas"?x.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:p(h)}):x.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[x.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x.jsx(mE,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),x.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-surface-3 text-ink-muted font-mono shrink-0",children:n.language})]}),x.jsx("button",{onClick:()=>c(!0),"data-testid":"codewalk-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:x.jsx(Dl,{className:"w-3.5 h-3.5"})})]}),x.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[x.jsx("div",{onClick:()=>{l||c(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:p(d)}),y]}),n.warnings&&n.warnings.length>0&&x.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[x.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),x.jsx("span",{children:n.warnings.join("; ")})]}),l&&x.jsx(Ad,{title:n.title,onClose:()=>c(!1),children:x.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:x.jsx(zl,{testid:"codewalk-modal-stage",children:x.jsx(qS,{data:e,variant:"canvas"})})})})]})}function SI({data:e,onPickAction:t}){const n=e,i=He(),[o,s]=R.useState(null),l=c=>{o||(s(c.id),t==null||t(`${i("guess.pickedPrefix")}${c.label}`))};return x.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[x.jsx(hC,{className:"w-4 h-4 text-accent"}),x.jsx("span",{className:"text-label font-bold text-accent",children:i("guess.header")})]}),x.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:n.prompt}),x.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:n.options.map(c=>{const d=o===c.id,h=o!==null;return x.jsxs("button",{onClick:()=>l(c),disabled:h,"data-testid":`guess-option-${c.id}`,className:`text-body p-2.5 rounded-lg border-2 font-medium transition-colors text-left flex items-center justify-between gap-2 ${d?"border-accent bg-accent/10 text-accent":h?"border-[var(--border-faint)] text-ink-faint cursor-default":"border-[var(--border)] text-ink-muted hover:border-accent hover:text-accent cursor-pointer"}`,children:[x.jsx("span",{children:c.label}),d&&x.jsx(Fn,{className:"w-4 h-4 shrink-0"})]},c.id)})}),o&&x.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"guess-picked-hint",children:i("guess.waitReveal")}),n.warnings&&n.warnings.length>0&&x.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:n.warnings.join("; ")})]})}function Lp({data:e,onQuizAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o,variant:s="card"}){const l=e;if(!l||!l.artifactType)return x.jsx(I2,{data:e});switch(l.artifactType){case"concept_map":return x.jsx(HS,{data:e,variant:s});case"quiz":return x.jsx(yI,{data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o});case"compare_table":return x.jsx(FS,{data:e,variant:s});case"diagram":return x.jsx(VS,{data:e,variant:s});case"code_walkthrough":return x.jsx(qS,{data:e,variant:s});case"guess":return x.jsx(SI,{data:e,onPickAction:i});default:return x.jsx(I2,{data:e})}}function I2({data:e}){var n;const t=He();return x.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[x.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[x.jsx(vE,{className:"w-4 h-4"}),t("artifact.unknownHeader")]}),x.jsx("pre",{className:"text-caption overflow-x-auto text-ink-muted",children:(n=JSON.stringify(e,null,2))==null?void 0:n.slice(0,200)})]})}const wI={concept_map:op,quiz:ip,compare_table:TE,diagram:gC,code_walkthrough:mE},kI=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function AI(e,t){return kI.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function CI({selectedNode:e,items:t,loading:n,forceTab:i,canvasArtifact:o,isReviewing:s,onReviewDone:l,onUserTabChange:c,onRemove:d,onTogglePin:h,onRecordQuizResult:m,onSaveContentNote:g,onUpdateNoteComment:b,onJumpToSource:p,onQuoteToChat:y,locale:E}){var L;const T=He(),[k,M]=R.useState("content"),N=i??k,O=_=>{M(_),c==null||c()},A=e?t.filter(_=>_.nodeId===e.id):[],C=R.useRef(null);return R.useEffect(()=>{var _;(_=C.current)==null||_.scrollTo({top:0})},[e==null?void 0:e.id]),x.jsxs("div",{className:"h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[x.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:x.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[x.jsx(Om,{label:T("notebook.tab.explain"),icon:ii,active:N==="content",onClick:()=>O("content"),testid:"tab-content"}),x.jsx(Om,{label:T("notebook.tab.notes"),icon:AC,active:N==="notes",onClick:()=>O("notes"),testid:"tab-notes",badge:A.length>0?String(A.length):void 0}),x.jsx(Om,{label:T("notebook.tab.board"),icon:Wh,active:N==="board",onClick:()=>O("board"),testid:"tab-board"})]})}),x.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:C,role:"tabpanel",children:N==="board"?x.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:o?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[x.jsx(Wh,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("span",{className:"text-label font-bold text-ink truncate",children:((L=o.output)==null?void 0:L.title)??o.toolName})]}),x.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:x.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:x.jsx(zl,{testid:"board-canvas-stage",children:x.jsx(Lp,{data:o.output,variant:"canvas"})})})})]}):x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[x.jsx(Wh,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),x.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:T("notebook.board.empty")})]})}):x.jsx(x.Fragment,{children:x.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:N==="content"?x.jsx(NI,{selectedNode:e,contentNotes:A.filter(_=>_.artifactType==="user_note"&&_.sourceAnchor),onQuoteToChat:y,onSaveContentNote:g,locale:E,isReviewing:s,onReviewDone:l}):x.jsx(_I,{items:A,loading:n,selectedNode:e,onRemove:d,onTogglePin:h,onRecordQuizResult:m,onUpdateNoteComment:b,onJumpToSource:p})})})},N)]})}function NI({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:i,locale:o,isReviewing:s,onReviewDone:l}){const c=He(),[d,h]=R.useState(null),[m,g]=R.useState(!1),[b,p]=R.useState(!1),[y,E]=R.useState([]),[T,k]=R.useState(null),M=R.useRef(null),N=R.useRef(null);R.useEffect(()=>{if(!e){h(null),p(!1);return}let L=!1;return g(!0),p(!1),be.getNodeContent(e.id,o??void 0).then(_=>{L||h(_)}).catch(()=>{L||(h(null),p(!0))}).finally(()=>{L||g(!1)}),()=>{L=!0}},[e==null?void 0:e.id,o]),R.useEffect(()=>{if(!e){E([]);return}let L=!1;return be.listAssetsByNode(e.id).then(_=>{L||E(_)}).catch(()=>{L||E([])}),()=>{L=!0}},[e==null?void 0:e.id]),R.useEffect(()=>{if(!d||!M.current)return;const L=[];for(const j of t)try{const D=JSON.parse(j.sourceAnchor);if(D.type==="content"){const P=JSON.parse(j.data).text??"";P&&L.push({noteId:j.id,text:P,surrounding:D.surroundingText})}}catch{}const _=setTimeout(()=>{N.current&&PS(N.current,L)},80);return()=>clearTimeout(_)},[d,t]),R.useEffect(()=>{const L=_=>{var P;const j=_.detail;if(!j)return;const D=(P=N.current)==null?void 0:P.querySelector(`mark[data-note-id="${j}"]`);D&&BS(D)};return window.addEventListener("lookatstudy-jump-to-note",L),()=>window.removeEventListener("lookatstudy-jump-to-note",L)},[]);const O=R.useCallback(()=>{var Z;if(!n&&!i)return;const L=window.getSelection(),_=(L==null?void 0:L.toString().trim())??"";if(_.length<2||_.length>500){k(null);return}const j=L==null?void 0:L.getRangeAt(0);if(!j||!((Z=M.current)!=null&&Z.contains(j.commonAncestorContainer))){k(null);return}const D=j.getBoundingClientRect(),P=M.current.getBoundingClientRect(),U=N.current;let J=null;if(U&&U.contains(j.commonAncestorContainer)){const ie=Wc(U);J=OS(j,ie)}const q=U?Wc(U).text:_,z=J?J.start:q.indexOf(_),H=z>=0?q.slice(Math.max(0,z-30),z+_.length+30):_,X=US({left:D.left-P.left,top:D.top-P.top,right:D.right-P.left,bottom:D.bottom-P.top,width:D.width,height:D.height},P.width,n?150:100);k({x:X.left,y:X.top,transform:X.transform,text:_,surrounding:H,offsets:J??void 0})},[n,i]);R.useEffect(()=>{let L=null,_=null;const j=()=>{L&&clearTimeout(L),L=setTimeout(()=>{var P;(((P=window.getSelection())==null?void 0:P.toString().trim().length)??0)>=2?(_&&(clearTimeout(_),_=null),O()):_||(_=setTimeout(()=>k(U=>U&&null),250))},250)};return document.addEventListener("selectionchange",j),()=>{document.removeEventListener("selectionchange",j),L&&clearTimeout(L),_&&clearTimeout(_)}},[O]);const A=R.useCallback(()=>{var _;if(!T||!n)return;const L=T.text.length>200?T.text.slice(0,200)+"…":T.text;n(c("notebook.quote.template",{text:L})),k(null),(_=window.getSelection())==null||_.removeAllRanges()},[T,n,c]),C=R.useCallback(()=>{var _,j,D;if(!T||!i||!e)return;const L=T.text.length>200?T.text.slice(0,200)+"…":T.text;i(L,{type:"content",surroundingText:T.surrounding,startOffset:(_=T.offsets)==null?void 0:_.start,endOffset:(j=T.offsets)==null?void 0:j.end}),k(null),(D=window.getSelection())==null||D.removeAllRanges()},[T,i,e]);return e?x.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:M,onMouseUp:O,children:[x.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-1",children:e.type==="section"?c("notebook.node_type.section"):e.type==="concept"?c("notebook.node_type.concept"):c("notebook.node_type.lesson")}),x.jsx("h2",{className:"text-title font-extrabold mb-4 text-ink-strong tracking-tight",children:e.title}),m?x.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),c("notebook.content.loading")]}):b?x.jsxs("div",{className:"text-body text-warning",children:[c("notebook.content.load_failed"),x.jsx("button",{className:"underline ml-1",onClick:()=>{p(!1),g(!0),be.getNodeContent(e.id,o??void 0).then(h).catch(()=>p(!0)).finally(()=>g(!1))},children:c("notebook.content.retry")})]}):d?x.jsx(JO,{fallback:(L,_)=>x.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[x.jsx("div",{className:"text-body text-warning mb-2",children:c("notebook.content.render_failed")}),x.jsxs("pre",{className:"text-caption text-ink-muted whitespace-pre-wrap break-words bg-surface-1 p-3 rounded",children:[d.slice(0,500),d.length>500?`
|
|
536
|
+
`+c("notebook.content.truncated"):""]}),x.jsx("div",{className:"flex gap-2 mt-2",children:x.jsx("button",{className:"text-caption underline text-accent",onClick:_,children:c("notebook.content.retry_render")})})]}),children:x.jsx("div",{ref:N,className:"prose prose-sm max-w-[80ch] leading-relaxed break-words overflow-x-auto [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_img]:max-w-full [&_video]:max-w-full [&_iframe]:max-w-full select-text",children:x.jsx(ET,{remarkPlugins:[GT],rehypePlugins:[NS,[DS,LS]],urlTransform:L=>L,components:{a({children:L,..._}){return x.jsx("a",{..._,target:"_blank",rel:"noopener noreferrer",children:L})},img({src:L,alt:_,...j}){return x.jsx(MI,{src:L,alt:_,assets:y,...j})},table({children:L}){return x.jsx("div",{className:"overflow-x-auto my-4",children:x.jsx("table",{children:L})})}},children:d})})},`${e.id}-${o??"orig"}`):x.jsx("div",{className:"text-body text-ink-muted",children:c("notebook.content.empty")}),y.length>0&&x.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[x.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[x.jsx(yC,{className:"w-3.5 h-3.5"}),x.jsx("span",{children:c("notebook.images.heading",{n:y.length})})]}),x.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:y.map(L=>x.jsx(RI,{asset:L},L.id))})]}),T&&x.jsxs("div",{style:{left:T.x,top:T.y,transform:T.transform},className:"absolute z-20 flex items-center gap-0.5 msg-enter",children:[n&&x.jsxs("button",{onClick:A,"data-testid":"quote-to-chat-btn","aria-label":c("notebook.quote.ask"),className:"px-2 py-1.5 rounded-lg bg-brand text-white text-label font-bold shadow-elevated flex items-center gap-1 hover:bg-brand-light transition-colors",children:[x.jsx(yE,{className:"w-3 h-3"}),c("notebook.quote.ask")]}),x.jsxs("button",{onClick:C,"data-testid":"save-note-btn","aria-label":c("notebook.quote.add_note"),className:"px-2 py-1.5 rounded-lg bg-accent text-white text-label font-bold shadow-elevated flex items-center gap-1 hover:brightness-110 transition",title:c("notebook.quote.save_note.title"),children:[x.jsx(vl,{className:"w-3.5 h-3.5"}),c("notebook.quote.add_note")]})]}),e.sourcePath&&x.jsx("div",{className:"mt-6 pt-3 border-t border-[var(--border-faint)] text-label text-ink-muted",children:c("notebook.source.label",{path:e.sourcePath})}),x.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-accent/5 border border-accent/20 text-body text-ink-muted flex items-start gap-1.5",children:[x.jsx(Hc,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),x.jsx("span",{children:c("notebook.quote.hint")})]}),s&&e&&x.jsx(eI,{nodeId:e.id,onRated:l})]}):x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[x.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),x.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:c("notebook.empty.select_node")})]})}function _I({items:e,loading:t,selectedNode:n,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c}){const d=He();if(!n)return x.jsx(j2,{message:d("notebook.empty.notes.title"),icon:"📓"});if(t)return x.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),d("notebook.empty.notes.title")]});const h=e.filter(E=>["concept_map","compare_table","diagram","code_walkthrough"].includes(E.artifactType)),m=e.filter(E=>E.artifactType==="user_note"),g=e.filter(E=>E.artifactType==="quiz"),b=e.length,p=g.filter(E=>E.lastResult==="correct").length,y=g.filter(E=>E.lastResult==="wrong").length;return b===0?x.jsx(j2,{message:d("notebook.empty.no_notes_message"),icon:"🧩"}):x.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[x.jsx(Rm,{title:d("notebook.zone.understand"),icon:x.jsx(op,{className:"w-4 h-4"}),subtitle:d("notebook.zone.understand.subtitle"),count:h.length,testid:"zone-understand",defaultOpen:!1,children:h.length===0?x.jsx(Dm,{hint:d("notebook.zone.understand.empty_hint")}):h.map(E=>x.jsx(Lm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),x.jsx(Rm,{title:d("notebook.zone.note"),icon:x.jsx(vl,{className:"w-4 h-4"}),subtitle:d("notebook.zone.note.subtitle"),count:m.length,testid:"zone-note",defaultOpen:!1,children:m.length===0?x.jsx(Dm,{hint:d("notebook.zone.note.empty_hint")}):m.map(E=>x.jsx(Lm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),x.jsx(Rm,{title:d("notebook.zone.practice"),icon:x.jsx(ip,{className:"w-4 h-4"}),subtitle:g.length>0?d("notebook.zone.practice.subtitle_stats",{total:g.length,correct:p,wrong:y}):d("notebook.zone.practice.subtitle_empty"),count:g.length,testid:"zone-practice",defaultOpen:!1,children:g.length===0?x.jsx(Dm,{hint:d("notebook.zone.practice.empty_hint")}):g.map(E=>x.jsx(Lm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))})]})}function Rm({title:e,icon:t,subtitle:n,count:i,testid:o,defaultOpen:s=!0,children:l}){const[c,d]=R.useState(s),h=R.useRef(!0),m=R.useRef(i);return R.useEffect(()=>{if(h.current){h.current=!1,m.current=i;return}i>m.current&&d(!0),m.current=i},[i]),x.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":o,children:[x.jsxs("button",{onClick:()=>d(g=>!g),"aria-expanded":c,className:"w-full flex items-center gap-2 px-3 py-2.5 bg-surface-1/50 hover:bg-surface-3/60 transition-colors text-left","data-testid":`${o}-toggle`,children:[x.jsx(ap,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${c?"":"-rotate-90"}`}),x.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),x.jsx("span",{className:"text-body font-bold text-ink",children:e}),x.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:i}),x.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),x.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:c?"1fr":"0fr"},children:x.jsx("div",{className:"overflow-hidden",children:x.jsx("div",{className:"p-3 space-y-3",children:l})})})]})}function Dm({hint:e}){return x.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function Lm({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:i,onUpdateNoteComment:o,onJumpToSource:s}){const l=He(),[c,d]=R.useState(!1),[h,m]=R.useState(e.notes??""),g=R.useCallback((N,O,A)=>{e.nodeId&&be.recordQuizAnswer(e.nodeId,A).catch(()=>{}),i(e.id,A)},[e.nodeId,e.id,i]),b=e.artifactType==="user_note";let p="",y=null;if(b){try{p=JSON.parse(e.data).text??""}catch{p=e.title??""}try{e.sourceAnchor&&(y=JSON.parse(e.sourceAnchor))}catch{y=null}}let E=null;if(!b)try{E=JSON.parse(e.data)}catch{E=null}const T=new Date(e.createdAt),k=`${T.getMonth()+1}/${T.getDate()} ${T.getHours().toString().padStart(2,"0")}:${T.getMinutes().toString().padStart(2,"0")}`;if(b){const N=e.notes&&e.notes.trim().length>0?e.notes:null,O=()=>{m(N??""),d(!0)},A=()=>{m(N??""),d(!1)},C=()=>{o==null||o(e.id,h),d(!1)};return x.jsx("div",{className:`bg-surface-2 rounded-lg p-3 relative ${e.pinned?"ring-1 ring-brand/40 bg-brand/5":""}`,"data-testid":`canvas-item-${e.id.slice(0,8)}`,children:x.jsxs("div",{className:"flex items-start gap-2",children:[x.jsx(RC,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:p}),o&&c?x.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[x.jsx("textarea",{value:h,onChange:L=>m(L.target.value),rows:2,placeholder:l(N?"notebook.note.comment.ph_edit":"notebook.note.comment.ph_new"),className:"w-full text-label leading-relaxed p-2 rounded-md border border-[var(--border-faint)] bg-surface-0 text-ink resize-none focus:outline-none focus:border-brand","data-testid":`note-comment-textarea-${e.id.slice(0,8)}`}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs("button",{onClick:C,className:"inline-flex items-center gap-1 text-caption font-bold text-white bg-brand hover:bg-brand/90 px-2 py-0.5 rounded","data-testid":`note-comment-save-${e.id.slice(0,8)}`,children:[x.jsx(Fn,{className:"w-3 h-3"})," ",l("notebook.action.save")]}),x.jsxs("button",{onClick:A,className:"inline-flex items-center gap-1 text-caption text-ink-muted hover:text-ink","data-testid":`note-comment-cancel-${e.id.slice(0,8)}`,children:[x.jsx(la,{className:"w-3 h-3"})," ",l("notebook.action.cancel")]})]})]}):N?x.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[x.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:N}),o&&x.jsxs("button",{onClick:O,className:"mt-1 inline-flex items-center gap-0.5 text-caption text-ink-muted hover:text-accent","data-testid":`note-comment-edit-btn-${e.id.slice(0,8)}`,title:l("notebook.note.edit_comment"),children:[x.jsx(vl,{className:"w-2.5 h-2.5"})," ",l("notebook.note.edit_comment")]})]}):o?x.jsxs("button",{onClick:O,className:"mt-2 inline-flex items-center gap-0.5 text-caption text-ink-muted hover:text-accent","data-testid":`note-comment-add-${e.id.slice(0,8)}`,title:l("notebook.note.add_comment"),children:[x.jsx(vl,{className:"w-2.5 h-2.5"})," ",l("notebook.note.add_comment")]}):null,y&&s&&x.jsx("button",{onClick:()=>s(y,p,e.id),className:"mt-2 inline-flex items-center gap-1 text-caption text-accent hover:underline font-bold","data-testid":`note-source-${e.id.slice(0,8)}`,children:y.type==="content"?x.jsxs(x.Fragment,{children:[x.jsx(ii,{className:"w-3 h-3"}),l("notebook.source.jump_content")]}):x.jsxs(x.Fragment,{children:[x.jsx(yE,{className:"w-3 h-3"}),l("notebook.source.jump_chat")]})}),x.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[x.jsx("span",{className:"text-caption text-ink-muted",children:k}),x.jsx("button",{onClick:()=>t(e.id),className:"text-caption text-ink-muted hover:text-warning","data-testid":`canvas-delete-${e.id.slice(0,8)}`,title:l("notebook.note.delete"),children:x.jsx(s0,{className:"w-3 h-3"})})]})]})]})})}const M=wI[e.artifactType]??vE;return x.jsxs("div",{className:`bg-surface-2 rounded-lg p-3 relative ${e.pinned?"ring-1 ring-brand/40 bg-brand/5":""}`,"data-testid":`canvas-item-${e.id.slice(0,8)}`,children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:x.jsx(M,{className:"w-4 h-4"})}),x.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??AI(l,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&x.jsx("span",{className:`text-caption font-bold px-1.5 py-0.5 rounded-full ${e.lastResult==="correct"?"bg-brand/15 text-brand":"bg-warning/15 text-warning"}`,"data-testid":`quiz-result-${e.id.slice(0,8)}`,children:e.lastResult==="correct"?l("notebook.quiz.last_correct"):l("notebook.quiz.last_wrong")}),e.pinned?x.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[x.jsx(sy,{className:"w-2.5 h-2.5"}),l("notebook.note.pinned")]}):null,x.jsx("button",{onClick:()=>n(e.id),className:"text-caption text-ink-muted hover:text-brand","data-testid":`canvas-pin-${e.id.slice(0,8)}`,title:e.pinned?l("notebook.note.unpin"):l("notebook.note.pin"),children:x.jsx(sy,{className:"w-3 h-3"})}),x.jsx("button",{onClick:()=>t(e.id),className:"text-caption text-ink-muted hover:text-warning","data-testid":`canvas-delete-${e.id.slice(0,8)}`,title:l("notebook.note.delete"),children:x.jsx(s0,{className:"w-3 h-3"})})]}),x.jsx("div",{className:"text-label",children:E?x.jsx(Lp,{data:E,onQuizAnswered:g}):x.jsx("div",{className:"text-ink-muted",children:l("notebook.artifact.broken")})}),x.jsx("div",{className:"text-caption text-ink-muted mt-2",children:k})]})}function j2({message:e,icon:t}){return x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[x.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),x.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function Om({label:e,icon:t,active:n,onClick:i,testid:o,badge:s}){return x.jsxs("button",{onClick:i,"data-testid":o,role:"tab","aria-selected":n,className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n?"bg-brand/20 text-brand":"text-ink-muted hover:text-ink-strong"}`,children:[x.jsx(t,{className:"w-3 h-3"}),x.jsx("span",{children:e}),s&&x.jsx("span",{className:`text-caption px-1.5 py-0.5 rounded-full font-bold ${n?"bg-brand/30 text-brand":"bg-ink/10 text-ink-faint"}`,children:s})]})}function MI({src:e,alt:t,assets:n,...i}){const[o,s]=R.useState(null),l=e??"",c=R.useMemo(()=>{if(!l||l.startsWith("http")||l.startsWith("data:"))return null;const h=l.split("/").pop()??l;return n.find(m=>{var g;return(g=m.sourcePath)==null?void 0:g.endsWith(h)})??n.find(m=>m.filename===h)??null},[l,n]);if(R.useEffect(()=>{if(!c){s(null);return}let h=!1;return be.getAssetDataUrl(c.id).then(m=>{h||s(m)}),()=>{h=!0}},[c]),!l)return null;const d=o??l;return x.jsx("img",{src:d,alt:t??"","data-asset-id":c==null?void 0:c.id,className:"rounded-lg max-w-full h-auto my-3",loading:"lazy",...i})}function RI({asset:e}){const t=He(),[n,i]=R.useState(null),[o,s]=R.useState(!1);return R.useEffect(()=>{let l=!1;return be.getAssetDataUrl(e.id).then(c=>{l||i(c)}),()=>{l=!0}},[e.id]),x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:()=>s(!0),className:"block rounded-lg overflow-hidden bg-ink/5 dark:bg-ink/10 hover:ring-2 hover:ring-accent transition-all",title:e.altText??e.filename,children:n?x.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):x.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),o&&n&&x.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>s(!1),children:[x.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg"}),x.jsx("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white","aria-label":t("action.close"),onClick:l=>{l.stopPropagation(),s(!1)},children:x.jsx(la,{className:"w-6 h-6"})})]})]})}function DI(e){const[t,n]=R.useState([]),[i,o]=R.useState(!0),s=R.useCallback(async()=>{if(!e){n([]),o(!1);return}try{const y=await be.canvasList(e);n(y)}catch{n([])}finally{o(!1)}},[e]);R.useEffect(()=>{s()},[s]);const l=R.useCallback(async y=>{if(!e)return null;try{const E=await be.canvasSave({...y,courseId:e});return n(T=>T.some(k=>k.id===E.id)?T:[E,...T]),E}catch{return null}},[e]),c=R.useCallback(async y=>{if(!e)return null;try{const E=await be.canvasSaveUserNote({...y,courseId:e});return n(T=>[E,...T]),E}catch{return null}},[e]),d=R.useCallback(async(y,E)=>{try{const T=await be.canvasRecordQuizResult(y,E);return T&&n(k=>k.map(M=>M.id===y?T:M)),T}catch{return null}},[]),h=R.useCallback(async(y,E)=>{try{const T=await be.canvasUpdateUserNoteComment(y,E);return T&&n(k=>k.map(M=>M.id===y?T:M)),T}catch{return null}},[]),m=R.useCallback(async y=>{try{await be.canvasDelete(y),n(E=>E.filter(T=>T.id!==y))}catch{}},[]),g=R.useCallback(async y=>{try{const E=await be.canvasTogglePin(y);E&&n(T=>T.map(M=>M.id===y?E:M).sort((M,N)=>N.pinned!==M.pinned?N.pinned-M.pinned:N.createdAt.localeCompare(M.createdAt)))}catch{}},[]),b=R.useCallback(y=>y===null?t:t.filter(E=>E.nodeId===y),[t]),p=R.useCallback((y,E)=>{const T=y===null?t:t.filter(k=>k.nodeId===y);return E==="note"?T.filter(k=>k.artifactType==="user_note"):E==="practice"?T.filter(k=>k.artifactType==="quiz"):T.filter(k=>["concept_map","compare_table","diagram","code_walkthrough"].includes(k.artifactType))},[t]);return{items:t,loading:i,reload:s,save:l,saveUserNote:c,recordQuizResult:d,updateUserNoteComment:h,remove:m,togglePin:g,byNode:b,byZone:p}}const P2={small:16,medium:17,large:18},B2="lookatstudy-font-size",LI="medium";function OI(){const[e,t]=R.useState(()=>{if(typeof localStorage<"u"){const i=localStorage.getItem(B2);if(i&&i in P2)return i}return LI});R.useEffect(()=>{document.documentElement.style.fontSize=`${P2[e]}px`,localStorage.setItem(B2,e)},[e]);const n=R.useCallback(i=>{t(o=>{const s=["small","medium","large"],l=s.indexOf(o),c=i==="up"?Math.min(l+1,s.length-1):Math.max(l-1,0);return s[c]})},[]);return{size:e,bump:n}}const Im=new Map;function II({ref_:e,onOpen:t}){const n=He(),[i,o]=R.useState(e.previewUrl??(e.file?Im.get(e.file)??null:null));return R.useEffect(()=>{if(i||!e.file)return;let s=!1;return(async()=>{const l=Im.get(e.file);if(l){s||o(l);return}const c=await be.getAttachmentDataUrl(e.file);c&&!s&&(Im.set(e.file,c),o(c))})(),()=>{s=!0}},[e.file,i]),i?x.jsx("button",{type:"button",onClick:()=>t(i),"aria-label":n("chat.attach.preview",{name:e.name}),className:"w-24 h-24 rounded-lg overflow-hidden border border-[var(--border)] hover:border-accent transition-colors shrink-0",children:x.jsx("img",{src:i,alt:e.name,className:"w-full h-full object-cover"})}):x.jsx("div",{className:"w-24 h-24 rounded-lg bg-ink/[0.06] flex items-center justify-center text-caption text-ink-faint",title:e.name,children:e.name.slice(0,8)})}function jI({src:e,name:t,onClose:n}){return R.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),x.jsxs("div",{role:"dialog","aria-label":t,className:"fixed inset-0 z-[70] bg-black/80 flex items-center justify-center p-8 cursor-zoom-out animate-[toast-enter_.15s_ease-out]",onClick:n,"data-testid":"attachment-lightbox",children:[x.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),x.jsx("button",{type:"button","aria-label":"close",onClick:n,className:"absolute top-4 right-4 w-9 h-9 rounded-full bg-white/10 hover:bg-white/20 text-white flex items-center justify-center transition-colors",children:x.jsx(la,{className:"w-4 h-4"})})]})}function PI({parts:e}){const t=He(),[n,i]=R.useState(null),o=e.filter(c=>c.type==="attachment").map(c=>c.attachment);if(o.length===0)return null;const s=o.filter(c=>c.kind==="image"),l=o.filter(c=>c.kind==="text");return x.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[s.length>0&&x.jsx("div",{className:"flex gap-1.5 flex-wrap",children:s.map((c,d)=>x.jsx(II,{ref_:c,onOpen:h=>i({src:h,name:c.name})},c.file??c.previewUrl??`${c.name}:${d}`))}),l.length>0&&x.jsx("div",{className:"flex gap-1.5 flex-wrap",children:l.map((c,d)=>x.jsxs("span",{"data-tooltip":t("chat.attach.textChip"),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-ink/[0.06] text-caption text-ink-muted",children:[x.jsx(Rl,{className:"w-3 h-3 shrink-0"}),x.jsx("span",{className:"truncate max-w-[12rem]",children:c.name})]},`${c.name}:${d}`))}),n&&x.jsx(jI,{src:n.src,name:n.name,onClose:()=>i(null)})]})}function BI(){const[e,t]=R.useState(null),[n,i]=R.useState(null),[o,s]=R.useState(null),l=R.useRef(null),c=R.useRef([]),d=R.useRef(!1),h=R.useRef([]),m=R.useRef(0),g=R.useRef(0),b=R.useRef(!1),p=R.useRef(null),y=()=>{if(!l.current){const O=window.AudioContext??window.webkitAudioContext;l.current=new O}return l.current.resume(),l.current},E=R.useCallback(()=>{b.current&&g.current>=m.current&&!d.current&&(p.current=null,t(null),i(null))},[]),T=R.useCallback(()=>{const O=l.current,A=c.current.shift();if(!O||!A){d.current=!1,E();return}d.current=!0;const C=O.createBufferSource();C.buffer=A,C.connect(O.destination),C.onended=()=>{g.current+=1,T()},h.current.push(C),C.start()},[E]),k=R.useCallback(()=>{for(const O of h.current)try{O.onended=null,O.stop()}catch{}h.current=[],c.current=[],d.current=!1,m.current=0,g.current=0,b.current=!1,p.current=null,t(null),i(null)},[]),M=R.useCallback(()=>{k(),window.api.ttsStop().catch(()=>{})},[k]),N=R.useCallback((O,A)=>{if(p.current===O){M();return}k(),s(null),p.current=O,m.current=0,g.current=0,b.current=!1,t(O),i({index:0,total:0}),y(),window.api.ttsSpeak(A,O).then(C=>{C.ok||(k(),C.reason!=="empty-text"&&s(C.reason))}).catch(()=>k())},[M,k]);return R.useEffect(()=>{const O=window.api.on("speech:ttsAudio",L=>{if(L.messageId!==p.current)return;const _=y();m.current+=1,i({index:L.sentenceIndex,total:L.sentenceTotal}),_.decodeAudioData(L.wavBytes).then(j=>{L.messageId===p.current&&(c.current.push(j),d.current||T())})}),A=window.api.on("speech:ttsDone",L=>{L.messageId===p.current&&(b.current=!0,E())}),C=window.api.on("speech:ttsError",()=>k());return()=>{O(),A(),C()}},[E,T,k]),R.useEffect(()=>k,[k]),{speakingMessageId:e,speakingSentence:n,failReason:o,clearFailReason:()=>s(null),speak:N,stop:M}}const YS=R.createContext(null);let UI=0;const zI={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},HI={default:null,success:x.jsx(ai,{className:"w-4 h-4 text-brand shrink-0"}),error:x.jsx(i0,{className:"w-4 h-4 text-warning shrink-0"}),warning:x.jsx(ri,{className:"w-4 h-4 text-review shrink-0"}),info:x.jsx(vC,{className:"w-4 h-4 text-accent shrink-0"})};function FI({children:e}){const[t,n]=R.useState([]),i=R.useCallback(l=>{n(c=>c.filter(d=>d.id!==l))},[]),o=R.useCallback(l=>{n(c=>c.map(d=>d.id===l?{...d,exiting:!0}:d))},[]),s=R.useCallback((l,c)=>{const d=++UI,h=(c==null?void 0:c.severity)??"default",m=(c==null?void 0:c.duration)??zI[h],g={id:d,message:l,action:c==null?void 0:c.action,duration:m,severity:h,exiting:!1};n(b=>[...b,g]),window.setTimeout(()=>o(d),m)},[o]);return x.jsxs(YS.Provider,{value:{show:s},children:[e,x.jsx("div",{className:"fixed top-14 left-1/2 -translate-x-1/2 z-[100] flex flex-col items-center gap-2 pointer-events-none",role:"region","aria-live":"polite","aria-label":"Notifications",children:t.map(l=>x.jsx(VI,{item:l,onAction:()=>{l.action.onClick(),o(l.id)},onDismiss:()=>o(l.id),onExitDone:()=>i(l.id)},l.id))})]})}function VI({item:e,onAction:t,onDismiss:n,onExitDone:i}){const o=He(),s=HI[e.severity];return x.jsxs("div",{className:`pointer-events-auto flex items-center gap-2.5 pl-4 pr-2 py-2 rounded-full bg-surface-0 text-ink-strong text-body shadow-elevated max-w-md ${e.exiting?"toast-exit":"toast-enter"}`,"data-testid":`toast-${e.id}`,"data-severity":e.severity,onAnimationEnd:e.exiting?i:void 0,children:[s,x.jsx("span",{className:"flex-1",children:e.message}),e.action&&x.jsx("button",{onClick:t,className:"text-brand font-bold text-body hover:underline shrink-0 px-1.5 py-1 rounded transition-colors hover:bg-brand/10","data-testid":`toast-action-${e.id}`,children:e.action.label}),x.jsx("button",{onClick:n,className:"text-ink-muted hover:text-ink-strong shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors hover:bg-surface-3","aria-label":o("action.close"),children:x.jsx(la,{className:"w-3.5 h-3.5"})})]})}function GS(){const e=R.useContext(YS);return e||{show:()=>{}}}function qI({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:i,summary:o,onStartLearning:s,agentReady:l=!0,onGotoSettings:c,hasNode:d=!0,selectedNodeId:h,threadId:m,onSaveChatNote:g,chatNotes:b,onPickQuizAction:p,onQuizCompleted:y,cardMode:E=!1}){const T=He(),k=GS(),M=BI();R.useEffect(()=>{if(M.failReason){const X=M.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":"chat.speech.model_missing";k.show(T(X),{severity:"warning"}),M.clearFailReason()}},[M.failReason,k,T,M]);const N=R.useCallback((X,Z,ie)=>{h&&be.recordQuizAnswer(h,ie,X.kc).catch(()=>{})},[h]),[O,A]=R.useState(null);R.useEffect(()=>{if(!h){A(null);return}let X=!1;const Z=()=>be.getProgress(h).then(V=>{X||A((V==null?void 0:V.mastery)??null)}).catch(()=>{});Z();const ie=be.on("state:changed",V=>{V==="mastery"&&Z()});return()=>{X=!0,ie()}},[h]);const C=R.useRef(null),L=R.useRef(!0),[_,j]=R.useState(!1);R.useEffect(()=>{const X=Z=>{const ie=Z.detail;if(!(ie!=null&&ie.msgId))return;const V=document.querySelector(`[data-msg-id="${ie.msgId}"]`);V&&(V.scrollIntoView({behavior:"smooth",block:"center"}),V.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>V.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",X),()=>window.removeEventListener("lookatstudy-highlight-message",X)},[]),R.useEffect(()=>{if(t||!C.current||!b||b.length===0)return;const X=setTimeout(()=>{if(!C.current)return;const Z=new Map;for(const ie of b)try{const V=JSON.parse(ie.sourceAnchor);if(V.type==="chat"&&V.msgId){const Y=JSON.parse(ie.data).text??"";if(Y){const G=Z.get(V.msgId)??[];G.push({noteId:ie.id,text:Y}),Z.set(V.msgId,G)}}}catch{}for(const[ie,V]of Z){const Y=C.current.querySelector(`[data-msg-id="${ie}"]`);Y&&PS(Y,V)}},150);return()=>clearTimeout(X)},[e,b,t]),R.useEffect(()=>{const X=Z=>{var Y;const ie=Z.detail;if(!ie)return;const V=(Y=C.current)==null?void 0:Y.querySelector(`mark[data-note-id="${ie}"]`);V&&BS(V)};return window.addEventListener("lookatstudy-jump-to-chat-note",X),()=>window.removeEventListener("lookatstudy-jump-to-chat-note",X)},[]);const[D,P]=R.useState(null),U=R.useCallback(()=>{if(!g||!m)return;const X=window.getSelection(),Z=(X==null?void 0:X.toString().trim())??"";if(Z.length<2||Z.length>500){P(null);return}const ie=X==null?void 0:X.getRangeAt(0);if(!ie){P(null);return}const V=C.current;if(!(V!=null&&V.contains(ie.commonAncestorContainer))){P(null);return}let Y=ie.commonAncestorContainer,G=null;for(;Y&&Y!==V;){if(Y instanceof HTMLElement&&Y.dataset.msgId){G=Y;break}Y=Y.parentNode}if(!G){P(null);return}const B=G.dataset.msgId,ne=Wc(G),K=OS(ie,ne),$=ie.getBoundingClientRect(),se=V.getBoundingClientRect(),de=US({left:$.left-se.left,top:$.top-se.top,right:$.right-se.left,bottom:$.bottom-se.top,width:$.width,height:$.height},se.width,110);P({x:de.left,y:de.top,transform:de.transform,text:Z,msgId:B,startOffset:K==null?void 0:K.start,endOffset:K==null?void 0:K.end})},[g,m]);R.useEffect(()=>{let X=null,Z=null;const ie=()=>{X&&clearTimeout(X),X=setTimeout(()=>{var Y;(((Y=window.getSelection())==null?void 0:Y.toString().trim().length)??0)>=2?(Z&&(clearTimeout(Z),Z=null),U()):Z||(Z=setTimeout(()=>P(G=>G&&null),250))},250)};return document.addEventListener("selectionchange",ie),()=>{document.removeEventListener("selectionchange",ie),X&&clearTimeout(X),Z&&clearTimeout(Z)}},[U]);const J=R.useCallback(()=>{var Z;if(!D||!g)return;const X=D.text.length>200?D.text.slice(0,200)+"…":D.text;g(X,D.msgId,D.startOffset,D.endOffset),P(null),(Z=window.getSelection())==null||Z.removeAllRanges()},[D,g]),q=R.useCallback(()=>{const X=C.current;if(!X)return;const Z=X.scrollHeight-X.scrollTop-X.clientHeight<80;L.current=Z,j(ie=>ie===!Z?ie:!Z)},[]);R.useEffect(()=>{if(!L.current)return;const X=C.current;X&&(X.scrollTop=X.scrollHeight)},[e,t]);const z=e.length>0&&e[e.length-1].role==="user";R.useEffect(()=>{if(!z)return;L.current=!0,j(!1);const X=C.current;X&&(X.scrollTop=X.scrollHeight)},[z]);const H=R.useCallback(()=>{const X=C.current;X&&(X.scrollTop=X.scrollHeight,L.current=!0,j(!1))},[]);return x.jsxs("div",{className:"relative flex-1 min-h-0",children:[x.jsxs("div",{ref:C,onScroll:q,onMouseUp:U,className:`h-full overflow-y-auto px-3 py-4 space-y-2 relative ${E?"":"px-5 py-6 space-y-6"}`,"data-testid":"chat-stream",children:[e.length===0&&x.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:d?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"text-center mb-4",children:[x.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),x.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.greeting")}),x.jsx("div",{className:"text-ink-muted text-label",children:T("chat.empty.overview")})]}),o?x.jsxs("div",{className:"surface-card p-4 mb-4",children:[x.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:T("chat.empty.summary.title")}),x.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:o})]}):x.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:x.jsx("div",{className:"text-body text-ink-muted",children:T("chat.empty.summary.none")})}),l?x.jsx(x.Fragment,{children:s&&x.jsxs("button",{onClick:s,disabled:t,"data-testid":"start-learning-btn",className:"btn-3d-brand w-full py-3 text-body font-bold flex items-center justify-center gap-2 disabled:opacity-40",children:[x.jsx(DC,{className:"w-4 h-4"}),x.jsx("span",{children:T("chat.empty.start")})]})}):x.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[x.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.keyless.title")}),x.jsx("div",{className:"text-label text-ink-muted mb-3",children:T("chat.empty.keyless.desc")}),x.jsxs("button",{onClick:c,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[x.jsx(Fc,{className:"w-4 h-4"}),x.jsx("span",{children:T("chat.empty.keyless.btn")})]})]})]}):x.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[x.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),x.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.no_node.title")}),x.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:T("chat.empty.no_node.desc")})]})}),e.map(X=>x.jsx("div",{className:E?"":"contents",children:x.jsx("div",{className:E&&X.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:x.jsx(YI,{msg:X,onApplyProposal:n,onRejectProposal:i,onQuizAnswered:N,quizMastery:O,onPickAction:p,onQuizCompleted:y,speakingMessageId:M.speakingMessageId,speakingSentence:M.speakingSentence,onSpeak:M.speak})})},X.id)),t&&x.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),_&&e.length>0&&x.jsxs("button",{onClick:H,"data-testid":"scroll-to-bottom","aria-label":T("chat.scroll.bottom"),title:T("chat.scroll.bottom"),className:"absolute bottom-4 right-4 w-9 h-9 rounded-full bg-ink-strong text-surface-0 shadow-elevated flex items-center justify-center hover:scale-105 active:scale-95 transition-transform msg-enter",children:[x.jsx(ap,{className:"w-5 h-5"}),t&&x.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 bg-brand rounded-full border-2 border-[var(--ink-strong)] animate-pulse"})]}),D&&x.jsxs("button",{onClick:J,"data-testid":"save-chat-note-btn",style:{left:D.x,top:D.y,transform:D.transform},className:"absolute z-20 px-3 py-1.5 rounded-lg bg-brand text-white text-body font-bold shadow-elevated flex items-center gap-1 hover:bg-brand-light transition msg-enter",title:T("chat.note.add.title"),children:[x.jsx(vl,{className:"w-3 h-3"})," ",T("chat.note.add")]})]})}function U2(e){const t=[];for(const n of e)if(n.role==="assistant")for(let i=0;i<n.parts.length;i++){const o=n.parts[i];o.type==="tool-call"&&o.state==="output-available"&&o.output&&typeof o.output=="object"&&"artifactType"in o.output&&t.push({id:`${n.id}-${i}`,toolName:o.toolName,output:o.output})}return t}function YI({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l,speakingMessageId:c,speakingSentence:d,onSpeak:h}){const m=He();if(e.role==="user")return x.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:x.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[x.jsx(PI,{parts:e.parts}),x.jsx("div",{className:"font-medium text-ink-strong whitespace-pre-wrap select-text text-body",children:e.displayText??e.parts.map((p,y)=>p.type==="text"?x.jsx("span",{children:p.text},y):null)})]})});const g=e.parts.map(p=>p.type==="text"?p.text:"").join("").trim(),b=c===e.id;return x.jsxs("div",{className:"msg-enter","data-testid":"msg-assistant","data-msg-id":e.id,children:[x.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((p,y)=>x.jsx(GI,{part:p,msgId:e.id,toolCallIdx:y,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l},y))}),h&&g&&x.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[x.jsx("button",{onClick:()=>h(e.id,g),"data-testid":b?"speech-stop-btn":"speech-speak-btn","aria-label":m(b?"chat.speech.stop":"chat.speech.speak"),title:m(b?"chat.speech.stop":"chat.speech.speak"),className:`w-7 h-7 rounded-lg flex items-center justify-center transition ${b?"bg-brand/15 text-brand":"text-ink-muted hover:bg-ink/[0.06] hover:text-ink"}`,children:b?x.jsx(EE,{className:"w-3.5 h-3.5"}):x.jsx(FC,{className:"w-4 h-4"})}),b&&d&&d.total>0&&x.jsx("span",{className:"text-caption text-ink-muted",children:m("chat.speech.progress").replace("{n}",String(d.index+1)).replace("{total}",String(d.total))})]})]})}function GI({part:e,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d}){if(e.type==="text")return x.jsx("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed break-words [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_img]:max-w-full [&_video]:max-w-full [&_iframe]:max-w-full select-text","data-testid":"part-text",children:x.jsx(ET,{remarkPlugins:[GT],rehypePlugins:[NS,[DS,LS]],urlTransform:p=>p,components:QI,children:e.text})});if(e.type==="reasoning")return x.jsx(XI,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:h,state:m,output:g,error:b}=e;return x.jsx(KI,{toolName:h,state:m,output:g,error:b,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d})}function XI({text:e}){const t=He(),[n,i]=R.useState(!1);return x.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[x.jsxs("button",{onClick:()=>i(o=>!o),className:"w-full flex items-center justify-between px-3 py-1.5 text-label font-bold text-ink-muted hover:text-ink-strong transition-colors",children:[x.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),x.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&x.jsx("div",{className:"px-3 pb-2.5 text-label text-ink-muted whitespace-pre-wrap leading-relaxed border-t border-[var(--border-faint)]/60 pt-2",children:e})]})}function KI({toolName:e,state:t,output:n,error:i,msgId:o,toolCallIdx:s,onApplyProposal:l,onRejectProposal:c,onQuizAnswered:d,quizMastery:h,onPickAction:m,onQuizCompleted:g}){const b=He(),y=(e==="record_answer"||e==="mark_mastered")&&t==="output-available"&&typeof n=="object"&&n!==null?n:null;if(y!=null&&y.proposalId){const k=y.status;return k==="applied"?x.jsxs("div",{className:"proposal-card rounded-xl border border-gold/30 bg-gold/5 p-3 flex items-center gap-2","data-testid":"part-proposal",children:[x.jsx(ai,{className:"w-4 h-4 text-gold shrink-0"}),x.jsx("span",{className:"text-body font-bold text-ink",children:b("chat.proposal.applied")})]}):k==="rejected"?x.jsxs("div",{className:"proposal-card rounded-xl border border-ink/10 bg-ink/5 p-3 flex items-center gap-2","data-testid":"part-proposal",children:[x.jsx(dC,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("span",{className:"text-body text-ink-muted",children:b("chat.proposal.rejected")})]}):x.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[x.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),x.jsxs("div",{className:"pl-4 pr-3 py-3",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:x.jsx(bE,{className:"w-4 h-4"})}),x.jsx("span",{className:"text-lead font-bold text-ink",children:b("chat.proposal.mastered.title")})]}),y.message&&x.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:y.message}),x.jsx("div",{className:"text-caption text-ink-muted mb-3",children:b("chat.proposal.mastered.hint")}),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("button",{onClick:()=>l==null?void 0:l(y.proposalId,o,s),"data-testid":"proposal-apply",className:"btn-3d-brand px-4 py-1.5 text-body",children:[x.jsx(Fn,{className:"w-3.5 h-3.5 inline"}),b("chat.proposal.confirm")]}),x.jsx("button",{onClick:()=>c==null?void 0:c(y.proposalId,o,s),"data-testid":"proposal-reject",className:"btn-3d-neutral px-4 py-1.5 text-body",children:b("chat.proposal.later")})]})]})]})}if(t==="output-available"&&n&&typeof n=="object"&&"artifactType"in n){const k=n.artifactType;return x.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${k}`,"data-tool":e,children:x.jsx(Lp,{data:n,onQuizAnswered:d,quizMastery:h,onPickAction:m,onQuizCompleted:g})})}const T=WI(e,b);return x.jsx("div",{className:"inline-flex items-center gap-1.5 text-label px-2.5 py-1 rounded-md bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-tool","data-tool":e,"data-state":t,children:t==="input-available"?x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsxs("span",{className:"text-ink-muted",children:[T,"…"]})]}):t==="output-error"?x.jsxs(x.Fragment,{children:[x.jsx(Ms,{className:"w-3.5 h-3.5 text-warning shrink-0"}),x.jsxs("span",{className:"text-warning",children:[T,": ",i]})]}):x.jsxs(x.Fragment,{children:[x.jsx(lp,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),x.jsx("span",{className:"text-ink-muted",children:T})]})})}const QI={pre({children:e,...t}){return x.jsx($I,{...t,children:e})},a({children:e,...t}){return x.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return x.jsx("div",{className:"overflow-x-auto my-4",children:x.jsx("table",{children:e})})}};function $I({children:e,...t}){const n=He(),[i,o]=R.useState(!1),s=Array.isArray(e)?e[0]:e,l=(s==null?void 0:s.props)??{},c=/language-(\w+)/.exec(l.className??""),d=(c==null?void 0:c[1])??"",h=()=>{var b;const m=l.children,g=typeof m=="string"?m:Array.isArray(m)?m.join(""):"";(b=navigator.clipboard)==null||b.writeText(g).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})};return x.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-1 border border-b-0 border-[var(--border-faint)] rounded-t-md",children:[x.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:d||"code"}),x.jsx("button",{onClick:h,"aria-label":n("chat.copy"),className:"text-caption text-ink-muted hover:text-brand transition-colors opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 inline-flex items-center gap-1","data-testid":"md-copy",children:i?x.jsxs(x.Fragment,{children:[x.jsx(Fn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):x.jsxs(x.Fragment,{children:[x.jsx(fC,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),x.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}function WI(e,t){return{get_node_info:t("chat.tool.get_node_info"),record_answer:t("chat.tool.record_answer"),mark_mastered:t("chat.tool.mark_mastered"),show_concept_map:t("chat.tool.show_concept_map"),generate_quiz:t("chat.tool.generate_quiz"),compare_table:t("chat.tool.compare_table"),draw_diagram:t("chat.tool.draw_diagram"),show_code_walkthrough:t("chat.tool.show_code_walkthrough")}[e]??e}const pl={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},ZI=new Set(["txt","md","markdown","rst","org","adoc","log","csv","tsv","json","yaml","yml","toml","ini","env","py","js","mjs","cjs","ts","tsx","jsx","go","rs","java","c","h","cpp","hpp","cs","rb","sh","bash","zsh","ps1","sql","html","htm","css","scss","vue","svelte","kt","swift","php","lua","r","dart","scala","clj","ex","exs","erl","hs","ml","jl","m","mm","pl","vb","bat","dockerfile"]);function z2(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function JI(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(z2(e))?n>pl.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:ZI.has(z2(e))?n>pl.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}const jm=16e3,e9=.25;function t9(e){const[t,n]=R.useState(!1),[i,o]=R.useState(""),[s,l]=R.useState(null),c=R.useRef(null),d=R.useRef(null),h=R.useRef(null),m=R.useRef([]),g=R.useRef(0),b=R.useRef(!1),p=R.useRef(e);p.current=e;const y=R.useCallback(()=>{var k,M,N;b.current=!1,(k=h.current)==null||k.disconnect(),h.current=null,(M=d.current)==null||M.getTracks().forEach(O=>O.stop()),d.current=null,(N=c.current)==null||N.close().catch(()=>{}),c.current=null,m.current=[],g.current=0},[]),E=R.useCallback(()=>{b.current&&(y(),n(!1),window.api.asrStop().then(k=>{k.text&&p.current(k.text)}).catch(()=>{}),o(""))},[y]),T=R.useCallback(()=>{if(b.current){E();return}l(null),o(""),(async()=>{var k;try{const M=await window.api.asrStart();if(!M.ok){l(M.reason);return}if(((k=navigator.mediaDevices)==null?void 0:k.getUserMedia)==null){await window.api.asrCancel().catch(()=>{}),l("mic-unavailable");return}const N=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),O=window.AudioContext??window.webkitAudioContext;let A;try{A=new O({sampleRate:jm})}catch{A=new O}c.current=A,d.current=N,b.current=!0;const C=A.createMediaStreamSource(N),L=A.createScriptProcessor(4096,1,1);h.current=L;const _=A.sampleRate/jm;L.onaudioprocess=D=>{if(!b.current)return;const P=D.inputBuffer.getChannelData(0),U=_===1?new Float32Array(P):n9(P,_);if(m.current.push(U),g.current+=U.length,g.current>=jm*e9){const J=a9(m.current);m.current=[],g.current=0,window.api.asrFeed(J).catch(()=>{})}},C.connect(L);const j=A.createGain();j.gain.value=0,L.connect(j),j.connect(A.destination),n(!0)}catch(M){y(),await window.api.asrCancel().catch(()=>{}),n(!1),l(M instanceof Error?M.message:String(M))}})()},[E,y]);return R.useEffect(()=>{const k=window.api.on("speech:asrPartial",M=>{o(M.text)});return()=>{k()}},[]),R.useEffect(()=>()=>{b.current&&(y(),window.api.asrCancel().catch(()=>{}))},[y]),{listening:t,partial:i,startError:s,start:T,stop:E}}function n9(e,t){const n=Math.floor(e.length/t),i=new Float32Array(n);for(let o=0;o<n;o++){const s=o*t,l=Math.floor(s),c=s-l,d=e[l]??0,h=e[l+1]??d;i[o]=d+(h-d)*c}return i}function a9(e){let t=0;for(const o of e)t+=o.length;const n=new Float32Array(t);let i=0;for(const o of e)n.set(o,i),i+=o.length;return n}function i9({onGotoSettings:e}){var E;const t=He(),[n,i]=R.useState(!1),[o,s]=R.useState(null),[l,c]=R.useState(""),[d,h]=R.useState(""),m=R.useRef(null),g=R.useCallback(async()=>{var T,k;try{const[M,N,O,A]=await Promise.all([be.getProviderPresets(),be.listCustomProviders(),be.getSetting("active_provider"),be.getSetting("active_model")]),C=O??"glm",L=await Promise.all(M.map(async U=>await be.getSetting(U.apiKeySetting)!=null)),_=new Set;M.forEach((U,J)=>{(L[J]||U.id===C)&&_.add(U.id)});const j=[],D=(U,J,q)=>{for(const z of q)j.push({providerId:U,providerLabel:J,modelId:z.id,modelLabel:z.label,vision:(z.capabilities??[]).includes("vision"),contextWindow:z.contextWindow})};for(const U of M)_.has(U.id)&&D(U.id,U.label,U.models);for(const U of N)D(U.id,U.label,U.models);const P=A??"";if(P&&!j.some(U=>U.providerId===C&&U.modelId===P)){const U=((T=M.find(J=>J.id===C))==null?void 0:T.label)??((k=N.find(J=>J.id===C))==null?void 0:k.label)??C;j.unshift({providerId:C,providerLabel:U,modelId:P,modelLabel:P,vision:!0,contextWindow:null})}s(j),c(C),h(P)}catch{s([])}},[]);R.useEffect(()=>{g();const T=()=>void g();return window.addEventListener("llm-config-changed",T),()=>window.removeEventListener("llm-config-changed",T)},[g]),R.useEffect(()=>{if(!n)return;const T=M=>{var N;M.target instanceof Node&&((N=m.current)==null?void 0:N.contains(M.target))!==!0&&i(!1)},k=M=>{M.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",T),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",T),document.removeEventListener("keydown",k)}},[n]);const b=async T=>{if(i(!1),!(T.providerId===l&&T.modelId===d))try{await be.setSetting("active_provider",T.providerId),await be.setSetting("active_model",T.modelId),c(T.providerId),h(T.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},p=((E=o==null?void 0:o.find(T=>T.providerId===l&&T.modelId===d))==null?void 0:E.modelLabel)??d??t("model.picker.label"),y=[];for(const T of o??[]){const k=y[y.length-1];k&&k.label===T.providerLabel?k.rows.push(T):y.push({label:T.providerLabel,rows:[T]})}return x.jsxs("div",{ref:m,className:"relative","data-testid":"composer-model",children:[x.jsxs("button",{type:"button",onClick:()=>i(!n),"aria-haspopup":"menu","aria-expanded":n,"data-tooltip":t("model.picker.label"),"data-testid":"composer-model-trigger",className:"flex items-center gap-1 max-w-[13rem] px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[x.jsx("span",{className:"truncate",children:p}),x.jsx(hE,{className:`w-3 h-3 shrink-0 transition-transform ${n?"":"rotate-180"}`})]}),n&&x.jsxs("div",{role:"menu","aria-label":t("model.picker.label"),"data-testid":"composer-model-menu",className:"absolute bottom-full right-0 mb-1.5 z-50 w-64 max-h-72 overflow-y-auto bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5",children:[y.length===0&&x.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),y.map(T=>x.jsxs("div",{role:"group","aria-label":T.label,children:[x.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-caption font-bold text-ink-faint",children:T.label}),T.rows.map(k=>{const M=k.providerId===l&&k.modelId===d;return x.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M,onClick:()=>void b(k),className:`w-full flex items-center gap-1.5 px-3 py-1.5 text-left transition-colors ${M?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[x.jsx(Fn,{className:`w-3.5 h-3.5 shrink-0 ${M?"opacity-100":"opacity-0"}`}),x.jsx("span",{className:"flex-1 truncate text-label",children:k.modelLabel}),k.vision&&x.jsx(mC,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${k.providerId}:${k.modelId}`)})]},T.label)),x.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:x.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{i(!1),e()},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-label text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[x.jsx(IC,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const N0=5.5,H2=2*Math.PI*N0,Ts=["system","node","learner","history","draft"],F2={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function r9({info:e,historyTokens:t,draftTokens:n}){const i=He(),[o,s]=R.useState(!1),l=R.useRef(null);if(R.useEffect(()=>{!(e!=null&&e.contextWindow)&&o&&s(!1)},[e==null?void 0:e.contextWindow,o]),R.useEffect(()=>{if(!o)return;const b=y=>{var E;y.target instanceof Node&&((E=l.current)==null?void 0:E.contains(y.target))!==!0&&s(!1)},p=y=>{y.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",p),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",p)}},[o]),!e)return null;const c={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},d=Ts.reduce((b,p)=>b+c[p],0),h=YC(d,e.contextWindow),m=h!==null&&h>=85,g=GC(Ts.map(b=>c[b]),h??0);return x.jsxs("span",{ref:l,className:"relative inline-flex items-center","data-testid":"composer-context",children:[x.jsxs("button",{type:"button",onClick:()=>s(!o),disabled:e.contextWindow===null,"aria-label":i("context.aria",{p:h!==null?`${h}%`:bs(d)}),"aria-haspopup":"dialog","aria-expanded":o,"data-testid":"composer-context-trigger","data-tooltip":e.contextWindow===null?`${i("context.label")} ~${bs(d)} · ${i("context.unknownWindow")}`:i("context.aria",{p:`${h}%`}),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${m?"text-warning":"text-ink-muted"} hover:bg-ink/[0.06] disabled:hover:bg-transparent`,children:[x.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[x.jsx("circle",{cx:"7",cy:"7",r:N0,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),x.jsx("circle",{cx:"7",cy:"7",r:N0,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${H2*(h??100)/100} ${H2}`,transform:"rotate(-90 7 7)"})]}),h!==null?x.jsxs("span",{children:[h,"%"]}):x.jsxs("span",{children:["~",bs(d)]})]}),o&&e.contextWindow!==null&&x.jsxs("div",{role:"dialog","aria-label":i("context.label"),"data-testid":"composer-context-panel",className:"absolute bottom-full right-0 mb-1.5 z-50 w-64 bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] p-3",children:[x.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[x.jsx("span",{className:"text-label font-bold text-ink-strong",children:i("context.label")}),x.jsxs("span",{className:`text-caption ${m?"text-warning":"text-ink-muted"}`,children:[i("context.approx")," ",bs(d)," / ",bs(e.contextWindow)]})]}),x.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-ink/10 mb-2",role:"img","aria-label":`${h}%`,children:Ts.map(b=>g[Ts.indexOf(b)]>0?x.jsx("div",{className:F2[b],style:{width:`${g[Ts.indexOf(b)]}%`}},b):null)}),x.jsx("dl",{className:"space-y-1",children:Ts.map(b=>x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[x.jsx("span",{className:`w-2 h-2 rounded-sm ${F2[b]}`,"aria-hidden":!0}),i(`context.${b}`)]}),x.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",bs(c[b])]})]},b))})]})]})}const _0={glm:{fast:e=>{e.thinking={type:"disabled"},e.reasoning_effort="low"},deep:e=>{e.thinking={type:"enabled"}}},qwen:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}},siliconcloud:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}}};function s9(e,t,n){if(e==="openai"||e in _0)return e;const i=(t??"").toLowerCase(),o=(n??"").toLowerCase();return i.includes("bigmodel.cn")||i.includes("z.ai")||o.startsWith("glm")?"glm":i.includes("dashscope")||o.startsWith("qwen")?"qwen":i.includes("siliconflow")?"siliconcloud":e}function o9(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in _0?!0:s9(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in _0}const Pm=[{value:"",labelKey:"effort.auto.label",descKey:"effort.auto.desc"},{value:"fast",labelKey:"effort.fast.label",descKey:"effort.fast.desc"},{value:"deep",labelKey:"effort.deep.label",descKey:"effort.deep.desc"}];function l9(){const e=He(),[t,n]=R.useState(!1),[i,o]=R.useState(""),[s,l]=R.useState(!0),c=R.useRef(null),d=R.useRef(null),[h,m]=R.useState("right"),[g,b]=R.useState(0),p=R.useRef(0),[y,E]=R.useState(0);R.useLayoutEffect(()=>{if(!t){E(0),p.current=0,b(0);return}const N=d.current;if(!N)return;const O=N.getBoundingClientRect(),A=O.left-p.current,C=O.right-p.current,L=window.innerWidth;if(y===0){if(A<8&&C<=L-8){m("left"),E(1);return}if(C>L-8&&A>=8){m("right"),E(1);return}E(1)}const _=Math.min(0,L-8-C)+Math.max(0,8-A);_!==p.current&&(p.current=_,b(_))},[t,y]);const T=R.useCallback(async()=>{var N;try{const[O,A,C,L,_]=await Promise.all([be.getSetting("active_provider"),be.getSetting("reasoning_effort"),be.getProviderPresets(),be.listCustomProviders(),be.getSetting("active_model")]),j=O??"glm",D=L.find(J=>J.id===j),P=((N=C.find(J=>J.id===j))==null?void 0:N.protocol)??(D==null?void 0:D.protocol)??"openai-compatible";l(o9(j,P,{baseUrl:D==null?void 0:D.baseUrl,model:_??(D==null?void 0:D.defaultModel)}));const U=A??"";o(U==="fast"||U==="deep"?U:"")}catch{l(!1)}},[]);R.useEffect(()=>{T();const N=()=>void T();return window.addEventListener("llm-config-changed",N),()=>window.removeEventListener("llm-config-changed",N)},[T]),R.useEffect(()=>{if(!t)return;const N=A=>{var C;A.target instanceof Node&&((C=c.current)==null?void 0:C.contains(A.target))!==!0&&n(!1)},O=A=>{A.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",N),document.addEventListener("keydown",O),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",O)}},[t]);const k=async N=>{if(n(!1),N!==i){o(N);try{await be.setSetting("reasoning_effort",N)}catch{o(i)}}},M=Pm.find(N=>N.value===i)??Pm[0];return x.jsxs("div",{ref:c,className:"relative","data-testid":"composer-effort",children:[x.jsxs("button",{type:"button",onClick:()=>!!s&&n(!t),disabled:!s,"aria-haspopup":"menu","aria-expanded":t,"data-testid":"composer-effort-trigger","data-tooltip":e(s?"effort.label":"effort.unsupported"),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${i?"text-accent":"text-ink-muted"} ${s?"hover:text-ink-strong hover:bg-ink/[0.06]":"opacity-40 cursor-not-allowed"}`,children:[x.jsx(oC,{className:"w-3 h-3 shrink-0"}),x.jsx("span",{className:"truncate",children:e(M.labelKey)}),x.jsx(hE,{className:`w-3 h-3 shrink-0 transition-transform ${t?"":"rotate-180"}`})]}),t&&x.jsx("div",{ref:d,role:"menu","aria-label":e("effort.label"),"data-testid":"composer-effort-menu",style:{transform:g?`translateX(${g}px)`:void 0},className:`absolute bottom-full ${h==="right"?"right-0":"left-0"} mb-1.5 z-50 w-60 max-w-[calc(100vw-1.5rem)] bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5`,children:Pm.map(N=>{const O=N.value===i;return x.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":O,onClick:()=>void k(N.value),className:`w-full flex items-start gap-1.5 px-3 py-1.5 text-left transition-colors ${O?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[x.jsx(Fn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${O?"opacity-100":"opacity-0"}`}),x.jsxs("span",{className:"flex-1",children:[x.jsx("span",{className:"block text-label font-bold",children:e(N.labelKey)}),x.jsx("span",{className:"block text-caption text-ink-faint",children:e(N.descKey)})]})]},N.value||"auto")})})]})}const u9={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},c9={direct:ii,guide:pE,practice:bC},d9={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},f9=["image/png","image/jpeg","image/webp","image/gif",".txt",".md",".markdown",".rst",".org",".adoc",".log",".csv",".tsv",".json",".yaml",".yml",".toml",".ini",".py",".js",".mjs",".cjs",".ts",".tsx",".jsx",".go",".rs",".java",".c",".h",".cpp",".hpp",".cs",".rb",".sh",".sql",".html",".css",".scss",".vue",".svelte",".kt",".swift",".php"].join(",");let V2=0;function h9({nodeId:e,agentReady:t,streaming:n,souls:i,activeSoul:o,starterPrompts:s,onPickSoul:l,onSend:c,onStop:d,onLogFriction:h,onGotoSettings:m,insertText:g,historyTokens:b}){const p=He(),y=NE(),[E,T]=R.useState(""),[k,M]=R.useState([]),[N,O]=R.useState(null),[A,C]=R.useState(null),[L,_]=R.useState(!1),j=R.useRef(null),D=R.useRef(0),P=t9(G=>{T(B=>B.trim()?`${B} ${G}`:G)});R.useEffect(()=>{if(!P.startError)return;const G=P.startError==="model-missing"?"chat.speech.asr_model_missing":P.startError==="engine-unavailable"?"chat.speech.engine_unavailable":"chat.speech.asr_start_fail";O(p(G))},[P.startError,p]),R.useEffect(()=>{g&&T(G=>G.trim()?`${G}
|
|
537
|
+
|
|
538
|
+
${g}`:g)},[g]),R.useEffect(()=>{if(!e){C(null);return}let G=!1;(async()=>{try{const ne=await be.getContextUsage(e,y);G||C(ne)}catch{G||C(null)}})();const B=()=>{be.getContextUsage(e,y).then(ne=>{G||C(ne)}).catch(()=>{})};return window.addEventListener("llm-config-changed",B),()=>{G=!0,window.removeEventListener("llm-config-changed",B)}},[e,y]),R.useEffect(()=>{if(!N)return;const G=setTimeout(()=>O(null),3e3);return()=>clearTimeout(G)},[N]);const U=R.useRef(new Set);R.useEffect(()=>()=>{for(const G of U.current)URL.revokeObjectURL(G)},[]);const J=R.useCallback(G=>{M(B=>{const ne=B.find(K=>K.id===G);return ne!=null&&ne.previewUrl&&(URL.revokeObjectURL(ne.previewUrl),U.current.delete(ne.previewUrl)),B.filter(K=>K.id!==G)})},[]),q=R.useCallback(async G=>{if(G.length===0)return;const B=pl.maxPerMessage-k.length;if(B<=0){O(p("chat.attach.tooMany",{n:pl.maxPerMessage}));return}const ne=G.length>B?G.slice(0,B):G;G.length>B&&O(p("chat.attach.tooMany",{n:pl.maxPerMessage}));const K=[],$=[];for(const se of ne){const de=JI(se.name,se.type,se.size);if(!de.ok){O(de.reason==="unsupported"?p("chat.attach.unsupported",{name:se.name}):de.reason==="tooLargeImage"?p("chat.attach.tooLargeImage",{name:se.name}):p("chat.attach.tooLargeText",{name:se.name}));continue}if(de.kind==="image"){if((A==null?void 0:A.visionCapable)===!1){O(p("chat.attach.visionUnsupported"));continue}const Ce=await new Promise($e=>{const We=new FileReader;We.onload=()=>{const Ct=We.result;$e(typeof Ct=="string"?Ct.slice(Ct.indexOf(",")+1):null)},We.onerror=()=>$e(null),We.readAsDataURL(se)});if(Ce===null)continue;const qe=URL.createObjectURL(se);$.push(qe),K.push({id:++V2,kind:"image",name:se.name,mime:se.type||"image/png",size:se.size,previewUrl:qe,base64:Ce})}else try{const Ce=await se.text();K.push({id:++V2,kind:"text",name:se.name,mime:se.type||"text/plain",size:se.size,text:Ce})}catch{}}if(K.length>0){for(const se of $)U.current.add(se);M(se=>[...se,...K])}else for(const se of $)URL.revokeObjectURL(se)},[k.length,A==null?void 0:A.visionCapable,p]),z=()=>{const G=E.trim();if(n||!e||!G&&k.length===0)return;const B=G||cp("chat.attach.imageOnlyText"),ne=k.map(K=>({kind:K.kind,name:K.name,mime:K.mime,size:K.size,data:K.kind==="image"?K.base64??"":K.text??"",...K.kind==="image"&&K.previewUrl?{previewUrl:K.previewUrl}:{}}));c(B,void 0,ne.length>0?ne:void 0),T(""),M([])},H=G=>{n||(c(G.message,G.label),G.frictionCategory&&(h==null||h(G.frictionCategory,null)))},X=G=>{const B=Array.from(G.clipboardData.files??[]);B.length>0&&(G.preventDefault(),q(B))},Z=G=>{G.dataTransfer.types.includes("Files")&&(G.preventDefault(),D.current+=1,_(!0))},ie=G=>{G.dataTransfer.types.includes("Files")&&(D.current=Math.max(0,D.current-1),D.current===0&&_(!1))},V=G=>{G.dataTransfer.types.includes("Files")&&(G.preventDefault(),D.current=0,_(!1),q(Array.from(G.dataTransfer.files??[])))},Y=R.useMemo(()=>wE(E),[E]);return t?x.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[s.length>0&&e&&x.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:s.map((G,B)=>x.jsx("button",{onClick:()=>H(G),disabled:n,"data-testid":`starter-prompt-${B}`,"data-tooltip":G.hint??G.label,className:"shrink-0 whitespace-nowrap px-2.5 py-1 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors disabled:opacity-30",children:G.label},B))}),x.jsxs("div",{className:`rounded-2xl transition-colors px-3 pt-2 pb-1.5 ${L?"bg-accent/10 ring-1 ring-accent":"bg-ink/[0.05] focus-within:bg-ink/[0.07]"}`,onDragEnter:Z,onDragOver:G=>{G.dataTransfer.types.includes("Files")&&G.preventDefault()},onDragLeave:ie,onDrop:V,"data-testid":"composer-card",children:[i.length>0&&x.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[x.jsx("span",{className:"text-body text-ink-faint shrink-0",children:p("chat.soul.label")}),i.map(G=>{const B=o===G.name,ne=c9[G.name]??pE,K=p(d9[G.name]??"soul.direct.desc");return x.jsxs("button",{onClick:()=>l(G.name),"data-testid":`soul-pill-${G.name}`,"data-tooltip":K,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${B?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[x.jsx(ne,{className:"w-3.5 h-3.5"}),x.jsx("span",{children:p(u9[G.name]??"soul.direct")})]},G.id)})]}),k.length>0&&x.jsxs("div",{className:"flex gap-1.5 flex-wrap mb-1.5","data-testid":"composer-attachments",children:[(A==null?void 0:A.visionBridgeModel)&&k.some(G=>G.kind==="image")&&x.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[x.jsx(OC,{className:"w-3.5 h-3.5 shrink-0"}),x.jsx("span",{children:p("chat.attach.bridgeChip",{model:A.visionBridgeModel})})]}),k.map(G=>G.kind==="image"?x.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[x.jsx("img",{src:G.previewUrl,alt:G.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),x.jsx("button",{type:"button",onClick:()=>J(G.id),"aria-label":p("chat.attach.remove",{name:G.name}),className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-ink/70 hover:bg-warning text-white flex items-center justify-center transition-colors",children:x.jsx(la,{className:"w-3 h-3"})})]},G.id):x.jsxs("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-1 rounded-full bg-ink/[0.08] text-caption text-ink-strong",children:[x.jsx(Rl,{className:"w-3 h-3 shrink-0 text-ink-faint"}),x.jsx("span",{className:"truncate max-w-[10rem]",children:G.name}),x.jsx("button",{type:"button",onClick:()=>J(G.id),"aria-label":p("chat.attach.remove",{name:G.name}),className:"w-4 h-4 rounded-full hover:bg-ink/20 flex items-center justify-center text-ink-muted hover:text-warning transition-colors",children:x.jsx(la,{className:"w-2.5 h-2.5"})})]},G.id))]}),N&&x.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:N}),x.jsxs("div",{className:"flex gap-2 items-end",children:[x.jsx("textarea",{value:E,onChange:G=>T(G.target.value),onKeyDown:G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),z())},onPaste:X,placeholder:p(e?"chat.input.placeholder":"chat.input.no_node"),disabled:n||!e,rows:2,"data-testid":"chat-input",className:"flex-1 bg-transparent text-ink-strong text-body rounded-lg px-1 py-1 resize-none focus:outline-none disabled:opacity-40 placeholder:text-ink-faint"}),n?x.jsx("button",{onClick:d,"data-testid":"chat-stop",className:"btn-icon-3d-warning shrink-0 w-9 h-9",title:p("chat.stop"),"aria-label":p("chat.stop"),children:x.jsx(EE,{className:"w-3.5 h-3.5 fill-current"})}):x.jsx("button",{onClick:z,disabled:n||!E.trim()&&k.length===0||!e,"data-testid":"chat-send",className:"btn-icon-3d-brand shrink-0 w-9 h-9",title:p("chat.send"),"aria-label":p("chat.send"),children:x.jsx(rC,{className:"w-4 h-4"})})]}),x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[x.jsxs("button",{type:"button",onClick:P.listening?P.stop:P.start,"data-tooltip":P.listening?p("chat.speech.dictation_stop"):p("chat.speech.dictation"),"aria-label":P.listening?p("chat.speech.dictation_stop"):p("chat.speech.dictation"),"data-testid":P.listening?"composer-mic-active":"composer-mic",className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${P.listening?"text-warning animate-pulse":"text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06]"}`,children:[x.jsx(wC,{className:"w-3.5 h-3.5"}),P.listening&&P.partial&&x.jsx("span",{className:"max-w-40 truncate","data-testid":"asr-partial",children:P.partial})]}),x.jsx("button",{type:"button",onClick:()=>{var G;return(G=j.current)==null?void 0:G.click()},"data-tooltip":p("chat.attach.add"),"aria-label":p("chat.attach.add"),"data-testid":"composer-attach",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:x.jsx(_C,{className:"w-3 h-3"})}),x.jsx("input",{ref:j,type:"file",multiple:!0,accept:f9,className:"hidden",onChange:G=>{q(Array.from(G.target.files??[])),G.target.value=""}}),x.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[x.jsx(l9,{}),x.jsx(r9,{info:A,historyTokens:b,draftTokens:Y}),x.jsx(i9,{onGotoSettings:m})]})]})]})]}):x.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:x.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[x.jsx("span",{children:p("chat.no_key.short")}),x.jsx("button",{onClick:m,className:"text-brand hover:underline font-bold",children:p("chat.no_key.cta")})]})})}function Bm(e){return e.length>=200||e.includes("```")?90:60}function m9(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function p9(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function q2(e,t){const n=Array.from({length:e},(i,o)=>o);for(let i=e-1;i>0;i--){const o=Math.floor(t()*(i+1)),s=n[i];n[i]=n[o],n[o]=s}return n}function g9(e,t){const n=p9(m9(t)),i=q2(e.length,n),o={};for(const s of e)o[s.id]=q2(Math.max(1,s.optionCount),n);return{questionOrder:i,optionPerms:o}}function x9(e,t){const n=e[t];return String(n??t)}function b9({stars:e}){return x.jsx("div",{className:"flex gap-1","aria-label":`${e} stars`,children:[1,2,3].map(t=>x.jsx(UC,{className:`w-7 h-7 ${t<=e?"text-gold fill-gold":"text-ink/20"}`},t))})}function y9({examNode:e,locale:t,onExamCompleted:n,onSessionChange:i,paused:o}){const s=He(),[l,c]=R.useState("loading"),[d,h]=R.useState(null),[m,g]=R.useState([]),[b,p]=R.useState(null),[y,E]=R.useState(0),[T,k]=R.useState(null),[M,N]=R.useState(null),[O,A]=R.useState(""),[C,L]=R.useState(0),[_,j]=R.useState(null),D=R.useRef({}),P=R.useRef(null),U=R.useRef(null),J=R.useRef(null),q=b?m[b.questionOrder[y]]??null:null,z=q&&b?b.optionPerms[q.id]??[]:[],H=(q==null?void 0:q.options)??[],X=z.length===H.length?z:H.map((B,ne)=>ne);R.useEffect(()=>{let B=!1;return c("loading"),A(""),N(null),h(null),(async()=>{try{const ne=await be.examGetStatus(e.id);if(B)return;h(ne),g(ne.exercises),ne.status==="generating"?c("generating"):ne.status==="failed"?(A(ne.error??s("exam.errorEmpty")),c("failed")):ne.status==="ready"?ne.latestAttempt&&ne.latestAttempt.finishedAt?(N({correctCount:ne.latestAttempt.correctCount,totalCount:ne.latestAttempt.totalCount,stars:ne.latestAttempt.stars,bestStars:ne.bestStars,terminated:ne.latestAttempt.terminated,perQuestion:ne.latestAttempt.perQuestion??[]}),c("result")):c("ready"):(c("generating"),be.examPrepare(e.id,t??null).catch(()=>{}))}catch(ne){B||(A(ne instanceof Error?ne.message:String(ne)),c("failed"))}})(),()=>{B=!0}},[e.id]),R.useEffect(()=>be.on("exam:status",ne=>{ne.nodeId===e.id&&(ne.status==="ready"?be.examGetStatus(e.id).then(K=>{h(K),g(K.exercises),c($=>$==="generating"?K.latestAttempt?"result":"ready":$)}).catch(()=>{}):ne.status==="failed"?(A(ne.error??s("exam.errorEmpty")),c("failed")):(h(K=>K&&{...K,...ne}),c(K=>K==="loading"?"generating":K)))}),[e.id]);const Z=R.useCallback(async()=>{var B;try{const ne=await be.examStartAttempt(e.id),K=g9(ne.exercises.map($=>{var se;return{id:$.id,optionCount:((se=$.options)==null?void 0:se.length)??0}}),ne.attemptId);g(ne.exercises),P.current=ne.attemptId,p(K),D.current={},E(0),k(null),N(null),U.current=null,c("answering"),L(Bm(((B=ne.exercises[K.questionOrder[0]])==null?void 0:B.prompt)??""))}catch(ne){A(ne instanceof Error?ne.message:String(ne)),c("failed")}},[e.id]),ie=R.useCallback(()=>{j(null),N(null),c("generating"),h(B=>B&&{...B,status:"generating",done:0,total:0}),be.examRegenerate(e.id,t??null).then(B=>{B.status==="failed"&&(A(B.error??s("exam.errorEmpty")),c("failed"))}).catch(B=>{A(B instanceof Error?B.message:String(B)),c("failed")})},[e.id,t,s]),V=x.jsxs(x.Fragment,{children:[x.jsxs("button",{className:"btn-3d-neutral px-4 py-1.5 text-body","data-testid":"exam-regen-btn",onClick:B=>j(B.currentTarget.getBoundingClientRect()),children:[x.jsx(Ac,{className:"w-3.5 h-3.5 inline"}),s("exam.regenerate")]}),_&&x.jsx(cd,{anchorRect:_,message:s("exam.regenerate.confirmMsg"),confirmLabel:s("exam.regenerate"),onConfirm:ie,onCancel:()=>j(null)})]});R.useEffect(()=>{var B;l!=="answering"||!q||U.current!==q.id&&(L(Bm(q.prompt)),k(null),(B=J.current)==null||B.scrollTo({top:0}))},[y,l]),R.useEffect(()=>{if(l!=="answering"||o)return;const B=setInterval(()=>{L(ne=>ne>0?ne-1:0)},1e3);return()=>clearInterval(B)},[l,o]);const Y=R.useCallback(B=>{const ne=q;if(!ne||l!=="answering"||U.current===ne.id)return;U.current=ne.id;const K=B===null?"":x9(X,B),$={...D.current,[ne.id]:K};D.current=$,P.current&&be.examRecordAnswer(e.id,P.current,ne.id,K).catch(()=>{}),y+1<m.length?E(y+1):(c("submitting"),(async()=>{try{const se=await be.examSubmitAttempt(e.id,P.current,$);N({correctCount:se.correctCount,totalCount:se.totalCount,stars:se.stars,bestStars:se.bestStars,terminated:se.terminated,perQuestion:se.perQuestion}),c("result"),n==null||n(),se.stars>=1&&Ar("exam-pass")}catch(se){A(se instanceof Error?se.message:String(se)),c("failed")}})())},[q,l,X,y,m.length,e.id,n]),G=R.useCallback(()=>{T!==null&&Y(T)},[T,Y]);if(R.useEffect(()=>{l!=="answering"||C>0||o||Y(T)},[C,l,o]),R.useEffect(()=>{const B=async()=>{if(P.current)try{await be.examSubmitAttempt(e.id,P.current,D.current,{terminated:!0}),n==null||n()}catch{}},ne=l==="answering"||l==="submitting";return i==null||i(ne?{active:!0,terminate:B}:{active:!1,terminate:null}),()=>i==null?void 0:i({active:!1,terminate:null})},[l,e.id,n,i]),l==="loading")return x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-loading",children:[x.jsx(Rs,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),x.jsxs("div",{className:"flex gap-1",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]});if(l==="generating"){const B=(d==null?void 0:d.done)??0,ne=(d==null?void 0:d.total)??0,K=ne>0?Math.round(B/ne*100):0;return x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-generating",children:[x.jsx(Rs,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),x.jsx("div",{className:"text-title font-bold text-ink mb-2",children:s("exam.generating.title")}),x.jsx("div",{className:"text-body text-ink-muted mb-4",children:s("exam.generating.stage")}),x.jsx("div",{className:"w-56 h-2.5 rounded-full bg-ink/10 overflow-hidden mb-2",role:"progressbar","aria-valuenow":K,"aria-valuemin":0,"aria-valuemax":100,children:x.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.max(4,K)}%`}})}),x.jsx("div",{className:"text-label text-ink-muted tabular-nums mb-6",children:ne>0?s("exam.generating.kcProgress",{done:B,total:ne}):s("exam.generating.preparing")}),x.jsx("div",{className:"text-caption text-ink-muted max-w-xs text-center",children:s("exam.generating.canLeave")})]})}if(l==="failed")return x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 text-center","data-testid":"exam-error",children:[x.jsx(i0,{className:"w-10 h-10 text-warning mb-3"}),x.jsx("div",{className:"text-body font-bold text-ink mb-1",children:s("exam.errorTitle")}),x.jsx("div",{className:"text-body text-ink-muted mb-4 max-w-xs break-words",children:O||s("exam.errorEmpty")}),x.jsxs("button",{className:"btn-3d-brand px-4 py-1.5 text-body",onClick:()=>{c("generating"),be.examPrepare(e.id,t??null).catch(()=>{})},children:[x.jsx(Ac,{className:"w-3.5 h-3.5 inline"}),s("exam.failed.retry")]})]});if(l==="ready"&&d){const B=d.exercises.reduce((K,$)=>K+Bm($.prompt),0),ne=Math.max(1,Math.round(B/60));return x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-ready",children:[x.jsx("div",{className:"w-14 h-14 rounded-full bg-brand/15 flex items-center justify-center mb-4",children:x.jsx(Rs,{className:"w-7 h-7 text-brand"})}),x.jsx("div",{className:"text-hero font-extrabold text-ink mb-1",children:s("exam.ready.title")}),x.jsx("div",{className:"text-body text-ink-muted mb-3 text-center",children:e.title}),x.jsx("div",{className:"text-label text-ink-muted mb-8",children:s("exam.ready.meta",{q:d.questionCount,kc:d.kcCount,min:ne})}),x.jsxs("div",{className:"flex flex-col items-center gap-3",children:[x.jsxs("button",{className:"btn-3d-brand px-6 py-2 text-lead",onClick:Z,"data-testid":"exam-start-btn",children:[s("exam.start"),x.jsx(a0,{className:"w-4 h-4 inline ml-1"})]}),V]})]})}if(l==="answering"||l==="submitting"){if(!q)return null;const B=C<=10;return x.jsxs("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"exam-answering",children:[x.jsxs("div",{className:"px-6 pt-6 w-full max-w-2xl mx-auto shrink-0",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3",children:[x.jsx("div",{className:"text-label text-ink-muted tabular-nums",children:s("exam.q.progress",{i:y+1,n:m.length})}),x.jsxs("div",{className:`flex items-center gap-1 text-label font-bold tabular-nums transition-colors ${B?"text-warning":"text-ink"}`,"data-testid":"exam-timer",children:[x.jsx(zC,{className:"w-3.5 h-3.5"}),Math.floor(C/60),":",String(C%60).padStart(2,"0")]})]}),x.jsx("div",{className:"w-full h-1.5 rounded-full bg-ink/10 overflow-hidden mb-6",children:x.jsx("div",{className:"h-full bg-accent transition-all duration-300",style:{width:`${y/m.length*100}%`}})})]}),x.jsxs("div",{ref:J,className:"flex-1 min-h-0 overflow-y-auto px-6 pb-6 w-full max-w-2xl mx-auto",children:[q.kcTitle&&x.jsxs("div",{className:"inline-flex items-center gap-1 text-caption text-accent bg-accent/10 rounded-full px-2.5 py-1 mb-3 self-start",children:[x.jsx(Hc,{className:"w-3 h-3"}),q.kcTitle]}),x.jsx("div",{className:"text-lead text-ink leading-relaxed mb-6 whitespace-pre-wrap break-words",children:q.prompt}),x.jsx("div",{className:"flex flex-col gap-2.5",children:X.map((ne,K)=>x.jsx("button",{onClick:()=>k(K),"data-testid":`exam-option-${K}`,className:`text-left px-4 py-3 rounded-xl border transition-all duration-150 ${T===K?"border-accent bg-accent/15 text-ink":"border-ink/10 bg-ink/5 text-ink hover:border-ink/25"}`,children:x.jsx("span",{className:"text-body break-words",children:H[ne]})},ne))}),x.jsx("div",{className:"mt-6 flex justify-end",children:l==="submitting"?x.jsx("div",{className:"text-body text-ink-muted",children:s("exam.submitting")}):x.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body disabled:opacity-40 disabled:cursor-not-allowed",disabled:T===null,onClick:G,"data-testid":"exam-next-btn",children:[y+1<m.length?s("exam.q.next"):s("exam.q.submit"),x.jsx(a0,{className:"w-3.5 h-3.5 inline ml-1"})]})})]})]})}if(l==="result"&&M){const B=M.totalCount>0?Math.round(M.correctCount/M.totalCount*100):0,ne=new Map;for(const $ of M.perQuestion){const se=$.kcTitle??"";if(!se)continue;const de=ne.get(se)??{correct:0,total:0};de.total++,$.correct&&de.correct++,ne.set(se,de)}const K=new Map(m.map($=>[$.id,$]));return x.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-2xl w-full mx-auto","data-testid":"exam-result",children:[x.jsxs("div",{className:"flex flex-col items-center mb-6",children:[x.jsx(b9,{stars:M.stars}),x.jsx("div",{className:"text-hero font-extrabold text-ink mt-3",children:s("exam.result.score",{correct:M.correctCount,total:M.totalCount})}),x.jsx("div",{className:"text-body text-ink-muted mt-1",children:s("exam.result.accuracy",{pct:B})}),x.jsxs("div",{className:"flex items-center gap-3 text-label text-ink-muted mt-2",children:[x.jsx("span",{children:s("exam.result.best",{stars:M.bestStars})}),d&&d.attemptCount>1&&x.jsx("span",{children:s("exam.result.attempts",{n:d.attemptCount})})]})]}),M.terminated&&x.jsxs("div",{className:"rounded-xl border border-warning/40 bg-warning/10 px-4 py-3 mb-6 flex items-center gap-2",children:[x.jsx(i0,{className:"w-4 h-4 text-warning shrink-0"}),x.jsx("span",{className:"text-body text-ink",children:s("exam.terminated.banner")})]}),ne.size>0&&x.jsxs("div",{className:"mb-8",children:[x.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.kcBreakdown")}),x.jsx("div",{className:"flex flex-col gap-2",children:[...ne.entries()].map(([$,se])=>{const Ce=(se.total>0?se.correct/se.total:0)<.6;return x.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 rounded-xl bg-ink/5","data-testid":"exam-kc-row",children:[x.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x.jsx(Hc,{className:"w-3.5 h-3.5 text-accent shrink-0"}),x.jsx("span",{className:"text-body text-ink truncate",children:$})]}),x.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[Ce&&x.jsx("span",{className:"text-caption text-warning",children:s("exam.result.weakKc")}),x.jsxs("span",{className:"text-label text-ink-muted tabular-nums",children:[se.correct,"/",se.total]})]})]},$)})})]}),x.jsxs("div",{className:"mb-8",children:[x.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.review")}),x.jsx("div",{className:"flex flex-col gap-2",children:M.perQuestion.map(($,se)=>{const de=K.get($.exerciseId),Ce=$.options??(de==null?void 0:de.options)??null,qe=$.prompt??(de==null?void 0:de.prompt)??`#${se+1}`,$e=We=>Ce&&We!==""&&Ce[Number(We)]!==void 0?Ce[Number(We)]:We;return x.jsx("div",{className:"px-4 py-3 rounded-xl bg-ink/5","data-testid":"exam-review-row",children:x.jsxs("div",{className:"flex items-start gap-2",children:[$.correct?x.jsx(Fn,{className:"w-4 h-4 text-brand shrink-0 mt-0.5"}):x.jsx(la,{className:`w-4 h-4 shrink-0 mt-0.5 ${$.answered?"text-warning":"text-ink-muted"}`}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("div",{className:"text-body text-ink mb-1",children:qe}),x.jsx("div",{className:"text-caption text-ink-muted",children:$.answered?$.correct?x.jsx("span",{className:"text-brand",children:s("exam.result.correctLabel")}):x.jsxs(x.Fragment,{children:[s("exam.result.yourAnswer"),":",$e($.userAnswer),x.jsx("span",{className:"mx-1",children:"·"}),s("exam.result.correctAnswer"),":",$e($.correctAnswer)]}):s("exam.result.unanswered")}),$.explanation&&x.jsx("div",{className:"text-caption text-ink-muted mt-1 leading-relaxed",children:$.explanation})]})]})},$.exerciseId)})})]}),x.jsxs("div",{className:"flex justify-center items-center gap-3 pb-4",children:[x.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body",onClick:Z,"data-testid":"exam-retry-btn",children:[x.jsx(Ac,{className:"w-3.5 h-3.5 inline"}),s("exam.retryExam")]}),V]})]})}return null}const v9=[{id:"explain_simple",icon:Hc,labelKey:"command.explain_simple",group:"command.group.node",requiresNode:!0},{id:"quiz_3",icon:Rl,labelKey:"command.quiz_3",group:"command.group.node",requiresNode:!0},{id:"concept_map",icon:rp,labelKey:"command.concept_map",group:"command.group.node",requiresNode:!0},{id:"compare_prev",icon:lC,labelKey:"command.compare_prev",group:"command.group.node",requiresNode:!0},{id:"socratic",icon:bE,labelKey:"command.socratic",group:"command.group.mode"},{id:"exam_mode",icon:Rs,labelKey:"command.exam_mode",group:"command.group.mode"}],E9=["command.group.node","command.group.mode","command.group.nav"];function T9({onClose:e,onPick:t,hasNode:n}){const i=He(),[o,s]=R.useState(""),[l,c]=R.useState(0),d=R.useRef(null),h=R.useRef(null);R.useEffect(()=>{var p;(p=d.current)==null||p.focus()},[]),Bs(h,!0);const g=v9.filter(p=>i(p.labelKey).toLowerCase().includes(o.toLowerCase())).filter(p=>!p.requiresNode||n),b=p=>{p.key==="ArrowDown"?(p.preventDefault(),c(y=>Math.min(y+1,g.length-1))):p.key==="ArrowUp"?(p.preventDefault(),c(y=>Math.max(y-1,0))):p.key==="Enter"&&g[l]&&(p.preventDefault(),t(g[l].id))};return x.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh] px-4","data-testid":"command-palette",children:[x.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),x.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":i("command.footer.hint"),className:"relative w-full max-w-lg bg-surface-0 rounded-xl shadow-elevated overflow-hidden",children:[x.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border-faint)]",children:[x.jsx(sp,{className:"w-4 h-4 text-ink-faint"}),x.jsx("input",{ref:d,value:o,onChange:p=>{s(p.target.value),c(0)},onKeyDown:b,placeholder:i("command.placeholder"),className:"flex-1 bg-transparent text-body text-ink-strong placeholder:text-ink-faint focus:outline-none","data-testid":"command-input"}),x.jsx("kbd",{className:"text-caption text-ink-faint px-1.5 py-0.5 rounded border border-[var(--border-faint)]",children:"ESC"})]}),x.jsx("div",{className:"max-h-80 overflow-y-auto py-2","data-testid":"command-list",children:g.length===0?x.jsx("div",{className:"px-4 py-6 text-center text-body text-ink-faint",children:i(n?"command.empty.node":"command.empty.nonode")}):E9.map(p=>{const y=g.filter(E=>E.group===p);return y.length===0?null:x.jsxs("div",{children:[x.jsx("div",{className:"px-4 pt-2 pb-1 text-caption font-bold text-ink-faint uppercase tracking-wider",children:i(p)}),y.map(E=>{const T=g.indexOf(E),k=E.icon;return x.jsxs("button",{onClick:()=>t(E.id),onMouseEnter:()=>c(T),"data-testid":`command-${E.id}`,className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${T===l?"bg-brand/10 text-brand":"text-ink-muted hover:bg-surface-1 hover:bg-surface-3/50"}`,children:[x.jsx(k,{className:"w-4 h-4 shrink-0","aria-hidden":"true"}),x.jsx("span",{className:"text-body font-medium flex-1",children:i(E.labelKey)})]},E.id)})]},p)})}),x.jsxs("div",{className:"px-4 py-2 border-t border-[var(--border-faint)] flex items-center justify-between text-caption text-ink-faint",children:[x.jsx("span",{children:i("command.footer.hint")}),x.jsx("span",{children:i("command.footer.keys")})]})]})]})}const XS="lookatstudy-theme",Y2="auto",KS="(prefers-color-scheme: dark)";function Um(){return typeof window>"u"||window.matchMedia(KS).matches?"dark":"light"}function S9(){if(typeof localStorage>"u")return Y2;const e=localStorage.getItem(XS);return e==="auto"||e==="light"||e==="dark"?e:Y2}function zm(e){const t=document.documentElement;t.classList.remove("dark","light"),t.classList.add(e),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{resolved:e}}))}function w9(){const[e,t]=R.useState(()=>S9()),[n,i]=R.useState(()=>e==="auto"?Um():e),o=R.useCallback(s=>{t(s),localStorage.setItem(XS,s);const l=s==="auto"?Um():s;i(l),zm(l)},[]);return R.useEffect(()=>{if(e!=="auto")return;const s=window.matchMedia(KS),l=c=>{const d=c.matches?"dark":"light";i(d),zm(d)};return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),R.useEffect(()=>{const s=e==="auto"?Um():e;i(s),zm(s)},[e]),{mode:e,resolved:n,setMode:o}}const Hn="bg-surface-1 text-ink text-body rounded-lg border border-[var(--border)] focus:border-brand focus:outline-none transition-colors placeholder:text-ink-faint",al="bg-surface-3 text-ink-muted hover:bg-surface-3 hover:bg-surface-3 hover:text-ink-strong",il="bg-brand text-white shadow-sm";function Un(e){return e?"px-4 py-3.5 border-t border-[var(--border-faint)]":"px-4 py-3.5"}function k9(){const e=He(),[t,n]=R.useState([]),[i,o]=R.useState([]),[s,l]=R.useState("glm"),[c,d]=R.useState(""),[h,m]=R.useState(""),[g,b]=R.useState(null),[p,y]=R.useState(!1),[E,T]=R.useState(null),[k,M]=R.useState(!1),[N,O]=R.useState(!1),[A,C]=R.useState(""),[L,_]=R.useState("openai-compatible"),[j,D]=R.useState(""),[P,U]=R.useState(""),[J,q]=R.useState(""),[z,H]=R.useState(!1),[X,Z]=R.useState(null),[ie,V]=R.useState([]),[Y,G]=R.useState(!1),[B,ne]=R.useState(null),[K,$]=R.useState(null),[se,de]=R.useState(""),[Ce,qe]=R.useState(!1),$e=w9(),We=async()=>{G(!0),ne(null);try{const ge=await be.discoverModels();ge.ok&&ge.models?V(ge.models):ne(ge.error||e("settings.discover_failed"))}catch(ge){ne(ge instanceof Error?ge.message:String(ge))}finally{G(!1)}},Ct=R.useCallback(async()=>{try{const[ge,Ue,Ie,he]=await Promise.all([be.getProviderPresets(),be.listCustomProviders(),be.getSetting("active_provider"),be.getSetting("active_model")]);n(ge),o(Ue);const Te=Ie??"glm";if(l(Te),Te.startsWith("custom-")){const Re=Ue.find(_e=>_e.id===Te);b(Re!=null&&Re.hasApiKey?e("settings.key.configured"):null)}else{const Re=ge.find(_e=>_e.id===Te);if(Re){const _e=await be.getSetting(Re.apiKeySetting);b(_e?`${_e.slice(0,4)}…${_e.slice(-4)}`:null)}}if(Te.startsWith("custom-")){const Re=Ue.find(_e=>_e.id===Te);d(he??(Re==null?void 0:Re.defaultModel)??"")}else{const Re=ge.find(_e=>_e.id===Te);d(he??(Re==null?void 0:Re.defaultModel)??"")}}catch(ge){console.error("[SettingsView] load() failed:",ge)}},[e]);R.useEffect(()=>{Ct()},[Ct]);const Rt=async ge=>{l(ge),T(null),m("");const Ue=t.find(Ie=>Ie.id===ge);if(Ue){const Ie=await be.getSetting(Ue.apiKeySetting);b(Ie?`${Ie.slice(0,4)}…${Ie.slice(-4)}`:null),d(c||Ue.defaultModel)}},Nt=async()=>{M(!1);try{if(await be.setSetting("active_provider",s),await be.setSetting("active_model",c),h.trim()){const ge=t.find(Ue=>Ue.id===s);ge&&(await be.setSetting(ge.apiKeySetting,h.trim()),b(`${h.trim().slice(0,4)}…${h.trim().slice(-4)}`),m(""))}M(!0),setTimeout(()=>M(!1),2e3),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},Kt=async()=>{y(!0),T(null);try{const ge=await be.testLlmConnection();T(ge)}catch(ge){T({ok:!1,detail:ge instanceof Error?ge.message:String(ge),errorKind:"unknown"})}finally{y(!1)}},mn=async()=>{if(!(!j.trim()||!J.trim()||z)){H(!0),Z(null);try{const ge=await be.testCustomProvider({label:A||e("settings.custom.test_label"),protocol:L,baseUrl:j.trim(),apiKey:P.trim()||void 0,defaultModel:J.trim()});Z({ok:ge.ok,detail:ge.detail})}catch(ge){Z({ok:!1,detail:ge instanceof Error?ge.message:String(ge)})}finally{H(!1)}}},pn=async()=>{if(!(!A.trim()||!j.trim()||!J.trim()))try{const ge=await be.createCustomProvider({label:A.trim(),protocol:L,baseUrl:j.trim(),apiKey:P.trim()||void 0,defaultModel:J.trim()});await be.setSetting("active_provider",ge.id),await be.setSetting("active_model",ge.defaultModel),l(ge.id),d(ge.defaultModel),C(""),D(""),U(""),q(""),_("openai-compatible"),Z(null),O(!1),await Ct(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},Qt=async ge=>{try{await be.deleteCustomProvider(ge),s===ge&&(await be.setSetting("active_provider","glm"),l("glm")),await Ct()}catch{}},pt=s.startsWith("custom-")?i.find(ge=>ge.id===s):null;R.useEffect(()=>{if(!pt)return;const ge=pt.models.find(Ue=>Ue.id===c);de(ge!=null&&ge.contextWindow?String(ge.contextWindow):"")},[pt,c]);const gn=async()=>{var Te,Re;if(!pt)return;const ge=se.trim().replace(/[,\s_]/g,""),Ue=/^(\d+)([km]?)$/i.exec(ge);if(ge!==""&&!Ue)return;const Ie=((Te=Ue==null?void 0:Ue[2])==null?void 0:Te.toLowerCase())==="k"?1e3:((Re=Ue==null?void 0:Ue[2])==null?void 0:Re.toLowerCase())==="m"?1e6:1,he=ge===""||!Ue?null:Math.max(1,Math.round(parseInt(Ue[1],10)*Ie));qe(!0);try{const _e=pt.models.map(Ye=>Ye.id===c?{...Ye,contextWindow:he}:Ye);await be.updateCustomProvider(pt.id,{models:_e}),await Ct(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}finally{qe(!1)}},Ht=s.startsWith("custom-")?null:t.find(ge=>ge.id===s);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"px-5 pt-5 space-y-6",children:[x.jsxs("section",{children:[x.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.ai")}),x.jsxs("div",{className:"surface-card overflow-hidden",children:[x.jsxs("div",{className:Un(!1),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.provider")}),x.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"provider-grid",children:[t.map(ge=>x.jsx("button",{onClick:()=>Rt(ge.id),"data-testid":`provider-card-${ge.id}`,"aria-pressed":s===ge.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors ${s===ge.id?il:al}`,children:ge.label},ge.id)),i.map(ge=>x.jsxs("button",{onClick:()=>Rt(ge.id),"data-testid":`provider-card-${ge.id}`,"aria-pressed":s===ge.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors inline-flex items-center gap-1 ${s===ge.id?il:al}`,children:[x.jsx(lp,{className:"w-3.5 h-3.5","aria-hidden":"true"}),ge.label]},ge.id)),x.jsxs("button",{onClick:()=>O(ge=>!ge),"data-testid":"add-custom-provider",className:"px-3 py-1.5 rounded-lg text-label whitespace-nowrap inline-flex items-center gap-1 border border-dashed border-[var(--border)] text-ink-muted hover:border-ink-muted hover:text-ink-strong transition-colors",children:[x.jsx(ud,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.add_custom")]})]})]}),N&&x.jsxs("div",{className:"px-4 py-3.5 bg-surface-1 border-t border-[var(--border-faint)] space-y-2.5","data-testid":"custom-provider-form",children:[x.jsx("div",{className:"text-label font-bold text-ink-strong",children:e("settings.custom.form_title")}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("input",{type:"text",value:A,onChange:ge=>C(ge.target.value),placeholder:e("settings.custom.label_ph"),"data-testid":"custom-label",className:`${Hn} flex-1 px-2.5 py-1.5`}),x.jsxs("select",{value:L,onChange:ge=>_(ge.target.value),"data-testid":"custom-protocol",className:`${Hn} px-2 py-1.5`,children:[x.jsx("option",{value:"openai-compatible",children:e("settings.proto.openai")}),x.jsx("option",{value:"anthropic",children:"Anthropic"}),x.jsx("option",{value:"google",children:"Google"})]})]}),x.jsx("input",{type:"text",value:j,onChange:ge=>D(ge.target.value),placeholder:e("settings.custom.baseurl_ph"),"data-testid":"custom-baseurl",className:`${Hn} w-full px-2.5 py-1.5 font-mono`}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("input",{type:"text",value:J,onChange:ge=>q(ge.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"custom-model",className:`${Hn} flex-1 px-2.5 py-1.5 font-mono`}),x.jsx("input",{type:"password",value:P,onChange:ge=>U(ge.target.value),placeholder:e("settings.custom.apikey_ph"),"data-testid":"custom-apikey",className:`${Hn} flex-1 px-2.5 py-1.5`})]}),X&&x.jsxs("div",{className:`text-label rounded p-2 inline-flex items-start gap-1.5 ${X.ok?"bg-brand/10 text-brand":"bg-warning/10 text-warning"}`,children:[X.ok?x.jsx(ai,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}):x.jsx(Ms,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}),x.jsx("span",{className:"break-words",children:X.detail})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("button",{onClick:mn,disabled:!j.trim()||!J.trim()||z,"data-testid":"custom-test",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(z?"settings.testing":"settings.test")}),x.jsx("button",{onClick:pn,disabled:!A.trim()||!j.trim()||!J.trim(),"data-testid":"custom-save",className:"btn-3d-brand px-3 py-1.5 text-label disabled:opacity-40",children:e("settings.custom.save")}),x.jsx("button",{onClick:()=>O(!1),className:"text-label text-ink-muted hover:text-ink-strong px-3 py-1.5 transition-colors",children:e("action.cancel")})]})]}),i.length>0&&s.startsWith("custom-")&&x.jsx("div",{className:Un(!0),children:x.jsx("button",{onClick:ge=>{const Ue=ge.currentTarget.getBoundingClientRect(),Ie=i.find(he=>he.id===s);Ie&&$({id:Ie.id,label:Ie.label,rect:Ue})},className:"text-label text-warning hover:underline",children:e("settings.delete_custom")})}),Ht&&x.jsxs(x.Fragment,{children:[Ht.baseUrl&&x.jsxs("div",{className:Un(!0),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),x.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:Ht.baseUrl})]}),x.jsxs("div",{className:Un(!0),children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),x.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[x.jsxs("select",{value:c,onChange:ge=>d(ge.target.value),"data-testid":"model-select",className:`${Hn} flex-1 px-2.5 py-1.5`,children:[Ht.models.map(ge=>x.jsx("option",{value:ge.id,children:ge.id},ge.id)),s==="openrouter"&&ie.map(ge=>x.jsx("option",{value:ge.id,children:ge.id},ge.id))]}),s==="openrouter"&&x.jsxs("button",{onClick:We,disabled:Y,"data-testid":"discover-models-btn",className:"text-label text-accent hover:underline disabled:opacity-40 whitespace-nowrap inline-flex items-center gap-1",children:[x.jsx(LC,{className:`w-3.5 h-3.5 ${Y?"animate-spin":""}`,"aria-hidden":"true"}),e(Y?"settings.discovering":"settings.refresh")]})]})]}),B&&x.jsx("div",{className:"text-label text-warning mt-1.5 ml-[68px]",children:B})]}),x.jsx("div",{className:Un(!0),children:x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.apikey")}),x.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[g&&x.jsxs("span",{className:"text-label text-brand shrink-0 inline-flex items-center gap-1",children:[x.jsx(ai,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g]}),x.jsx("input",{type:"password",value:h,onChange:ge=>m(ge.target.value),placeholder:e(g?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"settings-key-input",className:`${Hn} flex-1 px-2.5 py-1.5`}),x.jsx("a",{href:Ht.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-label text-brand hover:underline whitespace-nowrap",children:e("settings.key.get")})]})]})}),x.jsx("div",{className:Un(!0),children:x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("button",{onClick:Kt,disabled:p,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(p?"settings.testing":"settings.test")}),E&&x.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?x.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):x.jsx(Ms,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]}),pt&&!Ht&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:Un(!0),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),x.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:pt.baseUrl})]}),x.jsx("div",{className:Un(!0),children:x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),pt.models.length>1?x.jsx("select",{value:c,onChange:ge=>d(ge.target.value),"data-testid":"model-select-custom",className:`${Hn} flex-1 px-2.5 py-1.5`,children:pt.models.map(ge=>x.jsx("option",{value:ge.id,children:ge.id},ge.id))}):x.jsx("input",{type:"text",value:c,onChange:ge=>d(ge.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"model-input-custom",className:`${Hn} flex-1 px-2.5 py-1.5 font-mono`})]})}),x.jsxs("div",{className:Un(!0),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.custom.windowLabel")}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("input",{type:"text",inputMode:"numeric",value:se,onChange:ge=>de(ge.target.value),placeholder:e("settings.custom.windowPh"),"data-testid":"context-window-input",className:`${Hn} flex-1 px-2.5 py-1.5 font-mono tabular-nums`}),x.jsx("button",{onClick:gn,disabled:Ce,"data-testid":"context-window-save",className:"btn-3d-neutral px-3 py-1.5 text-label shrink-0 disabled:opacity-40",children:e("settings.custom.save")})]}),x.jsx("div",{className:"text-caption text-ink-faint mt-1",children:e("settings.custom.windowHint")})]}),x.jsx("div",{className:Un(!0),children:x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("button",{onClick:Kt,disabled:p,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(p?"settings.testing":"settings.test")}),E&&x.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?x.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):x.jsx(Ms,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]})]})]}),x.jsxs("section",{children:[x.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.vision")}),x.jsx("div",{className:"surface-card overflow-hidden",children:x.jsx(C9,{activeProvider:s,activeModel:c,presets:t,customProviders:i})})]}),x.jsxs("section",{children:[x.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.memory")}),x.jsx("div",{className:"surface-card overflow-hidden",children:x.jsx(N9,{})})]}),x.jsxs("section",{children:[x.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.speech.title")}),x.jsx("div",{className:"surface-card overflow-hidden",children:x.jsx(_9,{})})]}),x.jsxs("section",{children:[x.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.appearance")}),x.jsxs("div",{className:"surface-card overflow-hidden",children:[x.jsxs("div",{className:Un(!1),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.theme")}),x.jsx("div",{className:"flex gap-2",children:[{mode:"auto",label:e("settings.theme.auto")},{mode:"light",label:e("settings.theme.light")},{mode:"dark",label:e("settings.theme.dark")}].map(({mode:ge,label:Ue})=>x.jsx("button",{onClick:()=>$e.setMode(ge),"data-testid":`theme-${ge}`,"aria-pressed":$e.mode===ge,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${$e.mode===ge?il:al}`,children:Ue},ge))}),x.jsx("p",{className:"text-label text-ink-muted mt-2",children:$e.mode==="auto"?e("settings.theme.following",{mode:e(`settings.theme.${$e.resolved}`)}):null})]}),x.jsxs("div",{className:Un(!0),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.interface_lang")}),x.jsx("div",{className:"flex gap-2",children:["zh-CN","en"].map(ge=>x.jsx("button",{onClick:()=>QC(ge),"data-testid":`lang-${ge}`,"aria-pressed":Ds()===ge,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Ds()===ge?il:al}`,children:ge==="zh-CN"?"中文":"English"},ge))})]}),x.jsxs("div",{className:Un(!0),children:[x.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.import_lang")}),x.jsx(A9,{})]})]})]})]}),x.jsxs("div",{className:"sticky bottom-0 px-5 py-3 bg-surface-0 border-t border-[var(--border)] flex items-center justify-between gap-3",children:[x.jsx("span",{className:"text-label text-ink-muted",children:e("settings.footer.hint")}),x.jsxs("button",{onClick:Nt,"data-testid":"settings-save",className:"btn-3d-brand px-5 py-2 text-body inline-flex items-center gap-1.5",children:[k&&x.jsx(Fn,{className:"w-4 h-4","aria-hidden":"true"}),e(k?"settings.saved_text":"settings.footer.save")]})]}),K&&x.jsx(cd,{anchorRect:K.rect,message:e("settings.delete_custom_confirm",{name:K.label}),danger:!0,confirmLabel:e("action.delete"),testid:"custom-provider-delete-confirm",onConfirm:()=>{Qt(K.id),$(null)},onCancel:()=>$(null)})]})}function A9(){const[e,t]=R.useState("en"),[n,i]=R.useState(!1);R.useEffect(()=>{be.getSetting("pref_lang").then(l=>{l&&t(l),i(!0)})},[]);const o=async l=>{t(l),await be.setSetting("pref_lang",l)},s=[{code:"en",label:"English"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}];return n?x.jsx("div",{className:"flex gap-2","data-testid":"pref-lang-options",children:s.map(l=>x.jsx("button",{onClick:()=>o(l.code),"data-testid":`pref-lang-${l.code}`,"aria-pressed":e===l.code,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${e===l.code?il:al}`,children:l.label},l.code))}):null}function C9({activeProvider:e,activeModel:t,presets:n,customProviders:i}){const o=He(),[s,l]=R.useState(!1),[c,d]=R.useState(!1),[h,m]=R.useState(""),[g,b]=R.useState("");R.useEffect(()=>{Promise.all([be.getSetting("flag_multimodal_import"),be.getSetting("vision_provider_override"),be.getSetting("vision_model_override")]).then(([C,L,_])=>{l(C==="true"),m(L??""),b(_??""),d(!0)})},[]);const p=async()=>{const C=!s;l(C),await be.setSetting("flag_multimodal_import",String(C))},y=async()=>{await be.setSetting("vision_provider_override",h),await be.setSetting("vision_model_override",g)},[E,T]=R.useState(!1),[k,M]=R.useState(null),N=async()=>{if(!E){await y(),T(!0),M(null);try{const C=await be.testLlmConnection({vision:!0});M({ok:C.ok,detail:C.detail})}catch(C){M({ok:!1,detail:C instanceof Error?C.message:String(C)})}finally{T(!1)}}},O=h&&!h.startsWith("custom-")?n.find(C=>C.id===h):null,A=h.startsWith("custom-")?i.find(C=>C.id===h):null;return c?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[x.jsx(QS,{checked:s,onChange:p,label:o("settings.multimodal.toggle"),testid:"multimodal-toggle"}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-body font-medium text-ink-strong",children:o("settings.multimodal.toggle")}),x.jsx("div",{className:"text-label text-ink-muted",children:o("settings.multimodal.toggle.desc")})]})]}),x.jsxs("div",{className:"px-4 py-3.5 border-t border-[var(--border-faint)] space-y-3",children:[x.jsxs("div",{className:"text-label text-ink-muted bg-ink/5 rounded-lg p-3",children:[x.jsx("div",{className:"font-medium mb-1",children:o("settings.multimodal.current_model",{model:t||o("settings.multimodal.not_selected")})}),x.jsx("div",{children:e.startsWith("custom-")?o("settings.multimodal.hint_custom"):o("settings.multimodal.hint_preset")})]}),x.jsxs("div",{className:"bg-ink/5 rounded-lg p-3",children:[x.jsx("div",{className:"text-label font-medium text-ink-muted mb-2",children:o("settings.multimodal.override_title")}),x.jsx("div",{className:"text-caption text-ink-muted mb-2",children:o("settings.multimodal.override_bridge_hint")}),x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsxs("select",{value:h,onChange:C=>{m(C.target.value);const L=C.target.value;if(L.startsWith("custom-")){const _=i.find(j=>j.id===L);b((_==null?void 0:_.defaultModel)??"")}else{const _=n.find(j=>j.id===L);b((_==null?void 0:_.defaultModel)??"")}},className:`${Hn} w-full px-3 py-2`,children:[x.jsx("option",{value:"",children:o("settings.multimodal.no_override")}),x.jsx("optgroup",{label:o("settings.multimodal.group_preset"),children:n.map(C=>x.jsx("option",{value:C.id,children:C.label},C.id))}),i.length>0&&x.jsx("optgroup",{label:o("settings.multimodal.group_custom"),children:i.map(C=>x.jsx("option",{value:C.id,children:C.label},C.id))})]}),h&&x.jsxs(x.Fragment,{children:[((O==null?void 0:O.models.length)??0)>0?x.jsx("select",{value:g,onChange:C=>b(C.target.value),className:`${Hn} w-full px-3 py-2`,children:O.models.map(C=>x.jsxs("option",{value:C.id,children:[C.label,(C.capabilities??[]).includes("vision")?` · ${o("settings.multimodal.vision_capable")}`:""]},C.id))}):x.jsx("input",{type:"text",value:g,onChange:C=>b(C.target.value),placeholder:(A==null?void 0:A.defaultModel)??o("settings.custom.model_ph"),className:`${Hn} w-full px-3 py-2`}),x.jsxs("div",{className:"flex flex-wrap items-center gap-2 self-start",children:[x.jsx("button",{onClick:y,"data-testid":"vision-override-save",className:"btn-3d-brand px-4 py-1.5 text-label",children:o("settings.multimodal.save_override")}),x.jsx("button",{onClick:()=>void N(),disabled:E,"data-testid":"vision-override-test",className:"btn-3d-neutral px-4 py-1.5 text-label disabled:opacity-50",children:o(E?"settings.testing":"settings.multimodal.test_override")}),k&&x.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${k.ok?"text-brand":"text-warning"}`,children:[k.ok?x.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):x.jsx(Ms,{className:"w-4 h-4","aria-hidden":"true"}),k.detail]})]})]})]})]})]})]}):null}function N9(){const e=He(),[t,n]=R.useState(!1),[i,o]=R.useState(!1);R.useEffect(()=>{be.getSetting("flag_memory_system").then(l=>{n(l==="true"),o(!0)})},[]);const s=async()=>{const l=!t;n(l),await be.setSetting("flag_memory_system",String(l))};return i?x.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[x.jsx(QS,{checked:t,onChange:s,label:e("settings.memory.toggle"),testid:"memory-toggle"}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.memory.toggle")}),x.jsx("div",{className:"text-label text-ink-muted",children:e("settings.memory.toggle.desc")})]})]}):null}function QS({checked:e,onChange:t,label:n,testid:i}){return x.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n,onClick:t,"data-testid":i,className:`relative w-12 h-6 rounded-full transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/60 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface-2)] ${e?"bg-brand":"bg-ink/20 hover:bg-ink/25"}`,children:x.jsx("span",{className:`absolute left-0.5 top-1/2 -translate-y-1/2 w-5 h-5 rounded-full bg-white shadow transition-transform ${e?"translate-x-6":""}`})})}function _9(){const e=He(),[t,n]=R.useState([]),[i,o]=R.useState(null),[s,l]=R.useState(null),[c,d]=R.useState(null),[h,m]=R.useState(null),g=R.useCallback(()=>{window.api.getSpeechModelStatus().then(T=>n(T)).catch(()=>{})},[]);R.useEffect(()=>(g(),window.api.on("speech:modelProgress",k=>{d({id:k.id,pct:Math.floor(k.progress*100),label:k.currentFile?k.currentFile.split("/").pop()??"":""})})),[g]);const b=T=>{l(null),o(T),d({id:T,pct:0,label:""}),window.api.ensureSpeechModel(T).then(()=>{o(null),d(null),g()}).catch(k=>{o(null),d(null),l(k instanceof Error?k.message:String(k)),g()})},p=T=>{o(T),m(null),window.api.deleteSpeechModel(T).then(g).catch(k=>l(k instanceof Error?k.message:String(k))).finally(()=>o(null))},y=T=>e(T==="tts-kokoro"?"settings.speech.model.tts":"settings.speech.model.asr"),E=T=>e(T==="ready"?"settings.speech.state.ready":T==="error"?"settings.speech.state.error":"settings.speech.state.absent");return x.jsxs("div",{className:"p-4 space-y-3","data-testid":"settings-speech",children:[x.jsx("p",{className:"text-label text-ink-muted",children:e("settings.speech.desc")}),s&&x.jsx("div",{className:"text-label text-warning break-all",role:"alert",children:s==="engine-unavailable"?e("chat.speech.engine_unavailable"):s}),t.map(T=>x.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("div",{className:"text-label font-medium text-ink-strong truncate",children:y(T.id)}),x.jsxs("div",{className:"text-caption text-ink-muted",children:[E(T.state)," · ",e("settings.speech.license")]}),i===T.id&&(c==null?void 0:c.id)===T.id&&x.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":`speech-dl-bar-${T.id}`,children:x.jsx("div",{className:"h-full bg-brand transition-all",style:{width:`${c.pct}%`}})}),i===T.id&&(c==null?void 0:c.id)===T.id&&x.jsxs("div",{className:"text-caption text-ink-muted mt-0.5","data-testid":`speech-dl-pct-${T.id}`,children:[c.pct,"% ",c.label]})]}),T.state==="ready"?h===T.id?x.jsxs("div",{className:"flex gap-1.5",children:[x.jsx("button",{onClick:()=>p(T.id),className:"px-3 py-1.5 rounded-xl text-label font-bold bg-warning text-white","data-testid":`speech-del-confirm-${T.id}`,children:e("action.confirm")}),x.jsx("button",{onClick:()=>m(null),className:"px-3 py-1.5 rounded-xl text-label font-bold bg-ink/[0.08] text-ink",children:e("action.cancel")})]}):x.jsx("button",{onClick:()=>m(T.id),disabled:i!==null,className:"px-3 py-1.5 rounded-xl text-label font-bold bg-ink/[0.08] text-ink hover:bg-ink/[0.12] disabled:opacity-40","data-testid":`speech-del-${T.id}`,children:e("settings.speech.delete")}):x.jsx("button",{onClick:()=>b(T.id),disabled:i!==null,className:"btn-3d-brand px-3 py-1.5 text-label","data-testid":`speech-dl-${T.id}`,children:i===T.id?`${(c==null?void 0:c.pct)??0}%`:e("settings.speech.download")})]},T.id))]})}function M9(e,t){if(t.type==="text"){const n=e[e.length-1];return n&&n.type==="text"?[...e.slice(0,-1),{type:"text",text:n.text+t.text}]:[...e,{type:"text",text:t.text}]}if(t.type==="reasoning"){const n=e[e.length-1];return n&&n.type==="reasoning"?[...e.slice(0,-1),{type:"reasoning",text:n.text+t.text}]:[...e,{type:"reasoning",text:t.text}]}if(t.type==="tool-start")return[...e,{type:"tool-call",toolName:t.toolName,state:"input-available"}];if(t.type==="tool-result"){let n=-1;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.type==="tool-call"&&o.toolName===t.toolName&&o.state==="input-available"){n=i;break}}return n<0?e:e.map((i,o)=>o===n?{...i,state:"output-available",output:t.output}:i)}if(t.type==="tool-error"){let n=-1;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.type==="tool-call"&&o.toolName===t.toolName&&o.state==="input-available"){n=i;break}}return n<0?e:e.map((i,o)=>o===n?{...i,state:"output-error",error:t.error}:i)}return e}let R9=0;const yc=()=>`msg-v2-${++R9}`;function D9(e){if(!e)return null;try{const t=JSON.parse(e);return!Array.isArray(t)||t.length===0?null:t.every(i=>typeof i=="object"&&i!==null&&typeof i.type=="string")?t:null}catch{return null}}function L9(e,t){const[n,i]=R.useState([]),[o,s]=R.useState(!1),l=R.useRef(null);R.useEffect(()=>{if(!e){i([]),s(!1),l.current=null;return}let b=!1;return(async()=>{try{const p=await be.threadGetMessages(e);if(b)return;i(p.map(y=>{const E=D9(y.partsJson);return{id:y.id,role:y.role,parts:E??[{type:"text",text:y.content}],...y.displayText?{displayText:y.displayText}:{}}}))}catch{b||i([])}})(),()=>{b=!0}},[e]),R.useEffect(()=>be.on("chat:part",p=>{const E=l.current;i(T=>{let k=E,M=T;if(!(k&&T.some(A=>A.id===k))){const A=T[T.length-1];A&&A.role==="assistant"?k=A.id:(k=yc(),M=[...T,{id:k,role:"assistant",parts:[]}])}const O=k;return M.map(A=>A.id===O?{...A,parts:M9(A.parts,p)}:A)})}),[]),R.useEffect(()=>be.on("chat:done",(p,y)=>{s(!1),l.current=null,y&&(y.userMessageId||y.assistantMessageId)&&i(E=>{let T=-1,k=-1;for(let M=E.length-1;M>=0&&(E[M].role==="user"&&T===-1&&(T=M),E[M].role==="assistant"&&k===-1&&(k=M),!(T!==-1&&k!==-1));M--);return E.map((M,N)=>N===T&&y.userMessageId?{...M,id:y.userMessageId}:N===k&&y.assistantMessageId?{...M,id:y.assistantMessageId}:M)})}),[]),R.useEffect(()=>be.on("chat:error",p=>{s(!1),l.current=null,i(y=>[...y,{id:yc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${p}`}]}])}),[]);const c=R.useCallback(async(b,p,y,E)=>{const T=p??e;if(!T||o||!b.trim())return;const k=b.trim(),M={id:yc(),role:"user",parts:[...(E??[]).map(N=>({type:"attachment",attachment:{kind:N.kind,name:N.name,mime:N.mime,size:N.size,...N.previewUrl?{previewUrl:N.previewUrl}:{}}})),{type:"text",text:k}],...y?{displayText:y}:{}};i(N=>[...N,M]),s(!0),l.current=null;try{await be.agentChatThread(T,k,y,t??null,E)}catch(N){s(!1),i(O=>[...O,{id:yc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${N instanceof Error?N.message:String(N)}`}]}])}},[e,o,t]),d=R.useCallback(async()=>{if(!(!e||!o)){try{await be.abortAgentChatThread(e)}catch{}s(!1),l.current=null}},[e,o]),h=R.useCallback(()=>{i([])},[]);R.useEffect(()=>{const b=p=>{const y=p.detail;if(typeof y!="string")return;const T={explain_simple:{msg:"用大白话给我讲讲这一节的核心概念",labelKey:"command.explain_simple"},quiz_3:{msg:"出 3 道练习题考考我",labelKey:"command.quiz_3"},compare_prev:{msg:"把这一节和上一节做个对比表",labelKey:"command.compare_prev"},concept_map:{msg:"画个概念图帮我理清这一节的知识结构",labelKey:"command.concept_map"},socratic:{msg:"切换到苏格拉底模式,用提问引导我思考",labelKey:"command.socratic"},exam_mode:{msg:"切换到考试冲刺模式,出有难度的题",labelKey:"command.exam_mode"}}[y];T&&c(T.msg,void 0,cp(T.labelKey))};return window.addEventListener("lookatstudy-command",b),()=>window.removeEventListener("lookatstudy-command",b)},[c]);const m=R.useCallback((b,p,y)=>{i(E=>E.map(T=>{if(T.id!==b)return T;const k=[...T.parts],M=k[p];return M&&M.type==="tool-call"&&(k[p]={...M,output:{...typeof M.output=="object"&&M.output?M.output:{},status:y?"applied":"rejected"}}),{...T,parts:k}}))},[]),g=R.useCallback(b=>{i(b)},[]);return{messages:n,streaming:o,send:c,stop:d,clear:h,markProposalStatus:m,setMessagesForNode:g}}const vc=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function O9(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function I9(e,t){const n=e.detail.map((o,s)=>o.correct?t("quiz.hook.lineOk",{n:s+1,prompt:vc(o.prompt)}):t("quiz.hook.lineWrong",{n:s+1,prompt:vc(o.prompt),chosen:vc(o.chosen,30),answer:vc(o.answerText,30)})),i=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:i,correct:e.correct,total:e.total})+(n.length?`
|
|
539
|
+
`+n.join(`
|
|
540
|
+
`):"")}function j9(e,t){const[n,i]=R.useState([]),[o,s]=R.useState(null),l=R.useCallback(async()=>{if(!e||!t){i([]),s(null);return}try{const E=(await be.threadList(e,"active")).filter(T=>T.focusNodeId===t);i(E),E.length>0?s(E[0].id):s(null)}catch{i([]),s(null)}},[e,t]);R.useEffect(()=>{l()},[l]);const c=R.useCallback(async y=>{if(!e||!t)return null;try{const E=await be.threadCreate({...y,courseId:e,focusNodeId:t});return i(T=>[E,...T]),s(E.id),E}catch{return null}},[e,t]),d=R.useCallback(async(y,E)=>{try{const T=await be.threadUpdate(y,E);return T&&(T.status==="archived"?(i(k=>k.filter(M=>M.id!==y)),s(k=>{var N;return k!==y?k:((N=n.filter(O=>O.id!==y)[0])==null?void 0:N.id)??null})):i(k=>k.map(M=>M.id===y?T:M))),T}catch{return null}},[n]),h=R.useCallback(async y=>{try{await be.threadDelete(y),i(E=>E.filter(T=>T.id!==y)),s(E=>{var k;return E!==y?E:((k=n.filter(M=>M.id!==y)[0])==null?void 0:k.id)??null})}catch{}},[n]),m=R.useCallback(y=>{const E=n.find(T=>T.id===y)??null;return E?(i(T=>T.filter(k=>k.id!==y)),s(T=>{var M;return T!==y?T:((M=n.filter(N=>N.id!==y)[0])==null?void 0:M.id)??null}),E):null},[n]),g=R.useCallback(y=>{i(E=>[y,...E.filter(T=>T.id!==y.id)]),s(y.id)},[]),b=R.useCallback(async(y,E)=>{if(!e||!t)return null;if(o)return o;const T=await c({title:(E??y).trim()});return(T==null?void 0:T.id)??null},[e,t,o,c]),p=n.find(y=>y.id===o)??null;return{threads:n,activeId:o,activeThread:p,setActiveId:s,reload:l,create:c,update:d,remove:h,removeWithUndo:m,restore:g,ensureThreadForSend:b}}function P9({threads:e,activeThread:t,focusNodeTitle:n,onPickThread:i,onCreate:o,onRename:s,onArchive:l,onDelete:c}){const d=He(),[h,m]=R.useState(null),[g,b]=R.useState(null),[p,y]=R.useState(null),[E,T]=R.useState(""),[k,M]=R.useState(null),N=R.useRef(null);R.useEffect(()=>{const L=_=>{N.current&&!N.current.contains(_.target)&&(m(null),b(null))};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const O=(L,_)=>{L.stopPropagation();const j=L.currentTarget.getBoundingClientRect(),D=Math.max(8,j.right-128),P=j.bottom+4;b({top:P,left:D}),m(h===_?null:_)},A=L=>{y(L.id),T(L.title??""),m(null),b(null)},C=()=>{p&&E.trim()&&s(p,E.trim()),y(null)};return e.length===0?x.jsxs("div",{className:"px-4 py-2 shrink-0 flex items-center gap-2 text-label bg-surface-1 opacity-60","data-testid":"thread-switcher-empty",children:[x.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),x.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??d("thread.empty.no_node")}),x.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:d("thread.empty.hint")})]}):x.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[x.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-thin px-3 py-1.5 opacity-70 hover:opacity-100 transition-opacity",children:[e.map(L=>{const _=L.id===(t==null?void 0:t.id),j=p===L.id;return x.jsxs("div",{className:`group relative flex items-center gap-1.5 px-2 py-0.5 cursor-pointer whitespace-nowrap transition-colors shrink-0 rounded ${_?"text-ink-strong":"text-ink-muted hover:text-ink-strong"}`,onClick:()=>!j&&i(L.id),"data-testid":`thread-tab-${L.id.slice(0,8)}`,children:[x.jsx("span",{className:`w-1 h-1 rounded-full shrink-0 transition-opacity ${_?"bg-brand opacity-100":"bg-[var(--border)] opacity-0 group-hover:opacity-60"}`}),j?x.jsx("input",{value:E,onChange:D=>T(D.target.value),onKeyDown:D=>{D.key==="Enter"&&C(),D.key==="Escape"&&y(null)},onBlur:C,onClick:D=>D.stopPropagation(),autoFocus:!0,className:"bg-surface-0 text-ink-strong text-label rounded px-1.5 py-0.5 border border-brand focus:outline-none focus:ring-2 focus:ring-brand/20 w-28","data-testid":"thread-rename-input"}):x.jsx("span",{className:`text-label max-w-[120px] truncate ${_?"font-semibold":"font-normal"}`,"data-tooltip":L.title||d("toast.threadDefault"),children:L.title||d("toast.threadDefault")}),!j&&x.jsx("button",{onClick:D=>O(D,L.id),className:"flex items-center justify-center w-4 h-4 rounded text-ink-muted hover:text-ink-strong hover:bg-ink/5 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 transition-all","data-testid":`thread-gear-${L.id.slice(0,8)}`,title:d("thread.actions.label"),"aria-label":d("thread.actions.label"),children:x.jsx(Fc,{className:"w-3 h-3"})})]},L.id)}),x.jsx("button",{onClick:o,className:"flex items-center justify-center w-6 h-6 ml-1 rounded text-ink-muted hover:text-brand hover:bg-ink/5 transition-colors shrink-0","data-testid":"thread-new",title:d("thread.new.label"),"aria-label":d("thread.new.label"),children:x.jsx(ud,{className:"w-3.5 h-3.5"})})]}),h&&g&&(()=>{const L=e.find(_=>_.id===h);return L?x.jsxs("div",{ref:N,style:{position:"fixed",top:g.top,left:g.left},className:"z-50 w-32 bg-surface-0 rounded-lg shadow-pop py-1 border border-[var(--border-faint)]","data-testid":`thread-menu-${L.id.slice(0,8)}`,onClick:_=>_.stopPropagation(),children:[x.jsxs("button",{onClick:()=>A(L),className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[x.jsx(BC,{className:"w-3 h-3"}),d("thread.menu.rename")]}),x.jsxs("button",{onClick:()=>{l(L.id),m(null),b(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[x.jsx(iC,{className:"w-3 h-3"}),d("thread.menu.archive")]}),x.jsxs("button",{onClick:_=>{const j=_.currentTarget.getBoundingClientRect();M({id:L.id,title:L.title??d("toast.threadDefault"),rect:j}),m(null),b(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-warning hover:bg-warning/10 transition-colors",children:[x.jsx(s0,{className:"w-3 h-3"}),d("action.delete")]})]}):null})(),k&&x.jsx(cd,{anchorRect:k.rect,message:d("thread.delete.confirm",{name:k.title}),danger:!0,confirmLabel:d("action.delete"),testid:"thread-delete-confirm",onConfirm:()=>{c(k.id),M(null)},onCancel:()=>M(null)})]})}const B9=1240,U9=920;function z9(e){return e>=B9?1:e>=U9?2:3}function H9(e){return e==="rail"?"rail":"notebook"}function F9(e,t,n){if(Math.abs(t)<60||Math.abs(t)<Math.abs(n)*1.6)return null;const i=["rail","chat","notebook"],o=i.indexOf(e)+(t<0?1:-1);return o>=0&&o<i.length?i[o]:null}function V9(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function q9(){return z9(typeof window>"u"?Y9:window.innerWidth)}const Y9=99999;function G9(){return R.useSyncExternalStore(V9,q9,()=>1)}const Op=R.createContext({});function Ip(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const X9=typeof window<"u",Zc=X9?R.useLayoutEffect:R.useEffect,Cd=R.createContext(null);function jp(e,t){e.indexOf(t)===-1&&e.push(t)}function Jc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ra=(e,t,n)=>n>t?t:n<e?e:n;let Nd=()=>{};const Ui={},$S=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),WS=e=>typeof e=="object"&&e!==null,ZS=e=>/^0[^.\s]+$/u.test(e);function JS(e){let t;return()=>(t===void 0&&(t=e()),t)}const oa=e=>e,Hl=(...e)=>e.reduce((t,n)=>i=>n(t(i))),Al=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class Pp{constructor(){this.subscriptions=[]}add(t){return jp(this.subscriptions,t),()=>Jc(this.subscriptions,t)}notify(t,n,i){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,i);else for(let s=0;s<o;s++){const l=this.subscriptions[s];l&&l(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=e=>e*1e3,sa=e=>e/1e3,e3=(e,t)=>t?e*(1e3/t):0,t3=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,K9=1e-7,Q9=12;function $9(e,t,n,i,o){let s,l,c=0;do l=t+(n-t)/2,s=t3(l,i,o)-e,s>0?n=l:t=l;while(Math.abs(s)>K9&&++c<Q9);return l}function Fl(e,t,n,i){if(e===t&&n===i)return oa;const o=s=>$9(s,0,1,e,n);return s=>s===0||s===1?s:t3(o(s),t,i)}const n3=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,a3=e=>t=>1-e(1-t),i3=Fl(.33,1.53,.69,.99),Bp=a3(i3),r3=n3(Bp),s3=e=>e>=1?1:(e*=2)<1?.5*Bp(e):.5*(2-Math.pow(2,-10*(e-1))),Up=e=>1-Math.sin(Math.acos(e)),o3=a3(Up),l3=n3(Up),W9=Fl(.42,0,1,1),Z9=Fl(0,0,.58,1),u3=Fl(.42,0,.58,1),J9=e=>Array.isArray(e)&&typeof e[0]!="number",c3=e=>Array.isArray(e)&&typeof e[0]=="number",ej={linear:oa,easeIn:W9,easeInOut:u3,easeOut:Z9,circIn:Up,circInOut:l3,circOut:o3,backIn:Bp,backInOut:r3,backOut:i3,anticipate:s3},tj=e=>typeof e=="string",G2=e=>{if(c3(e)){Nd(e.length===4);const[t,n,i,o]=e;return Fl(t,n,i,o)}else if(tj(e))return ej[e];return e},Ec=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nj(e){let t=new Set,n=new Set,i=!1,o=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(h){s.has(h)&&(d.schedule(h),e()),h(l)}const d={schedule:(h,m=!1,g=!1)=>{const p=g&&i?t:n;return m&&s.add(h),p.add(h),h},cancel:h=>{n.delete(h),s.delete(h)},process:h=>{if(l=h,i){o=!0;return}i=!0;const m=t;t=n,n=m,t.forEach(c),t.clear(),i=!1,o&&(o=!1,d.process(h))}};return d}const aj=40;function d3(e,t){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,l=Ec.reduce((N,O)=>(N[O]=nj(s),N),{}),{setup:c,read:d,resolveKeyframes:h,preUpdate:m,update:g,preRender:b,render:p,postRender:y}=l,E=()=>{const N=Ui.useManualTiming,O=N?o.timestamp:performance.now();n=!1,N||(o.delta=i?1e3/60:Math.max(Math.min(O-o.timestamp,aj),1)),o.timestamp=O,o.isProcessing=!0,c.process(o),d.process(o),h.process(o),m.process(o),g.process(o),b.process(o),p.process(o),y.process(o),o.isProcessing=!1,n&&t&&(i=!1,e(E))},T=()=>{n=!0,i=!0,o.isProcessing||e(E)};return{schedule:Ec.reduce((N,O)=>{const A=l[O];return N[O]=(C,L=!1,_=!1)=>(n||T(),A.schedule(C,L,_)),N},{}),cancel:N=>{for(let O=0;O<Ec.length;O++)l[Ec[O]].cancel(N)},state:o,steps:l}}const{schedule:St,cancel:zi,state:ln,steps:Hm}=d3(typeof requestAnimationFrame<"u"?requestAnimationFrame:oa,!0);let Dc;function ij(){Dc=void 0}const yn={now:()=>(Dc===void 0&&yn.set(ln.isProcessing||Ui.useManualTiming?ln.timestamp:performance.now()),Dc),set:e=>{Dc=e,queueMicrotask(ij)}},f3=e=>t=>typeof t=="string"&&t.startsWith(e),h3=f3("--"),rj=f3("var(--"),zp=e=>rj(e)?sj.test(e.split("/*")[0].trim()):!1,sj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function X2(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const qs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Cl={...qs,transform:e=>Ra(0,1,e)},Tc={...qs,default:1},gl=e=>Math.round(e*1e5)/1e5,Hp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oj(e){return e==null}const lj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fp=(e,t)=>n=>!!(typeof n=="string"&&lj.test(n)&&n.startsWith(e)||t&&!oj(n)&&Object.prototype.hasOwnProperty.call(n,t)),m3=(e,t,n)=>i=>{if(typeof i!="string")return i;const[o,s,l,c]=i.match(Hp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},uj=e=>Ra(0,255,e),Fm={...qs,transform:e=>Math.round(uj(e))},Tr={test:Fp("rgb","red"),parse:m3("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Fm.transform(e)+", "+Fm.transform(t)+", "+Fm.transform(n)+", "+gl(Cl.transform(i))+")"};function cj(e){let t="",n="",i="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}}const M0={test:Fp("#"),parse:cj,transform:Tr.transform},Vl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ei=Vl("deg"),Ma=Vl("%"),Le=Vl("px"),dj=Vl("vh"),fj=Vl("vw"),K2={...Ma,parse:e=>Ma.parse(e)/100,transform:e=>Ma.transform(e*100)},Cs={test:Fp("hsl","hue"),parse:m3("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Ma.transform(gl(t))+", "+Ma.transform(gl(n))+", "+gl(Cl.transform(i))+")"},Xt={test:e=>Tr.test(e)||M0.test(e)||Cs.test(e),parse:e=>Tr.test(e)?Tr.parse(e):Cs.test(e)?Cs.parse(e):M0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Tr.transform(e):Cs.transform(e),getAnimatableNone:e=>{const t=Xt.parse(e);return t.alpha=0,Xt.transform(t)}},hj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Hp))==null?void 0:t.length)||0)+(((n=e.match(hj))==null?void 0:n.length)||0)>0}const p3="number",g3="color",pj="var",gj="var(",Q2="${}",xj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function js(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const c=t.replace(xj,d=>(Xt.test(d)?(i.color.push(s),o.push(g3),n.push(Xt.parse(d))):d.startsWith(gj)?(i.var.push(s),o.push(pj),n.push(d)):(i.number.push(s),o.push(p3),n.push(parseFloat(d))),++s,Q2)).split(Q2);return{values:n,split:c,indexes:i,types:o}}function bj(e){return js(e).values}function x3({split:e,types:t}){const n=e.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],i[s]!==void 0){const l=t[s];l===p3?o+=gl(i[s]):l===g3?o+=Xt.transform(i[s]):o+=i[s]}return o}}function yj(e){return x3(js(e))}const vj=e=>typeof e=="number"?0:Xt.test(e)?Xt.getAnimatableNone(e):e,Ej=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:vj(e);function Tj(e){const t=js(e);return x3(t)(t.values.map((i,o)=>Ej(i,t.split[o])))}const ba={test:mj,parse:bj,createTransformer:yj,getAnimatableNone:Tj};function Vm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Sj({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let o=0,s=0,l=0;if(!t)o=s=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;o=Vm(d,c,e+1/3),s=Vm(d,c,e),l=Vm(d,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:i}}function ed(e,t){return n=>n>0?t:e}const Tt=(e,t,n)=>e+(t-e)*n,qm=(e,t,n)=>{const i=e*e,o=n*(t*t-i)+i;return o<0?0:Math.sqrt(o)},wj=[M0,Tr,Cs],kj=e=>wj.find(t=>t.test(e));function $2(e){const t=kj(e);if(!t)return!1;let n=t.parse(e);return t===Cs&&(n=Sj(n)),n}const W2=(e,t)=>{const n=$2(e),i=$2(t);if(!n||!i)return ed(e,t);const o={...n};return s=>(o.red=qm(n.red,i.red,s),o.green=qm(n.green,i.green,s),o.blue=qm(n.blue,i.blue,s),o.alpha=Tt(n.alpha,i.alpha,s),Tr.transform(o))},R0=new Set(["none","hidden"]);function Aj(e,t){return R0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Cj(e,t){return n=>Tt(e,t,n)}function Vp(e){return typeof e=="number"?Cj:typeof e=="string"?zp(e)?ed:Xt.test(e)?W2:Mj:Array.isArray(e)?b3:typeof e=="object"?Xt.test(e)?W2:Nj:ed}function b3(e,t){const n=[...e],i=n.length,o=e.map((s,l)=>Vp(s)(s,t[l]));return s=>{for(let l=0;l<i;l++)n[l]=o[l](s);return n}}function Nj(e,t){const n={...e,...t},i={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(i[o]=Vp(e[o])(e[o],t[o]));return o=>{for(const s in i)n[s]=i[s](o);return n}}function _j(e,t){const n=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],l=e.indexes[s][i[s]],c=e.values[l]??0;n[o]=c,i[s]++}return n}const Mj=(e,t)=>{const n=ba.createTransformer(t),i=js(e),o=js(t);return i.indexes.var.length===o.indexes.var.length&&i.indexes.color.length===o.indexes.color.length&&i.indexes.number.length>=o.indexes.number.length?R0.has(e)&&!o.values.length||R0.has(t)&&!i.values.length?Aj(e,t):Hl(b3(_j(i,o),o.values),n):ed(e,t)};function y3(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Tt(e,t,n):Vp(e)(e,t)}const Rj=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>St.update(t,n),stop:()=>zi(t),now:()=>ln.isProcessing?ln.timestamp:yn.now()}},v3=(e,t,n=10)=>{let i="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)i+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},td=2e4;function qp(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<td;)t+=n,i=e.next(t);return t>=td?1/0:t}function Dj(e,t=100,n){const i=n({...e,keyframes:[0,t]}),o=Math.min(qp(i),td);return{type:"keyframes",ease:s=>i.next(o*s).value/t,duration:sa(o)}}const jt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function D0(e,t){return e*Math.sqrt(1-t*t)}const Lj=12;function Oj(e,t,n){let i=n;for(let o=1;o<Lj;o++)i=i-e(i)/t(i);return i}const Ym=.001;function Ij({duration:e=jt.duration,bounce:t=jt.bounce,velocity:n=jt.velocity,mass:i=jt.mass}){let o,s,l=1-t;l=Ra(jt.minDamping,jt.maxDamping,l),e=Ra(jt.minDuration,jt.maxDuration,sa(e)),l<1?(o=h=>{const m=h*l,g=m*e,b=m-n,p=D0(h,l),y=Math.exp(-g);return Ym-b/p*y},s=h=>{const g=h*l*e,b=g*n+n,p=Math.pow(l,2)*Math.pow(h,2)*e,y=Math.exp(-g),E=D0(Math.pow(h,2),l);return(-o(h)+Ym>0?-1:1)*((b-p)*y)/E}):(o=h=>{const m=Math.exp(-h*e),g=(h-n)*e+1;return-Ym+m*g},s=h=>{const m=Math.exp(-h*e),g=(n-h)*(e*e);return m*g});const c=5/e,d=Oj(o,s,c);if(e=qn(e),isNaN(d))return{stiffness:jt.stiffness,damping:jt.damping,duration:e};{const h=Math.pow(d,2)*i;return{stiffness:h,damping:l*2*Math.sqrt(i*h),duration:e}}}const jj=["duration","bounce"],Pj=["stiffness","damping","mass"];function Z2(e,t){return t.some(n=>e[n]!==void 0)}function Bj(e){let t={velocity:jt.velocity,stiffness:jt.stiffness,damping:jt.damping,mass:jt.mass,isResolvedFromDuration:!1,...e};if(!Z2(e,Pj)&&Z2(e,jj))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),o=i*i,s=2*Ra(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:jt.mass,stiffness:o,damping:s}}else{const n=Ij({...e,velocity:0});t={...t,...n,mass:jt.mass},t.isResolvedFromDuration=!0}return t}function nd(e=jt.visualDuration,t=jt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:d,damping:h,mass:m,duration:g,velocity:b,isResolvedFromDuration:p}=Bj({...n,velocity:-sa(n.velocity||0)}),y=b||0,E=h/(2*Math.sqrt(d*m)),T=l-s,k=sa(Math.sqrt(d/m)),M=Math.abs(T)<5;i||(i=M?jt.restSpeed.granular:jt.restSpeed.default),o||(o=M?jt.restDelta.granular:jt.restDelta.default);let N,O,A,C,L,_;if(E<1)A=D0(k,E),C=(y+E*k*T)/A,N=D=>{const P=Math.exp(-E*k*D);return l-P*(C*Math.sin(A*D)+T*Math.cos(A*D))},L=E*k*C+T*A,_=E*k*T-C*A,O=D=>Math.exp(-E*k*D)*(L*Math.sin(A*D)+_*Math.cos(A*D));else if(E===1){N=P=>l-Math.exp(-k*P)*(T+(y+k*T)*P);const D=y+k*T;O=P=>Math.exp(-k*P)*(k*D*P-y)}else{const D=k*Math.sqrt(E*E-1);N=q=>{const z=Math.exp(-E*k*q),H=Math.min(D*q,300);return l-z*((y+E*k*T)*Math.sinh(H)+D*T*Math.cosh(H))/D};const P=(y+E*k*T)/D,U=E*k*P-T*D,J=E*k*T-P*D;O=q=>{const z=Math.exp(-E*k*q),H=Math.min(D*q,300);return z*(U*Math.sinh(H)+J*Math.cosh(H))}}const j={calculatedDuration:p&&g||null,velocity:D=>qn(O(D)),next:D=>{if(!p&&E<1){const U=Math.exp(-E*k*D),J=Math.sin(A*D),q=Math.cos(A*D),z=l-U*(C*J+T*q),H=qn(U*(L*J+_*q));return c.done=Math.abs(H)<=i&&Math.abs(l-z)<=o,c.value=c.done?l:z,c}const P=N(D);if(p)c.done=D>=g;else{const U=qn(O(D));c.done=Math.abs(U)<=i&&Math.abs(l-P)<=o}return c.value=c.done?l:P,c},toString:()=>{const D=Math.min(qp(j),td),P=v3(U=>j.next(D*U).value,D,30);return D+"ms "+P},toTransition:()=>{}};return j}nd.applyToOptions=e=>{const t=Dj(e,100,nd);return e.ease=t.ease,e.duration=qn(t.duration),e.type="keyframes",e};const Uj=5;function E3(e,t,n){const i=Math.max(t-Uj,0);return e3(n-e(i),t-i)}function L0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:d,restDelta:h=.5,restSpeed:m}){const g=e[0],b={done:!1,value:g},p=_=>c!==void 0&&_<c||d!==void 0&&_>d,y=_=>c===void 0?d:d===void 0||Math.abs(c-_)<Math.abs(d-_)?c:d;let E=n*t;const T=g+E,k=l===void 0?T:l(T);k!==T&&(E=k-g);const M=_=>-E*Math.exp(-_/i),N=_=>k+M(_),O=_=>{const j=M(_),D=N(_);b.done=Math.abs(j)<=h,b.value=b.done?k:D};let A,C;const L=_=>{p(b.value)&&(A=_,C=nd({keyframes:[b.value,y(b.value)],velocity:E3(N,_,b.value),damping:o,stiffness:s,restDelta:h,restSpeed:m}))};return L(0),{calculatedDuration:null,next:_=>{let j=!1;return!C&&A===void 0&&(j=!0,O(_),L(_)),A!==void 0&&_>=A?C.next(_-A):(!j&&O(_),b)}}}function zj(e,t,n){const i=[],o=n||Ui.mix||y3,s=e.length-1;for(let l=0;l<s;l++){let c=o(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||oa:t;c=Hl(d,c)}i.push(c)}return i}function Hj(e,t,{clamp:n=!0,ease:i,mixer:o}={}){const s=e.length;if(Nd(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=zj(t,i,o),d=c.length,h=m=>{if(l&&m<e[0])return t[0];let g=0;if(d>1)for(;g<e.length-2&&!(m<e[g+1]);g++);const b=Al(e[g],e[g+1],m);return c[g](b)};return n?m=>h(Ra(e[0],e[s-1],m)):h}function Fj(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const o=Al(0,t,i);e.push(Tt(n,1,o))}}function Vj(e){const t=[0];return Fj(t,e.length-1),t}function qj(e,t){return e.map(n=>n*t)}function Yj(e,t){return e.map(()=>t||u3).splice(0,e.length-1)}function xl({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const o=J9(i)?i.map(G2):G2(i),s={done:!1,value:t[0]},l=qj(n&&n.length===t.length?n:Vj(t),e),c=Hj(l,t,{ease:Array.isArray(o)?o:Yj(t,o)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const Gj=e=>e!==null;function _d(e,{repeat:t,repeatType:n="loop"},i,o=1){const s=e.filter(Gj),c=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||i===void 0?s[c]:i}const Xj={decay:L0,inertia:L0,tween:xl,keyframes:xl,spring:nd};function T3(e){typeof e.type=="string"&&(e.type=Xj[e.type])}class Yp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Kj=e=>e/100;class ad extends Yp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var i,o;const{motionValue:n}=this.options;n&&n.updatedAt!==yn.now()&&this.tick(yn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(i=this.options).onStop)==null||o.call(i))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;T3(t);const{type:n=xl,repeat:i=0,repeatDelay:o=0,repeatType:s,velocity:l=0}=t;let{keyframes:c}=t;const d=n||xl;d!==xl&&typeof c[0]!="number"&&(this.mixKeyframes=Hl(Kj,y3(c[0],c[1])),c=[0,100]);const h=d({...t,keyframes:c});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=qp(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+o,this.totalDuration=this.resolvedDuration*(i+1)-o,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:i,totalDuration:o,mixKeyframes:s,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:m,repeat:g,repeatType:b,repeatDelay:p,type:y,onUpdate:E,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const k=this.currentTime-h*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?k<0:k>o;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let N=this.currentTime,O=i;if(g){const _=Math.min(this.currentTime,o)/c;let j=Math.floor(_),D=_%1;!D&&_>=1&&(D=1),D===1&&j--,j=Math.min(j,g+1),!!(j%2)&&(b==="reverse"?(D=1-D,p&&(D-=p/c)):b==="mirror"&&(O=l)),N=Ra(0,1,D)*c}let A;M?(this.delayState.value=m[0],A=this.delayState):A=O.next(N),s&&!M&&(A.value=s(A.value));let{done:C}=A;!M&&d!==null&&(C=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return L&&y!==L0&&(A.value=_d(m,this.options,T,this.speed)),E&&E(A.value),L&&this.finish(),A}then(t,n){return this.finished.then(t,n)}get duration(){return sa(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sa(t)}get time(){return sa(this.currentTime)}set time(t){t=qn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return E3(i=>this.generator.next(i).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(yn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=sa(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Rj,startTime:n}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(s=(o=this.options).onPlay)==null||s.call(o);const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(yn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Qj(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Sr=e=>e*180/Math.PI,O0=e=>{const t=Sr(Math.atan2(e[1],e[0]));return I0(t)},$j={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:O0,rotateZ:O0,skewX:e=>Sr(Math.atan(e[1])),skewY:e=>Sr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},I0=e=>(e=e%360,e<0&&(e+=360),e),J2=O0,ev=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Wj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ev,scaleY:tv,scale:e=>(ev(e)+tv(e))/2,rotateX:e=>I0(Sr(Math.atan2(e[6],e[5]))),rotateY:e=>I0(Sr(Math.atan2(-e[2],e[0]))),rotateZ:J2,rotate:J2,skewX:e=>Sr(Math.atan(e[4])),skewY:e=>Sr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function j0(e){return e.includes("scale")?1:0}function P0(e,t){if(!e||e==="none")return j0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=Wj,o=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=$j,o=c}if(!o)return j0(t);const s=i[t],l=o[1].split(",").map(Jj);return typeof s=="function"?s(l):l[s]}const Zj=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return P0(n,t)};function Jj(e){return parseFloat(e.trim())}const Ys=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gs=new Set([...Ys,"pathRotation"]),nv=e=>e===qs||e===Le,eP=new Set(["x","y","z"]),tP=Ys.filter(e=>!eP.has(e));function nP(e){const t=[];return tP.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Bi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:i})=>{const o=e.max-e.min;return i==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:i})=>{const o=e.max-e.min;return i==="border-box"?o:o-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>P0(t,"x"),y:(e,{transform:t})=>P0(t,"y")};Bi.translateX=Bi.x;Bi.translateY=Bi.y;const _r=new Set;let B0=!1,U0=!1,z0=!1;function S3(){if(U0){const e=Array.from(_r).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const o=nP(i);o.length&&(n.set(i,o),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const o=n.get(i);o&&o.forEach(([s,l])=>{var c;(c=i.getValue(s))==null||c.set(l)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}U0=!1,B0=!1,_r.forEach(e=>e.complete(z0)),_r.clear()}function w3(){_r.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(U0=!0)})}function aP(){z0=!0,w3(),S3(),z0=!1}class Gp{constructor(t,n,i,o,s,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=o,this.element=s,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(_r.add(this),B0||(B0=!0,St.read(w3),St.resolveKeyframes(S3))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),l=t[t.length-1];if(s!==void 0)t[0]=s;else if(i&&n){const c=i.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&s===void 0&&o.set(t[0])}Qj(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_r.delete(this)}cancel(){this.state==="scheduled"&&(_r.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const iP=e=>e.startsWith("--");function k3(e,t,n){iP(t)?e.style.setProperty(t,n):e.style[t]=n}const rP={};function A3(e,t){const n=JS(e);return()=>rP[t]??n()}const sP=A3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),C3=A3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),rl=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,av={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:rl([0,.65,.55,1]),circOut:rl([.55,0,1,.45]),backIn:rl([.31,.01,.66,-.59]),backOut:rl([.33,1.53,.69,.99])};function N3(e,t){if(e)return typeof e=="function"?C3()?v3(e,t):"ease-out":c3(e)?rl(e):Array.isArray(e)?e.map(n=>N3(n,t)||av.easeOut):av[e]}function oP(e,t,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:l="loop",ease:c="easeOut",times:d}={},h=void 0){const m={[t]:n};d&&(m.offset=d);const g=N3(c,o);Array.isArray(g)&&(m.easing=g);const b={delay:i,duration:o,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"};return h&&(b.pseudoElement=h),e.animate(m,b)}function _3(e){return typeof e=="function"&&"applyToOptions"in e}function lP({type:e,...t}){return _3(e)&&C3()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class M3 extends Yp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=l,this.options=t,Nd(typeof t.type!="string");const h=lP(t);this.animation=oP(n,i,o,h,s),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=_d(o,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),k3(n,i,m),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,i,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(i=this.animation).commitStyles)==null||o.call(i))}get duration(){var n,i;const t=((i=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:i.call(n).duration)||0;return sa(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sa(t)}get time(){return sa(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&sP()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),oa):o(this)}}const R3={anticipate:s3,backInOut:r3,circInOut:l3};function uP(e){return e in R3}function cP(e){typeof e.ease=="string"&&uP(e.ease)&&(e.ease=R3[e.ease])}const Gm=10;class dP extends M3{constructor(t){cP(t),T3(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:o,element:s,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new ad({...l,autoplay:!1}),d=Math.max(Gm,yn.now()-this.startTime),h=Ra(0,Gm,d-Gm),m=c.sample(d).value,{name:g}=this.options;s&&g&&k3(s,g,m),n.setWithVelocity(c.sample(Math.max(0,d-h)).value,m,h),c.stop()}}const iv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ba.test(e)||e==="0")&&!e.startsWith("url("));function fP(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hP(e,t,n,i){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],l=iv(o,t),c=iv(s,t);return!l||!c?!1:fP(e)||(n==="spring"||_3(n))&&i}function H0(e){e.duration=0,e.type="keyframes"}const D3=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),mP=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function pP(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&mP.test(e[t]))return!0;return!1}const gP=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),xP=JS(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function bP(e){var g;const{motionValue:t,name:n,repeatDelay:i,repeatType:o,damping:s,type:l,keyframes:c}=e,d=(g=t==null?void 0:t.owner)==null?void 0:g.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return xP()&&n&&(D3.has(n)||gP.has(n)&&pP(c))&&(n!=="transform"||!m)&&!h&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}const yP=40;class vP extends Yp{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:l="loop",keyframes:c,name:d,motionValue:h,element:m,...g}){var y;super(),this.stop=()=>{var E,T;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(T=this.keyframeResolver)==null||T.cancel()},this.createdAt=yn.now();const b={autoplay:t,delay:n,type:i,repeat:o,repeatDelay:s,repeatType:l,name:d,motionValue:h,element:m,...g},p=(m==null?void 0:m.KeyframeResolver)||Gp;this.keyframeResolver=new p(c,(E,T,k)=>this.onKeyframesResolved(E,T,b,!k),d,h,m),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,i,o){var k,M;this.keyframeResolver=void 0;const{name:s,type:l,velocity:c,delay:d,isHandoff:h,onUpdate:m}=i;this.resolvedAt=yn.now();let g=!0;hP(t,s,l,c)||(g=!1,(Ui.instantAnimations||!d)&&(m==null||m(_d(t,i,n))),t[0]=t[t.length-1],H0(i),i.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>yP?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},y=g&&!h&&bP(p),E=(M=(k=p.motionValue)==null?void 0:k.owner)==null?void 0:M.current;let T;if(y)try{T=new dP({...p,element:E})}catch{T=new ad(p)}else T=new ad(p);T.finished.then(()=>{this.notifyFinished()}).catch(oa),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),aP()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function L3(e,t,n,i=0,o=1){const s=Array.from(e).sort((h,m)=>h.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*i;return typeof n=="function"?n(s,l):o===1?s*i:c-s*i}const rv=30,EP=e=>!isNaN(parseFloat(e));class TP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var s;const o=yn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=yn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=EP(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Pp);const i=this.events[t].add(n);return t==="change"?()=>{i(),St.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=yn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>rv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,rv);return e3(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ps(e,t){return new TP(e,t)}function O3(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function Xp(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?O3(n,e):n}const SP={type:"spring",stiffness:500,damping:25,restSpeed:10},wP=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kP={type:"keyframes",duration:.8},AP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},CP=(e,{keyframes:t})=>t.length>2?kP:Gs.has(e)?e.startsWith("scale")?wP(t[1]):SP:AP,NP=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function _P(e){for(const t in e)if(!NP.has(t))return!0;return!1}const Kp=(e,t,n,i={},o,s)=>l=>{const c=Xp(i,e)||{},d=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-qn(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:b=>{t.set(b),c.onUpdate&&c.onUpdate(b)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:o};_P(c)||Object.assign(m,CP(e,m)),m.duration&&(m.duration=qn(m.duration)),m.repeatDelay&&(m.repeatDelay=qn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let g=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(H0(m),m.delay===0&&(g=!0)),(Ui.instantAnimations||Ui.skipAnimations||o!=null&&o.shouldSkipAnimations||c.skipAnimations)&&(g=!0,H0(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,g&&!s&&t.get()!==void 0){const b=_d(m.keyframes,c);if(b!==void 0){St.update(()=>{m.onUpdate(b),m.onComplete()});return}}return c.isSync?new ad(m):new vP(m)},MP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RP(e){const t=MP.exec(e);if(!t)return[,];const[,n,i,o]=t;return[`--${n??i}`,o]}function I3(e,t,n=1){const[i,o]=RP(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const l=s.trim();return $S(l)?parseFloat(l):l}return zp(o)?I3(o,t,n+1):o}function sv(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Qp(e,t,n,i){if(typeof t=="function"){const[o,s]=sv(i);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=sv(i);t=t(n!==void 0?n:e.custom,o,s)}return t}function Mr(e,t,n){const i=e.getProps();return Qp(i,t,n!==void 0?n:i.custom,e)}const j3=new Set(["width","height","top","left","right","bottom",...Ys]),F0=e=>Array.isArray(e);function DP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ps(n))}function LP(e){return F0(e)?e[e.length-1]||0:e}function OP(e,t){const n=Mr(e,t);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const l in s){const c=LP(s[l]);DP(e,l,c)}}const un=e=>!!(e&&e.getVelocity);function IP(e){return!!(un(e)&&e.add)}function V0(e,t){const n=e.getValue("willChange");if(IP(n))return n.add(t);if(!n&&Ui.WillChange){const i=new Ui.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function $p(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const jP="framerAppearId",P3="data-"+$p(jP);function B3(e){return e.props[P3]}function PP({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function U3(e,t,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();s=s?O3(s,d):d;const h=s==null?void 0:s.reduceMotion,m=s==null?void 0:s.skipAnimations;i&&(s=i);const g=[],b=o&&e.animationState&&e.animationState.getState()[o],p=s==null?void 0:s.path;p&&p.animateVisualElement(e,c,s,n,g);for(const y in c){const E=e.getValue(y,e.latestValues[y]??null),T=c[y];if(T===void 0||b&&PP(b,y))continue;const k={delay:n,...Xp(s||{},y)};m&&(k.skipAnimations=!0);const M=E.get();if(M!==void 0&&!E.isAnimating()&&!Array.isArray(T)&&T===M&&!k.velocity){St.update(()=>E.set(T));continue}let N=!1;if(window.MotionHandoffAnimation){const C=B3(e);if(C){const L=window.MotionHandoffAnimation(C,y,St);L!==null&&(k.startTime=L,N=!0)}}V0(e,y);const O=h??e.shouldReduceMotion;E.start(Kp(y,E,T,O&&j3.has(y)?{type:!1}:k,e,N));const A=E.animation;A&&g.push(A)}if(l){const y=()=>St.update(()=>{l&&OP(e,l)});g.length?Promise.all(g).then(y):y()}return g}function q0(e,t,n={}){var d;const i=Mr(e,t,n.type==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(U3(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:b}=o;return BP(e,t,h,m,g,b,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[h,m]=c==="beforeChildren"?[s,l]:[l,s];return h().then(()=>m())}else return Promise.all([s(),l(n.delay)])}function BP(e,t,n=0,i=0,o=0,s=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(q0(d,t,{...l,delay:n+(typeof i=="function"?0:i)+L3(e.variantChildren,d,i,o,s)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function UP(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const o=t.map(s=>q0(e,s,n));i=Promise.all(o)}else if(typeof t=="string")i=q0(e,t,n);else{const o=typeof t=="function"?Mr(e,t,n.custom):t;i=Promise.all(U3(e,o,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const zP={test:e=>e==="auto",parse:e=>e},z3=e=>t=>t.test(e),H3=[qs,Le,Ma,ei,fj,dj,zP],ov=e=>H3.find(z3(e));function HP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ZS(e):!0}const FP=new Set(["brightness","contrast","saturate","opacity"]);function VP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Hp)||[];if(!i)return e;const o=n.replace(i,"");let s=FP.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+o+")"}const qP=/\b([a-z-]*)\(.*?\)/gu,Y0={...ba,getAnimatableNone:e=>{const t=e.match(qP);return t?t.map(VP).join(" "):e}},G0={...ba,getAnimatableNone:e=>{const t=ba.parse(e);return ba.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},lv={...qs,transform:Math.round},YP={rotate:ei,pathRotation:ei,rotateX:ei,rotateY:ei,rotateZ:ei,scale:Tc,scaleX:Tc,scaleY:Tc,scaleZ:Tc,skew:ei,skewX:ei,skewY:ei,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:Cl,originX:K2,originY:K2,originZ:Le},id={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...YP,zIndex:lv,fillOpacity:Cl,strokeOpacity:Cl,numOctaves:lv},GP={...id,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Y0,WebkitFilter:Y0,mask:G0,WebkitMask:G0},F3=e=>GP[e],XP=new Set([Y0,G0]);function V3(e,t){let n=F3(e);return XP.has(n)||(n=ba),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const KP=new Set(["auto","none","0"]);function QP(e,t,n){let i=0,o;for(;i<e.length&&!o;){const s=e[i];typeof s=="string"&&!KP.has(s)&&js(s).values.length&&(o=e[i]),i++}if(o&&n)for(const s of t)e[s]=V3(n,o)}class $P extends Gp{constructor(t,n,i,o,s){super(t,n,i,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let g=t[m];if(typeof g=="string"&&(g=g.trim(),zp(g))){const b=I3(g,n.current);b!==void 0&&(t[m]=b),m===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!j3.has(i)||t.length!==2)return;const[o,s]=t,l=ov(o),c=ov(s),d=X2(o),h=X2(s);if(d!==h&&Bi[i]){this.needsMeasurement=!0;return}if(l!==c)if(nv(l)&&nv(c))for(let m=0;m<t.length;m++){const g=t[m];typeof g=="string"&&(t[m]=parseFloat(g))}else Bi[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let o=0;o<t.length;o++)(t[o]===null||HP(t[o]))&&i.push(o);i.length&&QP(t,i,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Bi[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(i,o).jump(o,!1)}measureEndState(){var c;const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,l=i[s];i[s]=Bi[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}const Wp=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function q3(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const o=(n==null?void 0:n[e])??i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(i=>i!=null)}const X0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Lc(e){return WS(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Zp}=d3(queueMicrotask,!1),pa={x:!1,y:!1};function Y3(){return pa.x||pa.y}function WP(e){return e==="x"||e==="y"?pa[e]?null:(pa[e]=!0,()=>{pa[e]=!1}):pa.x||pa.y?null:(pa.x=pa.y=!0,()=>{pa.x=pa.y=!1})}function G3(e,t){const n=q3(e),i=new AbortController,o={passive:!0,...t,signal:i.signal};return[n,o,()=>i.abort()]}function ZP(e){return!(e.pointerType==="touch"||Y3())}function JP(e,t,n={}){const[i,o,s]=G3(e,n);return i.forEach(l=>{let c=!1,d=!1,h;const m=()=>{l.removeEventListener("pointerleave",y)},g=T=>{h&&(h(T),h=void 0),m()},b=T=>{c=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),d&&(d=!1,g(T))},p=()=>{c=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},y=T=>{if(T.pointerType!=="touch"){if(c){d=!0;return}g(T)}},E=T=>{if(!ZP(T))return;d=!1;const k=t(l,T);typeof k=="function"&&(h=k,l.addEventListener("pointerleave",y,o))};l.addEventListener("pointerenter",E,o),l.addEventListener("pointerdown",p,o)}),s}const X3=(e,t)=>t?e===t?!0:X3(e,t.parentElement):!1,Jp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,e7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function t7(e){return e7.has(e.tagName)||e.isContentEditable===!0}const n7=new Set(["INPUT","SELECT","TEXTAREA"]);function a7(e){return n7.has(e.tagName)||e.isContentEditable===!0}const Oc=new WeakSet;function uv(e){return t=>{t.key==="Enter"&&e(t)}}function Xm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const i7=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=uv(()=>{if(Oc.has(n))return;Xm(n,"down");const o=uv(()=>{Xm(n,"up")}),s=()=>Xm(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function cv(e){return Jp(e)&&!Y3()}const dv=new WeakSet;function r7(e,t,n={}){const[i,o,s]=G3(e,n),l=c=>{const d=c.currentTarget;if(!cv(c)||dv.has(c))return;Oc.add(d),n.stopPropagation&&dv.add(c);const h=t(d,c),m={...o,capture:!0},g=(y,E)=>{window.removeEventListener("pointerup",b,m),window.removeEventListener("pointercancel",p,m),Oc.has(d)&&Oc.delete(d),cv(y)&&typeof h=="function"&&h(y,{success:E})},b=y=>{g(y,d===window||d===document||n.useGlobalTarget||X3(d,y.target))},p=y=>{g(y,!1)};window.addEventListener("pointerup",b,m),window.addEventListener("pointercancel",p,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,o),Lc(c)&&(c.addEventListener("focus",h=>i7(h,o)),!t7(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function eg(e){return WS(e)&&"ownerSVGElement"in e}const Ic=new WeakMap;let Ii;const K3=(e,t,n)=>(i,o)=>o&&o[0]?o[0][e+"Size"]:eg(i)&&"getBBox"in i?i.getBBox()[t]:i[n],s7=K3("inline","width","offsetWidth"),o7=K3("block","height","offsetHeight");function l7({target:e,borderBoxSize:t}){var n;(n=Ic.get(e))==null||n.forEach(i=>{i(e,{get width(){return s7(e,t)},get height(){return o7(e,t)}})})}function u7(e){e.forEach(l7)}function c7(){typeof ResizeObserver>"u"||(Ii=new ResizeObserver(u7))}function d7(e,t){Ii||c7();const n=q3(e);return n.forEach(i=>{let o=Ic.get(i);o||(o=new Set,Ic.set(i,o)),o.add(t),Ii==null||Ii.observe(i)}),()=>{n.forEach(i=>{const o=Ic.get(i);o==null||o.delete(t),o!=null&&o.size||Ii==null||Ii.unobserve(i)})}}const jc=new Set;let Ns;function f7(){Ns=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jc.forEach(t=>t(e))},window.addEventListener("resize",Ns)}function h7(e){return jc.add(e),Ns||f7(),()=>{jc.delete(e),!jc.size&&typeof Ns=="function"&&(window.removeEventListener("resize",Ns),Ns=void 0)}}function fv(e,t){return typeof e=="function"?h7(e):d7(e,t)}function m7(e){return eg(e)&&e.tagName==="svg"}const p7=[...H3,Xt,ba],g7=e=>p7.find(z3(e)),hv=()=>({translate:0,scale:1,origin:0,originPoint:0}),_s=()=>({x:hv(),y:hv()}),mv=()=>({min:0,max:0}),Zt=()=>({x:mv(),y:mv()}),x7=new WeakMap;function Md(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Nl(e){return typeof e=="string"||Array.isArray(e)}const tg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ng=["initial",...tg];function Rd(e){return Md(e.animate)||ng.some(t=>Nl(e[t]))}function Q3(e){return!!(Rd(e)||e.variants)}function b7(e,t,n){for(const i in t){const o=t[i],s=n[i];if(un(o))e.addValue(i,o);else if(un(s))e.addValue(i,Ps(o,{owner:e}));else if(s!==o)if(e.hasValue(i)){const l=e.getValue(i);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(i);e.addValue(i,Ps(l!==void 0?l:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const K0={current:null},$3={current:!1},y7=typeof window<"u";function v7(){if($3.current=!0,!!y7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>K0.current=e.matches;e.addEventListener("change",t),t()}else K0.current=!1}const pv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let rd={};function W3(e){rd=e}function E7(){return rd}class T7{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:l,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Gp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=yn.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,St.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=Rd(n),this.isVariantNode=Q3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...b}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in b){const y=b[p];h[p]!==void 0&&un(y)&&y.set(h[p])}}mount(t){var n,i;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=t,x7.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:($3.current||v7(),this.shouldReduceMotion=K0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),zi(this.notifyUpdate),zi(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const i=this.features[n];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&D3.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:h,duration:m}=n.accelerate,g=new M3({element:this.current,name:t,keyframes:c,times:d,ease:h,duration:qn(m)}),b=l(g);this.valueSubscriptions.set(t,()=>{b(),g.cancel()});return}const i=Gs.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&St.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in rd){const n=rd[t];if(!n)continue;const{isEnabled:i,Feature:o}=n;if(!this.features[t]&&o&&i(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Zt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<pv.length;i++){const o=pv[i];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,l=t[s];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=b7(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Ps(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&($S(i)||ZS(i))?i=parseFloat(i):!g7(i)&&ba.test(n)&&(i=V3(t,n)),this.setBaseTarget(t,un(i)?i.get():i)),un(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const l=Qp(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);l&&(i=l[t])}if(n&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!un(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Pp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Zp.render(this.render)}}class Z3 extends T7{constructor(){super(...arguments),this.KeyframeResolver=$P}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const i=t.style;return i?i[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Vi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function J3({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function S7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function w7(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Km(e){return e===void 0||e===1}function Q0({scale:e,scaleX:t,scaleY:n}){return!Km(e)||!Km(t)||!Km(n)}function vr(e){return Q0(e)||ew(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ew(e){return gv(e.x)||gv(e.y)}function gv(e){return e&&e!=="0%"}function sd(e,t,n){const i=e-n,o=t*i;return n+o}function xv(e,t,n,i,o){return o!==void 0&&(e=sd(e,o,i)),sd(e,n,i)+t}function $0(e,t=0,n=1,i,o){e.min=xv(e.min,t,n,i,o),e.max=xv(e.max,t,n,i,o)}function tw(e,{x:t,y:n}){$0(e.x,t.translate,t.scale,t.originPoint),$0(e.y,n.translate,n.scale,n.originPoint)}const bv=.999999999999,yv=1.0000000000001;function k7(e,t,n,i=!1){var c;const o=n.length;if(!o)return;t.x=t.y=1;let s,l;for(let d=0;d<o;d++){s=n[d],l=s.projectionDelta;const{visualElement:h}=s.options;h&&h.props.style&&h.props.style.display==="contents"||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(_a(e.x,-s.scroll.offset.x),_a(e.y,-s.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,tw(e,l)),i&&vr(s.latestValues)&&Pc(e,s.latestValues,(c=s.layout)==null?void 0:c.layoutBox))}t.x<yv&&t.x>bv&&(t.x=1),t.y<yv&&t.y>bv&&(t.y=1)}function _a(e,t){e.min+=t,e.max+=t}function vv(e,t,n,i,o=.5){const s=Tt(e.min,e.max,o);$0(e,t,n,s,i)}function Ev(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Pc(e,t,n){const i=n??e;vv(e.x,Ev(t.x,i.x),t.scaleX,t.scale,t.originX),vv(e.y,Ev(t.y,i.y),t.scaleY,t.scale,t.originY)}function nw(e,t){return J3(w7(e.getBoundingClientRect(),t))}function A7(e,t,n){const i=nw(e,n),{scroll:o}=t;return o&&(_a(i.x,o.offset.x),_a(i.y,o.offset.y)),i}const C7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},N7=Ys.length;function _7(e,t,n){let i="",o=!0;for(let l=0;l<N7;l++){const c=Ys[l],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(c.startsWith("scale")?1:0);else{const m=parseFloat(d);h=c.startsWith("scale")?m===1:m===0}if(!h||n){const m=X0(d,id[c]);if(!h){o=!1;const g=C7[c]||c;i+=`${g}(${m}) `}n&&(t[c]=m)}}const s=e.pathRotation;return s&&(o=!1,i+=`rotate(${X0(s,id.pathRotation)}) `),i=i.trim(),n?i=n(t,o?"":i):o&&(i="none"),i}function ag(e,t,n){const{style:i,vars:o,transformOrigin:s}=e;let l=!1,c=!1;for(const d in t){const h=t[d];if(Gs.has(d)){l=!0;continue}else if(h3(d)){o[d]=h;continue}else{const m=X0(h,id[d]);d.startsWith("origin")?(c=!0,s[d]=m):i[d]=m}}if(t.transform||(l||n?i.transform=_7(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:m=0}=s;i.transformOrigin=`${d} ${h} ${m}`}}function aw(e,{style:t,vars:n},i,o){const s=e.style;let l;for(l in t)s[l]=t[l];o==null||o.applyProjectionStyles(s,i);for(l in n)s.setProperty(l,n[l])}function Tv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Le.test(e))e=parseFloat(e);else return e;const n=Tv(e,t.target.x),i=Tv(e,t.target.y);return`${n}% ${i}%`}},M7={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,o=ba.parse(e);if(o.length>5)return i;const s=ba.createTransformer(e),l=typeof o[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;o[0+l]/=c,o[1+l]/=d;const h=Tt(c,d,.5);return typeof o[2+l]=="number"&&(o[2+l]/=h),typeof o[3+l]=="number"&&(o[3+l]/=h),s(o)}},W0={borderRadius:{...Zo,applyTo:[...Wp]},borderTopLeftRadius:Zo,borderTopRightRadius:Zo,borderBottomLeftRadius:Zo,borderBottomRightRadius:Zo,boxShadow:M7};function iw(e,{layout:t,layoutId:n}){return Gs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!W0[e]||e==="opacity")}function ig(e,t,n){var l;const i=e.style,o=t==null?void 0:t.style,s={};if(!i)return s;for(const c in i)(un(i[c])||o&&un(o[c])||iw(c,e)||((l=n==null?void 0:n.getValue(c))==null?void 0:l.liveStyle)!==void 0)&&(s[c]=i[c]);return s}function R7(e){return window.getComputedStyle(e)}class D7 extends Z3{constructor(){super(...arguments),this.type="html",this.renderInstance=aw}mount(t){Nd(!!t.style),super.mount(t)}readValueFromInstance(t,n){var i;if(Gs.has(n))return(i=this.projection)!=null&&i.isProjecting?j0(n):Zj(t,n);{const o=R7(t),s=(h3(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return nw(t,n)}build(t,n,i){ag(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return ig(t,n,i)}}const L7={offset:"stroke-dashoffset",array:"stroke-dasharray"},O7={offset:"strokeDashoffset",array:"strokeDasharray"};function I7(e,t,n=1,i=0,o=!0){e.pathLength=1;const s=o?L7:O7;e[s.offset]=`${-i}`,e[s.array]=`${t} ${n}`}const rw=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function sw(e,{attrX:t,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:l=0,...c},d,h,m){if(ag(e,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;for(const p of rw)g[p]!==void 0&&(b[p]=g[p],delete g[p]);(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=(m==null?void 0:m.transformBox)??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),i!==void 0&&(g.scale=i),o!==void 0&&I7(g,o,s,l,!1)}const ow=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),lw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function j7(e,t,n,i){aw(e,t,void 0,i);for(const o in t.attrs)e.setAttribute(ow.has(o)?o:$p(o),t.attrs[o])}function uw(e,t,n){const i=ig(e,t,n);for(const o in e)if(un(e[o])||un(t[o])){const s=Ys.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;i[s]=e[o]}return i}class P7 extends Z3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Zt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gs.has(n)){const i=F3(n);return i&&i.default||0}if(rw.includes(n)){const o=getComputedStyle(t)[n];if(typeof o=="string"&&o)return o.trim()}return n=ow.has(n)?n:$p(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return uw(t,n,i)}build(t,n,i){sw(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,o){j7(t,n,i,o)}mount(t){this.isSVGTag=lw(t.tagName),super.mount(t)}}const B7=ng.length;function cw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?cw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<B7;n++){const i=ng[n],o=e.props[i];(Nl(o)||o===!1)&&(t[i]=o)}return t}function dw(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const U7=[...tg].reverse(),z7=tg.length;function H7(e){return t=>Promise.all(t.map(({animation:n,options:i})=>UP(e,n,i)))}function F7(e){let t=H7(e),n=Sv(),i=!0,o=!1;const s=h=>(m,g)=>{var p;const b=Mr(e,g,h==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(b){const{transition:y,transitionEnd:E,...T}=b;m={...m,...T,...E}}return m};function l(h){t=h(e)}function c(h){const{props:m}=e,g=cw(e.parent)||{},b=[],p=new Set;let y={},E=1/0;for(let k=0;k<z7;k++){const M=U7[k],N=n[M],O=m[M]!==void 0?m[M]:g[M],A=Nl(O),C=M===h?N.isActive:null;C===!1&&(E=k);let L=O===g[M]&&O!==m[M]&&A;if(L&&(i||o)&&e.manuallyAnimateOnMount&&(L=!1),N.protectedKeys={...y},!N.isActive&&C===null||!O&&!N.prevProp||Md(O)||typeof O=="boolean")continue;if(M==="exit"&&N.isActive&&C!==!0){N.prevResolvedValues&&(y={...y,...N.prevResolvedValues});continue}const _=V7(N.prevProp,O);let j=_||M===h&&N.isActive&&!L&&A||k>E&&A,D=!1;const P=Array.isArray(O)?O:[O];let U=P.reduce(s(M),{});C===!1&&(U={});const{prevResolvedValues:J={}}=N,q={...J,...U},z=Z=>{j=!0,p.has(Z)&&(D=!0,p.delete(Z)),N.needsAnimating[Z]=!0;const ie=e.getValue(Z);ie&&(ie.liveStyle=!1)};for(const Z in q){const ie=U[Z],V=J[Z];if(y.hasOwnProperty(Z))continue;let Y=!1;F0(ie)&&F0(V)?Y=!dw(ie,V)||_:Y=ie!==V,Y?ie!=null?z(Z):p.add(Z):ie!==void 0&&p.has(Z)?z(Z):N.protectedKeys[Z]=!0}N.prevProp=O,N.prevResolvedValues=U,N.isActive&&(y={...y,...U}),(i||o)&&e.blockInitialAnimation&&(j=!1);const H=L&&_;j&&(!H||D)&&b.push(...P.map(Z=>{const ie={type:M};if(typeof Z=="string"&&(i||o)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,Y=Mr(V,Z);if(V.enteringChildren&&Y){const{delayChildren:G}=Y.transition||{};ie.delay=L3(V.enteringChildren,e,G)}}return{animation:Z,options:ie}}))}if(p.size){const k={};if(typeof m.initial!="boolean"){const M=Mr(e,Array.isArray(m.initial)?m.initial[0]:m.initial);M&&M.transition&&(k.transition=M.transition)}p.forEach(M=>{const N=e.getBaseTarget(M),O=e.getValue(M);O&&(O.liveStyle=!0),k[M]=N??null}),b.push({animation:k})}let T=!!b.length;return i&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(T=!1),i=!1,o=!1,T?t(b):Promise.resolve()}function d(h,m){var b;if(n[h].isActive===m)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(p=>{var y;return(y=p.animationState)==null?void 0:y.setActive(h,m)}),n[h].isActive=m;const g=c(h);for(const p in n)n[p].protectedKeys={};return g}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=Sv(),o=!0}}}function V7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dw(t,e):!1}function gr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Sv(){return{animate:gr(!0),whileInView:gr(),whileHover:gr(),whileTap:gr(),whileDrag:gr(),whileFocus:gr(),exit:gr()}}function Z0(e,t){e.min=t.min,e.max=t.max}function ma(e,t){Z0(e.x,t.x),Z0(e.y,t.y)}function wv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const fw=1e-4,q7=1-fw,Y7=1+fw,hw=.01,G7=0-hw,X7=0+hw;function vn(e){return e.max-e.min}function K7(e,t,n){return Math.abs(e-t)<=n}function kv(e,t,n,i=.5){e.origin=i,e.originPoint=Tt(t.min,t.max,e.origin),e.scale=vn(n)/vn(t),e.translate=Tt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=q7&&e.scale<=Y7||isNaN(e.scale))&&(e.scale=1),(e.translate>=G7&&e.translate<=X7||isNaN(e.translate))&&(e.translate=0)}function bl(e,t,n,i){kv(e.x,t.x,n.x,i?i.originX:void 0),kv(e.y,t.y,n.y,i?i.originY:void 0)}function Av(e,t,n,i=0){const o=i?Tt(n.min,n.max,i):n.min;e.min=o+t.min,e.max=e.min+vn(t)}function Q7(e,t,n,i){Av(e.x,t.x,n.x,i==null?void 0:i.x),Av(e.y,t.y,n.y,i==null?void 0:i.y)}function Cv(e,t,n,i=0){const o=i?Tt(n.min,n.max,i):n.min;e.min=t.min-o,e.max=e.min+vn(t)}function od(e,t,n,i){Cv(e.x,t.x,n.x,i==null?void 0:i.x),Cv(e.y,t.y,n.y,i==null?void 0:i.y)}function Nv(e,t,n,i,o){return e-=t,e=sd(e,1/n,i),o!==void 0&&(e=sd(e,1/o,i)),e}function $7(e,t=0,n=1,i=.5,o,s=e,l=e){if(Ma.test(t)&&(t=parseFloat(t),t=Tt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=Tt(s.min,s.max,i);e===s&&(c-=t),e.min=Nv(e.min,t,n,c,o),e.max=Nv(e.max,t,n,c,o)}function _v(e,t,[n,i,o],s,l){$7(e,t[n],t[i],t[o],t.scale,s,l)}const W7=["x","scaleX","originX"],Z7=["y","scaleY","originY"];function Mv(e,t,n,i){_v(e.x,t,W7,n?n.x:void 0,i?i.x:void 0),_v(e.y,t,Z7,n?n.y:void 0,i?i.y:void 0)}function Rv(e){return e.translate===0&&e.scale===1}function mw(e){return Rv(e.x)&&Rv(e.y)}function Dv(e,t){return e.min===t.min&&e.max===t.max}function J7(e,t){return Dv(e.x,t.x)&&Dv(e.y,t.y)}function Lv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pw(e,t){return Lv(e.x,t.x)&&Lv(e.y,t.y)}function Ov(e){return vn(e.x)/vn(e.y)}function Iv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Aa(e){return[e("x"),e("y")]}function eB(e,t,n){let i="";const o=e.x.translate/t.x,s=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((o||s||l)&&(i=`translate3d(${o}px, ${s}px, ${l}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:g,rotateX:b,rotateY:p,skewX:y,skewY:E}=n;h&&(i=`perspective(${h}px) ${i}`),m&&(i+=`rotate(${m}deg) `),g&&(i+=`rotate(${g}deg) `),b&&(i+=`rotateX(${b}deg) `),p&&(i+=`rotateY(${p}deg) `),y&&(i+=`skewX(${y}deg) `),E&&(i+=`skewY(${E}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}const tB=Wp.length,jv=e=>typeof e=="string"?parseFloat(e):e,Pv=e=>typeof e=="number"||Le.test(e);function nB(e,t,n,i,o,s){o?(e.opacity=Tt(0,n.opacity??1,aB(i)),e.opacityExit=Tt(t.opacity??1,0,iB(i))):s&&(e.opacity=Tt(t.opacity??1,n.opacity??1,i));for(let l=0;l<tB;l++){const c=Wp[l];let d=Bv(t,c),h=Bv(n,c);if(d===void 0&&h===void 0)continue;d||(d=0),h||(h=0),d===0||h===0||Pv(d)===Pv(h)?(e[c]=Math.max(Tt(jv(d),jv(h),i),0),(Ma.test(h)||Ma.test(d))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=Tt(t.rotate||0,n.rotate||0,i))}function Bv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const aB=gw(0,.5,o3),iB=gw(.5,.95,oa);function gw(e,t,n){return i=>i<e?0:i>t?1:n(Al(e,t,i))}function rB(e,t,n){const i=un(e)?e:Ps(e);return i.start(Kp("",i,t,n)),i.animation}function _l(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const sB=(e,t)=>e.depth-t.depth;class oB{constructor(){this.children=[],this.isDirty=!1}add(t){jp(this.children,t),this.isDirty=!0}remove(t){Jc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sB),this.isDirty=!1,this.children.forEach(t)}}function lB(e,t){const n=yn.now(),i=({timestamp:o})=>{const s=o-n;s>=t&&(zi(i),e(s-t))};return St.setup(i,!0),()=>zi(i)}function Bc(e){return un(e)?e.get():e}class uB{constructor(){this.members=[]}add(t){jp(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const o=i.instance;(!o||o.isConnected===!1)&&!i.snapshot&&(Jc(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Jc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let i=this.members.indexOf(t)-1;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,n){var o;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:l}=t.options;(s===void 0||s!==l)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,i,o,s,l;(i=(n=t.options).onExitComplete)==null||i.call(n),(l=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||l.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Uc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qm=["","X","Y","Z"],cB=1e3;let dB=0;function $m(e,t,n,i){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),i&&(i[e]=0))}function xw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=B3(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",St,!(o||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&xw(i)}function bw({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(l={},c=t==null?void 0:t()){this.id=dB++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(mB),this.nodes.forEach(vB),this.nodes.forEach(EB),this.nodes.forEach(pB)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new oB)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Pp),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=eg(l)&&!m7(l),this.instance=l;const{layoutId:c,layout:d,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let m,g=0;const b=()=>this.root.updateBlockedByResize=!1;St.read(()=>{g=window.innerWidth}),e(l,()=>{const p=window.innerWidth;p!==g&&(g=p,this.root.updateBlockedByResize=!0,m&&m(),m=lB(b,250),Uc.hasAnimatedSinceResize&&(Uc.hasAnimatedSinceResize=!1,this.nodes.forEach(Hv)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||h.getDefaultTransition()||AB,{onLayoutAnimationStart:E,onLayoutAnimationComplete:T}=h.getProps(),k=!this.targetLayout||!pw(this.targetLayout,p),M=!g&&b;if(this.options.layoutRoot||this.resumeFrom||M||g&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...Xp(y,"layout"),onPlay:E,onComplete:T};(h.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(m,M,N.path)}else g||Hv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),zi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(TB),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const g=this.path[m];g.shouldResetTransform=!0,(typeof g.latestValues.x=="string"||typeof g.latestValues.y=="string")&&(g.isLayoutDirty=!0),g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(xB),this.nodes.forEach(Uv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(bB),this.nodes.forEach(yB),this.nodes.forEach(fB),this.nodes.forEach(hB)):this.nodes.forEach(zv),this.clearAllSnapshots();const c=yn.now();ln.delta=Ra(0,1e3/60,c-ln.timestamp),ln.timestamp=c,ln.isProcessing=!0,Hm.update.process(ln),Hm.preRender.process(ln),Hm.render.process(ln),ln.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zp.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(gB),this.sharedNodes.forEach(SB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,St.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){St.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Zt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!mw(this.projectionDelta),d=this.getTransformTemplate(),h=d?d(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;l&&this.instance&&(c||vr(this.latestValues)||m)&&(o(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),CB(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var h;const{visualElement:l}=this.options;if(!l)return Zt();const c=l.measureViewportBox();if(!(((h=this.scroll)==null?void 0:h.wasRoot)||this.path.some(NB))){const{scroll:m}=this.root;m&&(_a(c.x,m.offset.x),_a(c.y,m.offset.y))}return c}removeElementScroll(l){var d;const c=Zt();if(ma(c,l),(d=this.scroll)!=null&&d.wasRoot)return c;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:b}=m;m!==this.root&&g&&b.layoutScroll&&(g.wasRoot&&ma(c,l),_a(c.x,g.offset.x),_a(c.y,g.offset.y))}return c}applyTransform(l,c=!1,d){var m,g;const h=d||Zt();ma(h,l);for(let b=0;b<this.path.length;b++){const p=this.path[b];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(_a(h.x,-p.scroll.offset.x),_a(h.y,-p.scroll.offset.y)),vr(p.latestValues)&&Pc(h,p.latestValues,(m=p.layout)==null?void 0:m.layoutBox)}return vr(this.latestValues)&&Pc(h,this.latestValues,(g=this.layout)==null?void 0:g.layoutBox),h}removeTransform(l){var d;const c=Zt();ma(c,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!vr(m.latestValues))continue;let g;m.instance&&(Q0(m.latestValues)&&m.updateSnapshot(),g=Zt(),ma(g,m.measurePageBox())),Mv(c,m.latestValues,(d=m.snapshot)==null?void 0:d.layoutBox,g)}return vr(this.latestValues)&&Mv(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ln.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var p;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:g}=this.options;if(!this.layout||!(m||g))return;this.resolvedRelativeTargetAt=ln.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Zt(),this.targetWithTransforms=Zt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Q7(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ma(this.target,this.layout.layoutBox),tw(this.target,this.targetDelta)):ma(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Q0(this.parent.latestValues)||ew(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Zt(),this.relativeTargetOrigin=Zt(),od(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),ma(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===ln.timestamp&&(d=!1),d)return;const{layout:h,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||m))return;ma(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,b=this.treeScale.y;k7(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Zt());const{target:p}=l;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(wv(this.prevProjectionDelta.x,this.projectionDelta.x),wv(this.prevProjectionDelta.y,this.projectionDelta.y)),bl(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==b||!Iv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Iv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_s(),this.projectionDelta=_s(),this.projectionDeltaWithTransform=_s()}setAnimationOrigin(l,c=!1,d){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},b=_s();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const p=Zt(),y=h?h.source:void 0,E=this.layout?this.layout.source:void 0,T=y!==E,k=this.getStack(),M=!k||k.members.length<=1,N=!!(T&&!M&&this.options.crossfade===!0&&!this.path.some(kB));this.animationProgress=0;let O;const A=d==null?void 0:d.interpolateProjection(l);this.mixTargetDelta=C=>{const L=C/1e3,_=A==null?void 0:A(L);_?(b.x.translate=_.x,b.x.scale=Tt(l.x.scale,1,L),b.x.origin=l.x.origin,b.x.originPoint=l.x.originPoint,b.y.translate=_.y,b.y.scale=Tt(l.y.scale,1,L),b.y.origin=l.y.origin,b.y.originPoint=l.y.originPoint):(Fv(b.x,l.x,L),Fv(b.y,l.y,L)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(od(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),wB(this.relativeTarget,this.relativeTargetOrigin,p,L),O&&J7(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Zt()),ma(O,this.relativeTarget)),T&&(this.animationValues=g,nB(g,m,this.latestValues,L,N,M)),_&&_.rotate!==void 0&&(this.animationValues||(this.animationValues=g),this.animationValues.pathRotation=_.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var c,d,h;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(h=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||h.stop(),this.pendingAnimation&&(zi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=St.update(()=>{Uc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ps(0)),this.motionValue.jump(0,!1),this.currentAnimation=rB(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:m=>{this.mixTargetDelta(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(cB),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:h,latestValues:m}=l;if(!(!c||!d||!h)){if(this!==l&&this.layout&&h&&yw(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||Zt();const g=vn(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+g;const b=vn(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+b}ma(c,d),Pc(c,m),bl(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new uB),this.sharedNodes.get(l).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var c;const{layoutId:l}=this.options;return l?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:l}=this.options;return l?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const h={};d.z&&$m("z",l,h,this.animationValues);for(let m=0;m<Qm.length;m++)$m(`rotate${Qm[m]}`,l,h,this.animationValues),$m(`skew${Qm[m]}`,l,h,this.animationValues);l.render();for(const m in h)l.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Bc(c==null?void 0:c.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Bc(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!vr(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let g=eB(this.projectionDeltaWithTransform,this.treeScale,m);d&&(g=d(m,g)),l.transform=g;const{x:b,y:p}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${p.origin*100}% 0`,h.animationValues?l.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:l.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const y in W0){if(m[y]===void 0)continue;const{correct:E,applyTo:T,isCSSVariable:k}=W0[y],M=g==="none"?m[y]:E(m[y],h);if(T){const N=T.length;for(let O=0;O<N;O++)l[T[O]]=M}else k?this.options.visualElement.renderState.vars[y]=M:l[y]=M}this.options.layoutId&&(l.pointerEvents=h===this?Bc(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var c;return(c=l.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(Uv),this.root.sharedNodes.clear()}}}function fB(e){e.updateLayout()}function hB(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:o}=e.layout,{animationType:s}=e.options,l=t.source!==e.layout.source;if(s==="size")Aa(g=>{const b=l?t.measuredBox[g]:t.layoutBox[g],p=vn(b);b.min=i[g].min,b.max=b.min+p});else if(s==="x"||s==="y"){const g=s==="x"?"y":"x";Z0(l?t.measuredBox[g]:t.layoutBox[g],i[g])}else yw(s,t.layoutBox,i)&&Aa(g=>{const b=l?t.measuredBox[g]:t.layoutBox[g],p=vn(i[g]);b.max=b.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+p)});const c=_s();bl(c,i,t.layoutBox);const d=_s();l?bl(d,e.applyTransform(o,!0),t.measuredBox):bl(d,i,t.layoutBox);const h=!mw(c);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:b,layout:p}=g;if(b&&p){const y=e.options.layoutAnchor||void 0,E=Zt();od(E,t.layoutBox,b.layoutBox,y);const T=Zt();od(T,i,p.layoutBox,y),pw(E,T)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=E,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:d,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function mB(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function pB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function gB(e){e.clearSnapshot()}function Uv(e){e.clearMeasurements()}function xB(e){e.isLayoutDirty=!0,e.updateLayout()}function zv(e){e.isLayoutDirty=!1}function bB(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function yB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Hv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function vB(e){e.resolveTargetDelta()}function EB(e){e.calcProjection()}function TB(e){e.resetSkewAndRotation()}function SB(e){e.removeLeadSnapshot()}function Fv(e,t,n){e.translate=Tt(t.translate,0,n),e.scale=Tt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Vv(e,t,n,i){e.min=Tt(t.min,n.min,i),e.max=Tt(t.max,n.max,i)}function wB(e,t,n,i){Vv(e.x,t.x,n.x,i),Vv(e.y,t.y,n.y,i)}function kB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const AB={duration:.45,ease:[.4,0,.1,1]},qv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yv=qv("applewebkit/")&&!qv("chrome/")?Math.round:oa;function Gv(e){e.min=Yv(e.min),e.max=Yv(e.max)}function CB(e){Gv(e.x),Gv(e.y)}function yw(e,t,n){return e==="position"||e==="preserve-aspect"&&!K7(Ov(t),Ov(n),.2)}function NB(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const _B=bw({attachResizeListener:(e,t)=>_l(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Wm={current:void 0},vw=bw({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Wm.current){const e=new _B({});e.mount(window),e.setOptions({layoutScroll:!0}),Wm.current=e}return Wm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rg=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Xv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function MB(...e){return t=>{let n=!1;const i=e.map(o=>{const s=Xv(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<i.length;o++){const s=i[o];typeof s=="function"?s():Xv(e[o],null)}}}}function RB(...e){return R.useCallback(MB(...e),e)}class DB extends R.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Lc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,o=Lc(i)&&i.offsetWidth||0,s=Lc(i)&&i.offsetHeight||0,l=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(l.height),c.width=parseFloat(l.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=o-c.width-c.left,c.bottom=s-c.height-c.top,c.direction=l.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function LB({children:e,isPresent:t,anchorX:n,anchorY:i,root:o,pop:s}){var b;const l=R.useId(),c=R.useRef(null),d=R.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=R.useContext(rg),m=s!==!1?((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref):void 0,g=RB(c,m);return R.useInsertionEffect(()=>{const{width:p,height:y,top:E,left:T,right:k,bottom:M,direction:N}=d.current;if(t||s===!1||!c.current||!p||!y)return;const O=N==="rtl",A=n==="left"?O?`right: ${k}`:`left: ${T}`:O?`left: ${T}`:`right: ${k}`,C=i==="bottom"?`bottom: ${M}`:`top: ${E}`;c.current.dataset.motionPopId=l;const L=document.createElement("style");h&&(L.nonce=h);const _=o??document.head;return _.appendChild(L),L.sheet&&L.sheet.insertRule(`
|
|
541
|
+
[data-motion-pop-id="${l}"] {
|
|
542
|
+
position: absolute !important;
|
|
543
|
+
width: ${p}px !important;
|
|
544
|
+
height: ${y}px !important;
|
|
545
|
+
${A}px !important;
|
|
546
|
+
${C}px !important;
|
|
547
|
+
}
|
|
548
|
+
`),()=>{var j;(j=c.current)==null||j.removeAttribute("data-motion-pop-id"),_.contains(L)&&_.removeChild(L)}},[t]),x.jsx(DB,{isPresent:t,childRef:c,sizeRef:d,pop:s,children:s===!1?e:R.cloneElement(e,{ref:g})})}const OB=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:d,root:h})=>{const m=Ip(IB),g=R.useId(),b=R.useRef(n),p=R.useRef(i);Zc(()=>{b.current=n,p.current=i});let y=!0,E=R.useMemo(()=>(y=!1,{id:g,initial:t,isPresent:n,custom:o,onExitComplete:T=>{m.set(T,!0);for(const k of m.values())if(!k)return;i&&i()},register:T=>(m.set(T,!1),()=>{var k;m.delete(T),!b.current&&!m.size&&((k=p.current)==null||k.call(p))})}),[n,m,i]);return s&&y&&(E={...E}),R.useMemo(()=>{m.forEach((T,k)=>m.set(k,!1))},[n]),R.useEffect(()=>{!n&&!m.size&&i&&i()},[n]),e=x.jsx(LB,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:h,children:e}),x.jsx(Cd.Provider,{value:E,children:e})};function IB(){return new Map}function Ew(e=!0){const t=R.useContext(Cd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=t,s=R.useId();R.useEffect(()=>{if(e)return o(s)},[e]);const l=R.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,l]:[!0]}const Sc=e=>e.key||"";function Kv(e){const t=[];return R.Children.forEach(e,n=>{R.isValidElement(n)&&t.push(n)}),t}const jB=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync",propagate:l=!1,anchorX:c="left",anchorY:d="top",root:h})=>{const[m,g]=Ew(l),b=R.useMemo(()=>Kv(e),[e]),p=l&&!m?[]:b.map(Sc),y=R.useRef(!0),E=R.useRef(b),T=Ip(()=>new Map),k=R.useRef(new Set),[M,N]=R.useState(b),[O,A]=R.useState(b);Zc(()=>{l&&!m&&!O.length&&(g==null||g())},[m,l,O.length,g]),Zc(()=>{y.current=!1,E.current=b;for(let _=0;_<O.length;_++){const j=Sc(O[_]);p.includes(j)?(T.delete(j),k.current.delete(j)):T.get(j)!==!0&&T.set(j,!1)}},[O,p.length,p.join("-")]);const C=[];if(b!==M){let _=[...b];for(let j=0;j<O.length;j++){const D=O[j],P=Sc(D);p.includes(P)||(_.splice(j,0,D),C.push(D))}return s==="wait"&&C.length&&(_=C),A(Kv(_)),N(b),null}const{forceRender:L}=R.useContext(Op);return x.jsx(x.Fragment,{children:O.map(_=>{const j=Sc(_),D=l&&!m?!1:b===O||p.includes(j),P=()=>{if(k.current.has(j))return;if(T.has(j))k.current.add(j),T.set(j,!0);else return;let U=!0;T.forEach(J=>{J||(U=!1)}),U&&(L==null||L(),A(E.current),l&&(g==null||g()),i&&i())};return x.jsx(OB,{isPresent:D,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:h,onExitComplete:D?void 0:P,anchorX:c,anchorY:d,children:_},j)})})},Tw=R.createContext({strict:!1}),Qv={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let $v=!1;function PB(){if($v)return;const e={};for(const t in Qv)e[t]={isEnabled:n=>Qv[t].some(i=>!!n[i])};W3(e),$v=!0}function Sw(){return PB(),E7()}function BB(e){const t=Sw();for(const n in e)t[n]={...t[n],...e[n]};W3(t)}const Dd=R.createContext({});function UB(e,t){if(Rd(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Nl(n)?n:void 0,animate:Nl(i)?i:void 0}}return e.inherit!==!1?t:{}}function zB(e){const{initial:t,animate:n}=UB(e,R.useContext(Dd));return R.useMemo(()=>({initial:t,animate:n}),[Wv(t),Wv(n)])}function Wv(e){return Array.isArray(e)?e.join(" "):e}const sg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ww(e,t,n){for(const i in t)!un(t[i])&&!iw(i,n)&&(e[i]=t[i])}function HB({transformTemplate:e},t){return R.useMemo(()=>{const n=sg();return ag(n,t,e),Object.assign({},n.vars,n.style)},[t])}function FB(e,t){const n=e.style||{},i={};return ww(i,n,e),Object.assign(i,HB(e,t)),i}function VB(e,t){const n={},i=FB(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const kw=()=>({...sg(),attrs:{}});function qB(e,t,n,i){const o=R.useMemo(()=>{const s=kw();return sw(s,t,lw(i),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ww(s,e.style,e),o.style={...s,...o.style}}return o}const YB=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ld(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||YB.has(e)}function GB(e,t){return e.startsWith("on")?!ld(e):(t==null?void 0:t(e))??!ld(e)}function XB(e,t,n,i){const o={};for(const s in e)s==="values"&&typeof e.values=="object"||un(e[s])||(GB(s,i)||n===!0&&ld(s)||!t&&!ld(s)||e.draggable&&s.startsWith("onDrag"))&&(o[s]=e[s]);return o}const KB=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function og(e){return typeof e!="string"||e.includes("-")?!1:!!(KB.indexOf(e)>-1||/[A-Z]/u.test(e))}function QB(e,t,n,{latestValues:i},o,s=!1,l,c){const h=(l??og(e)?qB:VB)(t,i,o,e),m=XB(t,typeof e=="string",s,c),g=e!==R.Fragment?{...m,...h,ref:n}:{},{children:b}=t,p=R.useMemo(()=>un(b)?b.get():b,[b]);return R.createElement(e,{...g,children:p})}function $B({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,o){return{latestValues:WB(n,i,o,e),renderState:t()}}function WB(e,t,n,i){const o={},s=i(e,{});for(const b in s)o[b]=Bc(s[b]);let{initial:l,animate:c}=e;const d=Rd(e),h=Q3(e);t&&h&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const g=m?c:l;if(g&&typeof g!="boolean"&&!Md(g)){const b=Array.isArray(g)?g:[g];for(let p=0;p<b.length;p++){const y=Qp(e,b[p]);if(y){const{transitionEnd:E,transition:T,...k}=y;for(const M in k){let N=k[M];if(Array.isArray(N)){const O=m?N.length-1:0;N=N[O]}N!==null&&(o[M]=N)}for(const M in E)o[M]=E[M]}}}return o}const Aw=e=>(t,n)=>{const i=R.useContext(Dd),o=R.useContext(Cd),s=()=>$B(e,t,i,o);return n?s():Ip(s)},ZB=Aw({scrapeMotionValuesFromProps:ig,createRenderState:sg}),JB=Aw({scrapeMotionValuesFromProps:uw,createRenderState:kw}),eU=Symbol.for("motionComponentSymbol");function tU(e,t,n){const i=R.useRef(n);R.useInsertionEffect(()=>{i.current=n});const o=R.useRef(null);return R.useCallback(s=>{var c;s&&((c=e.onMount)==null||c.call(e,s)),t&&(s?t.mount(s):t.unmount());const l=i.current;if(typeof l=="function")if(s){const d=l(s);typeof d=="function"&&(o.current=d)}else o.current?(o.current(),o.current=null):l(s);else l&&(l.current=s)},[t])}const Cw=R.createContext({});function ks(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function nU(e,t,n,i,o,s){var N,O;const{visualElement:l}=R.useContext(Dd),c=R.useContext(Tw),d=R.useContext(Cd),h=R.useContext(rg),m=h.reducedMotion,g=h.skipAnimations,b=R.useRef(null),p=R.useRef(!1);i=i||c.renderer,!b.current&&i&&(b.current=i(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m,skipAnimations:g,isSVG:s}),p.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const y=b.current,E=R.useContext(Cw);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&aU(b.current,n,o,E);const T=R.useRef(!1);R.useInsertionEffect(()=>{y&&T.current&&y.update(n,d)});const k=n[P3],M=R.useRef(!!k&&typeof window<"u"&&!((N=window.MotionHandoffIsComplete)!=null&&N.call(window,k))&&((O=window.MotionHasOptimisedAnimation)==null?void 0:O.call(window,k)));return Zc(()=>{p.current=!0,y&&(T.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),M.current&&y.animationState&&y.animationState.animateChanges())}),R.useEffect(()=>{y&&(!M.current&&y.animationState&&y.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,k)}),M.current=!1),y.enteringChildren=void 0)}),y}function aU(e,t,n,i){const{layoutId:o,layout:s,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:h,layoutAnchor:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Nw(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!l||c&&ks(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:g,layoutScroll:d,layoutRoot:h,layoutAnchor:m})}function Nw(e){if(e)return e.options.allowProjection!==!1?e.projection:Nw(e.parent)}function Zm(e,{forwardMotionProps:t=!1,type:n}={},i,o){i&&BB(i);const s=n?n==="svg":og(e),l=s?JB:ZB;function c(h,m){let g;const b={...R.useContext(rg),...h,layoutId:iU(h)},{isStatic:p,isValidProp:y}=b,E=zB(h),T=l(h,p);if(!p&&typeof window<"u"){rU();const k=sU(b);g=k.MeasureLayout,E.visualElement=nU(e,T,b,o,k.ProjectionNode,s)}return x.jsxs(Dd.Provider,{value:E,children:[g&&E.visualElement?x.jsx(g,{visualElement:E.visualElement,...b}):null,QB(e,h,tU(T,E.visualElement,m),T,p,t,s,y)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=R.forwardRef(c);return d[eU]=e,d}function iU({layoutId:e}){const t=R.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function rU(e,t){R.useContext(Tw).strict}function sU(e){const t=Sw(),{drag:n,layout:i}=t;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n!=null&&n.isEnabled(e)||i!=null&&i.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function oU(e,t){if(typeof Proxy>"u")return Zm;const n=new Map,i=(s,l)=>Zm(s,l,e,t),o=(s,l)=>i(s,l);return new Proxy(o,{get:(s,l)=>l==="create"?i:(n.has(l)||n.set(l,Zm(l,void 0,e,t)),n.get(l))})}const lU=(e,t)=>t.isSVG??og(e)?new P7(t):new D7(t,{allowProjection:e!==R.Fragment});class uU extends Vi{constructor(t){super(t),t.animationState||(t.animationState=F7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Md(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let cU=0;class dU extends Vi{constructor(){super(...arguments),this.id=cU++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:l,custom:c}=this.node.getProps();if(typeof l=="string"||typeof l=="object"&&l!==null&&!Array.isArray(l)){const d=Mr(this.node,l,c);if(d){const{transition:h,transitionEnd:m,...g}=d;for(const b in g)(s=this.node.getValue(b))==null||s.jump(g[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fU={animation:{Feature:uU},exit:{Feature:dU}};function ql(e){return{point:{x:e.pageX,y:e.pageY}}}const hU=e=>t=>Jp(t)&&e(t,ql(t));function yl(e,t,n,i){return _l(e,t,hU(n),i)}const _w=({current:e})=>e?e.ownerDocument.defaultView:null,Zv=(e,t)=>Math.abs(e-t);function mU(e,t){const n=Zv(e.x,t.x),i=Zv(e.y,t.y);return Math.sqrt(n**2+i**2)}const Jv=new Set(["auto","scroll"]);class Mw{constructor(t,n,{transformPagePoint:i,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=wc(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Jm(this.lastMoveEventInfo,this.history),E=this.startEvent!==null,T=mU(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!E&&!T)return;const{point:k}=y,{timestamp:M}=ln;this.history.push({...k,timestamp:M});const{onStart:N,onMove:O}=this.handlers;E||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),O&&O(this.lastMoveEvent,y)},this.handlePointerMove=(y,E)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=E,this.lastMoveEventInfo=wc(E,this.transformPagePoint),St.update(this.updatePoint,!0)},this.handlePointerUp=(y,E)=>{this.end();const{onEnd:T,onSessionEnd:k,resumeAnimation:M}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Jm(y.type==="pointercancel"?this.lastMoveEventInfo:wc(E,this.transformPagePoint),this.history);this.startEvent&&T&&T(y,N),k&&k(y,N)},!Jp(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=o||window;const d=ql(t),h=wc(d,this.transformPagePoint),{point:m}=h,{timestamp:g}=ln;this.history=[{...m,timestamp:g}];const{onSessionStart:b}=n;b&&b(t,Jm(h,this.history));const p={passive:!0,capture:!0};this.removeListeners=Hl(yl(this.contextWindow,"pointermove",this.handlePointerMove,p),yl(this.contextWindow,"pointerup",this.handlePointerUp,p),yl(this.contextWindow,"pointercancel",this.handlePointerUp,p)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(Jv.has(i.overflowX)||Jv.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const i=t===window,o=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),St.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),zi(this.updatePoint)}}function wc(e,t){return t?{point:t(e.point)}:e}function eE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jm({point:e},t){return{point:e,delta:eE(e,Rw(t)),offset:eE(e,pU(t)),velocity:gU(t,.1)}}function pU(e){return e[0]}function Rw(e){return e[e.length-1]}function gU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const o=Rw(e);for(;n>=0&&(i=e[n],!(o.timestamp-i.timestamp>qn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&o.timestamp-i.timestamp>qn(t)*2&&(i=e[1]);const s=sa(o.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const l={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function xU(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?Tt(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?Tt(n,e,i.max):Math.min(e,n)),e}function tE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bU(e,{top:t,left:n,bottom:i,right:o}){return{x:tE(e.x,n,o),y:tE(e.y,t,i)}}function nE(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function yU(e,t){return{x:nE(e.x,t.x),y:nE(e.y,t.y)}}function vU(e,t){let n=.5;const i=vn(e),o=vn(t);return o>i?n=Al(t.min,t.max-i,e.min):i>o&&(n=Al(e.min,e.max-o,t.min)),Ra(0,1,n)}function EU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const J0=.35;function TU(e=J0){return e===!1?e=0:e===!0&&(e=J0),{x:aE(e,"left","right"),y:aE(e,"top","bottom")}}function aE(e,t,n){return{min:iE(e,t),max:iE(e,n)}}function iE(e,t){return typeof e=="number"?e:e[t]||0}const SU=new WeakMap;class wU{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Zt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=g=>{n&&this.snapToCursor(ql(g).point),this.stopAnimation()},l=(g,b)=>{const{drag:p,dragPropagation:y,onDragStart:E}=this.getProps();if(p&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=WP(p),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Aa(k=>{let M=this.getAxisMotionValue(k).get()||0;if(Ma.test(M)){const{projection:N}=this.visualElement;if(N&&N.layout){const O=N.layout.layoutBox[k];O&&(M=vn(O)*(parseFloat(M)/100))}}this.originPoint[k]=M}),E&&St.update(()=>E(g,b),!1,!0),V0(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:p,dragDirectionLock:y,onDirectionLock:E,onDrag:T}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:k}=b;if(y&&this.currentDirection===null){this.currentDirection=AU(k),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",b.point,k),this.updateAxis("y",b.point,k),this.visualElement.render(),T&&St.update(()=>T(g,b),!1,!0)},d=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new Mw(t,{onSessionStart:s,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:_w(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!i)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&St.postRender(()=>c(i,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,i){const{drag:o}=this.getProps();if(!i||!kc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(l=xU(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&ks(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=bU(i.layoutBox,t):this.constraints=!1,this.elastic=TU(n),o!==this.constraints&&!ks(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Aa(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=EU(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ks(t))return!1;const i=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const s=A7(i,o.root,this.visualElement.getTransformPagePoint());let l=yU(o.layout.layoutBox,s);if(n){const c=n(S7(l));this.hasMutatedConstraints=!!c,c&&(l=J3(c))}return l}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},h=Aa(m=>{if(!kc(m,n,this.currentDirection))return;let g=d&&d[m]||{};(l===!0||l===m)&&(g={min:0,max:0});const b=o?200:1e6,p=o?40:1e7,y={type:"inertia",velocity:i?t[m]:0,bounceStiffness:b,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...g};return this.startAxisValueAnimation(m,y)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return V0(this.visualElement,t),i.start(Kp(t,i,0,n,this.visualElement,!1))}stopAnimation(){Aa(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps()[n];return o||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Aa(n=>{const{drag:i}=this.getProps();if(!kc(n,i,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:c}=o.layout.layoutBox[n],d=s.get()||0;s.set(t[n]-Tt(l,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!ks(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Aa(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();o[l]=vU({min:d,max:d},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Aa(l=>{if(!kc(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:h}=this.constraints[l];c.set(Tt(d,h,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;SU.set(this.visualElement,this);const t=this.visualElement.current,n=yl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),b=h.target,p=b!==t&&a7(b);m&&g&&!p&&this.start(h)});let i;const o=()=>{const{dragConstraints:h}=this.getProps();ks(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=kU(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),St.read(o);const c=_l(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Aa(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=h[g].translate,b.set(b.get()+h[g].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),d&&d(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:l=J0,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function rE(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function kU(e,t,n){const i=fv(e,rE(n)),o=fv(t,rE(n));return()=>{i(),o()}}function kc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function AU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class CU extends Vi{constructor(t){super(t),this.removeGroupControls=oa,this.removeListeners=oa,this.controls=new wU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||oa}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const e0=e=>(t,n)=>{e&&St.update(()=>e(t,n),!1,!0)};class NU extends Vi{constructor(){super(...arguments),this.removePointerDownListener=oa}onPointerDown(t){this.session=new Mw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_w(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:o}=this.node.getProps();return{onSessionStart:e0(t),onStart:e0(n),onMove:e0(i),onEnd:(s,l)=>{delete this.session,o&&St.postRender(()=>o(s,l))}}}mount(){this.removePointerDownListener=yl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let t0=!1;class _U extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),i&&i.register&&o&&i.register(s),t0&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Uc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:o,isPresent:s}=this.props,{projection:l}=i;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),t0=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||St.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Zp.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:o}=t;t0=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),i&&i.deregister&&i.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Dw(e){const[t,n]=Ew(),i=R.useContext(Op);return x.jsx(_U,{...e,layoutGroup:i,switchLayoutGroup:R.useContext(Cw),isPresent:t,safeToRemove:n})}const MU={pan:{Feature:NU},drag:{Feature:CU,ProjectionNode:vw,MeasureLayout:Dw}};function sE(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=i[o];s&&St.postRender(()=>s(t,ql(t)))}class RU extends Vi{mount(){const{current:t}=this.node;t&&(this.unmount=JP(t,(n,i)=>(sE(this.node,i,"Start"),o=>sE(this.node,o,"End"))))}unmount(){}}class DU extends Vi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Hl(_l(this.node.current,"focus",()=>this.onFocus()),_l(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function oE(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=i[o];s&&St.postRender(()=>s(t,ql(t)))}class LU extends Vi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=r7(t,(o,s)=>(oE(this.node,s,"Start"),(l,{success:c})=>oE(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const ep=new WeakMap,n0=new WeakMap,OU=e=>{const t=ep.get(e.target);t&&t(e)},IU=e=>{e.forEach(OU)};function jU({root:e,...t}){const n=e||document;n0.has(n)||n0.set(n,{});const i=n0.get(n),o=JSON.stringify(t);return i[o]||(i[o]=new IntersectionObserver(IU,{root:e,...t})),i[o]}function PU(e,t,n){const i=jU(t);return ep.set(e,n),i.observe(e),()=>{ep.delete(e),i.unobserve(e)}}const BU={some:0,all:1};class UU extends Vi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var d;(d=this.stopObserver)==null||d.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:o="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:i,threshold:typeof o=="number"?o:BU[o]},c=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,s&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),p=m?g:b;p&&p(h)};this.stopObserver=PU(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(zU(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function zU({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const HU={inView:{Feature:UU},tap:{Feature:LU},focus:{Feature:DU},hover:{Feature:RU}},FU={layout:{ProjectionNode:vw,MeasureLayout:Dw}},VU={...fU,...HU,...MU,...FU},qU=oU(VU,lU),YU=qU;function GU(e){switch(e){case"correct":return{Icon:ai,color:"var(--brand)"};case"wrong":return{Icon:Ms,color:"var(--warning)"};case"mastery":case"level-up":return{Icon:gE,color:"var(--gold)"};case"unlock":return{Icon:r0,color:"var(--brand)"};case"streak":return{Icon:xE,color:"var(--review)"};case"energy-full":return{Icon:o0,color:"var(--brand)"};case"exam-pass":return{Icon:sC,color:"var(--exam)"};case"lesson-complete":return{Icon:HC,color:"var(--gold)"};default:return{Icon:r0,color:"var(--brand)"}}}function XU(){const e=jE(),t=R.useRef(null),n=R.useRef([]),i=R.useRef(0),[o,s]=R.useState(null);return R.useEffect(()=>{if(e)return;const l=t.current;if(!l)return;const c=l.getContext("2d");if(!c)return;const d=()=>{const b=Math.min(window.devicePixelRatio||1,2);l.width=window.innerWidth*b,l.height=window.innerHeight*b,l.style.width=window.innerWidth+"px",l.style.height=window.innerHeight+"px",c.setTransform(b,0,0,b,0,0)};d(),window.addEventListener("resize",d);const h=()=>{c.clearRect(0,0,window.innerWidth,window.innerHeight);const b=n.current;for(let p=b.length-1;p>=0;p--){const y=b[p];if(y.x+=y.vx,y.y+=y.vy,y.vy+=.25,y.vx*=.99,y.rot+=y.vr,y.life--,y.life<=0){b.splice(p,1);continue}const E=Math.min(1,y.life/y.maxLife);c.save(),c.globalAlpha=E,c.translate(y.x,y.y),c.rotate(y.rot),c.fillStyle=y.color,y.shape==="circle"?(c.beginPath(),c.arc(0,0,y.size,0,Math.PI*2),c.fill()):c.fillRect(-y.size/2,-y.size/2,y.size,y.size*.6),c.restore()}i.current=b.length>0?requestAnimationFrame(h):0},g=xy(b=>{var k,M;const p=JN(b.kind),y=Math.round(p.particles*(b.intensity??1)),E=((k=b.origin)==null?void 0:k.x)??window.innerWidth/2,T=((M=b.origin)==null?void 0:M.y)??window.innerHeight/2;for(let N=0;N<y;N++){const O=Math.PI*2*N/y+Math.random()*.3,A=3+Math.random()*6,C=p.durationMs/16*(.7+Math.random()*.5);n.current.push({x:E,y:T,vx:Math.cos(O)*A,vy:Math.sin(O)*A-2,life:C,maxLife:C,color:p.colors[N%p.colors.length],size:4+Math.random()*5,rot:Math.random()*Math.PI,vr:(Math.random()-.5)*.3,shape:Math.random()<.5?"rect":"circle"})}i.current===0&&(i.current=requestAnimationFrame(h))});return()=>{g(),window.removeEventListener("resize",d),i.current&&cancelAnimationFrame(i.current),i.current=0,n.current=[]}},[e]),R.useEffect(()=>{if(!e)return;let l=0;return xy(d=>{const h=++l;s({kind:d.kind,id:h}),setTimeout(()=>{h===l&&s(null)},600)})},[e]),e?x.jsx(jB,{children:o&&(()=>{const{Icon:l,color:c}=GU(o.kind);return x.jsx(YU.div,{className:"fixed inset-0 pointer-events-none z-[60] flex items-center justify-center","aria-hidden":"true",initial:{opacity:0},animate:{opacity:.45},exit:{opacity:0},transition:{duration:.2},children:x.jsx(l,{className:"w-24 h-24",color:c,strokeWidth:1.5})},o.id)})()}):x.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const lE=["direct","guide","practice"];function KU(){const e=He(),[t,n]=R.useState([]),[i,o]=R.useState([]),[s,l]=R.useState({}),[c,d]=R.useState(null),[h,m]=R.useState(null),[g,b]=R.useState(null),[p,y]=R.useState(null),E=R.useCallback(oe=>{y(oe instanceof Error?oe.message:String(oe)),console.error(oe)},[]),[T,k]=R.useState([]),[M,N]=R.useState(null),[O,A]=R.useState([]),[C,L]=R.useState(null),[_,j]=R.useState("map"),[D,P]=R.useState(null),[U,J]=R.useState(new Set),[q,z]=R.useState(null),H=R.useRef({active:!1,terminate:null}),[X,Z]=R.useState({open:!1,pendingAction:null}),ie=R.useRef(null),[V,Y]=R.useState(null),[G,B]=R.useState(!1),[ne,K]=R.useState(!0),[$,se]=R.useState(!0),de=G9(),[Ce,qe]=R.useState("notebook"),[$e,We]=R.useState("chat"),Ct=R.useRef($e);Ct.current=$e;const Rt=R.useRef(de);R.useEffect(()=>{Rt.current!==de&&(de===1?(K(!0),se(!0)):de===2&&Rt.current===3&&qe(H9(Ct.current)),Rt.current=de)},[de]);const Nt=de===3?$e==="rail":de===2?Ce==="rail":ne,Kt=de===3?$e==="notebook":de===2?Ce==="notebook":$,mn=de!==3||$e==="chat",pn=()=>{de===1?K(oe=>!oe):de===2?qe(oe=>oe==="rail"?"notebook":"rail"):We(oe=>oe==="rail"?"chat":"rail")},Qt=()=>{de===1?se(oe=>!oe):de===2?qe(oe=>oe==="notebook"?"rail":"notebook"):We(oe=>oe==="notebook"?"chat":"notebook")},pt=R.useRef(null),gn=oe=>{var Ne,je;if(de!==3)return;const ye=oe.touches[0];pt.current={x:ye.clientX,y:ye.clientY,multi:oe.touches.length>1,noswipe:!!((je=(Ne=oe.target).closest)!=null&&je.call(Ne,"[data-noswipe]"))}},Ht=oe=>{const ye=pt.current;if(pt.current=null,!ye||ye.multi||ye.noswipe||de!==3)return;const Ne=oe.changedTouches[0],je=F9(Ct.current,Ne.clientX-ye.x,Ne.clientY-ye.y);je&&We(je)},[ge,Ue]=R.useState(!1),[Ie,he]=R.useState(null),[Te,Re]=R.useState([]),_e=j9(g,q),Ye=NE(),Ae=L9(_e.activeId,Ye),[Ze,Qe]=R.useState(""),Ge=R.useCallback(oe=>{Qe(oe)},[]),Jt=R.useCallback((oe,ye,Ne)=>{if(oe.type==="content"){if(Y("content"),Ne){const je=lt=>{document.querySelector(`mark[data-note-id="${Ne}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:Ne})):lt>0&&setTimeout(()=>je(lt-1),150)};setTimeout(()=>je(10),100)}}else if(oe.threadId!==_e.activeId&&_e.setActiveId(oe.threadId),Ne){const je=lt=>{document.querySelector(`mark[data-note-id="${Ne}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:Ne})):lt>0&&setTimeout(()=>je(lt-1),150)};setTimeout(()=>je(10),120)}},[_e]),[ft,Yn]=R.useState(null);R.useEffect(()=>{if(!q){Yn(null);return}let oe=!1;return be.getNodeSummary(q,Ye).then(ye=>{oe||Yn(ye)}).catch(()=>{oe||Yn(null)}),()=>{oe=!0}},[q,Ye]);const rt=R.useMemo(()=>i.find(oe=>oe.id===q)??null,[i,q]),Ld=R.useMemo(()=>Te.map(oe=>({...oe,label:e(`starter.${oe.key}.label`),hint:e(`starter.${oe.key}.hint`),message:e(`starter.${oe.key}.message`,{title:(rt==null?void 0:rt.title)??""})})),[Te,rt,e]),Gn=R.useRef(null),Ir=R.useCallback(()=>{var oe;rt&&((oe=Gn.current)==null||oe.call(Gn,e("chat.action.startLearningPrompt",{title:rt.title}),e("chat.action.startLearning",{title:rt.title})))},[rt,e]),Rn=R.useCallback(async()=>{try{const[oe,ye,Ne,je,lt,Lt]=await Promise.all([be.listCourses(),be.getStreak(),be.listSouls(),be.getActiveSoul(),be.getXpStatus(),be.getDueReviews()]);n(oe),d(ye),A(Ne),m(lt),L(je),J(new Set(Lt)),g&&!oe.some(En=>En.id===g)&&(b(null),z(null),o([]),l({}),P(null),k([]),N(null))}catch(oe){y(oe instanceof Error?oe.message:String(oe))}},[g]);R.useEffect(()=>{Rn()},[Rn]);const ua=R.useCallback(async()=>{try{he(await be.isAgentReady())}catch{he({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);R.useEffect(()=>{ua();const oe=()=>ua();return window.addEventListener("llm-config-changed",oe),()=>window.removeEventListener("llm-config-changed",oe)},[ua]);const qi=R.useRef(0),oi=R.useRef(0);R.useEffect(()=>{qi.current=(h==null?void 0:h.todayXp)??0},[h]),R.useEffect(()=>{oi.current=(c==null?void 0:c.currentStreak)??0},[c]);const jr=R.useCallback(async()=>{const oe=i.filter(je=>je.type==="lesson"||je.type==="exam"),ye=await Promise.all(oe.map(async je=>{const lt=await be.getProgress(je.id);return[je.id,lt]})),Ne={};for(const[je,lt]of ye)lt&&(Ne[je]=lt);l(Ne)},[i]);R.useEffect(()=>be.on("state:changed",ye=>{ye==="xp"?be.getXpStatus().then(Ne=>{m(Ne),qi.current<100&&Ne.todayXp>=100&&Ar("energy-full")}).catch(()=>{}):ye==="streak"?be.getStreak().then(Ne=>{d(Ne),Ne.currentStreak>oi.current&&Ar("streak")}).catch(()=>{}):ye==="mastery"&&(Ar("mastery"),Rn(),jr())}),[Rn,jr]),R.useEffect(()=>{g&&(be.getCourseLanguages(g).then(k).catch(()=>k([])),be.getCourseLanguage(g).then(N).catch(()=>N(null)))},[g]),R.useEffect(()=>{g&&(be.getCourseTree(g,M??void 0).then(async oe=>{o(oe);const ye=oe.filter(lt=>lt.type==="lesson"||lt.type==="exam"),Ne=await Promise.all(ye.map(async lt=>{const Lt=await be.getProgress(lt.id);return[lt.id,Lt]})),je={};for(const[lt,Lt]of Ne)Lt&&(je[lt]=Lt);l(je)}).catch(E),be.getDashboard(g).then(P).catch(E))},[g,M,E]),R.useEffect(()=>{if(!q){Re([]);return}be.getStarterPrompts(q).then(Re).catch(()=>Re([]))},[q]),R.useEffect(()=>{const oe=ye=>{if(ye.key==="Escape"&&_e.activeId&&(be.abortAgentChatThread(_e.activeId).catch(()=>{}),B(!1),Ue(!1)),(ye.ctrlKey||ye.metaKey)&&ye.key==="k"&&(ye.preventDefault(),Ue(Ne=>!Ne)),(ye.ctrlKey||ye.metaKey)&&ye.key==="b"&&(ye.preventDefault(),pn()),(ye.ctrlKey||ye.metaKey)&&ye.key==="Tab"){if(ye.preventDefault(),H.current.active)return;const Ne=_e.threads;if(Ne.length>1){const je=Ne.findIndex(Lt=>Lt.id===_e.activeId),lt=ye.shiftKey?(je-1+Ne.length)%Ne.length:(je+1)%Ne.length;_e.setActiveId(Ne[lt].id)}}(!ye.target||!ye.target.matches("input, textarea, select"))&&(ye.key==="1"&&j("map"),ye.key==="2"&&j("import"),ye.key==="s"&&(ye.ctrlKey||ye.metaKey)&&(ye.preventDefault(),B(!0)))};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[q]);const Pr=R.useCallback(async oe=>{var ye;try{if(oe.type==="exam"){z(oe.id),Y("content");return}if(((ye=s[oe.id])==null?void 0:ye.status)==="locked"){z(null);return}await be.markNodeAttempted(oe.id);const Ne=await be.getStreak();await jr(),d(Ne),z(oe.id),Y("content"),Zs(!1)}catch(Ne){E(Ne)}},[s,jr,E]),Yi=R.useCallback(oe=>{if(H.current.active){Z({open:!0,pendingAction:oe});return}oe()},[]),Gi=R.useCallback(oe=>{if(H.current.active&&oe.id!==q){Z({open:!0,pendingAction:()=>void Pr(oe)});return}Pr(oe)},[Pr,q]),Od=R.useCallback(oe=>{H.current=oe},[]),Yl=R.useCallback(async()=>{const oe=X.pendingAction;Z({open:!1,pendingAction:null});const ye=H.current;if(H.current={active:!1,terminate:null},ye.active&&ye.terminate)try{await ye.terminate()}catch{}oe==null||oe()},[X.pendingAction]);Bs(ie,X.open),R.useEffect(()=>{if(!X.open)return;const oe=ye=>{ye.key==="Escape"&&Z({open:!1,pendingAction:null})};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[X.open]);const Gl=async oe=>{try{await be.setActiveSoul(oe),L(oe)}catch(ye){E(ye)}},Xl=R.useCallback(async(oe,ye,Ne)=>{try{await be.applyProposal(oe),Ae.markProposalStatus(ye,Ne,!0)}catch(je){E(je)}},[Ae,E]),Xs=R.useCallback(async(oe,ye,Ne)=>{try{await be.rejectProposal(oe),Ae.markProposalStatus(ye,Ne,!1)}catch(je){E(je)}},[Ae,E]),Xi=t.find(oe=>oe.id===g),Ks=R.useMemo(()=>{const oe=new Set(i.map(ye=>ye.id));return new Set([...U].filter(ye=>oe.has(ye)))},[U,i]),Ki=Ks.size,va=R.useMemo(()=>i.filter(oe=>oe.type==="section").sort((oe,ye)=>oe.orderIdx-ye.orderIdx),[i]),$t=R.useMemo(()=>{const oe=lE.map(Ne=>O.find(je=>je.name===Ne)).filter(Ne=>!!Ne),ye=O.filter(Ne=>!lE.includes(Ne.name));return[...oe,...ye]},[O]),gt=DI(g),Oa=OI(),Dt=GS();R.useEffect(()=>be.on("exam:status",ye=>{if(ye.status!=="ready"||ye.nodeId===q)return;const Ne=i.find(je=>je.id===ye.nodeId);Ne&&Dt.show(e("exam.ready.toast",{title:Ne.title}),{duration:4e3})}),[q,i,Dt,e]);const Id=R.useCallback(async oe=>{const ye=t.find(Ne=>Ne.id===oe);try{await be.deleteCourse(oe),Dt.show(e("import.deleted",{title:(ye==null?void 0:ye.title)??oe}),{duration:3e3}),Rn()}catch(Ne){E(Ne)}},[t,Rn,E,Dt,e]),Qs=R.useCallback(async(oe,ye,Ne)=>{if(!oe.trim()||Ae.streaming)return;if(!_e.activeId){const lt=await _e.ensureThreadForSend(oe,ye);if(lt){Ae.send(oe,lt,ye,Ne);return}Dt.show(e("toast.threadCreateFailed"));return}const je=_e.activeThread;je&&!je.title&&_e.update(je.id,{title:(ye??oe).trim()}),Ae.send(oe,void 0,ye,Ne)},[Ae,_e,Dt,e]),$s=R.useRef(Ae.streaming);$s.current=Ae.streaming;const Qi=R.useCallback(oe=>{const ye=I9(oe,e),Ne=O9(oe,e),je=lt=>{var Lt;if(!$s.current){(Lt=Gn.current)==null||Lt.call(Gn,ye,Ne);return}lt>0&&setTimeout(()=>je(lt-1),2e3)};je(10)},[e]);Gn.current=Qs;const Br=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Xn=R.useMemo(()=>{const oe=U2(Ae.messages).filter(Ne=>{var je;return Br.has(((je=Ne.output)==null?void 0:je.artifactType)??"")});if(oe.length)return oe[oe.length-1];const ye=gt.items.filter(Ne=>Br.has(Ne.artifactType)).map(Ne=>{try{return{id:Ne.id,toolName:Ne.artifactType,output:JSON.parse(Ne.data)}}catch{return null}}).filter(Ne=>Ne!==null);return ye.length?ye[ye.length-1]:null},[Ae.messages,gt.items]),Ia=R.useRef(new Set);R.useEffect(()=>{!Xn||Ia.current.has(Xn.id)||(Ia.current.add(Xn.id),Ae.streaming&&Y("board"))},[Xn,Ae.streaming]);const $i=R.useMemo(()=>Ae.messages.reduce((oe,ye)=>oe+ye.parts.reduce((Ne,je)=>je.type==="text"?Ne+wE(je.text):Ne,0),0),[Ae.messages]),ja=R.useRef(!1);R.useEffect(()=>{Ki>0&&!ja.current&&(ja.current=!0,Dt.show(e("review.nudge",{n:Ki}),{duration:4e3}))},[Ki,Dt,e]);const Pt=R.useMemo(()=>U2(Ae.messages),[Ae.messages]),Ws=R.useRef(new Set);R.useEffect(()=>{for(const oe of Pt){const ye=oe.output;if(!ye||!ye.artifactType)continue;const Ne=`${ye.artifactType}:${JSON.stringify(ye)}`;Ws.current.has(Ne)||(Ws.current.add(Ne),gt.save({nodeId:q,artifactType:ye.artifactType,title:ye.title??null,data:ye}),Dt.show(e("toast.artifactSaved"),{duration:3e3}))}},[Pt,gt,q,Dt,e]),R.useEffect(()=>{_!=="map"&&Y(null)},[_]);const[Kl,ca]=R.useState(!1),[li,Zs]=R.useState(!1);return x.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[x.jsx($U,{streak:c,xp:h,fontSize:Oa.size,onFontBump:Oa.bump,onOpenSettings:()=>B(!0),leftVisible:Nt,rightVisible:Kt,onToggleLeft:pn,onToggleRight:Qt,tier:de,bottomBar:de===3?x.jsx("nav",{className:"inline-flex items-center gap-0.5 p-0.5 rounded-lg bg-ink/5 ring-1 ring-inset ring-[var(--border)]","data-testid":"t3-pane-switcher",role:"tablist","aria-label":e("pane.switcher"),children:[{k:"rail",icon:rp,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:SC,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:MC,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:oe,icon:ye,label:Ne,testid:je})=>x.jsx("button",{role:"tab","aria-selected":$e===oe,"aria-label":Ne,"data-testid":je,"data-tooltip":Ne,onClick:()=>We(oe),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${$e===oe?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:x.jsx(ye,{className:"w-4 h-4"})},oe))}):void 0}),p&&x.jsx(JU,{message:p,onClose:()=>y(null)}),x.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:gn,onTouchEnd:Ht,children:[Nt&&x.jsx(a5,{fullWidth:de===3,view:_,onViewChange:j,courseTitle:(Xi==null?void 0:Xi.title)??null,courseId:g,courses:t,sections:va,tree:i,progressMap:s,selectedNodeId:q,dueCount:Ki,dueNodeIds:Ks,overallMastery:(D==null?void 0:D.overallMastery)??0,streak:(c==null?void 0:c.currentStreak)??0,streaming:Ae.streaming,onJumpNode:oe=>{if(Ae.streaming)return;const ye=i.find(Ne=>Ne.id===oe);ye&&Gi(ye),de===3&&We("chat")},onOpenReview:()=>ca(!0),onSelectCourse:oe=>Yi(()=>{b(oe),Rn()}),onDeleteCourse:oe=>Yi(()=>{Id(oe)}),onCoursesChanged:()=>{Rn()},availableLanguages:T,currentLocale:M,onLocaleChange:async oe=>{g&&(await be.setCourseLanguage(g,oe),N(oe))}}),x.jsxs(x.Fragment,{children:[mn&&x.jsx("div",{className:"flex flex-col h-full bg-surface-1 shrink-0 min-w-0 motion-safe:transition-[width] motion-safe:duration-200",style:de===3?{flex:1}:Kt?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:g?(rt==null?void 0:rt.type)==="exam"?x.jsx(y9,{examNode:rt,locale:Ye,onSessionChange:Od,paused:X.open,onExamCompleted:()=>{be.getProgress(rt.id).then(oe=>{oe&&l(ye=>({...ye,[rt.id]:oe}))})}}):x.jsxs(x.Fragment,{children:[x.jsx(P9,{threads:_e.threads,activeThread:_e.activeThread,focusNodeTitle:(rt==null?void 0:rt.title)??null,onPickThread:oe=>{Ae.streaming||_e.setActiveId(oe)},onCreate:()=>{Ae.streaming||(_e.create({title:null}),Dt.show(e("toast.threadCreated")))},onRename:(oe,ye)=>{_e.update(oe,{title:ye}),Dt.show(e("toast.threadRenamed"))},onArchive:oe=>{_e.update(oe,{status:"archived"}),Dt.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>_e.update(oe,{status:"active"})}})},onDelete:oe=>{const ye=_e.removeWithUndo(oe);ye&&(Dt.show(`${e("toast.threadDeleted")}${ye.title?`「${ye.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{_e.restore(ye),Dt.show(e("toast.restored"))}}}),setTimeout(()=>{be.threadDelete(ye.id).catch(()=>{})},5500))}}),x.jsx(qI,{messages:Ae.messages,streaming:Ae.streaming,onApplyProposal:Xl,onRejectProposal:Xs,summary:ft,onStartLearning:Ie!=null&&Ie.ready?Ir:void 0,agentReady:(Ie==null?void 0:Ie.ready)??!1,onGotoSettings:()=>B(!0),hasNode:!!rt,selectedNodeId:q,threadId:_e.activeId,onPickQuizAction:oe=>{Qs(oe)},onQuizCompleted:Qi,cardMode:de===3,chatNotes:gt.items.filter(oe=>oe.artifactType==="user_note"&&oe.sourceAnchor),onSaveChatNote:(oe,ye,Ne,je)=>{!rt||!_e.activeId||(gt.saveUserNote({nodeId:rt.id,text:oe,sourceType:"chat",sourceAnchor:{type:"chat",threadId:_e.activeId,msgId:ye,startOffset:Ne,endOffset:je}}),Dt.show(e("toast.noteSaved"),{duration:2e3}))}}),x.jsx(h9,{nodeId:q,agentReady:(Ie==null?void 0:Ie.ready)??!1,streaming:Ae.streaming,souls:$t,activeSoul:C,starterPrompts:Ae.messages.length>0?Ld:[],onPickSoul:Gl,onSend:Qs,onStop:Ae.stop,onLogFriction:q?(oe,ye)=>{be.logFriction(q,oe,ye),Dt.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>B(!0),insertText:Ze,historyTokens:$i})]}):x.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:x.jsxs("div",{className:"text-center max-w-sm",children:[x.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),x.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),x.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),Kt&&x.jsx("main",{className:de===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":de===3?"notebook-pane-full":void 0,children:x.jsx(CI,{selectedNode:rt,items:gt.items,loading:gt.loading,forceTab:V,canvasArtifact:Xn,onUserTabChange:()=>Y(null),onRemove:oe=>{gt.remove(oe),Dt.show(e("toast.noteDeleted"))},onTogglePin:oe=>{gt.togglePin(oe)},onRecordQuizResult:(oe,ye)=>{gt.recordQuizResult(oe,ye)},onUpdateNoteComment:(oe,ye)=>{gt.updateUserNoteComment(oe,ye)},onSaveContentNote:(oe,ye)=>{rt&&(gt.saveUserNote({nodeId:rt.id,text:oe,sourceType:"content",sourceAnchor:ye}),Dt.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:Jt,onQuoteToChat:Ge,locale:M,isReviewing:li,onReviewDone:()=>Zs(!1)})})]})]}),G&&x.jsx(WU,{onClose:()=>B(!1)}),Kl&&x.jsx(ZU,{onClose:()=>ca(!1),tree:i,dashboard:D,progressMap:s,onPickNode:oe=>{Yi(()=>{z(oe),Y("content"),ca(!1),Zs(!0)})}}),X.open&&x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:x.jsxs("div",{ref:ie,className:"w-[min(400px,90vw)] rounded-2xl bg-surface-0 p-6 shadow-elevated border border-warning/40",role:"dialog","aria-modal":"true","aria-label":e("exam.leave.title"),children:[x.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[x.jsx(ri,{className:"w-5 h-5 text-warning shrink-0"}),x.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),x.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),x.jsxs("div",{className:"flex justify-end gap-2",children:[x.jsx("button",{className:"btn-3d-neutral px-4 py-1.5 text-body",onClick:()=>Z({open:!1,pendingAction:null}),"data-testid":"exam-leave-cancel",children:e("exam.leave.cancel")}),x.jsx("button",{className:"btn-3d-brand px-4 py-1.5 text-body",style:{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"},onClick:()=>void Yl(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),ge&&x.jsx(T9,{onClose:()=>Ue(!1),onPick:oe=>{Ue(!1),QU(oe)},hasNode:!!q}),x.jsx(m5,{}),x.jsx(XU,{})]})}function QU(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function $U({streak:e,xp:t,fontSize:n,onFontBump:i,onOpenSettings:o,leftVisible:s,rightVisible:l,onToggleLeft:c,onToggleRight:d,tier:h,bottomBar:m}){const g=He();return m?x.jsx("header",{className:"app-header shrink-0",children:x.jsxs("div",{className:"flex items-center h-12 px-4",children:[x.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&x.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:g("header.energy"),children:[x.jsx(o0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),x.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),m,x.jsx("div",{className:"flex-1 flex items-center justify-end",children:x.jsx("button",{onClick:o,"data-testid":"header-settings","aria-label":g("header.settings"),className:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-200 dark:hover:bg-neutral-800/50 transition-colors",title:g("header.settings"),children:x.jsx(Fc,{className:"w-4 h-4"})})})]})}):x.jsx("header",{className:"app-header shrink-0 flex flex-col",children:x.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[x.jsx("div",{className:"flex items-center gap-2 min-w-0",children:x.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",x.jsx("span",{className:"text-brand",children:"Study"})]})}),x.jsxs("div",{className:"flex items-center gap-3",children:[h!==3&&x.jsxs("div",{className:"flex items-center gap-0.5",children:[x.jsx("button",{onClick:c,"data-testid":"layout-toggle-left",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${s?"text-neutral-500 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800":"text-neutral-600 bg-neutral-200 dark:bg-neutral-800"}`,title:g("header.toggleLeft"),children:x.jsx(CC,{className:"w-4 h-4"})}),x.jsx("button",{onClick:d,"data-testid":"layout-toggle-right",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${l?"text-neutral-500 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800":"text-neutral-600 bg-neutral-200 dark:bg-neutral-800"}`,title:g("header.toggleRight"),children:x.jsx(NC,{className:"w-4 h-4"})})]}),h!==3&&x.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[x.jsx("button",{onClick:()=>i("down"),disabled:n==="small","data-testid":"font-smaller",className:"text-label w-7 h-7 flex items-center justify-center rounded-md text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-ink/5 disabled:opacity-20 disabled:cursor-not-allowed transition-colors",title:g("header.font.smaller"),children:"A-"}),x.jsx("button",{onClick:()=>i("up"),disabled:n==="large","data-testid":"font-larger",className:"text-body w-7 h-7 flex items-center justify-center rounded-md text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-ink/5 disabled:opacity-20 disabled:cursor-not-allowed transition-colors",title:g("header.font.larger"),children:"A+"})]}),t&&x.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:g("header.energy"),children:[x.jsx(o0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),x.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:x.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),x.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&x.jsx("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-brand/10","data-testid":"level-badge",title:g("header.level.title"),children:x.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&x.jsx(ez,{streak:e}),x.jsx("button",{onClick:o,"data-testid":"header-settings",className:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-200 dark:hover:bg-neutral-800/50 transition-colors",title:g("header.settings"),children:x.jsx(Fc,{className:"w-4 h-4"})})]})]})})}function WU({onClose:e}){const t=He(),n=R.useRef(null);return Bs(n,!0),x.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[x.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),x.jsxs("div",{ref:n,role:"dialog","aria-modal":"true","aria-label":t("settings.title"),className:"relative w-full max-w-lg h-full bg-surface-0 border-l border-[var(--border)] shadow-elevated flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[x.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),x.jsx("button",{onClick:e,"data-testid":"settings-close","aria-label":t("action.close"),className:"text-ink-muted hover:text-ink-strong w-8 h-8 flex items-center justify-center rounded-lg hover:bg-surface-3",children:"✕"})]}),x.jsx("div",{className:"flex-1 overflow-y-auto",children:x.jsx(k9,{})})]})]})}function ZU({onClose:e,tree:t,onPickNode:n,dashboard:i,progressMap:o}){const s=He(),l=R.useRef(null);Bs(l,!0);const[c,d]=R.useState([]);R.useEffect(()=>{be.getAllSrsItems().then(N=>d(N)).catch(()=>d([]))},[]);const h=R.useMemo(()=>new Map(c.map(N=>[N.nodeId,N])),[c]),m=R.useMemo(()=>{const N=new Map(t.map(A=>[A.id,A])),O=c.filter(A=>N.has(A.nodeId));return{overdue:O.filter(A=>A.overdue),short:O.filter(A=>!A.overdue&&A.intervalDays>0&&A.intervalDays<=7),long:O.filter(A=>!A.overdue&&A.intervalDays>7),inactive:O.filter(A=>A.repetitions===0&&!A.overdue)}},[c,t]),g=R.useMemo(()=>t.filter(O=>O.type==="section"&&(O.world??"study")==="study").sort((O,A)=>O.orderIdx-A.orderIdx).map(O=>({section:O,lessons:t.filter(A=>A.parentId===O.id&&A.type==="lesson").sort((A,C)=>A.orderIdx-C.orderIdx)})),[t]),b=R.useMemo(()=>{const N=new Map;for(const O of(i==null?void 0:i.sections)??[])N.set(O.sectionId,O.avgMastery);return N},[i]),p=R.useMemo(()=>t.filter(N=>{var A;const O=(A=o[N.id])==null?void 0:A.status;return N.type==="lesson"&&(N.world??"study")==="study"&&(O==="in_progress"||O==="mastered")}),[t,o]),[y,E]=R.useState(new Set),T=N=>E(O=>{const A=new Set(O);return A.has(N)?A.delete(N):A.add(N),A}),k=N=>{const O=h.get(N);return O?O.overdue?{color:"bg-review",title:s("review.quadrant.overdue")}:O.intervalDays>0&&O.intervalDays<=7?{color:"bg-gold",title:s("review.quadrant.short")}:O.intervalDays>7?{color:"bg-brand",title:s("review.quadrant.long")}:null:null},M=m.overdue.length>0;return x.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[x.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),x.jsxs("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":s("review.title"),className:"relative w-full max-w-md h-full bg-surface-0 border-l border-[var(--border)] shadow-elevated flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[x.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[x.jsx(ii,{className:"w-4 h-4","aria-hidden":"true"})," ",s("review.title")]}),x.jsx("button",{onClick:e,"data-testid":"review-close","aria-label":s("action.close"),className:"text-ink-muted hover:text-ink-strong w-8 h-8 flex items-center justify-center rounded-lg hover:bg-surface-3",children:"✕"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[p.length>0&&x.jsxs("button",{onClick:()=>{const N=p[Math.floor(Math.random()*p.length)];N&&n(N.id)},"data-testid":"review-interleave",className:"btn-3d-neutral w-full py-2.5 text-body flex items-center justify-center gap-1.5",children:[x.jsx(PC,{className:"w-4 h-4"}),s("review.interleave")]}),c.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.srsHint")}),x.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:[{items:m.overdue,label:s("review.quadrant.overdue"),dot:"bg-review"},{items:m.short,label:s("review.quadrant.short"),dot:"bg-gold"},{items:m.long,label:s("review.quadrant.long"),dot:"bg-brand"},{items:m.inactive,label:s("review.quadrant.inactive"),dot:"bg-ink-faint"}].filter(N=>N.items.length>0).map(N=>x.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[x.jsx("span",{className:`w-2 h-2 rounded-full ${N.dot}`}),x.jsx("span",{className:"text-label text-ink-muted",children:N.label}),x.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:N.items.length})]},N.label))}),M&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:s("review.overdueQuickHint")}),x.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.overdue.slice(0,8).map(N=>{const O=t.find(A=>A.id===N.nodeId);return O?x.jsx("button",{onClick:()=>n(N.nodeId),"data-testid":`review-overdue-${N.nodeId.slice(0,8)}`,className:"px-2 py-1 rounded-full bg-review/10 ring-1 ring-review/20 text-label text-review font-bold hover:bg-review/20 transition-colors truncate max-w-[140px]",children:O.title},N.nodeId):null})})]})]}),g.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.myProgress")}),x.jsx("div",{className:"space-y-1",children:g.map(({section:N,lessons:O})=>{const A=Math.round((b.get(N.id)??0)*100),C=y.has(N.id),L=O.filter(_=>{var D;const j=(D=o[_.id])==null?void 0:D.status;return j==="in_progress"||j==="mastered"});return x.jsxs("div",{children:[x.jsxs("button",{onClick:()=>T(N.id),className:"w-full flex items-center gap-2 p-2 rounded-lg hover:bg-surface-3 transition-colors",children:[C?x.jsx(ap,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):x.jsx(uC,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),x.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:N.title}),L.length>0&&x.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[x.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:x.jsx("div",{className:`h-full rounded-full ${A>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,A)}%`}})}),x.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[A,"%"]})]})]}),C&&x.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:O.length===0?x.jsx("div",{className:"text-label text-ink-faint py-1.5 pl-1",children:"—"}):O.map(_=>{const j=o[_.id],D=j?Math.round((j.mastery??0)*100):null,P=k(_.id),U=(j==null?void 0:j.status)==="in_progress"||(j==null?void 0:j.status)==="mastered";return x.jsxs("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors ${(P==null?void 0:P.color)==="bg-review"?"bg-review/8":"hover:bg-surface-3"}`,children:[P?x.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${P.color} shrink-0`,title:P.title}):x.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),x.jsx("span",{className:`text-label truncate flex-1 ${U?"text-ink-strong":"text-ink-faint"}`,children:_.title}),D!==null&&x.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[D,"%"]}),U&&x.jsx("button",{onClick:()=>n(_.id),"data-testid":`review-lesson-${_.id.slice(0,8)}`,className:"shrink-0 px-2 py-0.5 rounded-md bg-brand/15 text-brand text-caption font-bold hover:bg-brand/25 transition-colors",children:s("review.reviewLesson")})]},_.id)})})]},N.id)})})]}),i&&i.frictionByNode.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:s("dashboard.mini.struggle")}),i.frictionByNode.map(N=>x.jsxs("button",{onClick:()=>n(N.nodeId),className:"flex items-center gap-2 py-0.5 w-full text-left hover:bg-surface-3 rounded px-1",children:[x.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[N.count,"×"]}),x.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:N.title})]},N.nodeId))]}),p.length===0&&c.length===0&&g.length===0&&x.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[x.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),x.jsx("div",{className:"text-body text-ink-muted",children:s("review.empty.title")}),x.jsx("div",{className:"text-label text-ink-faint mt-1",children:s("review.empty.desc")})]})]})]})]})}function JU({message:e,onClose:t}){const n=He();return x.jsxs("div",{role:"alert","data-testid":"error-banner",className:"px-4 py-2 border-b border-warning-tint-border text-warning text-body flex items-center justify-between",style:{backgroundColor:"var(--warning-tint)"},children:[x.jsxs("span",{children:["⚠️ ",e]}),x.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function ez({streak:e}){const t=He();return x.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border border-review/20",style:{backgroundColor:"var(--review-tint)"},"data-testid":"streak-badge",title:t("streak.title",{n:e.currentStreak,m:e.longestStreak}),children:[x.jsx(xE,{className:"w-4 h-4 text-review flame-flicker"}),x.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&x.jsxs("span",{className:"flex items-center gap-0.5 ml-0.5","data-testid":"freeze-badge",title:t("streak.freeze.title",{n:e.freezeCount}),children:[x.jsx(jC,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),x.jsx("span",{className:"text-label font-bold text-review/80",children:e.freezeCount})]})]})}window.addEventListener("error",e=>{var t;console.error("[FATAL renderer error]",((t=e.error)==null?void 0:t.stack)||e.message)});window.addEventListener("unhandledrejection",e=>{var t;console.error("[FATAL unhandled rejection]",((t=e.reason)==null?void 0:t.stack)||e.reason)});function tz({rejected:e}){const t=navigator.language.startsWith("zh"),[n,i]=np.useState(""),o=s=>{s.preventDefault();const l=n.trim();if(!l)return;const c=l.includes("token=")?new URL(l).searchParams.get("token")??"":l;c&&zc(async()=>{const{setWebToken:d}=await import("./api-web-BSU76jU3.js");return{setWebToken:d}},[],import.meta.url).then(({setWebToken:d})=>d(c))};return x.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:x.jsxs("form",{onSubmit:o,className:"w-full max-w-sm text-center",children:[x.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),x.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),x.jsx("p",{className:"text-label text-white/55 leading-relaxed mb-5",children:t?"连接本机学习服务:粘贴启动时打印的令牌或整条链接":"Connect to your study server — paste the token or the full link printed at startup"}),e&&x.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),x.jsx("input",{type:"text",value:n,onChange:s=>i(s.target.value),placeholder:t?"访问令牌":"access token",autoFocus:!0,className:"w-full bg-black/30 text-white placeholder:text-white/30 text-body font-mono rounded-lg px-3 py-2.5 border border-white/20 focus:border-brand focus:outline-none transition-colors mb-3"}),x.jsx("button",{type:"submit",disabled:!n.trim(),className:"btn-3d-brand w-full px-3 py-2.5 text-body disabled:opacity-40",children:t?"连接":"Connect"}),x.jsx("p",{className:"text-caption text-white/40 leading-relaxed mt-5",children:t?"令牌在服务启动日志里,形如 http://127.0.0.1:17890/?token=…,也可以直接打开那个链接。":"The token is in the server startup log, like http://127.0.0.1:17890/?token=… — opening that link directly works too."})]})})}const Lw=eC.createRoot(document.getElementById("root"));function nz(){Lw.render(x.jsx(np.StrictMode,{children:x.jsx(FI,{children:x.jsx(KU,{})})}))}function uE(e){Lw.render(x.jsx(np.StrictMode,{children:x.jsx(tz,{rejected:e})}))}async function az(){const{installAppHeight:e}=await zc(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await zc(()=>import("./api-web-BSU76jU3.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>uE(!0)),!t.hasWebToken()){uE(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}nz()}az();export{zc as _,Ml as g};
|